diff --git a/changelog.d/9777-build-cache-concat-site-cache.md b/changelog.d/9777-build-cache-concat-site-cache.md new file mode 100644 index 0000000000..fa6c1dedf7 --- /dev/null +++ b/changelog.d/9777-build-cache-concat-site-cache.md @@ -0,0 +1,10 @@ +**`PERRY_CONCAT_SITE_CACHE` is now a build-cache input.** #9514's per-site +concat cache reads the variable as a build-time kill switch — setting it to +`0` removes the lowering lane entirely — but it was registered neither in +`BUILD_CACHE_ENV_VARS` nor as a justified exclusion. A build with the switch +flipped could therefore be served a cached object produced with it in the +other state. + +`codegen_env_vars_are_build_cache_inputs` caught this by scanning +`crates/perry-codegen/src` for every `env::var("PERRY_…")`, which is why the +check scans the source instead of trusting a hand-maintained list. diff --git a/crates/perry/src/commands/compile/build_cache.rs b/crates/perry/src/commands/compile/build_cache.rs index 285918a5f9..340efb9a06 100644 --- a/crates/perry/src/commands/compile/build_cache.rs +++ b/crates/perry/src/commands/compile/build_cache.rs @@ -94,6 +94,11 @@ const BUILD_CACHE_ENV_VARS: &[&str] = &[ // #9026: gates the once-per-closure-entry resolution of read-only boxed // capture cells — flipping it changes every closure body that qualifies. "PERRY_BOX_CAPTURE_ENTRY_CELLS", + // #9514: gates the per-site concat cache. `PERRY_CONCAT_SITE_CACHE=0` + // removes the lane at build time, so a qualifying `"literal" + value` + // site lowers to a different sequence with it on and off and a cached + // object from one setting must not serve the other. + "PERRY_CONCAT_SITE_CACHE", // The guarded-preinline IR-size ceiling: functions on either side of the // budget inline differently, so a run with a raised ceiling must not be // served objects a default run produced (same rule as the RS4GC budget