Skip to content

fix(scripts): include build inputs in make_git_package cache key#145

Open
samlaf wants to merge 1 commit intoflashbots:mainfrom
samlaf:fix--make-git-package-cache-key
Open

fix(scripts): include build inputs in make_git_package cache key#145
samlaf wants to merge 1 commit intoflashbots:mainfrom
samlaf:fix--make-git-package-cache-key

Conversation

@samlaf
Copy link
Copy Markdown

@samlaf samlaf commented May 5, 2026

Fixes #144.

The cache key was <package>-<git_describe> — source identity only. Build-input changes (RUSTFLAGS, GOFLAGS, cargo profile env vars, toolchain version) silently reused cached binaries built under different conditions.

Cache key is now <package>-<git_describe>-<env_hash>, where env_hash is sha256(build_cmd || $MAKE_GIT_PACKAGE_CACHE_KEY_EXTRA). build_cmd is always hashed in. MAKE_GIT_PACKAGE_CACHE_KEY_EXTRA is opt-in for caller-injected inputs — e.g., the rust toolchain version installed via rustup, so that toolchain bumps invalidate cached binaries built under the previous one.

Existing caches invalidate once when this lands.

…s#24)

Fixes flashbots#144

The cache key was `<package>-<git_describe>` — source identity only.
Build-input changes (RUSTFLAGS, GOFLAGS, cargo profile env vars,
toolchain version) silently reused cached binaries built under different
conditions.

Cache key is now `<package>-<git_describe>-<env_hash>`, where env_hash
is `sha256(build_cmd || $MAKE_GIT_PACKAGE_CACHE_KEY_EXTRA)`. build_cmd
is always hashed in. MAKE_GIT_PACKAGE_CACHE_KEY_EXTRA is opt-in for
caller-injected inputs — e.g., the rust toolchain version installed via
rustup, so that toolchain bumps invalidate cached binaries built under
the previous one.

Existing caches invalidate once when this lands.
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.

make_git_package.sh: cache key omits build inputs, can serve stale binaries

1 participant