Policy: allow up to 2 MiB for Rust source files under asset policy #1361
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/fxceless--victory-fork!1361
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@ashishdhillon on GitHub · 2026-11-26 18:11 UTC · original
ashishdhillon:fix/asset-policy-rs-size-limit→main· +37 −6 · 2 files · 1 commits · openDescription
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.