Policy: allow up to 2 MiB for Rust source files under asset policy #1361
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1361"
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 fxceless/victory-fork. Originally posted by ashishdhillon on 2026-11-26T18:11:57Z.
Description
Fixes #1342. On
main,crates/victory-gpu/src/host.rs(528,954 bytes) andcrates/victory-shader/src/emit/lower.rs(535,588 bytes) exceeded the uniform 512 KiBMAX_FILE_SIZEceiling inxtask/src/policy.rs, causingpolicy::tests::repository_passes_policy(CITests) to fail andcargo xtask policy --stagedto reject commits touching either file.This implements Option 1 discussed in #1342: giving
.rssource files a dedicated 2 MiB size ceiling (MAX_SOURCE_FILE_SIZE) while keeping all content guards (allowlisted extension, forbidden binary signatures, NUL-byte check, andMAX_ENCODED_RUN = 512hex/base64 run check) unchanged and keepingMAX_FILE_SIZE = 512 KiBfor all other non-run-log files.Changes
xtask/src/policy.rs: AddedMAX_SOURCE_FILE_SIZE(2 MiB) for.rsfiles, updatedcheck()size enforcement, addedsource_files_have_their_own_size_limitunit test, and updatedrejects_game_like_files.docs/asset-policy.md: Documented the 2 MiB ceiling for.rssource files alongside the 512 KiB general limit.Verification
cargo clippy -p xtask --all-targets --locked -- -D warnings: passedcargo test -p xtask --locked: 6 passed, 0 failed (includingpolicy::tests::repository_passes_policy)cargo xtask policy:asset policy: 223 files okView 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.