Skip to content

build: bake version.Package as github.com/EarthBuild/buildkit#18

Merged
kmannislands merged 1 commit into
mainfrom
fix/buildkit-version-package
Jun 17, 2026
Merged

build: bake version.Package as github.com/EarthBuild/buildkit#18
kmannislands merged 1 commit into
mainfrom
fix/buildkit-version-package

Conversation

@kmannislands

@kmannislands kmannislands commented Jun 17, 2026

Copy link
Copy Markdown

Fixes EarthBuild/earthbuild#437

Problem

The buildkitd/buildctl ldflags bake version.Package as the legacy github.com/earthly/buildkit:

buildkitd github.com/earthly/buildkit 485613cc c40c767e201de9ad72c8c52e207dc8f4b5b51e9d

EarthBuild's earthly client compares the buildkit daemon's reported package against github.com/EarthBuild/buildkit (case-insensitively) and, on mismatch, warns on every invocation:

Using a non-EarthBuild version of Buildkit is not supported.
  Supported: github.com/EarthBuild/buildkit
  Detected:  github.com/earthly/buildkit

Fix

Set EARTHLY_PKG=github.com/EarthBuild/buildkit in the buildkit-version stage of the Dockerfile (the single source consumed by both the buildctl and buildkitd build stages, and by the Earthfile +build target via FROM DOCKERFILE --target buildkit-linux).

Verification

Built --target buildkit-linux locally and confirmed:

$ buildkitd --version
buildkitd github.com/EarthBuild/buildkit v0.0.0-pkgtest .m

🤖 Generated with Claude Code

The buildkitd/buildctl ldflags set version.Package to the legacy
github.com/earthly/buildkit. EarthBuild's earthly client compares the
buildkit daemon's reported package against github.com/EarthBuild/buildkit
and warns "Using a non-EarthBuild version of Buildkit is not supported"
on every invocation. Report the current org so our own buildkit is
recognised as supported.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request updates the EARTHLY_PKG build argument in the Dockerfile, changing the repository path from github.com/earthly/buildkit to github.com/EarthBuild/buildkit. There are no review comments, and I have no feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@kmannislands kmannislands added the ai-assisted Authored with AI assistance label Jun 17, 2026
kmannislands added a commit to EarthBuild/earthbuild that referenced this pull request Jun 17, 2026
Point buildkitd/Earthfile and the go.mod replace at EarthBuild/buildkit
commit 24dff63d2728, which bakes version.Package as
github.com/EarthBuild/buildkit instead of the legacy
github.com/earthly/buildkit. This stops release binaries from warning
"Using a non-EarthBuild version of Buildkit is not supported" on every
run, since the daemon's reported package now matches the buildkitPackage
constant in buildkitd/buildkitd.go.

Fork change: EarthBuild/buildkit#18
go.sum also drops stale unused entries as a side effect of go mod tidy.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

➖ Are we earthbuild yet?

No change in "earthly" occurrences

📈 Overall Progress

Branch Total Count
main 217
This PR 217
Difference +0

Keep up the great work migrating from Earthly to Earthbuild! 🚀

💡 Tips for finding more occurrences

Run locally to see detailed breakdown:

./.github/scripts/count-earthly.sh

Note that the goal is not to reach 0.
There is anticipated to be at least some occurences of earthly in the source code due to backwards compatibility with config files and language constructs.

@kmannislands kmannislands merged commit 51fe8fb into main Jun 17, 2026
16 of 22 checks passed
kmannislands added a commit to EarthBuild/earthbuild that referenced this pull request Jun 17, 2026
Point buildkitd/Earthfile and the go.mod replace at EarthBuild/buildkit
main commit 51fe8fb974fd, which bakes version.Package as
github.com/EarthBuild/buildkit instead of the legacy
github.com/earthly/buildkit. This stops release binaries from warning
"Using a non-EarthBuild version of Buildkit is not supported" on every
run, since the daemon's reported package now matches the buildkitPackage
constant in buildkitd/buildkitd.go.

Fork change: EarthBuild/buildkit#18 (merged to main).
go.sum also drops stale unused entries as a side effect of go mod tidy.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
kmannislands added a commit to EarthBuild/earthbuild that referenced this pull request Jun 23, 2026
Point buildkitd/Earthfile and the go.mod replace at EarthBuild/buildkit
main commit 51fe8fb974fd, which bakes version.Package as
github.com/EarthBuild/buildkit instead of the legacy
github.com/earthly/buildkit. This stops release binaries from warning
"Using a non-EarthBuild version of Buildkit is not supported" on every
run, since the daemon's reported package now matches the buildkitPackage
constant in buildkitd/buildkitd.go.

Fork change: EarthBuild/buildkit#18 (merged to main).
go.sum also drops stale unused entries as a side effect of go mod tidy.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
kmannislands added a commit to EarthBuild/earthbuild that referenced this pull request Jun 25, 2026
* build: forward release metadata args through all-binaries to +earthly

The release pipeline (release+signed-release) passes --VERSION,
--DEFAULT_BUILDKITD_IMAGE and --DEFAULT_INSTALLATION_NAME to the
+all-binaries target via COPY. Those COPY-scoped args were never declared
or forwarded by all-binaries or the per-platform earthly-<os>-<arch>
targets, so they stopped there and +earthly fell back to its dev defaults.

VERSION happened to still be correct because CI also passes it on the
earthly CLI (which propagates globally to every matching ARG), but
DEFAULT_BUILDKITD_IMAGE and DEFAULT_INSTALLATION_NAME are only passed via
COPY. As a result release binaries baked in a buildkit image of
$IMAGE_REGISTRY:buildkitd-$VERSION (ghcr.io/earthbuild/earthbuild:...)
instead of docker.io/earthbuild/buildkitd:$VERSION -- the source of the
"wrong buildkit version" warning.

Declare these args (mirroring +earthly's own defaults) and forward them
explicitly so callers can set them once and have them reach the binary.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* ci: upload release binaries before the smoke test

The smoke test gated the artifact upload, so any smoke-test failure meant
no binaries were uploaded and there was nothing to download for debugging.
Run the upload first; the smoke test still fails the job, but the binaries
are preserved as an artifact regardless.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* ci: fix buildkit-image smoke test for urfave/cli v3 and improve debugging

The smoke test grepped for the literal "--buildkit-image value", but after
the upgrade to urfave/cli v3 the flag renders as "--buildkit-image string"
(v3 uses the type name as the placeholder, v2 used "value"). The grep
matched nothing, so the test always failed at the first check with
"Failed to find --buildkit-image flag" -- before ever comparing the image.
This had been failing every staging release on main.

Match on the flag name only so the check is robust to the placeholder
token, and on failure print the binary version and full --help output (and
use ::error:: annotations) to make diagnosis easier next time.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* build: bump buildkit fork to report EarthBuild package

Point buildkitd/Earthfile and the go.mod replace at EarthBuild/buildkit
main commit 51fe8fb974fd, which bakes version.Package as
github.com/EarthBuild/buildkit instead of the legacy
github.com/earthly/buildkit. This stops release binaries from warning
"Using a non-EarthBuild version of Buildkit is not supported" on every
run, since the daemon's reported package now matches the buildkitPackage
constant in buildkitd/buildkitd.go.

Fork change: EarthBuild/buildkit#18 (merged to main).
go.sum also drops stale unused entries as a side effect of go mod tidy.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* chore: update stale earthly/buildkit references to EarthBuild

Comments, log messages, ticktock BUILDKIT_PROJECT and the cache-from
hint still pointed at the old earthly org. No functional change to the
release path.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* build: bake the release buildkitd with the semver VERSION

The shipped buildkitd (built by release+perform-release-buildkitd-dockerhub)
baked its version from --TAG=$RELEASE_TAG (the short git sha), while the
earthly client ships the semver VERSION (vX.Y.Z-<sha>). The local-buildkit
check requires an exact match, so every release binary warned:

  Warning: Buildkit version (<sha>) is different from earth version (vX.Y.Z-<sha>)

This was previously hidden behind the "non-EarthBuild buildkit" package
warning, which is now fixed.

Decouple the buildkitd binary's RELEASE_VERSION from its image TAG: the
image tag stays keyed on RELEASE_TAG (so copy-staging-buildkitd-to-dockerhub
still finds it), but the baked version is the semver VERSION. The release
job already has VERSION available (no extra build cost -- this buildkitd is
already rebuilt here with TAG=RELEASE_TAG). RELEASE_VERSION defaults to TAG
so all other callers are unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
gilescope added a commit that referenced this pull request Jun 30, 2026
Resolves the Dockerfile version-baking conflict: keep the branch's
worktree-aware heredoc block (skips version check for git worktrees,
sets dev stubs) and apply main's rebrand from #18
(EARTHLY_PKG github.com/earthly/buildkit -> github.com/EarthBuild/buildkit).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-assisted Authored with AI assistance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use earthbuild image by default

2 participants