Skip to content

Fix gc-native-roots failures on ARM Linux and macOS - #9920

Closed
proggeramlug wants to merge 1 commit into
PerryTS:mainfrom
proggeramlug:fix/9915-native-roots-platforms
Closed

Fix gc-native-roots failures on ARM Linux and macOS#9920
proggeramlug wants to merge 1 commit into
PerryTS:mainfrom
proggeramlug:fix/9915-native-roots-platforms

Conversation

@proggeramlug

@proggeramlug proggeramlug commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

The scheduled gc-native-roots gate fails for two platform-specific reasons: Ubuntu ARM cannot compile the libyaml diagnostic pointer on targets where Rust's c_char is unsigned, and the macOS stock-toolchain step overwrites the LLVM 22 prefix with Homebrew's unversioned LLVM 23 before invoking the LLVM 22 in-process backend.

This casts libyaml's problem pointer through the target std::ffi::c_char type and preserves the LLVM_SYS_221_PREFIX exported by setup-llvm22. The stock-toolchain assertion still removes the external opt and clang overrides, while the in-process backend remains linked to the ABI required by llvm-sys 221.

Validation:

  • ARM Linux target compile of the changed unsafe-libyaml diagnostic expression
  • invalid Bun.YAML.parse compiled probe, including the full SyntaxError diagnostic
  • corrected in-process RS4GC probe under LLVM 22: compact map present, raw stackmaps removed, output equal to the shadow-stack control, 75 copying minors and 15,391 objects moved, 12/12 functions reported as RS4GC
  • perry-runtime: 3,242 passed, 4 ignored; doc tests: 8 ignored
  • perry-stdlib: 132 passed
  • all 64 local lint and compile gates passed; 2 CI-expression-only commands skipped
  • actionlint reports one fewer finding than origin/main, with the remaining findings unchanged

Fixes #9915

Summary by CodeRabbit

  • Bug Fixes

    • Restored scheduled native-roots validation on ARM Linux and macOS.
    • Improved platform-specific YAML parsing compatibility and error handling.
    • Ensured in-process LLVM builds use the configured LLVM 22 toolchain consistently.
  • Documentation

    • Added changelog coverage for native-roots validation across supported platforms.

@coderabbitai

coderabbitai Bot commented Sep 6, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: 1e78e941-4a91-4a26-add1-5c669d1449ed

📥 Commits

Reviewing files that changed from the base of the PR and between 504e180 and 49c63e5.

📒 Files selected for processing (3)
  • .github/workflows/gc-native-roots.yml
  • changelog.d/9920-gc-native-roots-platforms.md
  • crates/perry-runtime/src/bun_compat/cli_utils.rs

Included review availability: Your plan provides up to 8 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

The workflow preserves the setup-provided LLVM 22 prefix for in-process linking. The YAML parser error path adds an explicit c_char pointer cast. A changelog entry records the native-roots platform fixes.

Changes

Native-roots compatibility fixes

Layer / File(s) Summary
Native-roots workflow toolchain
.github/workflows/gc-native-roots.yml, changelog.d/9920-gc-native-roots-platforms.md
The in-process workflow step no longer overrides LLVM_SYS_221_PREFIX with Homebrew’s LLVM path. The changelog records the related platform fixes.
Parser error pointer conversion
crates/perry-runtime/src/bun_compat/cli_utils.rs
parser.problem is cast to std::ffi::c_char before CStr::from_ptr receives it.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 49c63

This change restores native-roots compatibility checks on ARM Linux and macOS while preserving YAML diagnostic behavior. No merge-blocking risk remains.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. (2 skipped: 2 … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the primary change: fixing gc-native-roots failures on ARM Linux and macOS.
Description check ✅ Passed The description explains the failure causes, lists the code and workflow changes, references issue #9915, and provides detailed validation results. It omits the template headings and checklist, but th…
Linked Issues check ✅ Passed The changes address the platform-specific failures described in issue #9915 by correcting ARM Linux libyaml pointer handling and preserving the LLVM 22 prefix for macOS in-process RS4GC validation. Th…
Out of Scope Changes check ✅ Passed The workflow update, libyaml compatibility fix, and changelog entry are directly related to restoring the failing gc-native-roots gate. No unrelated code changes are identified.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. (2 skipped: 2 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@proggeramlug
proggeramlug force-pushed the fix/9915-native-roots-platforms branch from 499af1a to 49c63e5 Compare September 6, 2026 20:52
@proggeramlug

Copy link
Copy Markdown
Contributor Author

Landed on main via merge train #9923. Validated as a tree: 64/64 lint gates, and perry-runtime/codegen/hir/stdlib all green (5,962 tests, 0 failures). Thanks!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[scheduled-gate:gc-native-roots.yml] gc-native-roots is failing on main

1 participant