-
-
Notifications
You must be signed in to change notification settings - Fork 668
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
Allow setting pure, static, etc. in go_cross_binary rule #4131
Comments
Could you try whether you can get the basename you want by using a name such as I have the feeling that |
We use platform_transition_filegroup on go_binary to build multi arch OCI image index, exactly as you describe. I think go_cross_binary is not needed |
@fmeum it looks like using a name like @dzbarsky can you give an example of how |
but I do have a fear that the behavior of naming it |
We do this:
BUILD usage:
So with this setup you can either tag
|
What version of rules_go are you using?
0.50.1
What version of gazelle are you using?
0.39.0
What version of Bazel are you using?
7.3.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?
What did you do?
We currently cross build docker image for linux/amd64 by passing in the follow args to the command line:
Because of bazel-contrib/rules_oci#706, and also just that passing in platform args to the command line is just brittle, we are moving away to use
go_cross_binary
to cross build.Basically we now have
BUILD.bazel
like this:Since we use distroless, pure mode is very important for us (without it we would have to use the version of distroless with libc instead), but it's not currently allowed on
go_cross_binary
, so we have to set it ongo_binary
instead. It would be great if we can set it ongo_cross_binary
.Additionally (this could be its own issue), it would be great if we can have an alias/rename attribute allowed in
go_cross_binary
rule. Currently the binary name always come from the rule name, and since we are not allowed to have duplicate rule names, we cannot use it to generate same binary name with different platform cross binary rules (for example, to build multi-arch oci image). Basically ideally we could be able to do something like this instead:What did you expect to see?
What did you see instead?
The text was updated successfully, but these errors were encountered: