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
It is of my understanding that adding linkmode = "c-shared" creates an additional .so and _cgo_install.h file. So then I have a genrule that consumes this .h file:
I expected to be able to run the genrule above, and rename the header file
What did you see instead?
When the --spawn_strategy is local, the outputs of //path/to/target:target are correctly produced: a .so and _cgo_install.h. However, when using --spawn_strategy=processwrapper-sandbox or remote execution, only the .so shows up as an output of //path/to/target:target, and header file is missing, causing the genrule to fail with file not found.
Could it be due to the header file not being part of the outputs of the go_binary rule? Not sure how to proceed here
The text was updated successfully, but these errors were encountered:
The header file should be part of the CcInfo provider returned by the go_binary target. You can inspect it with bazel cquery --output=starlark --starlark:expr='providers(target)' //:target.
The header file is not a standard "file to build" that you could access via a regular genrule. What do you want to do with the file?
What version of rules_go are you using?
0.40.1
What version of gazelle are you using?
0.28.0
What version of Bazel are you using?
7.2.1
Does this issue reproduce with the latest releases of all the above?
Yes (with version 0.49.0 of rules_go and version 0.37.0 of gazelle)
What operating system and processor architecture are you using?
Linux, x86_64
Any other potentially useful information about your toolchain?
Also reproduced the error with remote execution.
What did you do?
I have the following bazel targets:
It is of my understanding that adding
linkmode = "c-shared"
creates an additional .so and _cgo_install.h file. So then I have a genrule that consumes this .h file:What did you expect to see?
I expected to be able to run the genrule above, and rename the header file
What did you see instead?
When the --spawn_strategy is local, the outputs of //path/to/target:target are correctly produced: a .so and _cgo_install.h. However, when using --spawn_strategy=processwrapper-sandbox or remote execution, only the .so shows up as an output of //path/to/target:target, and header file is missing, causing the genrule to fail with file not found.
Could it be due to the header file not being part of the outputs of the go_binary rule? Not sure how to proceed here
The text was updated successfully, but these errors were encountered: