Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions changelog.d/9260-release-legs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
The Windows, musl and old-glibc release build legs no longer fail before they
start. `perry-runtime`'s test build imported two `malloc_trim` counters under a
weaker `cfg` than their declarations, breaking compilation on Windows MSVC; the
glibc-2.31 container never put the mounted Cargo bin directory on `PATH`, so
`rustup` was not found; and the glibc-only `libc::backtrace` pair was selected
for musl targets, where it does not exist.
14 changes: 12 additions & 2 deletions crates/perry-runtime/src/arena/quarantine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -864,7 +864,14 @@ extern "C" fn fromspace_fault_handler(
}
}

#[cfg(all(unix, any(target_os = "macos", target_os = "linux")))]
// `libc::backtrace`/`backtrace_symbols_fd` are a glibc extension: they do not
// exist in musl, so `target_os = "linux"` alone selected a body that cannot
// compile for `x86_64-unknown-linux-musl` (#9245-era release leg, E0425). The
// musl build takes the empty arm below.
#[cfg(all(
unix,
any(target_os = "macos", all(target_os = "linux", target_env = "gnu"))
))]
fn emit_native_backtrace() {
const MAX_FRAMES: usize = 64;
let mut frames = [std::ptr::null_mut::<libc::c_void>(); MAX_FRAMES];
Expand All @@ -878,7 +885,10 @@ fn emit_native_backtrace() {
}
}

#[cfg(all(unix, not(any(target_os = "macos", target_os = "linux"))))]
#[cfg(all(
unix,
not(any(target_os = "macos", all(target_os = "linux", target_env = "gnu")))
))]
fn emit_native_backtrace() {}

/// Name the objects that still HOLD the stale address, not just the frame that
Expand Down
7 changes: 6 additions & 1 deletion crates/perry-runtime/src/exception.rs
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,12 @@ fn emit_uncaught_backtrace() {
if !on {
return;
}
#[cfg(all(unix, any(target_os = "macos", target_os = "linux")))]
// glibc-only pair; musl has no `backtrace`, so this block must not be
// selected there (E0425 at release time on the musl leg).
#[cfg(all(
unix,
any(target_os = "macos", all(target_os = "linux", target_env = "gnu"))
))]
{
const MAX_FRAMES: usize = 96;
let mut frames = [std::ptr::null_mut::<libc::c_void>(); MAX_FRAMES];
Expand Down
12 changes: 10 additions & 2 deletions crates/perry-runtime/src/gc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,16 @@ mod cycle_malloc_trim;
use cycle::*;
#[cfg(test)]
pub(crate) use cycle_malloc_trim::{
reset_test_malloc_trim_call_count, reset_test_malloc_trim_executed_count,
test_malloc_trim_call_count, test_malloc_trim_executed_count,
reset_test_malloc_trim_call_count, test_malloc_trim_call_count,
};
// The *executed* counters only exist where `malloc_trim` itself does, so the
// import has to carry the same gate as the declaration. Importing them under a
// bare `#[cfg(test)]` made `perry-runtime`'s test build fail to compile on
// Windows MSVC (E0432) — a target the PR tier never builds, so only the full
// tier's `windows-build`/`windows-arm64-build` saw it.
#[cfg(all(test, any(target_env = "gnu", target_os = "macos")))]
pub(crate) use cycle_malloc_trim::{
reset_test_malloc_trim_executed_count, test_malloc_trim_executed_count,
};
mod verify;

Expand Down
13 changes: 13 additions & 0 deletions scripts/build_linux_glibc_2_31.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,19 @@ export LLVM_SYS_221_PREFIX
exit 1
}

# The image deliberately ships no Rust toolchain: release-packages.yml mounts
# the runner's ~/.cargo and ~/.rustup and points CARGO_HOME/RUSTUP_HOME at
# them. Those give cargo its data, not its binaries — nothing puts
# $CARGO_HOME/bin on PATH inside the container, so `rustup` and `cargo`
# resolved to nothing and the leg died with exit 127. This leg was added in
# #8350 (2026-08-18), after the last successful release, so it had never once
# run to completion.
export PATH="${CARGO_HOME:-$HOME/.cargo}/bin:$PATH"
command -v rustup >/dev/null || {
echo "rustup not found on PATH ($PATH) — is \$CARGO_HOME/bin mounted?" >&2
exit 1
}

rustup target add "$target"

cargo build --profile dist --target "$target" -p perry
Expand Down
Loading