You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This happens because //:go_context_data has a dependency on //:cgo_context_data. There are two other places where this same cgo dependency enters //:stdlib and //:cgo_context_data_proxy.
**What type of PR is this?**
> Feature
**What does this PR do? Why is it needed?**
//:cgo_context_data is in the dependency closure of pure go_binary
targets. This PR adds a config_setting to detect when //go/config:pure
is set to True and updates the places where //:cgo_context_data is
selected.
**Which issues(s) does this PR fix?**
Fixes#4145
**Other notes for review**
No breaking tests have been added, but the functionality can be seen on
the pure targets in the test folder. e.g.
```
bazel cquery "somepath(//tests/core/go_binary:static_pure_bin, //:cgo_context_data)"
INFO: Analyzed 2 targets (0 packages loaded, 0 targets configured).
INFO: Found 2 targets...
INFO: Empty query results
INFO: Elapsed time: 0.097s, Critical Path: 0.00s
INFO: 0 processes.
INFO: Build completed successfully, 0 total actions
```
---------
Co-authored-by: Connor McEntee <[email protected]>
What version of rules_go are you using?
v0.50.1
What version of Bazel are you using?
7.3.2
Does this issue reproduce with the latest releases of all the above?
Yes
What operating system and processor architecture are you using?
PopOS 22.04
What did you do?
go_binary targets with pure = "on" still participate in cc toolchain selection. This can be seen in one of the examples in the repo:
This happens because //:go_context_data has a dependency on //:cgo_context_data. There are two other places where this same cgo dependency enters //:stdlib and //:cgo_context_data_proxy.
What did you expect to see?
Only the go SDK should be selected
The text was updated successfully, but these errors were encountered: