Idea: release builds don't reuse a cached target folder #43

Closed
opened 2026-12-05 17:22:17 +00:00 by llun · 1 comment
Member

The idea

On the runs that publish a release, build from an empty target/ folder, or restore only cargo's downloaded crates. Don't reuse compiled files from a cache.

Why

MagicBeanAdmin/Release's launcher.yml restores ~/.cargo/registry/cache and the target/ folder before scripts/package.sh, and saves them afterwards. Cargo checks every downloaded crate against Cargo.lock's checksum, but it doesn't re-check files already compiled in target/: those go into the release as they are. Whatever can write that cache can put code into a signed release without a commit.

Today only the release workflows write that cache, which is right. Making the publishing run not depend on it removes the question entirely, at the cost of a slower build. Longshot's release build may be worth the same look.

Found while checking the download chain for LongshotLauncher issue 379 (nothing wrong was found there).

Done when

A published release is built from its commit, the locked crates and the pinned toolchain only, and the workflow says so.

### The idea On the runs that publish a release, build from an empty `target/` folder, or restore only cargo's downloaded crates. Don't reuse compiled files from a cache. ### Why MagicBeanAdmin/Release's `launcher.yml` restores `~/.cargo/registry/cache` **and** the `target/` folder before `scripts/package.sh`, and saves them afterwards. Cargo checks every downloaded crate against `Cargo.lock`'s checksum, but it doesn't re-check files already compiled in `target/`: those go into the release as they are. Whatever can write that cache can put code into a signed release without a commit. Today only the release workflows write that cache, which is right. Making the publishing run not depend on it removes the question entirely, at the cost of a slower build. Longshot's release build may be worth the same look. Found while checking the download chain for [LongshotLauncher issue 379](https://git.magicbean.dev/MagicBeanDev/LongshotLauncher/issues/379) (nothing wrong was found there). ### Done when A published release is built from its commit, the locked crates and the pinned toolchain only, and the workflow says so.
Owner

Will add for stable-only

Will add for stable-only
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Tooling#43
No description provided.