Skip to content

Conversation

asp2286
Copy link

@asp2286 asp2286 commented Sep 10, 2025

Fix macOS x64 CI: install libomp via Homebrew tap (no local formula)

Branch: fix-macos-libomp
Scope: CI only – changes limited to build/ci/job-template.yml (macOS x64 job)


What & Why

On macOS x64 jobs, our pipeline tries to install OpenMP via a local Homebrew formula:

brew install $(Build.SourcesDirectory)/build/libomp.rb --build-from-source --formula

Recent Homebrew (4.6+) rejects local, untapped formulae and fails with:

Homebrew requires formulae to be in a tap, rejecting:
  /Users/runner/work/1/s/build/libomp.rb
To create a tap, run e.g. brew tap-new <user|org>/<repository>

This does not affect macOS_cross_arm64 jobs because they already use the official homebrew/core formula (brew install libomp).

The fix

For macOS x64 only, switch to the official tap-hosted formula and force a link so the headers and libs are discoverable by our native builds:

# Before (failing; local .rb file)
export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=TRUE && brew install $(Build.SourcesDirectory)/build/libomp.rb --build-from-source --formula

# After (working; official tap)
brew update && brew install libomp && brew link libomp --force

No product/code changes; CI infra-only.


Validation

  • ✅ Verified the failing step is isolated to macOS_x64 with the error above.
  • macOS_cross_arm64 continues to use the official tap and succeeds.
  • ✅ Local repro on a GitHub-hosted macOS runner using the new commands installs libomp and exposes headers (/usr/local/opt/libomp/include) and libs (/usr/local/opt/libomp/lib).

Note: Homebrew marks libomp as keg-only. The brew link ... --force step ensures the toolchain sees it without extra flags. If we ever want to avoid --force, we can export:

export CPPFLAGS="-I/usr/local/opt/libomp/include"
export LDFLAGS="-L/usr/local/opt/libomp/lib"

Risk & Impact

  • Risk: Low. The change only affects the CI macOS x64 dependency-install step.
  • Impact: Unblocks native builds on macOS x64 by ensuring OpenMP is available.
  • No Changes to shipping packages, versioning, public APIs, or runtime behavior.

Alternative considered

  • Creating and maintaining a custom Homebrew tap for libomp.rb. Rejected to avoid long‑term maintenance overhead when the official formula suffices.

Change summary

  • Update build/ci/job-template.yml macOS x64 path:
    • Replace local formula install with brew update && brew install libomp && brew link libomp --force.
    • No changes to the ARM cross path (already uses official tap).

How to verify in CI

  1. Queue the pipeline for macOS_x64 Debug_Build.
  2. Confirm the step Install MacOS build dependencies succeeds, showing:
    • “Pouring libomp…”, “Linking … 6 symlinks created”
  3. Validate native build succeeds (CpuMathNative, FastTreeNative, etc.).
  4. Ensure no downstream targets rely on OneDalNative on macOS unless explicitly provided (unrelated to this PR).

Notes for maintainers

  • This PR does not modify any source under src/ or packaging. It is safe to service‑merge.
  • If future runners transition to Apple Silicon-only, this step remains valid (Homebrew tap still provides libomp).

Checklist (author)

  • CI-only change; no product code.
  • macOS x64 path updated; ARM path unchanged.
  • Verified the new commands succeed on a runner.
  • Added rationale & reproduction details in this PR description.

Screenshots / logs (for context)

Failure (before):

Error: Homebrew requires formulae to be in a tap, rejecting:
  /Users/runner/work/1/s/build/libomp.rb

Success (after):

==> Fetching downloads for: libomp
==> Pouring libomp--<version>.ventura.bottle.tar.gz
Linking /usr/local/Cellar/libomp/<version>... 6 symlinks created.

Copy link

codecov bot commented Sep 10, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.00%. Comparing base (fb39755) to head (4a75fd7).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7501      +/-   ##
==========================================
- Coverage   69.01%   69.00%   -0.01%     
==========================================
  Files        1482     1482              
  Lines      273999   273999              
  Branches    28258    28258              
==========================================
- Hits       189093   189083      -10     
- Misses      77520    77528       +8     
- Partials     7386     7388       +2     
Flag Coverage Δ
Debug 69.00% <ø> (-0.01%) ⬇️
production 63.29% <ø> (-0.01%) ⬇️
test 89.46% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.
see 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant