-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Remove gox in favor of go build. #16353
Conversation
@@ -1,6 +1,5 @@ | |||
# Multi-stage builder to avoid polluting users environment with wrong | |||
# architecture binaries. Since this binary is used in an alpine container, | |||
# we're explicitly compiling for 'linux/amd64' | |||
# architecture binaries. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed this comment about linux/amd64
as I was able to successfully get this to work on linux/arm64
on my Mac as well (but not Dockerfile.ui
due to problems with the debian
distro).
This looks good to me. Nothing really jumped out at me and I was able to build locally (darwin/arm64). Just in case you missed this reference, should we update the website content to remove the
|
Ah, thanks, I had missed that reference in the docs. Will remove. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
-tags="${BUILD_TAGS}" \ | ||
-gocmd="${GO_CMD}" \ | ||
-ldflags "${LD_FLAGS} -X github.com/hashicorp/vault/sdk/version.GitCommit='${GIT_COMMIT}${GIT_DIRTY}' -X github.com/hashicorp/vault/sdk/version.BuildDate=${BUILD_DATE}" \ | ||
-o "bin/vault" \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This bit will probably be missed:
rm -f ${MAIN_GOPATH}/bin/vault
cp ${F} ${MAIN_GOPATH}/bin/
Can you do something equivalent? People are used to the newly built being in their path.
Also the rm is important on macos, something to do with their binary scanning/validation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
go build
does this under the hood already: golang/go@cf7aa58 (thanks to mitchellh for the link).
I'll re-add the bit to copy into the GOPATH.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does that for the build target, but if we're copying into GOPATH, that binary will still be vulnerable to the same problem, I think. Happy to test it once you've made the change if you like.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I kept the rm
for the copy into GOPATH. It should be committed now if you would like to test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I just tested with a manual cp
, and it gets sigkilled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested your branch, works!
@@ -207,8 +207,7 @@ func Run() error { | |||
## Running your plugin | |||
|
|||
The above main package, once built, will supply you with a binary of your | |||
plugin. We also recommend if you are planning on distributing your plugin to | |||
build with [gox](https://github.com/mitchellh/gox) for cross platform builds. | |||
plugin. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might not include this bit, our removal of gox from vault doesn't necessarily have implications for plugins.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Looks good modulo my comments above. When this is merged, please email team-vault to inform them of this change. The only user-facing impact I see is that those who are used to using XC_OSARCH for cross platform builds will now want to use GOOS/GOARCH instead, but if you've noticed anything else you could mention that too. |
`gox` hasn't had a release to update it in many years, so is missing support for many modern systems, like `darwin/arm64`. In any case, we only use it for dev builds, where we don't even use the ability of it to build for multiple platforms. Release builds use `go build` now. So, this switches to `go build` everywhere. I pulled this down and tested it in Windows as well. (Side note: I couldn't get `gox` to work in Windows, so couldn't build before this change.)
Thanks everyone! |
gox is no longer maintained and releases are done with `go build` now. See hashicorp/vault#16353 where we removed gox in Vault.
gox is no longer maintained and releases are done with now. See hashicorp/vault#16353 where we removed gox in Vault.
gox is no longer maintained and releases are done with `go build` now. See hashicorp/vault#16353 where we removed gox in Vault.
gox is no longer maintained and releases are done with `go build` now. See hashicorp/vault#16353 where we removed gox in Vault.
gox is no longer maintained and releases are done with now. See hashicorp/vault#16353 where we removed gox in Vault.
gox is no longer maintained and releases are done with `go build` now. See hashicorp/vault#16353 where we removed gox in Vault.
* Remove gox in favor of go build gox is no longer maintained and releases are done with `go build` now. See hashicorp/vault#16353 where we removed gox in Vault. * revert accidental commit of snowflake.go file * update readme link * re-revert snowflake.go; confusion bc branch needed rebase
gox
hasn't had a release to update it in many years, so is missingsupport for many modern systems, like
darwin/arm64
.In any case, we only use it for dev builds, where we don't even use
the ability of it to build for multiple platforms. Release builds use
go build
now.So, this switches to
go build
everywhere.I pulled this down and tested it in Windows as well. (Side note: I
couldn't get
gox
to work in Windows, so couldn't build before thischange.)