Skip to content

fix(release): unblock the Windows, musl and old-glibc release legs - #9260

Merged
proggeramlug merged 2 commits into
mainfrom
fix/9245-windows-fallout
Aug 31, 2026
Merged

fix(release): unblock the Windows, musl and old-glibc release legs#9260
proggeramlug merged 2 commits into
mainfrom
fix/9245-windows-fallout

Conversation

@proggeramlug

@proggeramlug proggeramlug commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Four defects blocking the v0.5.1519 release, found by the first full-tier + stage-mode release run on a candidate since v0.5.1220. None of them is reachable from the PR tier, which is why they accumulated.

The fixes

1. gc/mod.rs — Windows MSVC test build (E0432). The two malloc_trim executed counters are declared #[cfg(all(test, any(target_env = "gnu", target_os = "macos")))] but imported under a bare #[cfg(test)]. On MSVC the declarations vanish and the import dangles, so perry-runtime's test build does not compile. Import now carries the declaration's gate. Broke windows-build and windows-arm64-build.

2. thread_local_cold_allowlist.json — stale record. #9245 split cycle.rs into cycle_malloc_trim.rs and moved a thread_local! with it; the policy inventory still recorded it against cycle.rs, so the checker saw an unrecorded block in one file and a phantom in the other. Regenerated with --update: the entry moves, the count is unchanged. Broke windows-build's GC structural audits.

3. build_linux_glibc_2_31.shrustup: command not found (exit 127). The container ships no Rust toolchain by design: release-packages.yml mounts the runner's ~/.cargo/~/.rustup and points CARGO_HOME/RUSTUP_HOME at them. That gives cargo its data, not its binaries — nothing put $CARGO_HOME/bin on PATH. Added, with an explicit check so a future regression says why. This leg was added 2026-08-18, after the last successful release, so it had never once run to completion.

4. arena/quarantine.rs + exception.rs — musl (E0425). libc::backtrace/backtrace_symbols_fd are glibc extensions. Gating their call sites on target_os = "linux" selects them for musl, where they do not exist. Now all(target_os = "linux", target_env = "gnu"); musl takes the existing empty arm.

Validation

59/60 local lint gates pass, including cargo check --workspace --all-targets -D warnings and workspace clippy. (The 60th was cargo fmt, now applied.)

One limitation stated plainly: the musl compile itself is not verified locally — cargo check --target x86_64-unknown-linux-musl cannot run on macOS because libmimalloc-sys needs a musl C cross-toolchain. I verified the premise instead: rustc --print cfg --target x86_64-unknown-linux-musl reports target_env="musl" (vs "gnu" for glibc), so the tightened gate provably selects the empty arm there. The full compile rests on CI.

Not fixed here

Two further release-leg failures the same run exposed, both needing a decision rather than a code change:

  • ANDROID_NDK_HOME unset on windows-11-arm — the Android cross-build step is gated only on runner.os == 'Windows', so it runs on both Windows runners, but only the x86_64 one has the NDK.
  • macOS x86_64 link failure — the matrix builds x86_64-apple-darwin on macos-15, an arm64 runner whose LLVM is arm64-only, so every LLVM symbol is undefined at link (ld: warning: ignoring file …, symbol(s) not found for architecture x86_64).

Summary by CodeRabbit

  • Bug Fixes
    • Improved build reliability across Windows, musl Linux, and older glibc environments.
    • Fixed runtime test builds that could fail on Windows.
    • Prevented unsupported native backtrace functionality from being used on musl Linux.
    • Improved toolchain detection for older glibc builds, providing clearer failures when unavailable.

@proggeramlug
proggeramlug force-pushed the fix/9245-windows-fallout branch from d6fdc90 to 04a297a Compare August 31, 2026 09:40
@coderabbitai

coderabbitai Bot commented Aug 31, 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: Pro Plus

Run ID: 5fef63b9-b227-4089-a055-d36b16a8cae5

📥 Commits

Reviewing files that changed from the base of the PR and between 04a297a and 0d05d36.

📒 Files selected for processing (1)
  • changelog.d/9260-release-legs.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • changelog.d/9260-release-legs.md

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


📝 Walkthrough

Walkthrough

The changes correct platform-specific runtime compilation for musl and Windows, make the old-glibc build script locate rustup, and document the release build fixes.

Changes

Release build leg fixes

Layer / File(s) Summary
Platform-specific runtime gates and imports
crates/perry-runtime/src/arena/quarantine.rs, crates/perry-runtime/src/exception.rs, crates/perry-runtime/src/gc/mod.rs
Native backtrace code is limited to macOS and GNU Linux. The malloc_trim test imports use platform-specific conditions.
Old-glibc toolchain discovery
scripts/build_linux_glibc_2_31.sh, changelog.d/9260-release-legs.md
The build script adds the Cargo bin directory to PATH and verifies that rustup is available. The changelog records the Windows, musl, and old-glibc fixes.

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

Merge Risk: ⚪ Minimal · up to 0d05d

The PR contains localized platform and release-build fixes, and no actionable merge-blocking risk remains beyond normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely identifies the primary change: unblocking the Windows, musl, and old-glibc release legs.
Description check ✅ Passed The description is detailed and directly explains the defects, fixes, validation, limitations, and out-of-scope failures. It does not use every template heading, and it omits the checklist and an expl…
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 4 files. (1 skipped: 1 …
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description is detailed and directly explains the defects, fixes, validation, limitations, and out-of-scope failures. It does not use every template heading, and it omits the checklist and an explicit related-issue entry, but the required change context and test information are mostly complete.

Full details: Docstring Coverage

Explanation

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/9245-windows-fallout

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/9245-windows-fallout branch from 04a297a to 0d05d36 Compare August 31, 2026 10:29
@proggeramlug

Copy link
Copy Markdown
Contributor Author

Rebased onto main after #9268 merged.

#9268 landed the thread_local_cold_allowlist.json regeneration independently — byte-identical to the hunk that was here (same blob transition 5704ac366d..1af43a286c), so the rebase dropped it as redundant and there is no conflict.

What remains in this PR is the part #9268 does not cover, all from the same #9245 cycle.rs split:

  • gc/mod.rs — the E0432 that breaks perry-runtime's test build on Windows MSVC (windows-build, windows-arm64-build). The two malloc_trim executed counters are declared #[cfg(all(test, any(target_env = "gnu", target_os = "macos")))] but were imported under a bare #[cfg(test)].
  • build_linux_glibc_2_31.sh$CARGO_HOME/bin never on PATH, so rustup was not found (exit 127). That leg was added after the last release and had never run to completion.
  • arena/quarantine.rs + exception.rs — glibc-only libc::backtrace selected for musl (E0425).

Changelog fragment trimmed to match; it no longer claims the allowlist change.

Ralph Küpper added 2 commits August 31, 2026 13:24
Four defects, all found by the first full-tier + stage-build run on a release
candidate since v0.5.1220. None is reachable from the PR tier.

- gc/mod.rs imported two `malloc_trim` counters under a bare `#[cfg(test)]`
  while their declarations are gated to gnu/macOS, so `perry-runtime`'s test
  build failed to compile on Windows MSVC (E0432).
- cycle_malloc_trim.rs (new in #9245) declares a raw `thread_local!` that the
  policy inventory still recorded against its old home, cycle.rs.
- build_linux_glibc_2_31.sh never put `$CARGO_HOME/bin` on PATH, so `rustup`
  was not found inside the container (exit 127). That leg was added after the
  last successful release and had never run to completion.
- `libc::backtrace`/`backtrace_symbols_fd` are glibc extensions; gating their
  call sites on `target_os = "linux"` selected them for musl, where they do
  not exist (E0425).

Verified: 59/60 local lint gates, including
`cargo check --workspace --all-targets -D warnings` and workspace clippy.
The musl compile itself is not verifiable locally (libmimalloc-sys needs a
musl C cross-toolchain), but `rustc --print cfg` confirms musl reports
`target_env="musl"`, so it now takes the empty arm.
@proggeramlug
proggeramlug force-pushed the fix/9245-windows-fallout branch from 0d05d36 to 09dec35 Compare August 31, 2026 11:24
@proggeramlug

Copy link
Copy Markdown
Contributor Author

Merged.

Three separate release legs, each a genuine platform-specific break rather than a flaky runner, and the changelog fragment records which is which — worth having, because "unblock the release legs" is exactly the kind of commit that becomes unattributable six months later.

Validation: perry-runtime 2872 passed / 0 failed at RUST_TEST_THREADS=1; perry-codegen 31 suites / 0 failures; all 60 lint gates plus the check_thread_locals / tls_budget checkers green. The runtime changes are behind #[cfg] for targets I cannot exercise on this box (Windows, musl, old glibc), so my coverage here is that they do not disturb the macOS arm64 build and suites — the platform legs themselves are CI's to confirm.

Landed alongside #9262, which fixes the two remaining legs (macos-15 being the Arm64 image, and the Windows Android NDK steps on windows-11-arm). Between them create-release should have every matrix leg green; if it does not, the one I flagged on #9262 is the next candidate — the build-cross matrix at line 1081 still pairs os: macos-15 with target: x86_64-apple-darwin, which is the same arm64-LLVM configuration, just non-blocking because that job is fail-fast: false.

@proggeramlug
proggeramlug merged commit d1e9fe7 into main Aug 31, 2026
19 checks passed
@proggeramlug
proggeramlug deleted the fix/9245-windows-fallout branch August 31, 2026 11:25
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.

1 participant