Releases: bazel-contrib/rules_go
Releases · bazel-contrib/rules_go
0.5.0
Features
go_repositoryreplacesnew_go_repositoryfor dependencies with
and without BUILD or BUILD.bazel files.go_repositorywill
generate these files using Gazelle if they are not already present.- Import paths may be specified explicitly using the
importpathin
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 usingselect. - Link stamping in multiple packages is now supported via the
x_defs
attribute.x_defsmay 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_librarynow allows sources in multiple directories.cgo_libraryno longer assumessrcsis a list (it can now include
selectcalls).go_binaryandgo_testno 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
# keepcomments from existing sources. - Many more...
0.4.4
0.4.3
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, andgo_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_repositoriesnow 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 thego_linuxorgo_darwinattributes.go_repositorynow supportsvcsandimportpathattributes. This enables repositories with different URLs and import paths.gc_gooptsandgc_linkoptsattributes can be used to pass additional options to the compiler and linker.protocandprotoc_gen_gocan now be overridden ingo_proto_library. Also added anignore_go_packageattribute.- Gazelle now adds a
datadependency ontestdatadirectories.
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 diffin Gazelle. It now produces a regular textual diff. - Gazelle no longer attempts to rename files with
-mode fixor-mode print. - Gazelle can now find
# gazelle:ignorecomments 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.
datafiles are now propagated transitively across dependencies.
0.4.2
This release fixes a break which was caused by github.com/bazelbuild/buildifier being renamed to buildtools. The following changes are cherry-picked:
0.3.4
This release fixes a break which was caused by github.com/bazelbuild/buildifier being renamed to buildtools. The following changes are cherry-picked:
0.4.1
0.2.0
Features
- Update Go toolchain from 1.7.0 to 1.7.1 -- #93
- Add new repository rules,
go_repositoryandnew_go_repository-- #84 - Several enhancements of Gazelle -- #83, #95, #96, #102, #107
- Support execroot-relative include paths in cgo command line -- #99
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_libraryrule which requires linkopts -- #103
Misc
0.1.0
0.0.4
0.0.3
Incompatible Changes
linkoptsanddepsattributes incgo_librarywere renamed toclinkoptsandcdepsaccordingly.
Features
- Update Go version from 1.6 to 1.6.2
- Allow Go assembler sources as source files in
go_library,cgo_library,go_binaryandgo_test - Add
x_defsattribute togo_binary - Support building external repositories imported by
git_repositoryor other workspace rules