-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tweak build scripts to enable cross-compiling
The main build script for this project is `script/build.go` which implements Makefile-like building of the `gh` binary and associated man pages. Our Makefile defers to the Go script. However, when setting GOOS, GOARCH, and other environment variables to modify the target for the resulting binary, these environment variables would affect the execution of `build.go` as well, which was unintended. This tweaks our Makefile to reset variables like GOOS and GOARCH when building the `build.go` script itself, ensuring that the built script runs on the same platform, and adds the ability to pass environment variables as arguments to `go run script/build.go`. This allows the following usage on platforms without `make`: go run script/build.go GOOS=linux With this style of invocation, the GOOS setting does not actually affect `go run` itself; just the `go build` that is executed in a child process.
- Loading branch information
Showing
3 changed files
with
69 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters