Age | Commit message (Collapse) | Author |
|
This PR prepares a minor release to allow downstream users to begin integrating with https://github.com/bazelbuild/rules_go/pull/3919
|
|
go_tool_binary() is completely oblivious of toolchains. The reason being
that Go toolchains actually depend on their output. Adding a toolchain
dependency would thus add a cyclic dependency. This is problematic,
because it means that the actions with mnemonic GoToolchainBinaryBuild
end up getting scheduled on arbitrary workers.
Address this by adding exec_compatible_with to the locations where
go_tool_binary() is instantiated, namely the auto-generated BUILD files
that are part of Go SDKs.
Fixes: #3942
|
|
* Add support for `--incompatible_enable_proto_toolchain_resolution`
* Do not use dict union
* Fix visibility
* Fix buildifier finding
* Add proto deps to tests
* Attempt to fix integration tests
* MOre fixes
* Add test deps
* Fix test sources
* Remove unused load
* Fix tests and update to rules_proto 6.0.0
* Add back WORKSPACE deps
|
|
This gives us a determinstic location to ignore for goleak, which we
previously had, but was removed as part of #3920.
|
|
The community has agreed[1] that "pure" builds of Go code should
use the `purego` build tag.
This change adds that de-facto tag.
The minimum version of Gazelle is bumped to `0.36.0` which includes a patch[2]
for ignoring the `purego` tag so that the source flies are passed to the
compiler for conditional compilation decisions.
[1]: https://github.com/golang/go/issues/23172
[2]: https://github.com/bazelbuild/bazel-gazelle/pull/1767
|
|
Docs for https://github.com/bazelbuild/bazel-gazelle/pull/1731
|
|
Closes #3935
|
|
Update docs to cover new capabilities added by: https://github.com/bazelbuild/bazel-gazelle/pull/1776
|
|
Prepare a patch release to include: 54c451550c520d4a26f491fa5f52a97b2dcfa0d7
|
|
* feat: support syso files in srcs.
This change adds support for including .syso files in srcs, which
enables embedding version and icon info into windows executables.
Fixes #2757
* go:generate doesnt work with empty go.mod
* remove test, combine syso and o file addToArchive, update comments
* update docs
|
|
In https://github.com/bazelbuild/rules_go/pull/3920, a new mechanism to
handle test timeout was introduced. However this broke existing tests
that use SIGTERM inside.
Restore the original behavior.
|
|
This PR prepares the `rules_go` release `v0.47.0`. A few tests are no longer applicable in the `x/tools` repo.
|
|
|
|
|
|
I'm running into an issue where data dependencies of C/C++ libraries
don't end up being placed in the input roots of Go based tests that
depend on these libraries via cgo. It turns out that this is caused by
emit_archive() not properly merging runfiles from all GoArchive
dependencies.
I tried to make a small reproduction case of this under tests/core/cgo,
but for the life of me I can't seem to reproduce this. Maybe this can
only be observed when cross compiling or using custom C++ toolchains?
|
|
|
|
|
|
|
|
* Add //go/private:polyfill_bazel_features.bzl to sources.
* Fix format
|
|
|
|
|
|
|
|
The to_json and to_proto methods on struct are deprecated and will be
removed. The "json" and "proto" builtin modules should be used instead.
This replaces instances of `foo.to_json()` with `json.encode(foo)`.
|
|
This reverts commit 55ea579a70958d66f24a907433978b21edd36b29.
|
|
Fixes #3889
|
|
|
|
* gopackagesdriver: move and simplify test
Moved //tests/integration/gopackagesdriver:gopackagesdriver_test
to //go/tools/gopackagesdriver:gopackagesdriver_test.
Previously the test invoked gopackagesdriver with 'bazel run'
in a temporary workspace, which forced Bazel to build it, slowing
down the test significantly, especially on Windows. Now, the test
embeds the gopackagesdriver library and invokes it directly.
The driver still runs in a temporary workspace and still needs to
invoke bazel, so the test is still slow, but it's faster than before.
Also, a number of other improvements:
- gopackagesdriver now sets --consistent_labels if the bazel version
is 6.4.0 or later instead of guessing based on the link-stamped
rules_go repo name.
- bazel_testing.BazelCmd now writes --output_user_root to a .bazelrc
file instead of passing it to commands. gopackagesdriver invokes
bazel directly, so this lets it use the same output root.
* restore output directory path
* fix review comment
|
|
Fixes https://github.com/bazelbuild/rules_go/issues/3884
|
|
|
|
|
|
* Bump Go version to 1.21.8
* Update WORKSPACE
|
|
|
|
* Remove Latin-1 workaround on Bazel 6.4.0+
The fix for Latin-1 encoded files was landed in [6.4.0] after
being landed on Bazel [master].
We can conditionally use the old, unhermetic, `tar` workaround
on modern Bazel versions.
[master]: https://github.com/bazelbuild/bazel/pull/18448
[6.4.0]: https://github.com/bazelbuild/bazel/pull/19765
* Use `versions` rather than `bazel_features` to avoid circular load pattern
Due to the polyfilling of `bazel_features` to avoid double step loading in
`WORKSPACE`.
|
|
|
|
|
|
See https://github.com/bazelbuild/bazel/issues/14444#issuecomment-1945642624.
|
|
|
|
|
|
Newly required by BCR policies.
|
|
|
|
* nogo: Create a go_register_nogo wrapper for WORKSPACE users.
Currently, workspace users register nogo targets by abusing the
go_register_toolchain() function, which calls go_register_nogo().
Instead, we should expose go_register_nogo to workspace users directly.
This will allow workspace users and bzlmod users to use the same
underlying code because go_register_nogo allows users to specify
includes and excludes which you currently can't do with WORKSPACE.
Add a test to verify this functionality works in WORKSPACE too.
* Exclude running on bazel 5.4.0
|
|
In go1.19 through go1.22-devel (as of golang/go@6382893) a series of
changes were made to the way assembly files' symabis are produced.
https://go-review.googlesource.com/c/go/+/523337
Most significantly, the packagename now must be passed to the assembler
via the -p flag, even when generating only the symabis. The go build
system does this, but Bazel Go rules have not, and this finally breaks
in go1.22-devel as the compatibility code is removed.
Without specifying -p to the assembler, the output symabis file will
contain something like:
```
def <unlinkable>.s2Decode ABI0
```
instead of
```
def github.com/klauspost/compress/s2.s2Decode ABI0
```
The result is that the compiler will default to using ABIInternal
instead of ABI0 if it cannot resolve a match in symabis, which will
cause a link failure:
```
Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
github.com/klauspost/compress/s2.Decode: relocation target github.com/klauspost/compress/s2.s2Decode not defined for ABIInternal (but is defined for ABI0)
link: error running subcommand external/go_sdk/pkg/tool/darwin_arm64/link: exit status 2
```
We conservatively only do this for go minor releases later than 1.21.
|
|
* go_test: ensure external source compilation has data
go_test is split into 2 compilation actions, one for internal test,
where package name of the test is the same with library package.
```bash
package foo
package foo
```
and external test where the package name is different.
```bash
package foo
package foo_test
```
Ensure that the compilation for external test has access to go_test's
data attribute.
* add test
|
|
* Use `-linkobj` to directly generate `.x` and `.a`
* Extract nogo facts into a separate file
* Address review comments
|
|
* Update outdated URLs for AMD64 microarchitecture levels
* GOARM constraint definitions
* Populate GOARM from context data
|
|
This includes various bug fixes from 0.45.0 and fixes the BCR publishing. In the interest of compatibility we are not upgrading any dependencies for this release.
|
|
* Fix regression in empty `.go` file filtering for nogo
6236dd80670cdfe1477a484e98e3f82dbcc28fe9 regressed the nogo exclusion
logic for the empty `.go` file generated for targets that otherwise
don't contain any `.go` files. The test had been silently disabled a
while ago when the name pattern for the empty file was changed.
This is fixed by reintroducing the exclusion logic and making the test
more strict.
* Update go/tools/builders/compilepkg.go
Co-authored-by: Tyler French <66684063+tyler-french@users.noreply.github.com>
---------
Co-authored-by: Tyler French <66684063+tyler-french@users.noreply.github.com>
|
|
|
|
`go_*` rules do not emit the module map files required for
`layering_check`.
|
|
|