Repository navigation
web: stop the release zip shipping Cargo build artifacts (#793) - #848
Merged
bflatastic merged 1 commit intoOct 11, 2026
Merged
Conversation
lightcraft-web-<version>.zip carried Cargo host build output next to the site: deps/ (81 files, 90.6 MB), build/ (149 files, 22.4 MB) and .fingerprint/ (297 files), ~113 MB that the app never references and that leaked build paths and crate names to anyone hosting the zip. Cause: xtask wrote the bundle to <target>/web (SITE in packaging/web/package.sh) while building with --profile web. Cross-compiling with --target wasm32-unknown-unknown makes Cargo write the selected profile host artifacts (build scripts, proc-macros, deps/, build/, .fingerprint/) to <target>/<profile>/, so they landed in the bundle directory and package.sh copied the whole tree into the zip. Fix: write the bundle to <target>/web-site, a directory that is not a Cargo profile name, and point SITE at it. The wasm32/web/ target artifacts and the web profile are unchanged, so the rust-cache keys and the CI web job keep working. Guard: package.sh now fails if deps/, build/ or .fingerprint/ exists in $SITE, and a unit test asserts the bundle directory is not a Cargo profile name, so the collision cannot come back silently. Reference (storytold#793)
Member
|
Landed in #975 (fixes #793). On merge I also pointed the last two Generated by Claude Code |
This was referenced Oct 11, 2026
Closed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Bug: The lightcraft-web-0.5.0.zip release artifact shipped the Cargo build output for the web profile inside the site bundle. The archive carried deps/ (81 files, 90.6 MB), build/ (149 files, 22.4 MB), and .fingerprint/ (297 files) — roughly 113 MB of unreferenced build output that also leaked absolute build paths and internal crate names into a published release.
Cause: The site bundle was written to /web while the build ran under --profile web. When cross-compiling with --target wasm32-unknown-unknown, Cargo places that profile's HOST artifacts — build scripts, proc-macro crates, and their deps/, build/, and .fingerprint/ bookkeeping — under //, which is exactly the bundle directory. packaging/web/package.sh then zipped that directory wholesale.
Fix: The bundle now goes to /web-site, a name that is not a Cargo profile, so Cargo's host artifacts can no longer land inside it. A new unit test, site_dir_is_not_a_cargo_profile, asserts this invariant against Cargo.toml (the site dir must never match a declared profile name). packaging/web/package.sh points at the new directory and fails if deps/, build/, or .fingerprint/ ever appear in the site dir again. The profile name, the rust-cache keys, and the CI web job are unchanged.
Tests: New: cargo test -p xtask runs 34/34, including the new site_dir_is_not_a_cargo_profile test. The packaging guard was dry-run both ways — it fires on a planted deps/ directory and passes a clean site dir. Gates: cargo fmt and cargo clippy -p xtask -- -D warnings are clean, and a stale-reference grep for the old bundle path returns zero hits.
VERIFY: