From 2cf1a1083ba4628696de66fec88a530cdd93b6b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ralph=20K=C3=BCpper?= Date: Sat, 15 Aug 2026 14:22:42 +0200 Subject: [PATCH] fix(compile): register #8128's optnone knob as a build-cache input MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `cargo-test` is red on main. `codegen_env_vars_are_build_cache_inputs` reports `PERRY_LL_RS4GC_OPTNONE_INSTRS` keying neither the build cache nor an exclusion. #8128 introduced the knob and its description says it was "registered as a build-cache key per #6394" — it was not. The knob stamps `optnone`+`noinline` on any function past the threshold, so flipping it skips the middle-end for that function and changes emitted code. It belongs in BUILD_CACHE_ENV_VARS, not the exclusion list: an exclusion asserts the variable cannot change emitted code, which is the opposite of what this one does. Without it, changing the threshold leaves the build-level no-op check reporting a match and hands back the previous build's executable. Verified failing on main at 8b1b4b909 before the change and passing after; `-p perry --bin perry` green. --- crates/perry/src/commands/compile/build_cache.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/crates/perry/src/commands/compile/build_cache.rs b/crates/perry/src/commands/compile/build_cache.rs index a7df4e805b..e91ddc739d 100644 --- a/crates/perry/src/commands/compile/build_cache.rs +++ b/crates/perry/src/commands/compile/build_cache.rs @@ -39,6 +39,13 @@ const BUILD_CACHE_ENV_VARS: &[&str] = &[ "PERRY_WRITE_BARRIERS", "PERRY_SHADOW_STACK", "PERRY_RS4GC", + // #8128: the post-RS4GC `optnone`+`noinline` instruction cap. A function + // past the threshold has the middle-end skipped, so flipping this changes + // emitted code for that function — it must invalidate the build-level + // no-op check, not merely per-object entries. #8128 said it registered + // this and did not; `codegen_env_vars_are_build_cache_inputs` caught it on + // main, where it had gone red. + "PERRY_LL_RS4GC_OPTNONE_INSTRS", "PERRY_GC_SAFEPOINT_ONLY", "PERRY_INLINE_SHADOW_SLOT", "PERRY_DISABLE_BUFFER_FAST_PATH",