From cfbc99805bc845f57f12f06de44034e9e8a9fd20 Mon Sep 17 00:00:00 2001 From: Mikhail Ryzhov Date: Wed, 22 Jan 2025 10:05:27 +0100 Subject: [PATCH] [GHA] VS 2022 (#28520) ### Details: - Switch Windows pipelines to VS 2022 ### Tickets: - *ticket-id* --- .github/actions/common/constants.py | 4 ++- .github/workflows/job_build_windows.yml | 8 ++--- .github/workflows/job_samples_tests.yml | 4 +-- .../windows_conditional_compilation.yml | 2 +- .github/workflows/windows_vs2019_debug.yml | 6 ++-- .github/workflows/windows_vs2019_release.yml | 4 +-- .github/workflows/workflows_to_track.txt | 8 ++--- src/bindings/python/wheel/CMakeLists.txt | 36 ++++++++++--------- src/bindings/python/wheel/fdupes_check.cmake | 8 ++++- src/bindings/python/wheel/setup.py | 4 +-- 10 files changed, 48 insertions(+), 36 deletions(-) diff --git a/.github/actions/common/constants.py b/.github/actions/common/constants.py index 6a1d165fc7df13..a9ed34ce7a2275 100644 --- a/.github/actions/common/constants.py +++ b/.github/actions/common/constants.py @@ -16,6 +16,8 @@ class EventType(Enum): 'public_linux_ubuntu_24_04_x86_64_release', 'public_windows_vs2019_Release', 'public_windows_vs2019_Debug', + 'public_windows_vs2022_Release', + 'public_windows_vs2022_Debug', 'public_manylinux2014_x86_64_release', ) ProductType = Enum('ProductType', {t.upper(): t for t in productTypes}) @@ -41,5 +43,5 @@ class EventType(Enum): PlatformKey.UBUNTU20_ARM64: ProductType.PUBLIC_LINUX_UBUNTU_20_04_ARM64_RELEASE, PlatformKey.UBUNTU22_X86_64: ProductType.PUBLIC_LINUX_UBUNTU_22_04_X86_64_RELEASE, PlatformKey.UBUNTU24_X86_64: ProductType.PUBLIC_LINUX_UBUNTU_24_04_X86_64_RELEASE, - PlatformKey.WINDOWS_X86_64: ProductType.PUBLIC_WINDOWS_VS2019_RELEASE, + PlatformKey.WINDOWS_X86_64: ProductType.PUBLIC_WINDOWS_VS2022_RELEASE, } diff --git a/.github/workflows/job_build_windows.yml b/.github/workflows/job_build_windows.yml index 988bec1de7f929..e725f15c7081c1 100644 --- a/.github/workflows/job_build_windows.yml +++ b/.github/workflows/job_build_windows.yml @@ -56,7 +56,7 @@ jobs: BUILD_DIR: "${{ github.workspace }}\\openvino_build" ARTIFACTS_SHARE: "C:\\mount\\build-artifacts" MANIFEST_PATH: "${{ github.workspace }}\\manifest.yml" - PRODUCT_TYPE: 'public_windows_vs2019_${{ inputs.build-type }}' + PRODUCT_TYPE: 'public_windows_vs2022_${{ inputs.build-type }}' steps: - name: Clone OpenVINO uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 @@ -154,10 +154,10 @@ jobs: restore-keys: | ${{ runner.os }}-${{ runner.arch }}-ccache - - name: Configure Developer Command Prompt for Microsoft Visual C++ (2019) + - name: Configure Developer Command Prompt for Microsoft Visual C++ uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0 with: - toolset: 14.29 + toolset: 14.40 # v2022 - name: Set SSL_CERT_FILE for model downloading for unit tests run: echo SSL_CERT_FILE=$(python3 -m certifi) >> $env:GITHUB_ENV @@ -229,7 +229,7 @@ jobs: & $pythonExecutablePath -m pip install -r ${{ env.OPENVINO_REPO }}/src/bindings/python/wheel/requirements-dev.txt cmake -DPython3_EXECUTABLE="$pythonExecutablePath" -DOpenVINODeveloperPackage_DIR=${{ env.BUILD_DIR }} -S ${{ env.OPENVINO_REPO }}/src/bindings/python -B "$pyBuildDir" && - cmake --build "$pyBuildDir" --parallel --config ${{ env.CMAKE_BUILD_TYPE }} && + cmake --build "$pyBuildDir" --parallel $ENV:NUMBER_OF_PROCESSORS --target ie_wheel --config ${{ env.CMAKE_BUILD_TYPE }} && cmake --install "$pyBuildDir" --config ${{ env.CMAKE_BUILD_TYPE }} --prefix ${{ env.INSTALL_WHEELS_DIR }} --component python_wheels if ($LASTEXITCODE -ne 0) { Write-Host "Failed to build Python wheels for Python $pyVersion" diff --git a/.github/workflows/job_samples_tests.yml b/.github/workflows/job_samples_tests.yml index 07fc17b797592e..abcbc62c182342 100644 --- a/.github/workflows/job_samples_tests.yml +++ b/.github/workflows/job_samples_tests.yml @@ -84,11 +84,11 @@ jobs: version: '3.11' should-setup-pip-paths: 'false' - - name: Configure Developer Command Prompt for Microsoft Visual C++ (2022) + - name: Configure Developer Command Prompt for Microsoft Visual C++ if: runner.os == 'Windows' uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0 with: - toolset: 14.40 + toolset: 14.40 # v2022 - name: Build cpp samples run: $INSTALL_DIR/samples/cpp/build_samples.sh -i $INSTALL_DIR -b $BUILD_DIR/cpp_samples diff --git a/.github/workflows/windows_conditional_compilation.yml b/.github/workflows/windows_conditional_compilation.yml index 6ce104ad07fe9f..ba9908558201e6 100644 --- a/.github/workflows/windows_conditional_compilation.yml +++ b/.github/workflows/windows_conditional_compilation.yml @@ -157,7 +157,7 @@ jobs: - name: Configure Developer Command Prompt for Microsoft Visual C++ uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0 with: - toolset: 14.40 + toolset: 14.40 # v2022 - name: Set SSL_CERT_FILE for model downloading for unit tests run: echo SSL_CERT_FILE=$(python3 -m certifi) >> $env:GITHUB_ENV diff --git a/.github/workflows/windows_vs2019_debug.yml b/.github/workflows/windows_vs2019_debug.yml index 4fcdc6b58b79d1..c69ea87d1bcbf8 100644 --- a/.github/workflows/windows_vs2019_debug.yml +++ b/.github/workflows/windows_vs2019_debug.yml @@ -1,4 +1,4 @@ -name: Windows (VS 2019, Python 3.11, Debug) +name: Windows (VS 2022, Python 3.11, Debug) on: workflow_dispatch: merge_group: @@ -9,7 +9,7 @@ on: - 'releases/**' concurrency: # github.ref is not unique in post-commit - group: ${{ github.event_name == 'push' && github.run_id || github.ref }}-windows-vs2019-debug + group: ${{ github.event_name == 'push' && github.run_id || github.ref }}-windows-vs2022-debug cancel-in-progress: true permissions: read-all @@ -77,7 +77,7 @@ jobs: with: runner: 'aks-win-4-cores-8gb' affected-components: ${{ needs.smart_ci.outputs.affected_components }} - os: 'windows_2019' + os: 'windows_2022' build-type: 'Debug' timeout-minutes: 60 diff --git a/.github/workflows/windows_vs2019_release.yml b/.github/workflows/windows_vs2019_release.yml index d909c18633795e..0288bef986bbee 100644 --- a/.github/workflows/windows_vs2019_release.yml +++ b/.github/workflows/windows_vs2019_release.yml @@ -1,4 +1,4 @@ -name: Windows (VS 2019, Python 3.11, Release) +name: Windows (VS 2022, Python 3.11, Release) on: workflow_dispatch: pull_request: @@ -520,7 +520,7 @@ jobs: with: runner: 'aks-win-4-cores-8gb' affected-components: ${{ needs.smart_ci.outputs.affected_components }} - os: 'windows_2019' + os: 'windows_2022' build-type: 'Release' timeout-minutes: 50 diff --git a/.github/workflows/workflows_to_track.txt b/.github/workflows/workflows_to_track.txt index ef3bb633ed7737..262465ead6b6e5 100644 --- a/.github/workflows/workflows_to_track.txt +++ b/.github/workflows/workflows_to_track.txt @@ -20,8 +20,8 @@ name: Linux Static CC (Ubuntu 22.04, Python 3.11, Clang) name: GitHub Actions Workflows Scans ==> ./check_pr_commits.yml <== name: PR Commits -==> ./windows_vs2019_debug.yml <== -name: Windows (VS 2019, Python 3.11, Debug) +==> ./windows_vs2022_debug.yml <== +name: Windows (VS 2022, Python 3.11, Debug) ==> ./files_size.yml <== name: Files Size ==> ./cleanup_caches.yml <== @@ -69,7 +69,7 @@ name: Webassembly name: Linux (Ubuntu 24.04, Python 3.12) ==> ./assign_issue.yml <== name: Take Issue -==> ./windows_vs2019_release.yml <== -name: Windows (VS 2019, Python 3.11, Release) +==> ./windows_vs2022_release.yml <== +name: Windows (VS 2022, Python 3.11, Release) ==> ./coverity.yml <== name: Coverity (Ubuntu 20.04, Python 3.11) diff --git a/src/bindings/python/wheel/CMakeLists.txt b/src/bindings/python/wheel/CMakeLists.txt index 3f42940627d730..e598487753d0d8 100644 --- a/src/bindings/python/wheel/CMakeLists.txt +++ b/src/bindings/python/wheel/CMakeLists.txt @@ -132,23 +132,27 @@ add_custom_command(OUTPUT ${openvino_wheel_path} WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" COMMENT "Building Python wheel ${openvino_wheel_name}" VERBATIM) +set(ie_wheel_deps ${openvino_wheel_path}) + +if(NOT CMAKE_HOST_WIN32) + set(fdupes_report ${CMAKE_CURRENT_BINARY_DIR}/fdupes_report.txt) + add_custom_command(OUTPUT "${fdupes_report}" + COMMAND ${CMAKE_COMMAND} + -D Python3_EXECUTABLE=${Python3_EXECUTABLE} + -D WORKING_DIRECTORY=${CMAKE_CURRENT_BINARY_DIR} + -D WHEEL_VERSION=${WHEEL_VERSION} + -D PACKAGE_FILE=${openvino_wheel_path} + -D REPORT_FILE=${fdupes_report} + -D CMAKE_SHARED_LIBRARY_SUFFIX=${CMAKE_SHARED_LIBRARY_SUFFIX} + -P "${CMAKE_CURRENT_SOURCE_DIR}/fdupes_check.cmake" + DEPENDS "${openvino_wheel_path}" + WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" + COMMENT "Run 'fdupes' checks for wheel ${openvino_wheel_name}" + VERBATIM) + list(APPEND ie_wheel_deps ${fdupes_report}) +endif() -set(fdupes_report ${CMAKE_CURRENT_BINARY_DIR}/fdupes_report.txt) -add_custom_command(OUTPUT "${fdupes_report}" - COMMAND ${CMAKE_COMMAND} - -D Python3_EXECUTABLE=${Python3_EXECUTABLE} - -D WORKING_DIRECTORY=${CMAKE_CURRENT_BINARY_DIR} - -D WHEEL_VERSION=${WHEEL_VERSION} - -D PACKAGE_FILE=${openvino_wheel_path} - -D REPORT_FILE=${fdupes_report} - -D CMAKE_SHARED_LIBRARY_SUFFIX=${CMAKE_SHARED_LIBRARY_SUFFIX} - -P "${CMAKE_CURRENT_SOURCE_DIR}/fdupes_check.cmake" - DEPENDS "${openvino_wheel_path}" - WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" - COMMENT "Run 'fdupes' checks for wheel ${openvino_wheel_name}" - VERBATIM) - -add_custom_target(ie_wheel ALL DEPENDS ${openvino_wheel_path} ${fdupes_report}) +add_custom_target(ie_wheel ALL DEPENDS ${ie_wheel_deps}) add_custom_command( TARGET ie_wheel diff --git a/src/bindings/python/wheel/fdupes_check.cmake b/src/bindings/python/wheel/fdupes_check.cmake index 9f2a7860b3b769..d7cbec3343d8b4 100644 --- a/src/bindings/python/wheel/fdupes_check.cmake +++ b/src/bindings/python/wheel/fdupes_check.cmake @@ -12,7 +12,13 @@ endforeach() find_program(fdupes_PROGRAM NAMES fdupes DOC "Path to fdupes") if(NOT fdupes_PROGRAM) - message(WARNING "Failed to find 'fdupes' tool, use 'sudo apt-get install fdupes' to install it") + set(fdupes_install_msg "refer to your platform's package manager or install it manually.") + if(CMAKE_HOST_LINUX) + set(fdupes_install_msg "sudo apt-get install fdupes") + elseif(CMAKE_HOST_APPLE) + set(fdupes_install_msg "brew install fdupes") + endif() + message(WARNING "Failed to find 'fdupes' tool. Install it using: ${fdupes_install_msg}") return() endif() diff --git a/src/bindings/python/wheel/setup.py b/src/bindings/python/wheel/setup.py index 50f0066313d4cd..620ce30f33dbca 100644 --- a/src/bindings/python/wheel/setup.py +++ b/src/bindings/python/wheel/setup.py @@ -66,9 +66,9 @@ "rpath": LIBS_RPATH, "binary_dir": OPENVINO_BINARY_DIR, }, - "ie_libs_с": { + "ie_libs_c": { "name": "core_c", - "prefix": f"{BUILD_BASE}/libs.core_с", + "prefix": f"{BUILD_BASE}/libs.core_c", "install_dir": OV_RUNTIME_LIBS_DIR, "rpath": LIBS_RPATH, "binary_dir": OPENVINO_BINARY_DIR,