Skip to content

OpenVINO™ is an open source toolkit for optimizing and deploying AI inference

[GHA] Enable shared ccache for Windows and RISC-V Conan builds (#39505)

Mikhail Ryzhov082530dc7e8b
diff --git a/.github/workflows/cleanup_caches.yml b/.github/workflows/cleanup_caches.yml
index 6d605b32171..9d3aff8a604 100644
--- a/.github/workflows/cleanup_caches.yml
+++ b/.github/workflows/cleanup_caches.yml
@@ -168,3 +168,65 @@ jobs:
cache-path: C:\\mount\\caches\\ccache
recursive: true
key: '.'
+
+ Docker:
+ name: Docker
+ runs-on: aks-linux-4-cores-16gb-docker-build
+ if: ${{ github.repository_owner == 'openvinotoolkit' }}
+ container:
+ image: openvinogithubactions.azurecr.io/docker_build:0.2
+ volumes:
+ - /mount:/mount
+ outputs:
+ images: "${{ steps.handle_docker.outputs.images }}"
+ steps:
+ - name: Checkout
+ uses: ababushk/checkout@dd591a6a2ac25618db4eda86e7e0d938f88cf01b # cherry_pick_retries
+ timeout-minutes: 15
+
+ - uses: ./.github/actions/handle_docker
+ id: handle_docker
+ with:
+ images: |
+ ov_build/ubuntu_24_04_x64
+ registry: 'openvinogithubactions.azurecr.io'
+ dockerfiles_root_dir: '.github/dockerfiles'
+ changed_components: '{"docker_env": false, "dockerfiles": false}'
+
+ # Remote ccache entries are hash-named files without the ".cache" suffix used by the cache
+ # action, so they are trimmed by ccache itself: least recently used entries (by modification
+ # time, refreshed on hits via update-mtime=true) are evicted down to CCACHE_REMOTE_MAX_SIZE.
+ Cleanup_remote_ccache_lin:
+ name: Cleanup Linux remote ccache
+ needs: Docker
+ runs-on: aks-linux-medium
+ timeout-minutes: 60
+ if: ${{ github.repository_owner == 'openvinotoolkit' }}
+ container:
+ image: ${{ fromJSON(needs.docker.outputs.images).ov_build.ubuntu_24_04_x64 }}
+ volumes:
+ - /mount:/mount
+ env:
+ CCACHE_REMOTE_PATH: /mount/caches/ccache/shared
+ CCACHE_REMOTE_MAX_SIZE: 500Gi
+
+ steps:
+ - name: Cleanup remote ccache
+ shell: bash
+ run: ccache --trim-dir "${CCACHE_REMOTE_PATH}" --trim-max-size "${CCACHE_REMOTE_MAX_SIZE}" --trim-method mtime
+
+ Cleanup_remote_ccache_win:
+ name: Cleanup Windows remote ccache
+ runs-on: 'aks-win-4-cores-8gb-build'
+ timeout-minutes: 60
+ if: ${{ github.repository_owner == 'openvinotoolkit' }}
+ env:
+ CCACHE_REMOTE_PATH: "C:\\mount\\caches\\ccache\\shared"
+ CCACHE_REMOTE_MAX_SIZE: 500Gi
+
+ steps:
+ - name: Cleanup remote ccache
+ shell: pwsh
+ run: |
+ ccache --trim-dir $env:CCACHE_REMOTE_PATH --trim-max-size $env:CCACHE_REMOTE_MAX_SIZE --trim-method mtime
+ if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
diff --git a/.github/workflows/job_build_windows.yml b/.github/workflows/job_build_windows.yml
index 5fff2a6543d..49cb7f332ac 100644
--- a/.github/workflows/job_build_windows.yml
+++ b/.github/workflows/job_build_windows.yml
@@ -56,11 +56,12 @@ jobs:
runs-on: ${{ inputs.runner }}
env:
CMAKE_BUILD_TYPE: ${{ inputs.build-type }}
- CMAKE_CXX_COMPILER_LAUNCHER: ${{ inputs.build-type != 'Debug' && 'ccache' || '' }}
- CMAKE_C_COMPILER_LAUNCHER: ${{ inputs.build-type != 'Debug' && 'ccache' || '' }}
- CCACHE_REMOTE_DIR: "C:\\mount\\caches\\ccache\\windows${{ inputs.build-variant }}_x86_64_${{ inputs.build-type }}\\${{ inputs.target-branch }}"
+ CMAKE_CXX_COMPILER_LAUNCHER: ccache
+ CMAKE_C_COMPILER_LAUNCHER: ccache
+ CCACHE_SECONDARY_STORAGE: "file:///C:/mount/caches/ccache/shared/windows/${{ inputs.build-variant }}/x86_64/${{ inputs.build-type }}|update-mtime=true"
CCACHE_DIR: ${{ github.workspace }}\\ccache
CCACHE_MAXSIZE: 3G
+ CCACHE_COMPILERCHECK: content
CCACHE_SLOPPINESS: pch_defines,time_macros
OPENVINO_REPO: "${{ github.workspace }}\\openvino"
OPENVINO_CONTRIB_REPO: "${{ github.workspace }}\\openvino_contrib"
@@ -156,16 +157,14 @@ jobs:
#
- name: Setup ccache
- uses: ./openvino/.github/actions/cache
- if: ${{ inputs.build-type != 'Debug' }}
- with:
- save-always: ${{ github.event_name == 'push' && 'true' || 'false' }}
- cleanup-always: ${{ github.event_name == 'push' && 'true' || 'false' }}
- cache-path: ${{ env.CCACHE_REMOTE_DIR }}
- path: ${{ env.CCACHE_DIR }}
- key: ${{ runner.os }}-${{ runner.arch }}-ccache-${{ github.sha }}
- restore-keys: |
- ${{ runner.os }}-${{ runner.arch }}-ccache
+ run: |
+ ccache --version
+ $config = ccache --show-config | Out-String
+ Write-Output $config
+ if (-not $config.Contains($env:CCACHE_SECONDARY_STORAGE)) {
+ Write-Error "ccache remote storage is not configured: expected $env:CCACHE_SECONDARY_STORAGE"
+ exit 1
+ }
- name: Configure Developer Command Prompt for Microsoft Visual C++
uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0
@@ -192,15 +191,14 @@ jobs:
Invoke-Expression $cmakeCommand
- name: Clean ccache stats
- if: ${{ inputs.build-type != 'Debug' }}
run: '& ccache --zero-stats'
- name: Cmake build - OpenVINO
run: cmake --build ${{ env.BUILD_DIR }} --config ${{ env.CMAKE_BUILD_TYPE }} --parallel $env:CMAKE_BUILD_PARALLEL_LEVEL -- --quiet
- name: Show ccache stats
- if: ${{ inputs.build-type != 'Debug' }}
- run: '& ccache --show-stats'
+ if: ${{ !cancelled() }}
+ run: '& ccache --show-stats --verbose'
- name: Cmake install - OpenVINO
run: |
diff --git a/.github/workflows/job_build_windows_cpp20.yml b/.github/workflows/job_build_windows_cpp20.yml
index e313c946182..ee9744fcafd 100644
--- a/.github/workflows/job_build_windows_cpp20.yml
+++ b/.github/workflows/job_build_windows_cpp20.yml
@@ -10,7 +10,7 @@ on:
type: string
required: true
target-branch:
- description: 'Target branch for the build'
+ description: 'Retained for compatibility; remote ccache is shared across branches'
type: string
required: true
cmake-options:
@@ -47,9 +47,10 @@ jobs:
CMAKE_BUILD_TYPE: ${{ inputs.build-type }}
CMAKE_CXX_COMPILER_LAUNCHER: ccache
CMAKE_C_COMPILER_LAUNCHER: ccache
- CCACHE_REMOTE_DIR: "C:\\mount\\caches\\ccache\\windows${{ inputs.build-variant }}_x86_64_${{ inputs.build-type }}_cpp20\\${{ inputs.target-branch }}"
+ CCACHE_SECONDARY_STORAGE: "file:///C:/mount/caches/ccache/shared/windows/${{ inputs.build-variant }}/x86_64/${{ inputs.build-type }}_cpp20|update-mtime=true"
CCACHE_DIR: ${{ github.workspace }}\\ccache
CCACHE_MAXSIZE: 3G
+ CCACHE_COMPILERCHECK: content
CCACHE_SLOPPINESS: pch_defines,time_macros
OPENVINO_REPO: "${{ github.workspace }}\\openvino"
BUILD_DIR: "${{ github.workspace }}\\openvino_build"
@@ -77,15 +78,14 @@ jobs:
run: python3 -m pip install -r ${{ env.OPENVINO_REPO }}/src/bindings/python/wheel/requirements-dev.txt
- name: Setup ccache
- uses: ./openvino/.github/actions/cache
- with:
- save-always: ${{ github.event_name == 'push' && 'true' || 'false' }}
- cleanup-always: ${{ github.event_name == 'push' && 'true' || 'false' }}
- cache-path: ${{ env.CCACHE_REMOTE_DIR }}
- path: ${{ env.CCACHE_DIR }}
- key: ${{ runner.os }}-${{ runner.arch }}-cpp20-ccache-${{ github.sha }}
- restore-keys: |
- ${{ runner.os }}-${{ runner.arch }}-cpp20-ccache
+ run: |
+ ccache --version
+ $config = ccache --show-config | Out-String
+ Write-Output $config
+ if (-not $config.Contains($env:CCACHE_SECONDARY_STORAGE)) {
+ Write-Error "ccache remote storage is not configured: expected $env:CCACHE_SECONDARY_STORAGE"
+ exit 1
+ }
- name: Configure Developer Command Prompt for Microsoft Visual C++
uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0
@@ -109,7 +109,7 @@ jobs:
- name: Show ccache stats
if: always()
- run: '& ccache --show-stats'
+ run: '& ccache --show-stats --verbose'
- name: Report non-blocking failure
if: failure()
diff --git a/.github/workflows/linux_riscv_conan.yml b/.github/workflows/linux_riscv_conan.yml
index 92f005d8271..9197b795f59 100644
--- a/.github/workflows/linux_riscv_conan.yml
+++ b/.github/workflows/linux_riscv_conan.yml
@@ -3,7 +3,7 @@ on:
workflow_dispatch:
inputs:
target-branch:
- description: 'Target branch for the build; taken from event context by default'
+ description: 'Retained for compatibility; remote ccache is shared across branches'
type: string
required: false
pull_request:
@@ -24,9 +24,6 @@ concurrency:
permissions: read-all
-env:
- TARGET_BRANCH: ${{ inputs.target-branch || github.base_ref || github.event.merge_group.base_ref || github.ref }}
-
jobs:
Smart_CI:
runs-on: ubuntu-latest
@@ -35,7 +32,6 @@ jobs:
affected_components: "${{ steps.smart_ci.outputs.affected_components }}"
changed_components: "${{ steps.smart_ci.outputs.changed_components }}"
skip_workflow: "${{ steps.smart_ci.outputs.skip_workflow }}"
- target_branch: ${{ steps.set_target_branch.outputs.target_branch }}
steps:
- name: checkout action
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
@@ -55,13 +51,6 @@ jobs:
repo_token: ${{ secrets.GITHUB_TOKEN }}
skip_when_only_listed_labels_set: 'docs'
skip_when_only_listed_files_changed: '*.md,*.rst,*.png,*.jpg,*.svg,*/layer_tests_summary/*,*/conformance/*'
-
- - name: Get target branch
- id: set_target_branch
- run: |
- echo "target_branch=${TARGET_BRANCH#refs/heads/}" >> $GITHUB_OUTPUT
- shell: bash
-
Docker:
needs: Smart_CI
runs-on: aks-linux-4-cores-16gb-docker-build
@@ -113,9 +102,9 @@ jobs:
OPENVINO_BUILD_DIR: /__w/openvino/openvino/openvino_build
INSTALL_DIR: /__w/openvino/openvino/openvino_install
CONAN_USER_HOME: /mount/caches/ccache/ubuntu24_riscv64_master_release/.conan
- CCACHE_SECONDARY_STORAGE: "file:///mount/caches/ccache/shared/ubuntu24/riscv64/gnu|umask=002|update-mtime=true"
+ CCACHE_DIR: /__w/openvino/openvino/ccache
+ CCACHE_SECONDARY_STORAGE: "file:///mount/caches/ccache/shared/ubuntu24/riscv64/conan|umask=002|update-mtime=true"
CCACHE_MAXSIZE: 10G
- CCACHE_BASEDIR: ${{ github.workspace }}
CCACHE_COMPILERCHECK: content
PIP_INDEX_URL: "http://pip-proxy.pip-proxy.svc.cluster.local/simple/"
PIP_TRUSTED_HOST: "pip-proxy.pip-proxy.svc.cluster.local"
@@ -240,7 +229,8 @@ jobs:
run: cmake --build ${OPENVINO_BUILD_DIR} --parallel ${CMAKE_BUILD_PARALLEL_LEVEL} -- --quiet
- name: Show ccache stats
- run: ccache --show-stats
+ if: ${{ !cancelled() }}
+ run: ccache --show-stats --verbose
- name: Cmake - Install
run: cmake --build ${OPENVINO_BUILD_DIR} --parallel ${CMAKE_BUILD_PARALLEL_LEVEL} --target install -- --quiet
diff --git a/.github/workflows/windows_conditional_compilation.yml b/.github/workflows/windows_conditional_compilation.yml
index c2405c86e1f..e23cd26b097 100644
--- a/.github/workflows/windows_conditional_compilation.yml
+++ b/.github/workflows/windows_conditional_compilation.yml
@@ -74,9 +74,10 @@ jobs:
CMAKE_GENERATOR: 'Ninja Multi-Config' # Visual Studio does not seem to work with `ccache`. Ninja is the generator supported by `ccache`
CMAKE_CXX_COMPILER_LAUNCHER: ccache
CMAKE_C_COMPILER_LAUNCHER: ccache
- CCACHE_REMOTE_DIR: "C:\\mount\\caches\\ccache\\windows2022_x86_64_itt\\${{ github.base_ref || github.ref_name }}"
+ CCACHE_SECONDARY_STORAGE: "file:///C:/mount/caches/ccache/shared/windows/vs2022/x86_64/Release_collect|update-mtime=true"
CCACHE_DIR: ${{ github.workspace }}\\ccache
CCACHE_MAXSIZE: 3G
+ CCACHE_COMPILERCHECK: content
CCACHE_SLOPPINESS: pch_defines,time_macros
OPENVINO_REPO: "${{ github.workspace }}\\openvino"
INSTALL_DIR: "${{ github.workspace }}\\openvino_install"
@@ -137,15 +138,14 @@ jobs:
#
- name: Setup ccache
- uses: ./openvino/.github/actions/cache
- with:
- save-always: ${{ github.event_name == 'push' && 'true' || 'false' }}
- cleanup-always: ${{ github.event_name == 'push' && 'true' || 'false' }}
- cache-path: ${{ env.CCACHE_REMOTE_DIR }}
- path: ${{ env.CCACHE_DIR }}
- key: ${{ runner.os }}-${{ runner.arch }}-ccache-${{ github.sha }}
- restore-keys: |
- ${{ runner.os }}-${{ runner.arch }}-ccache
+ run: |
+ ccache --version
+ $config = ccache --show-config | Out-String
+ Write-Output $config
+ if (-not $config.Contains($env:CCACHE_SECONDARY_STORAGE)) {
+ Write-Error "ccache remote storage is not configured: expected $env:CCACHE_SECONDARY_STORAGE"
+ exit 1
+ }
- name: Configure Developer Command Prompt for Microsoft Visual C++
uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0
@@ -183,7 +183,8 @@ jobs:
cmake --build ${{ env.BUILD_DIR }} --parallel ${{ env.CMAKE_BUILD_PARALLEL_LEVEL }} --config ${{ env.CMAKE_BUILD_TYPE }} --target sea_itt_lib -- --quiet
- name: Show ccache stats
- run: '& ccache --show-stats'
+ if: ${{ !cancelled() }}
+ run: '& ccache --show-stats --verbose'
- name: Cmake install - OpenVINO
run: |
diff --git a/.github/workflows/windows_vs2022_debug.yml b/.github/workflows/windows_vs2022_debug.yml
index 964c3deb263..17601d6be80 100644
--- a/.github/workflows/windows_vs2022_debug.yml
+++ b/.github/workflows/windows_vs2022_debug.yml
@@ -79,6 +79,8 @@ jobs:
-DENABLE_STRICT_DEPENDENCIES=OFF
-DCMAKE_DISABLE_FIND_PACKAGE_PkgConfig=ON
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
+ -DCMAKE_MSVC_DEBUG_INFORMATION_FORMAT=Embedded
+ -DENABLE_STATIC_LIBS_PDB=ON
-DFETCHCONTENT_BASE_DIR="C:\fcc\ninja"
Overall_Status:
diff --git a/cmake/developer_package/compile_flags/os_flags.cmake b/cmake/developer_package/compile_flags/os_flags.cmake
index 322c60b03c4..f170fea415e 100644
--- a/cmake/developer_package/compile_flags/os_flags.cmake
+++ b/cmake/developer_package/compile_flags/os_flags.cmake
@@ -132,6 +132,21 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
# PDB related flags
#
+ # With embedded debug information (/Z7, e.g. for compiler caches) the linker builds PDB files
+ # from scratch anyway, while incremental linking adds padding and thunks to binaries, a second
+ # link to embed manifests and stale blocks in PDB files.
+ # /INCREMENTAL:NO is added as a link option: third-party projects (e.g. level_zero) rewrite
+ # "/INCREMENTAL" in the linker flag variables and would turn it into "/INCREMENTAL:NO:NO".
+ if(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT MATCHES "Embedded")
+ foreach(link_type IN ITEMS EXE SHARED MODULE)
+ foreach(config IN ITEMS DEBUG RELWITHDEBINFO)
+ string(REGEX REPLACE "(^| )/INCREMENTAL( |$)" " "
+ CMAKE_${link_type}_LINKER_FLAGS_${config} "${CMAKE_${link_type}_LINKER_FLAGS_${config}}")
+ endforeach()
+ endforeach()
+ add_link_options("$<$<CONFIG:Debug,RelWithDebInfo>:/INCREMENTAL:NO>")
+ endif()
+
if(ENABLE_PDB_IN_RELEASE)
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /Zi")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zi")
diff --git a/cmake/developer_package/features.cmake b/cmake/developer_package/features.cmake
index 7d5dbfb667d..d6a6abbdc0a 100644
--- a/cmake/developer_package/features.cmake
+++ b/cmake/developer_package/features.cmake
@@ -46,6 +46,8 @@ ov_dependent_option (ENABLE_API_VALIDATOR "Enables API Validator usage" ON "WIN3
ov_dependent_option (ENABLE_PDB_IN_RELEASE "Enables PDB files for Release build" OFF "WIN32" OFF)
+ov_dependent_option (ENABLE_STATIC_LIBS_PDB "Keeps debug information of developer package static libraries in separate PDB files when CMAKE_MSVC_DEBUG_INFORMATION_FORMAT is Embedded" OFF "CMAKE_CXX_COMPILER_ID STREQUAL MSVC" OFF)
+
# Defines CPU capabilities
ov_dependent_option (ENABLE_SSE42 "Enable SSE4.2 optimizations" ON "X86_64 OR (X86 AND NOT EMSCRIPTEN)" OFF)
diff --git a/cmake/developer_package/packaging/packaging.cmake b/cmake/developer_package/packaging/packaging.cmake
index 285323032ef..d7105485bf3 100644
--- a/cmake/developer_package/packaging/packaging.cmake
+++ b/cmake/developer_package/packaging/packaging.cmake
@@ -74,6 +74,35 @@ macro(ov_install_pdb target)
endif()
endmacro()
+#
+# ov_keep_debug_info_in_pdb(<target>...)
+#
+# When ENABLE_STATIC_LIBS_PDB is ON and embedded debug information (/Z7) is requested via
+# CMAKE_MSVC_DEBUG_INFORMATION_FORMAT, keeps the given targets and the object libraries archived
+# into them on a separate PDB (/Zi). Otherwise, the debug information format is left unchanged.
+#
+function(ov_keep_debug_info_in_pdb)
+ if(NOT ENABLE_STATIC_LIBS_PDB OR NOT MSVC OR NOT CMAKE_MSVC_DEBUG_INFORMATION_FORMAT MATCHES "Embedded")
+ return()
+ endif()
+
+ string(REPLACE "Embedded" "ProgramDatabase" debug_info_format "${CMAKE_MSVC_DEBUG_INFORMATION_FORMAT}")
+
+ foreach(target IN LISTS ARGN)
+ set(targets ${target})
+ get_target_property(sources ${target} SOURCES)
+ foreach(source IN LISTS sources)
+ if(source MATCHES "\\$<TARGET_OBJECTS:([^>]+)>")
+ if(TARGET "${CMAKE_MATCH_1}")
+ list(APPEND targets "${CMAKE_MATCH_1}")
+ endif()
+ endif()
+ endforeach()
+
+ set_target_properties(${targets} PROPERTIES MSVC_DEBUG_INFORMATION_FORMAT "${debug_info_format}")
+ endforeach()
+endfunction()
+
# Increments the global visited-epoch used by _ov_collect_static_deps_impl so
# that per-target _OV_SDEP_SEEN_EPOCH flags from previous traversals are
# implicitly invalidated without having to clear them.
diff --git a/cmake/extra_modules.cmake b/cmake/extra_modules.cmake
index 9d6c6a02244..2e447a68d1c 100644
--- a/cmake/extra_modules.cmake
+++ b/cmake/extra_modules.cmake
@@ -12,6 +12,15 @@ function(ov_generate_dev_package_config)
# create a helper target to build all developer package targets
add_custom_target(ov_dev_targets DEPENDS ${_OPENVINO_DEVELOPER_PACKAGE_TARGETS})
+ # embedded debug information would considerably enlarge the installed static libraries
+ foreach(target IN LISTS _OPENVINO_DEVELOPER_PACKAGE_TARGETS)
+ get_target_property(target_type ${target} TYPE)
+ get_target_property(target_imported ${target} IMPORTED)
+ if(target_type STREQUAL "STATIC_LIBRARY" AND NOT target_imported)
+ ov_keep_debug_info_in_pdb(${target})
+ endif()
+ endforeach()
+
# filter out targets which are installed by OpenVINOConfig.cmake static build case
if(openvino_installed_targets)
list(REMOVE_ITEM _OPENVINO_DEVELOPER_PACKAGE_TARGETS ${openvino_installed_targets})
diff --git a/docs/dev/ci/github_actions/caches.md b/docs/dev/ci/github_actions/caches.md
index 7d022a5e3cb..f271bad8c87 100644
--- a/docs/dev/ci/github_actions/caches.md
+++ b/docs/dev/ci/github_actions/caches.md
@@ -90,12 +90,12 @@ add the mounting point under the `container`'s `volumes` key in a job configurat
Build:
...
needs: Docker
- runs-on: aks-linux-16-cores-32gb
+ runs-on: <self-hosted runner>
container:
- image: ${{ fromJSON(needs.docker.outputs.images).ov_build.ubuntu_22_04_x64 }}
+ image: ${{ fromJSON(needs.docker.outputs.images).ov_build.<image> }}
volumes:
- - /mount:/mount
- - /home/runner/secrets/:/secrets:ro
+ - <shared drive path>:<shared drive path>
+ - <secrets path on runner>:/secrets:ro
options: -e SCCACHE_AZURE_BLOB_CONTAINER
steps:
- name: Append the environment variable - load SCCACHE_AZURE_CONNECTION_STRING from file
@@ -108,16 +108,17 @@ Build:
...
```
-In `- /mount:/mount`, the first `/mount` is the path on the runner, the second `/mount` is the
-path in the Docker container where the resources will be available.
+In `- <shared drive path>:<shared drive path>`, the first path is the location of the shared drive
+on the runner, the second one is the path in the Docker container where the resources will be
+available. Use the same mount point as the existing workflows for the target runner.
### Available Resources
* `pip` cache
- * Accessible via the environment variable `PIP_CACHE_PATH: /mount/caches/pip/linux`, defined at the workflow level
+ * Accessible via the `PIP_CACHE_PATH` environment variable, defined at the workflow level
* Used in jobs that involve Python usage
* onnx models for tests
- * Accessible at the path: `/mount/onnxtestdata`
+ * Stored in a dedicated folder on the shared drive
* Used in the `ONNX Models tests` job in the [`ubuntu_22.yml`](./../../../../.github/workflows/ubuntu_22.yml) workflow
* Linux RISC-V with Conan build artifacts
* Used in the [`linux_riscv.yml`](./../../../../.github/workflows/linux_riscv.yml) workflow
@@ -127,12 +128,29 @@ To add new resources, contact a member of the CI team for assistance.
### Remote Storage Compiler Cache
Builds can share compiled objects through ccache's remote storage on the shared drive
-by setting `CCACHE_SECONDARY_STORAGE` (or `CCACHE_REMOTE_STORAGE` on newer ccache)
-to `file:///mount/caches/ccache/shared`. The RISC-V GNU build in
-[`linux_riscv.yml`](./../../../../.github/workflows/linux_riscv.yml) and RISC-V with Conan in [`linux_riscv_conan.yml`](./../../../../.github/workflows/linux_riscv_conan.yml) are the pilot users.
-Old entries are evicted together with the rest of `/mount/caches/ccache` by the
-`Cleanup_ccache_lin` job in
-[`cleanup_caches.yml`](./../../../../.github/workflows/cleanup_caches.yml).
+by setting `CCACHE_SECONDARY_STORAGE` (or `CCACHE_REMOTE_STORAGE` on newer ccache) to a
+`file://` URL. Each build configuration uses its own directory inside the shared storage.
+Users:
+* The RISC-V GNU and Conan builds in [`linux_riscv.yml`](./../../../../.github/workflows/linux_riscv.yml)
+ and [`linux_riscv_conan.yml`](./../../../../.github/workflows/linux_riscv_conan.yml).
+* The Windows builds in
+ [`job_build_windows.yml`](./../../../../.github/workflows/job_build_windows.yml),
+ [`job_build_windows_cpp20.yml`](./../../../../.github/workflows/job_build_windows_cpp20.yml) and
+ [`windows_conditional_compilation.yml`](./../../../../.github/workflows/windows_conditional_compilation.yml).
+
+ccache cannot cache MSVC compilations with a separate PDB (`/Zi`), so the Windows Debug build
+sets `-DCMAKE_MSVC_DEBUG_INFORMATION_FORMAT=Embedded` (`/Z7`), which stores debug information
+in object files. Builds with embedded debug information link without `/INCREMENTAL`, which keeps
+PDB files free of stale incremental-link data. See `ENABLE_STATIC_LIBS_PDB` in
+[CMake options for custom compilation](./../../cmake_options_for_custom_compilation.md) for how
+static libraries are handled.
+
+`CCACHE_MAXSIZE` limits only the local cache. The remote storage is trimmed periodically by the
+`Cleanup_remote_ccache_*` jobs in
+[`cleanup_caches.yml`](./../../../../.github/workflows/cleanup_caches.yml) with
+`ccache --trim-dir --trim-method mtime` (ccache 4.8 or newer), which evicts the least recently used
+entries down to `CCACHE_REMOTE_MAX_SIZE`. Builds must keep `update-mtime=true` in the remote storage
+URL so that cache hits refresh the modification time used for eviction.
## Cloud Storage via Azure Blob Storage
@@ -176,12 +194,12 @@ key under the `container` key to make them accessible for `sccache` inside the c
Build:
...
needs: Docker
- runs-on: aks-linux-16-cores-32gb
+ runs-on: <self-hosted runner>
container:
- image: ${{ fromJSON(needs.docker.outputs.images).ov_build.ubuntu_22_04_x64 }}
+ image: ${{ fromJSON(needs.docker.outputs.images).ov_build.<image> }}
volumes:
- - /mount:/mount
- - /home/runner/secrets/:/secrets:ro
+ - <shared drive path>:<shared drive path>
+ - <secrets path on runner>:/secrets:ro
options: -e SCCACHE_AZURE_BLOB_CONTAINER
steps:
- name: Append the environment variable - load SCCACHE_AZURE_CONNECTION_STRING from file
diff --git a/docs/dev/cmake_options_for_custom_compilation.md b/docs/dev/cmake_options_for_custom_compilation.md
index dd45367a15e..eefeaaa4194 100644
--- a/docs/dev/cmake_options_for_custom_compilation.md
+++ b/docs/dev/cmake_options_for_custom_compilation.md
@@ -156,6 +156,18 @@ In this case OpenVINO CMake scripts take `TBBROOT` environment variable into acc
* `ENABLE_INTEGRITYCHECK` builds DLLs with [/INTEGRITYCHECK] flag:
* `OFF` is default.
* Available on MSVC compiler only.
+* `ENABLE_STATIC_LIBS_PDB` keeps debug information of developer package static libraries in
+ separate PDB files (`/Zi`) when `-DCMAKE_MSVC_DEBUG_INFORMATION_FORMAT=Embedded` (`/Z7`) is used:
+ * `OFF` is default.
+ * Available on MSVC compiler only.
+ * Embedded debug information (`/Z7`) is required by compiler caches such as ccache, which
+ cannot cache compilations writing to a shared PDB file (`/Zi`). With `/Z7`, every object
+ file carries its own copy of the debug information, so static libraries archiving these
+ objects grow considerably, while DLLs and executables are not affected because the linker
+ moves the debug information into their PDB files. With this option, the static libraries
+ installed to the developer package (and the object libraries archived into them) are built
+ with `/Zi` to keep their size, while all other targets, including DLLs, keep `/Z7` and stay
+ cacheable.
* `ENABLE_QSPECTRE` builds with [/Qspectre] flag:
* `OFF` is default.
* Available on MSVC compiler only.