github bazelbuild/rules_go 0.5.1

latest releases: v0.46.0, v0.45.1, v0.45.0...
pre-release6 years ago

Go rules

  • Dependency checking is now strict: go_library, go_binary, and go_test must now include a library in deps for each package they import. Previously, transitive deps were allowed. This lets us speed up the build by only passing direct deps to the compiler.
  • cgo_genrule is deprecated. It now just invokes cgo_library with tags = ["manual"]. Please use cgo_library directly when possible.
  • Several internal improvements were made to cgo_library. We are planning to consolidate it with go_library some time in the future.
  • deps are now propagated through the library attribute. This means, for example, a go_test rule doesn't need to repeat deps specified in a go_library under test, though doing so is encouraged if the go_test references those dependencies itself.
  • go_test will now always change to the package directory before running test cases. This was previously broken for tests in external repositories.

Gazelle

  • Generated .go files will now be included in rules that Gazelle creates. Gazelle discovers these files by looking at filenames in out and outs attributes of other rules in BUILD files.
  • Gazelle only generate BUILD files in testdata directories if there are no .go files, BUILD files, or BUILD.bazel files in any subdirectory. Previously, Gazelle did not recurse into testdata directories at all.
  • Go release tags (e.g., go1.8) are treated as unknown (neither true nor false). Gazelle will include files with these tags, whether or not they are negated. This avoids some confusing situations where Gazelle is compiled with a different version of Go than the one used to build a project.
  • Several improvements for merging with existing files. copts and clinkopts attributes are now merged. visibility won't be added if a package rule with a default_visibility attribute is present. Comments are preserved on existing elements. deps are now sorted according to buildifier rules.

Don't miss a new rules_go release

NewReleases is sending notifications on new releases.