Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 17 additions & 14 deletions .github/workflows/build-test-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -188,23 +188,26 @@ jobs:
env:
GETTEXT_ROOT: C:\msys64_meshlib_mrbind\clang64
VCPKG_ROOT: C:\vcpkg
# Error handling: use `|| exit /b 1` chained to each command instead
# of the `if errorlevel 1 exit 1` pattern. The latter was failing to
# propagate `cmake --build` / ninja failures out of the step on
# windows-2025 runners; in a run where ninja reported
# `ninja: build stopped: subcommand failed` the step still exited 0
# and went on to `xcopy`, which hid the real failure and caused the
# next step's linker error for a nonexistent .lib. `|| exit /b 1`
# is evaluated at process-exit time rather than via the
# errorlevel-in-parens parsing quirks of cmd.exe IF blocks, and is
# the documented idiom for robust error propagation in batch files.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment seems excessively large, can it be simplified?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shortened to three lines in fb6f4ca.

run: |
if ${{ fromJSON('["1==0", "1==1"]')[matrix.build_system == 'CMake'] }} (
call "${{matrix.vc-path}}\Common7\Tools\VsDevCmd.bat" -arch=amd64 ${{ fromJSON('["", "-vcvars_ver=14.2"]')[matrix.cxx_compiler == 'msvc-2019'] }}
if errorlevel 1 exit 1
cmake --version
if errorlevel 1 exit 1
cmake -B source\TempOutput -GNinja -DCMAKE_BUILD_TYPE=${{matrix.config}} -DMESHLIB_BUILD_GENERATED_C_BINDINGS=${{ fromJSON('["OFF", "ON"]')[inputs.mrbind_c] }}
if errorlevel 1 exit 1
cmake --build source\TempOutput -j
if errorlevel 1 exit 1
if not exist source\x64 mkdir source\x64
if errorlevel 1 exit 1
xcopy source\TempOutput\bin\* source\x64\${{matrix.config}}\* /s /e /i /Y
if errorlevel 1 exit 1
call "${{matrix.vc-path}}\Common7\Tools\VsDevCmd.bat" -arch=amd64 ${{ fromJSON('["", "-vcvars_ver=14.2"]')[matrix.cxx_compiler == 'msvc-2019'] }} || exit /b 1
cmake --version || exit /b 1
cmake -B source\TempOutput -GNinja -DCMAKE_BUILD_TYPE=${{matrix.config}} -DMESHLIB_BUILD_GENERATED_C_BINDINGS=${{ fromJSON('["OFF", "ON"]')[inputs.mrbind_c] }} || exit /b 1
cmake --build source\TempOutput -j || exit /b 1
if not exist source\x64 mkdir source\x64 || exit /b 1
xcopy source\TempOutput\bin\* source\x64\${{matrix.config}}\* /s /e /i /Y || exit /b 1
) else (
msbuild -m source\MeshLib.sln -p:Configuration=${{ matrix.config }}${{ fromJSON('["", ";PlatformToolset=v142"]')[matrix.cxx_compiler == 'msvc-2019'] }}
if errorlevel 1 exit 1
msbuild -m source\MeshLib.sln -p:Configuration=${{ matrix.config }}${{ fromJSON('["", ";PlatformToolset=v142"]')[matrix.cxx_compiler == 'msvc-2019'] }} || exit /b 1
)

- name: Generate and build Python bindings
Expand Down
Loading