CLI: refuse VICTORY_PREBUILD_KEYS paths inside the repository #3042
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/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?
Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T05:12:24Z.
Problem
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)Imported from Marvisak/VIctory. Originally posted by kotekompotek on 2026-11-26T05:25:30Z.
Review: APPROVED
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.Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-26T06:17:21Z.
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
Imported from Marvisak/VIctory. Originally posted by Dukestar69 on 2026-11-26T08:32:43Z.
Review: APPROVED
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).
Imported from Marvisak/VIctory. Originally posted by futurepro62 on 2026-11-26T19:03:29Z.
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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.