-
-
Notifications
You must be signed in to change notification settings - Fork 661
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
Multiple go versions, toolchains from go_sdk #2527
Comments
You can have multiple Even if that constraint setting were defined, I don't think it would solve your problem. You'd only be able to build for one Go version at a time. It might be possible to build for multiple platforms selecting multiple toolchains, but it would be difficult to arrange, and I'm not sure that Bazel supports it very well yet. What is blocking you from building all targets with Go 1.14? That would be a much, much easier approach. |
Thanks for your response! I did try to get everything building with 1.14, but unfortunately I wasnt able to get rules_go to select that version by default, I tried the following configurations (using rules_go version 0.22.3):
This configuration causes 1.13.x to be loaded (from what i can tell it should check for the existence of a go_sdk rule and use that instead of the default)
also
this sadly errors with |
You should be able to download a 1.14 release without setting the
That said, setting For |
Hiya, thanks for confirming the behaviour - I guess its something funky with our setup. Thanks again 👍 |
One case where this would be useful is in large monorepos, where it's risky to upgrade all services at once. I think instead of modeling different versions of |
@bartle-stripe I'm not sure what you mean here. A toolchain in Bazel is pretty abstract: it's something that provides an object that rules requesting a toolchain of that type know how to use. Generally it provides dependencies (toolchain binaries, standard library) and functions for creating actions. Toolchains are automatically selected based on compatibility constraints they declare and constraints of the target platform. In theory, you could define a toolchain which is the union of several Go distributions. You could define a new build setting for the Go version, and make the toolchain functions provide different sets of files based on that setting. Is this what you mean? I think this would be very difficult to implement. |
Yeah, that's what I was thinking. |
What version of rules_go are you using?
0.19.5, but this can be reproduced with the latest
What version of gazelle are you using?
0.18.2
What version of Bazel are you using?
2.2.0
Does this issue reproduce with the latest releases of all the above?
Appears too yes, although i didnt test with gazelle, only rules_go
What operating system and processor architecture are you using?
linux/amd64
Any other potentially useful information about your toolchain?
What did you do?
Seperately, I did also attempt the following:
Unfortunately, that also resulted in the same error :(
What did you expect to see?
Id like to have multiple versions of go_sdk in my project, (we've got some targets that need 1.14, and some that use 1.13)
Id expect using a toolchain provided by a go_sdk rule to work with a go_binary rule.
What did you see instead?
Spooky errors, even when using the default toolchain
Appreciate this could also be a misunderstanding from my part, this is my first real foray into toolchains, but given the documentation I could find; my approach seems ok?
Thanks!
The text was updated successfully, but these errors were encountered: