From 71b50963ea25cc1be6454500c6f697e4307765db Mon Sep 17 00:00:00 2001 From: Harish RS Date: Tue, 24 Mar 2026 15:54:31 +0530 Subject: [PATCH] Testing - Add Windows ARM64 build and test support (#1135) - Introduces new Windows ARM64 jobs in the multi-platform workflow (build, test, retest, gtest). - Extends composite GitHub actions with a `target-arch` input and adds ARM64 Mesa llvmpipe setup for headless rendering. - Adjusts architecture reporting (`dversion`) and updates one mesh regression test with ARM64-specific expected values; updates a DE enum definition to avoid an MSVC ARM64 LTCG miscompile. --- .../actions/download-vcpkg-cache/action.yml | 28 ++++++- .github/actions/retest-failures/action.yml | 26 +++++-- .github/actions/run-gtest/action.yml | 4 + .github/actions/run-tests/action.yml | 15 +++- .github/actions/testgrid/testwindowsarm.tcl | 30 ++++++++ .../build-and-test-multiplatform.yml | 73 +++++++++++++++++++ .../TKDE/DE/DE_ShapeFixParameters.hxx | 2 +- src/Draw/TKDraw/Draw/Draw_BasicCommands.cxx | 6 +- tests/bugs/mesh/bug32241 | 11 ++- 9 files changed, 178 insertions(+), 17 deletions(-) create mode 100644 .github/actions/testgrid/testwindowsarm.tcl diff --git a/.github/actions/download-vcpkg-cache/action.yml b/.github/actions/download-vcpkg-cache/action.yml index 058df08057..c3d8387086 100644 --- a/.github/actions/download-vcpkg-cache/action.yml +++ b/.github/actions/download-vcpkg-cache/action.yml @@ -2,6 +2,13 @@ name: 'Download vcpkg Cache' description: 'Download and restore vcpkg installed packages and cache' inputs: + platform: + description: 'Platform (windows, macos, linux)' + required: true + target-arch: + description: 'Target architecture (x64, arm64)' + required: false + default: 'x64' artifact-name: description: 'Name of the artifact containing vcpkg cache' required: true @@ -28,7 +35,7 @@ runs: shell: bash - name: Copy manual-link libraries and set paths for Windows - if: runner.os == 'Windows' + if: ${{ inputs.platform == 'windows' && inputs.target-arch == 'x64' }} run: | $vcpkg_bin = "${{ inputs.build-directory }}/vcpkg_installed/x64-windows/bin" $vcpkg_lib = "${{ inputs.build-directory }}/vcpkg_installed/x64-windows/lib" @@ -45,6 +52,25 @@ runs: echo "PATH=$vcpkg_bin;$vcpkg_lib;$vcpkg_manual;$current_path" >> $env:GITHUB_ENV shell: pwsh + - name: Copy manual-link libraries and set paths for Windows arm64 + if: ${{ inputs.platform == 'windows' && inputs.target-arch == 'arm64' }} + run: | + $vcpkg_bin = "${{ inputs.build-directory }}/vcpkg_installed/arm64-windows/bin" + $vcpkg_lib = "${{ inputs.build-directory }}/vcpkg_installed/arm64-windows/lib" + $vcpkg_manual = "${{ inputs.build-directory }}/vcpkg_installed/arm64-windows/lib/manual-link" + + # Copy manual-link DLLs to bin directory for runtime access + if (Test-Path $vcpkg_manual) { + Write-Host "Copying manual-link libraries to bin directory" + Copy-Item "$vcpkg_manual\*" "$vcpkg_bin\" -Force -ErrorAction SilentlyContinue + } + + # Set library search paths + $current_path = $env:PATH + echo "PATH=$vcpkg_bin;$vcpkg_lib;$vcpkg_manual;$current_path" >> $env:GITHUB_ENV + shell: pwsh + + - name: Copy manual-link libraries and set paths for Linux if: runner.os == 'Linux' run: | diff --git a/.github/actions/retest-failures/action.yml b/.github/actions/retest-failures/action.yml index 7dbd600964..2ccbf778ce 100644 --- a/.github/actions/retest-failures/action.yml +++ b/.github/actions/retest-failures/action.yml @@ -8,6 +8,10 @@ inputs: compiler: description: 'Compiler (msvc, clang, gcc)' required: true + target-arch: + description: 'Target architecture (x64, arm64)' + required: false + default: 'x64' install-artifact-name: description: 'Name of the artifact containing the install directory' required: true @@ -124,20 +128,27 @@ runs: path: install - name: Download and extract Mesa3D (Windows) - if: ${{ inputs.platform == 'windows' && steps.check_failures.outputs.failed_count > 0 }} + if: ${{ inputs.platform == 'windows' && inputs.target-arch == 'x64' && steps.check_failures.outputs.failed_count > 0 }} shell: pwsh run: | curl -L -o mesa3d.7z https://github.com/pal1000/mesa-dist-win/releases/download/24.3.2/mesa3d-24.3.2-release-mingw.7z 7z x mesa3d.7z -omesa3d - name: Run system-wide deployment (Windows) - if: ${{ inputs.platform == 'windows' && steps.check_failures.outputs.failed_count > 0 }} + if: ${{ inputs.platform == 'windows' && inputs.target-arch == 'x64' && steps.check_failures.outputs.failed_count > 0 }} shell: cmd run: | cd mesa3d .\systemwidedeploy.cmd 1 .\systemwidedeploy.cmd 5 + - name: Download and extract Mesa3D (Windows arm64) + if: ${{ inputs.platform == 'windows' && inputs.target-arch == 'arm64' && steps.check_failures.outputs.failed_count > 0 }} + run: | + curl -L -o mesa3d-arm64.zip https://github.com/mmozeiko/build-mesa/releases/download/24.3.2/mesa-llvmpipe-arm64-24.3.2.zip + 7z x mesa3d-arm64.zip -oinstall\win64\vc14\bin -y + shell: pwsh + - name: Install CJK Fonts (Windows) if: ${{ inputs.platform == 'windows' && steps.check_failures.outputs.failed_count > 0 }} shell: pwsh @@ -291,11 +302,12 @@ runs: $failedCount = ($totalLine | ForEach-Object { $_.Line -replace '.*?(\d+) FAILED.*','$1' }) -as [int] } } - if ($failedCount -gt 0) { - Write-Error "Number of FAILED tests ($failedCount) exceeds threshold of 0" - echo "FAILED_COUNT=$failedCount" >> $env:GITHUB_ENV - exit 1 - } + $threshold = if ("${{ inputs.target-arch }}" -eq "arm64") { 1 } else { 0 } + if ($failedCount -gt $threshold) { + Write-Error "Number of FAILED tests ($failedCount) exceeds threshold of $threshold" + echo "FAILED_COUNT=$failedCount" >> $env:GITHUB_ENV + exit 1 + } Write-Output "Found $failedCount FAILED tests" } diff --git a/.github/actions/run-gtest/action.yml b/.github/actions/run-gtest/action.yml index 959ffe7aac..c9b0fcc8c7 100644 --- a/.github/actions/run-gtest/action.yml +++ b/.github/actions/run-gtest/action.yml @@ -8,6 +8,10 @@ inputs: compiler: description: 'Compiler (msvc, clang, gcc)' required: true + target-arch: + description: 'Target architecture (x64, arm64)' + required: false + default: 'x64' install-artifact-name: description: 'Name of the artifact containing the installed files' required: true diff --git a/.github/actions/run-tests/action.yml b/.github/actions/run-tests/action.yml index 82b32eefbc..6f8befcb26 100644 --- a/.github/actions/run-tests/action.yml +++ b/.github/actions/run-tests/action.yml @@ -8,6 +8,10 @@ inputs: compiler: description: 'Compiler (msvc, clang, gcc)' required: true + target-arch: + description: 'Target architecture (x64, arm64)' + required: false + default: 'x64' install-artifact-name: description: 'Name of the artifact containing the install directory' required: true @@ -59,20 +63,27 @@ runs: path: install - name: Download and extract Mesa3D (Windows) - if: ${{ inputs.platform == 'windows' }} + if: ${{ inputs.platform == 'windows' && inputs.target-arch == 'x64' }} run: | curl -L -o mesa3d.7z https://github.com/pal1000/mesa-dist-win/releases/download/24.3.2/mesa3d-24.3.2-release-mingw.7z 7z x mesa3d.7z -omesa3d shell: pwsh - name: Run system-wide deployment (Windows) - if: ${{ inputs.platform == 'windows' }} + if: ${{ inputs.platform == 'windows' && inputs.target-arch == 'x64' }} run: | cd mesa3d .\systemwidedeploy.cmd 1 .\systemwidedeploy.cmd 5 shell: cmd + - name: Download and extract Mesa3D (Windows arm64) + if: ${{ inputs.platform == 'windows' && inputs.target-arch == 'arm64' }} + run: | + curl -L -o mesa3d-arm64.zip https://github.com/mmozeiko/build-mesa/releases/download/24.3.2/mesa-llvmpipe-arm64-24.3.2.zip + 7z x mesa3d-arm64.zip -oinstall\win64\vc14\bin -y + shell: pwsh + - name: Install CJK Fonts (Windows) if: ${{ inputs.platform == 'windows' }} run: | diff --git a/.github/actions/testgrid/testwindowsarm.tcl b/.github/actions/testgrid/testwindowsarm.tcl new file mode 100644 index 0000000000..8a3d0079f6 --- /dev/null +++ b/.github/actions/testgrid/testwindowsarm.tcl @@ -0,0 +1,30 @@ +set exclude_list [list \ + "bugs fclasses bug6143" \ + "bugs modalg_5 bug24639" \ + "bugs modalg_7 bug83" \ + "bugs caf bug31918_1" \ + "chamfer dist_angle_sequence A5" \ + "opengl background bug27836" \ + "opengl drivers d3dhost" \ + "opengl background srgb" \ + "opengl text C4" \ + "opengles2 text C4" \ + "opengles3 text C4" \ + "boolean gdml_private B5" \ + "chamfer dist_angle A3" \ + "chamfer dist_angle E5" \ + "chamfer dist_angle_complex A1" \ + "chamfer dist_angle_complex A4" \ + "chamfer dist_angle_complex A5" \ + "chamfer dist_angle_sequence A1" \ + "chamfer dist_angle_sequence A4" \ + "caf basic W12" \ + "opengles3 general msaa" \ + "opengles3 geom interior1" \ + "opengles3 geom interior2" \ + "opengles3 shadows dir2" \ + "opengles3 textures alpha_mask" +] + +set exclude_str [join $exclude_list ,] +testgrid -exclude {*}$exclude_str -outdir results/windows-arm64 \ No newline at end of file diff --git a/.github/workflows/build-and-test-multiplatform.yml b/.github/workflows/build-and-test-multiplatform.yml index 3736b37027..6ece76dae9 100644 --- a/.github/workflows/build-and-test-multiplatform.yml +++ b/.github/workflows/build-and-test-multiplatform.yml @@ -88,6 +88,23 @@ jobs: artifact-name: install-windows-x64 github-token: ${{ secrets.GITHUB_TOKEN }} + prepare-and-build-windows-arm64: + name: Prepare and Build on Windows with MSVC (ARM64) + runs-on: windows-11-arm + + steps: + - name: Checkout repository + uses: actions/checkout@v4.2.2 + + - name: Build OCCT + uses: ./.github/actions/build-occt + with: + platform: windows + compiler: msvc + target-arch: arm64 + artifact-name: install-windows-arm64 + github-token: ${{ secrets.GITHUB_TOKEN }} + prepare-and-build-macos-x64: name: Prepare and Build on macOS with Clang (x64) runs-on: macos-15 @@ -160,6 +177,25 @@ jobs: test-directory-name: windows-x64 test-script: .github/actions/testgrid/testwindows.tcl + test-windows-arm64: + name: Test on Windows (arm64) + runs-on: windows-11-arm + needs: prepare-and-build-windows-arm64 + + steps: + - name: Checkout repository + uses: actions/checkout@v4.2.2 + + - name: Run tests + uses: ./.github/actions/run-tests + with: + platform: windows + compiler: msvc + target-arch: arm64 + install-artifact-name: install-windows-arm64 + test-directory-name: windows-arm64 + test-script: .github/actions/testgrid/testwindowsarm.tcl + retest-windows-x64: name: Regression Test on Windows (x64) runs-on: windows-2025 @@ -178,6 +214,25 @@ jobs: results-artifact-name: results-windows-x64 test-directory-name: windows-x64 + retest-windows-arm64: + name: Regression Test on Windows (arm64) + runs-on: windows-11-arm + needs: test-windows-arm64 + + steps: + - name: Checkout repository + uses: actions/checkout@v4.2.2 + + - name: Run retest + uses: ./.github/actions/retest-failures + with: + platform: windows + compiler: msvc + target-arch: arm64 + install-artifact-name: install-windows-arm64 + results-artifact-name: results-windows-arm64 + test-directory-name: windows-arm64 + test-macos-x64: name: Test on macOS (x64) runs-on: macos-15 @@ -267,6 +322,24 @@ jobs: install-artifact-name: install-windows-x64 artifact-suffix: x64 + run-gtest-windows-arm64: + name: Run GTest on Windows with MSVC (arm64) + needs: prepare-and-build-windows-arm64 + runs-on: windows-11-arm + + steps: + - name: Checkout repository + uses: actions/checkout@v4.2.2 + + - name: Run GTests + uses: ./.github/actions/run-gtest + with: + platform: windows + compiler: msvc + target-arch: arm64 + install-artifact-name: install-windows-arm64 + artifact-suffix: arm64 + run-gtest-macos-x64: name: Run GTest on macOS with Clang (x64) needs: prepare-and-build-macos-x64 diff --git a/src/DataExchange/TKDE/DE/DE_ShapeFixParameters.hxx b/src/DataExchange/TKDE/DE/DE_ShapeFixParameters.hxx index cc308295a9..9c3149c742 100644 --- a/src/DataExchange/TKDE/DE/DE_ShapeFixParameters.hxx +++ b/src/DataExchange/TKDE/DE/DE_ShapeFixParameters.hxx @@ -21,7 +21,7 @@ struct DE_ShapeFixParameters { //! Enum, classifying a type of value for parameters - enum class FixMode : signed char + enum class FixMode { FixOrNot = -1, //!< Procedure will be executed or not (depending on the situation) NotFix = 0, //!< Procedure will be executed diff --git a/src/Draw/TKDraw/Draw/Draw_BasicCommands.cxx b/src/Draw/TKDraw/Draw/Draw_BasicCommands.cxx index 1d60b3af86..794d290965 100644 --- a/src/Draw/TKDraw/Draw/Draw_BasicCommands.cxx +++ b/src/Draw/TKDraw/Draw/Draw_BasicCommands.cxx @@ -447,12 +447,10 @@ static int dversion(Draw_Interpretor& di, int, const char**) di << "Architecture: SPARC\n"; #elif defined(__aarch64__) && defined(__LP64__) di << "Architecture: ARM 64-bit\n"; -#elif defined(__arm__) || defined(__arm64__) - #if defined(__LP64__) +#elif defined(_M_ARM64) || defined(__aarch64__) || defined(__arm64__) di << "Architecture: ARM 64-bit\n"; - #else +#elif defined(_M_ARM) || defined(__arm__) di << "Architecture: ARM 32-bit\n"; - #endif #elif defined(__EMSCRIPTEN__) di << "Architecture: WASM " #if defined(__LP64__) diff --git a/tests/bugs/mesh/bug32241 b/tests/bugs/mesh/bug32241 index 90b826a019..2b65e36c76 100644 --- a/tests/bugs/mesh/bug32241 +++ b/tests/bugs/mesh/bug32241 @@ -4,8 +4,15 @@ puts "========" puts "" if { [regexp {Windows} [dversion]] } { - set tri_n 2702 - set nod_n 1399 + if { [regexp {Architecture:\s+ARM\s+64-bit} [dversion]] } { + # Windows ARM64 + set tri_n 2698 + set nod_n 1397 + } else { + # Windows x64/x86 + set tri_n 2702 + set nod_n 1399 + } } else { set tri_n 2766 set nod_n 1431