Skip to content

Rebuild the evmtool Docker image from the current distribution - #11965

Merged
macfarla merged 4 commits into
besu-eth:mainfrom
macfarla:evmtool-docker-stale-dist
Nov 19, 2026
Merged

macfarla merged 4 commits into
besu-eth:mainfrom
macfarla:evmtool-docker-stale-dist

Conversation

@macfarla

Copy link
Copy Markdown
Contributor

PR description

A local ./gradlew :ethereum:evmtool:distDocker builds the image from the first evmtool distribution ever unpacked in the build directory, not from the current code, as long as ethereum/evmtool/build/docker-besu-evmtool/ is still there from an earlier build.

dockerDistUntar unpacks the distribution to docker-besu-evmtool/evmtool-<version>/ and renames it to besu-evmtool/, which the Dockerfile copies into the image. File.renameTo returns false rather than throwing when the target directory already exists, and the result was ignored. So after the first build, the rename silently failed, the Dockerfile copied the old besu-evmtool/, and the image was tagged with the current version. A versioned folder was also left behind on every build.

Found while testing #11964: a checkout last cleaned in June produced an image tagged 26.11-develop-4d41b4d that contained besu-ethereum-evmtool-26.6-develop-41fe887.jar, next to about 60 leftover evmtool-* folders.

The root dockerDistUntar for the Besu image deletes build/docker-besu/besu before renaming, so it doesn't have this problem. This change:

  • deletes the whole staging directory before unpacking (which also clears the leftover folders)
  • fails the build if the rename fails, instead of carrying on with whatever is there

CI builds from a clean checkout, so the published hyperledger/besu-evmtool images are not affected. This only matters for local builds, so there is no changelog entry.

Testing

  • Planted a stale besu-evmtool/lib/STALE-MARKER.jar and a leftover evmtool-old-leftover/ in the staging directory, then ran ./gradlew :ethereum:evmtool:distDocker: both were removed, the image contains besu-ethereum-evmtool-26.11-develop-1f2052c.jar only, and --version reports 26.11-develop-1f2052c.
  • Ran distDocker again over the existing staging directory: it succeeds, and the image runs bytecode.

🤖 Generated with Claude Code

dockerDistUntar renamed the unpacked distribution to besu-evmtool with
File.renameTo, which fails without error when besu-evmtool already
exists. Every local distDocker after the first one then built the image
from the first distribution unpacked in that build directory. Clear the
directory before unpacking, and fail the build if the rename fails.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>
@macfarla
macfarla marked this pull request as ready for review November 18, 2026 04:28
Copilot AI balanced review requested due to automatic review settings November 18, 2026 04:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

macfarla and others added 2 commits November 19, 2026 16:27
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Sally MacFarlane <macfarla.github@gmail.com>

@usmansaleem usmansaleem left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@macfarla macfarla self-assigned this Nov 19, 2026
@macfarla
macfarla enabled auto-merge (squash) November 19, 2026 08:26
@macfarla
macfarla merged commit 1711ad2 into besu-eth:main Nov 19, 2026
48 checks passed
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.

3 participants