-
Notifications
You must be signed in to change notification settings - Fork 652
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't use rules_go toolchain as toolchains
attribute in genrule
#2255
Comments
Could you explain more about the problem you're trying to solve? The example you gave reproduces the error, but I don't understand why you'd want to use a Go toolchain in a This is the first time I've heard of the
The Go toolchain does not provide any variables like this. I guess |
Sure, I'm trying to build a go-plugin based on some C++ libraries (using SWIG). I also build some C++ libraries as part of that, and after the C++ libraries are built, I want to use the same I need to use the same |
The actual genrule looks something like this:
and in the
|
I can't speak for building C/C++, but running For building a plugin, your best option is likely Writing a custom rule that uses the toolchain API directly is also an option. I'd still advise against using |
I'm using swig to make go talk to C++ classes, and unfortunately I'll try writing a custom rule and using the toolchain API. |
Allows developers to build their own local convenience scripts around `go`, e.g. to run `go mod tidy` backed by a hermetic Go toolchain. This requires getting rid of the `env` attribute as it is not evaluated if the binary is run as a dependency of another target. Since `//go` select a Go SDK suitable for the host, not the exec platform, we forbid its use in the exec configuration. As remarked in bazelbuild#2255, using raw `go` in a genrule is not a good idea to start with.
Allows developers to build their own local convenience scripts around `go`, e.g. to run `go mod tidy` backed by a hermetic Go toolchain. This requires getting rid of the `env` attribute as it is not evaluated if the binary is run as a dependency of another target. Since `//go` select a Go SDK suitable for the host, not the exec platform, we forbid its use in the exec configuration. As remarked in bazelbuild#2255, using raw `go` in a genrule is not a good idea to start with.
Allows developers to build their own local convenience scripts around `go`, e.g. to run `go mod tidy` backed by a hermetic Go toolchain. This requires getting rid of the `env` attribute as it is not evaluated if the binary is run as a dependency of another target. Since `//go` select a Go SDK suitable for the host, not the exec platform, we forbid its use in the exec configuration. As remarked in bazelbuild#2255, using raw `go` in a genrule is not a good idea to start with.
Allows developers to build their own local convenience scripts around `go`, e.g. to run `go mod tidy` backed by a hermetic Go toolchain. This requires getting rid of the `env` attribute as it is not evaluated if the binary is run as a dependency of another target. Since `//go` select a Go SDK suitable for the host, not the exec platform, we forbid its use in the exec configuration. As remarked in bazelbuild#2255, using raw `go` in a genrule is not a good idea to start with.
Allows developers to build their own local convenience scripts around `go`, e.g. to run `go mod tidy` backed by a hermetic Go toolchain. This requires getting rid of the `env` attribute as it is not evaluated if the binary is run as a dependency of another target. Since `//go` select a Go SDK suitable for the host, not the exec platform, we forbid its use in the exec configuration. As remarked in bazelbuild#2255, using raw `go` in a genrule is not a good idea to start with.
Allows developers to build their own local convenience scripts around `go`, e.g. to run `go mod tidy` backed by a hermetic Go toolchain. This requires getting rid of the `env` attribute as it is not evaluated if the binary is run as a dependency of another target. Since `//go` select a Go SDK suitable for the host, not the exec platform, we forbid its use in the exec configuration. As remarked in bazelbuild#2255, using raw `go` in a genrule is not a good idea to start with.
Allows developers to build their own local convenience scripts around `go`, e.g. to run `go mod tidy` backed by a hermetic Go toolchain. This requires getting rid of the `env` attribute as it is not evaluated if the binary is run as a dependency of another target. Since `//go` selects a Go SDK suitable for the host, not the exec platform, we forbid its use in the exec or host configuration. As remarked in #2255, using raw `go` in a genrule is not a good idea to start with.
Allows developers to build their own local convenience scripts around `go`, e.g. to run `go mod tidy` backed by a hermetic Go toolchain. This requires getting rid of the `env` attribute as it is not evaluated if the binary is run as a dependency of another target. Since `//go` selects a Go SDK suitable for the host, not the exec platform, we forbid its use in the exec or host configuration. As remarked in bazelbuild#2255, using raw `go` in a genrule is not a good idea to start with.
What version of rules_go are you using?
0.20.1
What version of gazelle are you using?
0.17.0
What version of Bazel are you using?
1.1.0
Does this issue reproduce with the latest releases of all the above?
Yes
What operating system and processor architecture are you using?
Linux x86_64
Any other potentially useful information about your toolchain?
None
What did you do?
I have a genrule like:
What did you expect to see?
That this toolchain is successfully provided to the execution of the genrule.
What did you see instead?
The text was updated successfully, but these errors were encountered: