Skip to content

Conversation

@michaeldwan
Copy link
Member

By default go 1.18+ injects version control info into main packages on build. That's fine. But it's buggy and we don't need it anyway since goreleaser does it for us. So I'm disabling it.

Why? If you're building from a linked git worktree (which I do all the time) it'll bomb because go expects the .git directory to be the common git root, not a pointer to one. It's a longstanding bug that'll maybe get fixed by go 3.0 golang/go#58218

By default go 1.18+ injects version control info into main packages on build. That's fine. But it's buggy and we don't need it anyway since goreleaser does it for us. So I'm disabling it.

Why? If you're building from a linked git worktree (which I do all the time) it'll bomb because go expects the `.git` directory to be the common git root, not a pointer to one. It's a longstanding bug that'll maybe get fixed by go 3.0 golang/go#58218
tjex added a commit to zk-org/zk that referenced this pull request Sep 7, 2025
It breaks when building in worktrees and isn't necessary for us, as
we're injecting the version ourselves anyway.

It will also be set to false by default in upcoming go version:
replicate/cog#2516
@michaeldwan michaeldwan requested a review from a team September 9, 2025 22:26
@michaeldwan michaeldwan merged commit 1087c98 into main Oct 3, 2025
26 checks passed
@michaeldwan michaeldwan deleted the md/buildvcs-worktree-fix branch October 3, 2025 16:30
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