Skip to content

web: stop the release zip shipping Cargo build artifacts (#793) - #848

Merged
bflatastic merged 1 commit into
storytold:mainfrom
eliets2:claude/issue-793-web-zip-artifacts
Oct 11, 2026
Merged

bflatastic merged 1 commit into
storytold:mainfrom
eliets2:claude/issue-793-web-zip-artifacts

Conversation

@eliets2

@eliets2 eliets2 commented Oct 10, 2026

Copy link
Copy Markdown
Contributor

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:

  • cargo test -p xtask -> 34/34 pass, including site_dir_is_not_a_cargo_profile
  • cargo clippy -p xtask -- -D warnings -> clean
  • packaging/web/package.sh on a clean site -> zip contains no deps/, build/, or .fingerprint/

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)

Copy link
Copy Markdown
Member

Landed in #975 (fixes #793). On merge I also pointed the last two target/web mentions at target/web-site, picked up from #888. Thank you, @eliets2! If you haven't already, come and join us on Discord: https://discord.gg/artcraft


Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants