Skip to content

Embed VCS build info so plugins report a valid version - #280

Open
evan314159 wants to merge 1 commit into
caddyserver:masterfrom
evan314159:fix-vcs-buildinfo
Open

Embed VCS build info so plugins report a valid version#280
evan314159 wants to merge 1 commit into
caddyserver:masterfrom
evan314159:fix-vcs-buildinfo

Conversation

@evan314159

Copy link
Copy Markdown

Builds run in a fresh temporary module folder that is not a git repo, so Go embeds no vcs.revision/vcs.time settings in the binary. Plugins that read their version via debug.ReadBuildInfo() then have no data. Tailscale, for example, reports "-ERR-BuildInfo" in the Tailscale console.

Initialize a git repo with one commit in the temp folder before compiling so Go can stamp valid VCS info.

If git is missing or fails, a warning is logged and the build proceeds.

Builds run in a fresh temporary module folder that is not a git repo, so Go
embeds no vcs.revision/vcs.time settings in the binary. Plugins that read
their version via debug.ReadBuildInfo() then have no data. Tailscale, for
example, reports "<Tailscale version>-ERR-BuildInfo" in the Tailscale console.

Initialize a git repo with one commit in the temp folder before compiling
so Go can stamp valid VCS info.

If git is missing or fails, a warning is logged and the build proceeds.
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.

1 participant