Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

internal/build: include git-date on detached head #30320

Merged
merged 1 commit into from
Aug 19, 2024

Conversation

holiman
Copy link
Contributor

@holiman holiman commented Aug 19, 2024

When we are building in detached head, we cannot easily obtain the same information as we can if we're in non-detached head.

However, one thing we can obtain is the git-hash and git-date. Currently, we omit to include the git-date into the build-info, which causes problem for reproducable builds which are on a detached head. This PR should fix it.


Can be tested locally by adding an early return in ci.go and then do go run build/ci.go install , check out a specific git commit and add some printouts to see the env.

func doInstall(cmdline []string) {
	var (
		dlgo       = flag.Bool("dlgo", false, "Download Go and build with it")
		arch       = flag.String("arch", "", "Architecture to cross build for")
		cc         = flag.String("cc", "", "C compiler to cross build with")
		staticlink = flag.Bool("static", false, "Create statically-linked executable")
	)
	flag.CommandLine.Parse(cmdline)
	env := build.Env()
        return

HT to @vivi365 for finding

Copy link
Member

@MariusVanDerWijden MariusVanDerWijden left a comment

Choose a reason for hiding this comment

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

LGTM

@holiman holiman added this to the 1.14.9 milestone Aug 19, 2024
@holiman holiman merged commit 60db6a7 into ethereum:master Aug 19, 2024
2 of 3 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.

2 participants