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
...
external/go_sdk/pkg/tool/linux_amd64/link: bazel-out/k8-fastbuild/bin/myapp/myapp.a: not package main
link: error running subcommand external/go_sdk/pkg/tool/linux_amd64/link: exit status 2
Target //myapp:myapp failed to build
...
The main.go Go source file is ignored due to the build constraint inside the file.
The Go library archive file is empty, which causes the failure during the binary link command.
The text was updated successfully, but these errors were encountered:
The environment variable `GOEXPERIMENT` must be defined at the execution
of the builder. Without that, the default build context `build.Default`
used in the builder to filter files using build constraints will not be
able to filter on a `goexperiment.x` build tag.
Fixes#3555
tingilee
pushed a commit
to tingilee/rules_go
that referenced
this issue
Jul 19, 2023
The environment variable `GOEXPERIMENT` must be defined at the execution
of the builder. Without that, the default build context `build.Default`
used in the builder to filter files using build constraints will not be
able to filter on a `goexperiment.x` build tag.
Fixesbazelbuild#3555
What version of rules_go are you using?
0.39.1
What version of gazelle are you using?
None
What version of Bazel are you using?
6.1.2
Does this issue reproduce with the latest releases of all the above?
Yes
What operating system and processor architecture are you using?
Linux
/amd64
Any other potentially useful information about your toolchain?
No
What did you do?
Build a go binary using a Go SDK with a experimental feature and using a Go source file with the related
goexperiment.x
build flag.Example with
boringcrypto
experimental feature:WORKSPACE
(but same issue with bzlmod):myapp/BUILD.bazel
myapp/main.go
Building
myapp
binary with this command below:What did you expect to see?
What did you see instead?
The
main.go
Go source file is ignored due to the build constraint inside the file.The Go library archive file is empty, which causes the failure during the binary link command.
The text was updated successfully, but these errors were encountered: