gb v0.4.0 Release Notes

Release Date: 2016-01-21 // about 8 years ago
  • The 0.4 series focuses on improvements to project dependency management.

    ๐Ÿ†• New features

    ๐Ÿ— The headline feature of the 0.4 series will be adding support for an alternative mechanism to fetch, at build time, dependencies that are not vendored into the gb project.

    ๐Ÿš€ This mechanism is opt in only and is activated by the presence of a file at the root of your project, tentatively named $PROJECT/depfile. The depfile contains the missing information required to download a specific release version of a library from upstream.

    gb 0.4.0 lays most of the groundwork for implementing this feature, but not the feature itself.

    Please consult issue #536 for full details.

    gb 0.4.0 also features the following improvements.

    ๐Ÿ— In preparation for adding support for automatically downloading missing dependencies, see above, the use of go/build for package source code resolution has been replaced by a home grown version. This has solved a number of long standing issues that were caused by an impedance mismatch between gb's needs and the go/build API. Fixes #306

    ๐Ÿ“ฆ There may be some discrepancies between how packages are resolved in 0.4.0 vs 0.3.5. It is my priority to address these issues before moving on implementing #536, please raise issues if you experience difficulties.

    ๐Ÿ— As a result of moving away from the go/build package you can now create a command package called cmd, ie $PROJECT/src/cmd/main.go -- but really you shouldn't do that because the name of the binary would be $PROJECT/bin/cmd. Fixes #416

    When cross compiling, gb will always append the value of GOOS and GOARCH to the output binary. ie

    ๐Ÿง env GOOS=linux GOARCH=amd64 gb build

    Will produce $PROJECT/bin/$BINARY-linux-amd64 even if this is a linux/amd64 machine. This is important for people automating their build pipeline and rely on a predictable file name. Thanks @rafael84. Fixes #346

    ๐Ÿ— To support users who want to vendor tools to build their projects, protobufs is an example, gb will now let you build those packages if you name them explicitly. This is an exception to the rule that code in $PROJECT/vendor/src is not consider to be buildable (it is only built if referenced transitively from $PROJECT/src). See #528.

    ๐Ÿ› Bug fixes

    • ๐Ÿ— gb help {build,test} now lists -race correctly. Fixes #543
    • ๐Ÿ›  A bug relating to the hard coded name of the linker on FreeBSD has been fixed. Thanks @derekmarcotte. Fixes #506
    • โ†ช The OSX binary installer (.pkg installer) for Go 1.5 (and probably earlier) had a bug that causes the timestamps of the .a files in the distribution to be incorrect with respect to their .go source. The issue has been fixed upstream and gb has a workaround. Fixes #515
    • ๐Ÿ›  Various gb commands that shell out to the go tool, like gb generate and gb doc should now work more reliably with go installations that have modified the locations of the go tool relative to $GOROOT. This only affects users of operating system distros of Go, if you use the ones from golang.org, you can ignore this issue. Fixes #521
    • ๐Ÿ‘€ gb vendor fetch now permits ~ in import paths. Thanks @FiloSottile. See #535
    • ๐Ÿ‘€ gb generate now uses the correct operating system path separator when constructing the environment to execute go generate. Thanks @ChrisHines. See #540