Skip to content

Releases: bazelbuild/rules_go

0.5.0

13 Jun 16:53
Compare
Choose a tag to compare
0.5.0 Pre-release
Pre-release

Features

  • go_repository replaces new_go_repository for dependencies with
    and without BUILD or BUILD.bazel files. go_repository will
    generate these files using Gazelle if they are not already present.
  • Import paths may be specified explicitly using the importpath in
    go_library. This allows for Go subtrees that aren't at the top of
    a repository. It also allows flat BUILD files.
  • Gazelle generates BUILD files for multiple platforms. Sources with
    build constraints (tags or filename suffixes) and dependencies
    imported from them are now compiled conditionally using select.
  • Link stamping in multiple packages is now supported via the x_defs
    attribute. x_defs may now contain values wrapped in braces (for
    example: {VAR}) which are replaced with values from the workspace
    status files.
  • Rules are substantially cleaned up and organized. Assemble, compile,
    and link actions are rewritten in Go, avoiding incompatibilities and
    quoting problems with Bash.
  • Preliminary support for toolchains.

Bug fixes

  • cgo_library now allows sources in multiple directories.
  • cgo_library no longer assumes srcs is a list (it can now include
    select calls).
  • go_binary and go_test no longer expose .a files in outputs.
  • All rules now allow target names with slashes.
  • If multiple packages are present after applying build constraints,
    Gazelle will generate BUILD files for the package matching the
    directory name. If there is no match, Gazelle will report an error.
  • Gazelle is much faster when running in external mode on repositories
    with lots of external dependencies.
  • Gazelle no longer removes # keep comments from existing sources.
  • Many more...

0.4.4

05 May 21:46
Compare
Choose a tag to compare
0.4.4 Pre-release
Pre-release

This release is a cherry-pick of #428 on top of 0.4.3. This adds support for the darwin_x86_64 cpu value, which will become standard in Bazel soon.

0.4.3

12 Apr 14:27
Compare
Choose a tag to compare
0.4.3 Pre-release
Pre-release

Features

  • Upgraded to Go 1.8.1 and provided backward compatibility for tests in 1.7.5.
  • Support for build constraints (build tags and filename suffixes) in go_library, cgo_library, go_test, and go_binary. You can now add all your sources to your rules, and they will be filtered during compilation.
    • Note: Gazelle also filters sources with build constraints. This behavior will be removed when #339 is fixed.
  • go_repositories now supports custom Go versions. Versions can be specified with a simple version string (e.g., "1.8.0") or by declaring a separate Bazel repository and providing that through the go_linux or go_darwin attributes.
  • go_repository now supports vcs and importpath attributes. This enables repositories with different URLs and import paths.
  • gc_goopts and gc_linkopts attributes can be used to pass additional options to the compiler and linker.
  • protoc and protoc_gen_go can now be overridden in go_proto_library. Also added an ignore_go_package attribute.
  • Gazelle now adds a data dependency on testdata directories.

Bug fixes

  • Fixed repositories rules that depended on the real names of repositories. This broke when one of our dependencies (github.com/bazelbuild/buildifier) was renamed to buildtools. A quick fix was backported to 0.4.2 and 0.3.4.
  • Fixed -mode diff in Gazelle. It now produces a regular textual diff.
  • Gazelle no longer attempts to rename files with -mode fix or -mode print.
  • Gazelle can now find # gazelle:ignore comments that aren't at the top of a file.
  • Bash scripts generated by rules are now executed as commands instead of executable files. This is required on Windows.
  • Fixed an infinite recursion issue on Windows.
  • data files are now propagated transitively across dependencies.

0.4.2

07 Apr 17:54
Compare
Choose a tag to compare
0.4.2 Pre-release
Pre-release

This release fixes a break which was caused by github.com/bazelbuild/buildifier being renamed to buildtools. The following changes are cherry-picked:

  • #319 go_repository: add importpath and vcs flags. This allows us to have separate import paths and remote URLs for repositories.
  • #362 Fetch buildifier from new location. This allows the buildifier zip to be extracted with the new name.

0.3.4

07 Apr 17:32
Compare
Choose a tag to compare
0.3.4 Pre-release
Pre-release

This release fixes a break which was caused by github.com/bazelbuild/buildifier being renamed to buildtools. The following changes are cherry-picked:

  • #319 go_repository: add importpath and vcs flags. This allows us to have separate import paths and remote URLs for repositories.
  • #362 Fetch buildifier from new location. This allows the buildifier zip to be extracted with the new name.

0.4.1

03 Mar 22:25
Compare
Choose a tag to compare
0.4.1 Pre-release
Pre-release

Features

  • Upgraded to Go 1.8.0
  • Upgraded protobuf to 3.2.0
  • #233 - Support for link stamping in go_binary and go_test with the linkstamp attribute.
  • #272 - Cases within go_test targets can be filtered with --test_filter

Bug fixes

  • #257 - gazelle lists loaded symbols in sorted order to avoid conflicts
  • #266 - gazelle no longer reformats files with "# gazelle:ignore".
  • #274 - cgo libraries are now built with -pthread or -mthreads
  • #277 - empty go_prefix("") no longer breaks the linker

0.2.0

21 Sep 04:40
Compare
Choose a tag to compare
0.2.0 Pre-release
Pre-release

Features

Bug fixes

  • Build failure of cgo targets on OSX with Bazel HEAD -- #86
  • /bin/bash: Argument list too long(#42) -- fixed by #83
  • Avoid unnecessary re-download of go toolchains -- #85
  • Link failure of cgo targets depending on a cc_library rule which requires linkopts -- #103

Misc

0.1.0

29 Aug 22:16
Compare
Choose a tag to compare
0.1.0 Pre-release
Pre-release

New features

  • Upgrade to go 1.7.0, #67
  • Support TestMain, #68

Other changes

0.0.4

20 Jul 02:08
Compare
Choose a tag to compare
0.0.4 Pre-release
Pre-release
  • Update to go 1.6.3 #49
  • Fix compatibility to Bazel 0.3.0 #43

0.0.3

23 Jun 15:17
Compare
Choose a tag to compare
0.0.3 Pre-release
Pre-release

Incompatible Changes

  • linkopts and deps attributes in cgo_library were renamed to clinkopts and cdeps accordingly.

Features

  • Update Go version from 1.6 to 1.6.2
  • Allow Go assembler sources as source files in go_library, cgo_library, go_binary and go_test
  • Add x_defs attribute to go_binary
  • Support building external repositories imported by git_repository or other workspace rules