CI: Fix the macOS build (zlib for HDF5's CMake config) and make steps fail fast - #994
Conversation
|
Thanks for approving the CI run, @gonuke. Mac Build/Test is green: run 30524019376 — MOAB and DAGMC both configure and build, and The red "Is Changelog up-to-date ?" check is pre-existing and unrelated to this PR. It fails after 6 seconds on the
The same failure shows up on #982 (run 29750280790); the last green run of this check was on 29 March 2026. The changelog entry this repo requires is present here in I'd be glad to fix it in a separate PR: dropping the |
|
Thanks for your contribution @cyb3ralbert - I'm fine with the changelog workflow update being adding to this PR, or a separate one, which ever is easiest. We recently confronted this on another project, but I didn't check the extent of this issue across my projects. |
|
Thanks @gonuke — I've added the changelog workflow fix here, as you suggested. Two commits: the workflow change itself, and a The fix drops the changelog_update:
runs-on: ubuntu-latest
- container:
- image: alpine:3.14
name: Is Changelog up-to-date ?
steps:
- - name: Install latest git
- run: |
- apk add --no-cache bash git openssh
- git --version
-
- name: Checkout repository
- uses: actions/checkout@v3
+ uses: actions/checkout@v5The Verified green: run 30610951114 on my fork — Note this only fixes |
gonuke
left a comment
There was a problem hiding this comment.
Thanks for your interest and support @cyb3ralbert !!
Description
Two changes to
.github/workflows/mac_build_test.yml. The first is what turns theMac Build/Testjob green again; the second is what makes the next failure readable:-DZLIB_ROOT="$(brew --prefix zlib)"to the DAGMC configure step and install Homebrew'szlibalongsidehdf5.shell: bash -l {0}), for which GitHub does not add-e. Changed toshell: bash -leo pipefail {0}so a failing command stops the step.No CMake module is touched, so this does not overlap with the pending refactor in #987.
Motivation and Context
Mac Build/Testhas been failing on every branch since March 2026 — the last green run was the push todevelopon 2026-02-16 (#990). It fails on unrelated branches, so the trigger is a runner-image update rather than anyone's patch — but the fragility it exposed is in this repository's own CMake, see below. This also makes #542 ("We have no ability to verify whether the Mac build is working") effectively true again.The failure is in the
Build DAGMCstep:Chain of events on
macos-latest(currentlymacos-26-arm64, CMake 4.4.0):cmake/HDF5_macro.cmake:4narrowsCMAKE_FIND_LIBRARY_SUFFIXESto${CMAKE_SHARED_LIBRARY_SUFFIX}— i.e..dylibonly — beforefind_package(HDF5).hdf5-config.cmakecallsfind_dependency(ZLIB), soFindZLIBruns with that narrowed list..tbdstub (MacOSX.sdk/usr/lib/libz.tbd), which the narrowed suffix list excludes. The header is still found — hence the misleadingfound version "1.2.12"— butZLIB_LIBRARYstays empty and the configure step fails.Verified on the runner: a plain
find_package(ZLIB)there resolves toMacOSX.sdk/usr/lib/libz.tbdwith the default suffix list.tbd;.dylib;.so;.a, so nothing is wrong with the image — only with the interaction between the narrowed suffix list and the SDK stub. Homebrew'szlibis a real.dylib, but keg-only and therefore not under$(brew --prefix)/lib, soZLIB_ROOThas to point at the keg. The reasoning is left as a comment in the workflow.The second change is what made this expensive to read. With
shell: bash -l {0}and no-e, the step kept going after the configure failure, so the tail of the log — the part a human sees first — is:The real error is ~150 lines above that.
bash -leo pipefail {0}makes future failures point at their own cause.Changes
Bug fix, CI only. No source or CMake changes.
Behavior
Build DAGMCfails at configure withCould NOT find ZLIB; the step then runs on and reports a missingMakefile.make testto completion.Runs in my fork, same workflow, same runner:
develop): https://github.com/cyb3ralbert/DAGMC/actions/runs/30522484666 — failure,Could NOT find ZLIBOther Information
If you would rather fix the cause than the symptom, the line to drop is the suffix narrowing at
cmake/HDF5_macro.cmake:4— with the default suffix list the SDK stub is found and noZLIB_ROOTis needed. I left it alone on purpose: #987 removes that file, and I would rather not put this fix behind a pending refactor. Happy to do it that way instead if you prefer.Follows on from @matthewfeickert's CI work in February 2026 (#989, #990, and the Eigen/
TestEndianesscomments in this workflow), which is what kept this job alive up to that point.Deliberately left out of this PR, happy to open a follow-up: no workflow in the repository sets a
permissions:block, andactions/checkout@v3is still used in 9 workflows — the mac job log already warns that its Node.js 20 runtime is deprecated and being forced onto Node.js 24.Changelog file
Entry added under Fixed in
doc/CHANGELOG.rst.