Skip to content

Commit e93b407

Browse files
committed
Stabilize macOS bindgen deps with pinned llvm@18
1 parent 2b308c2 commit e93b407

5 files changed

Lines changed: 29 additions & 21 deletions

File tree

.github/workflows/ci.yml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -229,20 +229,24 @@ jobs:
229229
if: ${{ matrix.kind == 'linux' }}
230230
run: sudo apt-get update && sudo apt-get install -y clang libclang-dev pkg-config
231231

232+
- name: Install Rust bindgen dependencies (macOS)
233+
if: ${{ matrix.kind == 'macos' }}
234+
shell: bash
235+
run: |
236+
if brew install llvm@18; then
237+
llvm_prefix="$(brew --prefix llvm@18)"
238+
else
239+
brew install llvm
240+
llvm_prefix="$(brew --prefix llvm)"
241+
fi
242+
echo "LIBCLANG_PATH=${llvm_prefix}/lib" >> "${GITHUB_ENV}"
243+
232244
- name: Install LLVM (bindgen dependency)
233-
if: ${{ matrix.kind == 'windows' || matrix.kind == 'macos' }}
245+
if: ${{ matrix.kind == 'windows' }}
234246
uses: KyleMayes/install-llvm-action@v2
235247
with:
236248
version: "18.1.8"
237249

238-
- name: Export LIBCLANG_PATH (macOS)
239-
if: ${{ matrix.kind == 'macos' }}
240-
shell: bash
241-
run: |
242-
llvm_bin="$(dirname "$(command -v llvm-config)")"
243-
llvm_root="$(cd "${llvm_bin}/.." && pwd)"
244-
echo "LIBCLANG_PATH=${llvm_root}/lib" >> "${GITHUB_ENV}"
245-
246250
- name: Configure bindgen include paths for Windows Ruby headers
247251
if: ${{ matrix.kind == 'windows' }}
248252
shell: pwsh

.github/workflows/release.yml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -170,20 +170,24 @@ jobs:
170170
if: ${{ matrix.kind == 'linux' }}
171171
run: sudo apt-get update && sudo apt-get install -y clang libclang-dev pkg-config
172172

173+
- name: Install Rust bindgen dependencies (macOS)
174+
if: ${{ matrix.kind == 'macos' }}
175+
shell: bash
176+
run: |
177+
if brew install llvm@18; then
178+
llvm_prefix="$(brew --prefix llvm@18)"
179+
else
180+
brew install llvm
181+
llvm_prefix="$(brew --prefix llvm)"
182+
fi
183+
echo "LIBCLANG_PATH=${llvm_prefix}/lib" >> "${GITHUB_ENV}"
184+
173185
- name: Install LLVM (bindgen dependency)
174-
if: ${{ matrix.kind == 'windows' || matrix.kind == 'macos' }}
186+
if: ${{ matrix.kind == 'windows' }}
175187
uses: KyleMayes/install-llvm-action@v2
176188
with:
177189
version: "18.1.8"
178190

179-
- name: Export LIBCLANG_PATH (macOS)
180-
if: ${{ matrix.kind == 'macos' }}
181-
shell: bash
182-
run: |
183-
llvm_bin="$(dirname "$(command -v llvm-config)")"
184-
llvm_root="$(cd "${llvm_bin}/.." && pwd)"
185-
echo "LIBCLANG_PATH=${llvm_root}/lib" >> "${GITHUB_ENV}"
186-
187191
- name: Configure bindgen include paths for Windows Ruby headers
188192
if: ${{ matrix.kind == 'windows' }}
189193
shell: pwsh

docs/modernization-handoff.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ Delivered:
139139
- dual Rust DLL artifact-name staging support (`lda_ruby_rust.dll` and `liblda_ruby_rust.dll`)
140140
- CI jobs for packaged-gem fallback, rust-enabled checks, and manifest checks
141141
- CI precompiled gem build guardrail job (`precompiled-gem-build`) aligned to the full release-blocking precompiled matrix
142-
- macOS precompiled CI/release lanes now pin LLVM `18.1.8` (`install-llvm-action`) and derive `LIBCLANG_PATH` from `llvm-config` to avoid bindgen breakage from Homebrew LLVM drift
142+
- macOS precompiled CI/release lanes now pin Homebrew `llvm@18` (with fallback to `llvm`) and export `LIBCLANG_PATH` from the selected prefix to avoid bindgen breakage from Homebrew LLVM drift
143143
- release workflow matrix for precompiled gems:
144144
- `x86_64-linux`
145145
- `x86_64-linux-musl`

docs/porting-strategy.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ Completed in `codex/experiment-ruby3-modernization`:
8585
- RubyGems credential preflight helper added (`bin/verify-rubygems-api-key`) for CI-safe publish key validation.
8686
- Post-publish verification helper added (`bin/verify-release-publish`) to validate RubyGems + GitHub release artifacts by tag.
8787
- CI precompiled guardrail job added (`precompiled-gem-build`) for full release-blocking platform packaging checks (Linux, Linux musl, macOS Intel, macOS Apple Silicon, Windows).
88-
- macOS precompiled CI/release lanes now pin LLVM `18.1.8` (`install-llvm-action`) and derive `LIBCLANG_PATH` from `llvm-config` to avoid bindgen breakage from Homebrew LLVM drift.
88+
- macOS precompiled CI/release lanes now pin Homebrew `llvm@18` (with fallback to `llvm`) and export `LIBCLANG_PATH` from the selected prefix to avoid bindgen breakage from Homebrew LLVM drift.
8989
- Release workflow post-publish verification job added (`verify_published_artifacts`).
9090
- Release failure alert workflow added (`.github/workflows/release-failure-alert.yml`) to open issue alerts for failed tag-triggered `release.yml` runs and auto-close matching alerts when reruns succeed.
9191
- Maintainer release runbook added (`docs/release-runbook.md`) with publish and rollback/yank procedures.

docs/precompiled-platform-policy.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Release automation requirements:
5656
Continuous integration guardrail:
5757

5858
- `.github/workflows/ci.yml` runs `release-precompiled-artifacts` for the full release-blocking precompiled matrix (Linux, Linux musl, macOS Intel, macOS Apple Silicon, Windows) on every branch/PR.
59-
- macOS precompiled lanes pin LLVM `18.1.8` via `KyleMayes/install-llvm-action` and export `LIBCLANG_PATH` from `llvm-config` to keep bindgen stable across Homebrew formula updates.
59+
- macOS precompiled lanes pin Homebrew `llvm@18` (falling back to `llvm` if unavailable) and export `LIBCLANG_PATH` from the selected prefix to keep bindgen stable across Homebrew formula updates.
6060
- `.github/workflows/precompiled-candidate-evaluation.yml` is used for additional platform candidate checks.
6161
- `.github/workflows/release.yml` dry-run validates the full release-blocking matrix before publish.
6262

0 commit comments

Comments
 (0)