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
I expected to be able to run both binary targets (bazel run //:library_bin and bazel run //:library_local_bin).
What did you see instead?
bazel run //:library_local_bin now fails with getName is not defined, because defaults_local.go has been removed from the dependencies.
If I configure gazelle to use -gotags=local for all targets, then the other target breaks, since defaults_not_local.go is now excluded.
Given this is a common pattern, it would be good to have a way of disabling the gotags filtering behaviour, so I can include both sources in the target definition, but switch between them at go_binary build time. Alternatively, Gazelle would need a way of generating two libraries, one with the build tag and one without it.
The text was updated successfully, but these errors were encountered:
What version of gazelle are you using?
v0.28.0
What version of rules_go are you using?
v0.37.0
What version of Bazel are you using?
5.4.0
Does this issue reproduce with the latest releases of all the above?
Yes
What operating system and processor architecture are you using?
Ubuntu 22.04.1 LTS
What did you do?
As of #1243, the latest version of Gazelle automatically filers out files without
gotags
set. This means that one of my libraries has gone from:to
The contents of
defaults_local.go
is:And the contents of
defaults_not_local.go
is:This library is then used to build two
go_binary
targets:What did you expect to see?
I expected to be able to run both binary targets (
bazel run //:library_bin
andbazel run //:library_local_bin
).What did you see instead?
bazel run //:library_local_bin
now fails withgetName is not defined
, becausedefaults_local.go
has been removed from the dependencies.If I configure gazelle to use
-gotags=local
for all targets, then the other target breaks, sincedefaults_not_local.go
is now excluded.Given this is a common pattern, it would be good to have a way of disabling the
gotags
filtering behaviour, so I can include both sources in the target definition, but switch between them atgo_binary
build time. Alternatively, Gazelle would need a way of generating two libraries, one with the build tag and one without it.The text was updated successfully, but these errors were encountered: