Skip to content
Closed
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
1 change: 1 addition & 0 deletions changelog.d/9566-linux-callback-deopt-runtime.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test: the versioned indexed-loop callback-deopt fixture now links Perry's shipped `panic=abort` runtime, so its ordinary and forced-evacuation GC paths run on Linux again instead of aborting behind an ignore (#9482).
42 changes: 29 additions & 13 deletions crates/perry/tests/versioned_indexed_loop_callback_deopt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,40 @@ fn workspace_root() -> PathBuf {
.expect("canonicalize workspace root")
}

/// Perry ships a `panic=abort` runtime. A debug `panic=unwind` archive plants
/// abort-on-unwind guards in `extern "C"` helpers, so the raw JS exceptions in
/// this fixture cannot reach their generated catch landing pads on Linux.
/// Relative Cargo target overrides are rooted at the nested build's workspace.
fn target_runtime_dir() -> PathBuf {
let target = match std::env::var_os("CARGO_TARGET_DIR")
.filter(|value| !value.is_empty())
.map(PathBuf::from)
{
Some(path) if path.is_absolute() => path,
Some(path) => workspace_root().join(path),
None => workspace_root().join("target"),
};
if cfg!(windows) {
target.join("x86_64-pc-windows-msvc").join("release")
} else {
target.join("release")
}
}

fn runtime_dir() -> PathBuf {
static BUILD_RUNTIME: Once = Once::new();
BUILD_RUNTIME.call_once(|| {
let cargo = std::env::var_os("CARGO").unwrap_or_else(|| "cargo".into());
let mut command = Command::new(cargo);
command.current_dir(workspace_root()).arg("build");
command
.current_dir(workspace_root())
.arg("build")
// `panic` is profile-level; this must match `target_runtime_dir()`
// and the runtime Perry actually ships.
.arg("--release");
remove_gc_env_overrides(&mut command);
if !cfg!(debug_assertions) {
command.arg("--release");
if cfg!(windows) {
command.arg("--target").arg("x86_64-pc-windows-msvc");
}
let build = command
.args(["-p", "perry-runtime-static"])
Expand All @@ -63,10 +88,7 @@ fn runtime_dir() -> PathBuf {
);
});

perry_bin()
.parent()
.expect("Perry binary directory")
.to_path_buf()
target_runtime_dir()
}

fn run_fixture(binary: &Path, force_evacuation: bool) -> Output {
Expand All @@ -93,12 +115,6 @@ fn llvm_function_body(ir: &str, symbol: &str) -> String {
}

#[test]
// #9482: aborts on Linux with `panic in a function that cannot unwind` inside
// the force_evacuation=false GC fixture — consistent there, never observed
// green; passes 3/3 on macOS at the same pin. Deferred to unblock releases,
// NOT shown pre-existing; the diagnosis and Linux repro live in #9482, and
// re-enabling is deleting this attribute.
#[cfg_attr(target_os = "linux", ignore = "#9482: Linux-only GC deopt abort")]
fn cold_callback_arms_resume_once_at_the_next_index() {
let dir = tempfile::tempdir().expect("tempdir");
let entry = dir.path().join("main.ts");
Expand Down
Loading