-
Notifications
You must be signed in to change notification settings - Fork 1.5k
hack/release: Make it easy to cross-compile release binaries #397
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
Conversation
I'd added this in f230c3e (hack/build: Add the local vendor directory for generate, 2018-09-26, openshift#340), citing [1]. But: * vendor/ is not a useful GOPATH addition, because it lacks the src/ that Go requires. Go might look in vendor/src/github.com/... with our GOPATH stuffing, but that won't help it find our vendored libraries. * All that really seems to matter is whether the repository as a whole is checked out into your GOPATH. I'm really looking forward to Go 1.11's modules killing the GOPATH idea. [1]: golang/go#20406 Reported-by: Stephen Augustus <saugustu@redhat.com>
|
@wking can we make our binaries getable like this. https://github.com/openshift/installer/blob/master/hack/get-terraform.sh#L26 The zip file is named according to arch and os but the internal binary is always |
And stick Git tagging in there too, because why not. This is mostly to get our list of target OSes and architectures into version control. The SKIP_GENERATION variable allows you to turn off vfsgen when we have GOOS and/or GOARCH set to values that will not run on your host ;). Also change --abbrev from 0 to 40 in the build script, because --abbrev=0 results in dropping the commit hash entirely when there's a past tag: $ git describe --always --abbrev=40 --dirty v0.1.0-2-gff5ee75e5010efb305d4bc381d944b14a4a97c3b-dirty $ git describe --always --abbrev=0 --dirty v0.1.0-dirty $ git describe --always --dirty v0.1.0-2-gff5ee75-dirty Checking on the tag itself for sanity: $ git checkout v0.1.0 $ git describe --always --abbrev=40 --dirty v0.1.0
292586b to
7b02330
Compare
We could. But why zip the files at all? Currently you can: $ curl -s https://github.com/openshift/installer/releases/download/v0.1.0/openshift-install-linux-amd64 >~/bin/openshift-installWith zips, you'd: $ curl -s https://github.com/openshift/installer/releases/download/v0.1.0/openshift-install-linux-amd64.zip | funzip >~/bin/openshift-installThe former seems simpler to me. |
|
For now this seems okay /lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: abhinavdahiya, wking The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This gets the correct main.version value. Before this commit, you could have: $ hack/release.sh v0.4.0 ... + go build -ldflags ' -X main.version=v0.3.0-273-g...' ... ... With this commit, that same invocation will give you: + go build -ldflags ' -X main.version=v0.4.0' ... The bug is from the initial script in 7b02330 (hack/release: Make it easy to cross-compile release binaries, 2018-10-02, openshift#397).
Builds on #396; review that first.
I've stuck Git tagging in there too, because why not. This is mostly to get our list of target OSes and architectures into version control.
The
SKIP_GENERATIONvariable allows you to turn off vfsgen when we have GOOS and/or GOARCH set to values that will not run on your host ;).