You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix: key compilation caches on namespace and extern switches - #14929
cargo-test fails the compiler environment audit because PERRY_FACTS_NATIVE_EXTERN and PERRY_NS_PAIRS are read by compilation but omitted from the cache-key inputs. Both switches change the facts or lowering; changing either must invalidate the object and completed-build caches.
Changes
crates/perry/src/commands/compile/compile_env.rs: register both switches in the sorted shared cache-input list.
docs/src/cli/cache-dir.md: document invalidation when either switch changes, including =0.
changelog.d/14929-compile-env-cache-switches.md: record the cache correctness fix.
Related issue
Refs #12582 and CI investigation in #14919. #14898 documents the inherited failure but does not modify these cache inputs.
The independent e2e-scoped failure is fixed by #14928. This cache fix does not include that script change.
Test plan
A temporary Cargo harness imports the actual compile_env.rs and its existing compile_env/tests.rs through symlinks, with CARGO_MANIFEST_DIR set to the real workspace crate. On unchanged main it reports 52 passed, 1 failed, naming exactly the two missing switches. With the fix it reports 53 passed, 0 failed (cargo test --offline). The harness is outside the repository and changes no production/test source.
CARGO_HOME=<task-cache> CARGO_TARGET_DIR=<task-target> cargo test --locked --offline --profile perry-dev -p perry --bin perry commands::compile::compile_env::tests -- --test-threads=1 — the actual CLI test binary also reports 53 passed, 0 failed, 1587 filtered out, on macOS arm64 with the pinned toolchain. No runtime symbol shim is used.
Full script-tier lint (SKIP_COMPILE_GATES=1, BASE_SHA=upstream/main, offline task caches) initially reports 18/142 failing commands, with 2 CI-only arms skipped. A clean same-base 2ea9a8be checkout has the same 17 failures except the one-second parity fixture; a separate unchanged parity-runner rerun passes all 52 tests on this branch. No gate, timeout or baseline is weakened. No full-lint pass is claimed.
Checklist
No workspace version bump or CHANGELOG.md edit.
No cache audit exclusions or gate weakening; both switches affect emitted code.
Summary by CodeRabbit
Bug Fixes
Changing namespace-lowering or native-extern settings now triggers a rebuild rather than reusing cached results built with different settings.
Documentation
Clarified that compiler switches, including switches set to 0, affect cache reuse.
No actionable comments were generated in the recent review.
Walkthrough
The compilation environment cache inputs now include PERRY_FACTS_NATIVE_EXTERN and PERRY_NS_PAIRS. The changelog and cache-directory documentation describe how changing these switches affects cached results.
Changes: Compiler environment cache keys
Layer / File(s)
Summary
Add switches to cache inputs crates/perry/src/commands/compile/compile_env.rs, docs/src/cli/cache-dir.md, changelog.d/14929-compile-env-cache-switches.md
COMPILE_ENV_VARS now includes PERRY_FACTS_NATIVE_EXTERN and PERRY_NS_PAIRS. The cache documentation and changelog state that changing a switch, including setting it to 0, triggers a rebuild instead of reusing cached results.
This fix makes changes to PERRY_FACTS_NATIVE_EXTERN and PERRY_NS_PAIRS invalidate cached objects and completed builds, so stale outputs are no longer reused. The change is small and reversible, and I found no remaining merge-blocking risk.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: compilation caches now key on the namespace and native-extern switches. It matches the summary, the cache-key list change, and the stated objective. The title is short…
Description check
The description follows the template's sections: Summary, Changes, Related issue, Test plan, and Checklist. The Summary states the cause and the fix. Changes lists the three touched files. The Related…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the main change: compilation caches now key on the namespace and native-extern switches. It matches the summary, the cache-key list change, and the stated objective. The title is short and specific. The 'fix:' prefix follows the repository convention.
Full details: Description check
Explanation
The description follows the template's sections: Summary, Changes, Related issue, Test plan, and Checklist. The Summary states the cause and the fix. Changes lists the three touched files. The Related issue section gives references. The Test plan lists commands run and their results, with the lint gate reported as not passing. The Type of change, Platforms, and Tested on sections are not filled in. The description does not mark a type of change or platform. It states the platform only in the test plan text (macOS arm64). The Checklist items are ticked. One Test plan item is unchecked and explained.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Fix failing CI checks
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
File: No configuration file from this repository applied
Commit: Unavailable
Layers: defaults
Review profile: CHILL
Plan: Advanced
Run ID: ad784550-7a84-4081-b0b0-14ab7984225e
Commits
Reviewing files that changed from the base of the PR and between d6da0c0 and 67920f0.
Files selected for processing: 1
docs/src/cli/cache-dir.md
Files skipped from review as they are similar to previous changes: 1
docs/src/cli/cache-dir.md
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
cargo-testfails the compiler environment audit becausePERRY_FACTS_NATIVE_EXTERNandPERRY_NS_PAIRSare read by compilation but omitted from the cache-key inputs. Both switches change the facts or lowering; changing either must invalidate the object and completed-build caches.Changes
crates/perry/src/commands/compile/compile_env.rs: register both switches in the sorted shared cache-input list.docs/src/cli/cache-dir.md: document invalidation when either switch changes, including=0.changelog.d/14929-compile-env-cache-switches.md: record the cache correctness fix.Related issue
Refs #12582 and CI investigation in #14919. #14898 documents the inherited failure but does not modify these cache inputs.
The independent
e2e-scopedfailure is fixed by #14928. This cache fix does not include that script change.Test plan
compile_env.rsand its existingcompile_env/tests.rsthrough symlinks, withCARGO_MANIFEST_DIRset to the real workspace crate. On unchanged main it reports 52 passed, 1 failed, naming exactly the two missing switches. With the fix it reports 53 passed, 0 failed (cargo test --offline). The harness is outside the repository and changes no production/test source.rustfmt --check --edition 2021 crates/perry/src/commands/compile/compile_env.rs.python3 scripts/check_test_registration.py.git diff --check.CARGO_HOME=<task-cache> CARGO_TARGET_DIR=<task-target> cargo test --locked --offline --profile perry-dev -p perry --bin perry commands::compile::compile_env::tests -- --test-threads=1— the actual CLI test binary also reports 53 passed, 0 failed, 1587 filtered out, on macOS arm64 with the pinned toolchain. No runtime symbol shim is used.cargo-testCI job passes on this PR.SKIP_COMPILE_GATES=1,BASE_SHA=upstream/main, offline task caches) initially reports 18/142 failing commands, with 2 CI-only arms skipped. A clean same-base2ea9a8becheckout has the same 17 failures except the one-second parity fixture; a separate unchanged parity-runner rerun passes all 52 tests on this branch. No gate, timeout or baseline is weakened. No full-lint pass is claimed.Checklist
CHANGELOG.mdedit.Summary by CodeRabbit
Bug Fixes
Documentation
0, affect cache reuse.