CLI: refuse VICTORY_PREBUILD_KEYS paths inside the repository #3044
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!3044
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3044"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@fuzeofficlal on GitHub · 2026-11-26 05:12 UTC · original
fuzeofficlal:fix/prebuild-keys-outside-repo→main· +34 −1 · 1 files · 1 commits · openProblem
apps/victory/src/prebuild.rsreadsVICTORY_PREBUILD_KEYS=<file>and writes game-derived pipeline keys and shader hashes directly viastd::fs::write, without callingvictory_core::ensure_outside_repo. Setting a repo-relative path such asVICTORY_PREBUILD_KEYS=keys.txtfrom the checkout root writes game-derived output into the repository tree (and truncates any existing file at that path), unlikeVICTORY_EMIT_DUMPinapps/victory/src/translate.rs.Fix
VICTORY_PREBUILD_KEYSviavictory_core::ensure_outside_repoat the start ofprebuild::run(before scanning files or touching caches/outputs).prebuild_keys_inside_repo_is_refused) verifying thatNonepasses, a path inside the repository is rejected, and a path outside the repository is accepted.Verification
cargo test --locked -p victory(15 unit tests + 4 integration tests passed)cargo clippy --locked -p victory --all-targets -- -D warningsrustfmt --edition 2024 --check apps/victory/src/prebuild.rscargo xtask policy(191 files ok)@Marvisak on GitHub · 2026-11-26 06:17 UTC · original
Automated triage for the maintainers.
prebuild::run(apps/victory/src/prebuild.rs) writes game-derived pipeline keys and shader hashes toVICTORY_PREBUILD_KEYSwithstd::fs::write. It never calledvictory_core::ensure_outside_repo, unlike every other place that writes game-derived output (translate.rsforVICTORY_EMIT_DUMP,main.rs,config.rs,victory-pipeline's cache). The PR checks the path first, before any file is scanned or written. That supports the asset policy. The later uses ofkeys_only(theis_some()checks and the final write) work unchanged with the newOption<PathBuf>. The test's expected text matchesPolicyError::InsideRepo's message. CI:checkpassing.Generated by Claude Code
@kotekompotek on GitHub · 2026-11-26 05:25 UTC · original · approved these changes
Verified:
keys_output_pathroutes the env path throughensure_outside_repo— the asset-policy requirement for runtime writes — and rejects before any work starts rather than after the scan. Test covers the inside/outside/unset cases.@Dukestar69 on GitHub · 2026-11-26 08:32 UTC · original · approved these changes
Verified against
origin/main(63bcca4):cargo test -p victory -- --test-threads=1: 15 lib + 4 integration tests passed (includingprebuild::tests::prebuild_keys_inside_repo_is_refused).cargo clippy -p victory --all-targets -- -D warnings: clean.cargo xtask policy: 191 files ok.Cleanly prevents
VICTORY_PREBUILD_KEYSfrom pointing inside the repository, matching the existing repo-path safeguards.Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
@futurepro62 on GitHub · 2026-11-26 19:03 UTC · original
Full-suite run on NVIDIA, since this PR has no test report yet. Tested exact head
66ca71b(on its base63bcca4).Tested
dxil.dllfrom Windows SDK 10.0.26100 (the loader's default), debug.cargo build --workspace --locked, thencargo test --workspace --locked --no-fail-fast -- --test-threads=4 --skip emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index --skip descriptor::host::tests::dynamic_slots_are_held_until_released --skip memory::tests::lists_share_a_table_and_copies_keep_their_views --skip emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride --skip emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros --skip emit::synthetic_tests::gathers_at_a_level_match_the_hardware: 867 passed, 0 failed, 10 ignored.prebuild_keys_inside_repo_is_refused.--skipleaves out tests that fail on main63bcca4on this card too, not because of this PR:heap_direct_texture_reads_mark_their_heap_indexends thevictory-shadertest process with0xc0000005(#2571), so without the skip the rest of that crate never reports;dynamic_slots_are_held_until_released,lists_share_a_table_and_copies_keep_their_viewsand the twostride_testshit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317);gathers_at_a_level_match_the_hardwarefails on lane 0 (#1744).Not tested
AI use
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.