-
-
Notifications
You must be signed in to change notification settings - Fork 165
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
oci_push rule fails on osx when pushing a linux image #706
Comments
We are seeing the same issue. I think maybe there's a better way to cross-build container image for linux-amd64 on other host platforms than adding @codesuki can you describe more about how the transition solution works? |
Reading all these issues it certainly feels like the underlying issues are not resolved even with that transition. Anyhow, for why the transition broke for me with Bazel 7 was the change I linked to above. The transition code in rules_oci adds the |
Having the exact same problem when wanting to build a linux/amd64 container on a darwin/arm64 machine. I think this is a bug because binaries for |
It also happens when trying to push linux/arm64 images from a linux/amd64 host. |
FWIW, @codesuki's patch fixes it for me (with Bazel 7.3.2), so thanks a lot for that! However, reverting #590 fixes it as well without requiring |
Ok this sounds like something that's trivial to add a unit test for then, and validate that things work as expected. Cross compiling from darwin is not so trivial as it requires darwin based runners |
I think i'll defer to @EdSchouten |
I was able to update the go example from aspect to newer versions of all the rules, and didn't fail in the attempt, so I think this issue is resolved aspect-build/bazel-examples#377, it's not merged yet, but I tested in our perl images and it worked |
While adding support for oci_image to rules_k8s I ran into the following issue.
I am pushing an image with
--platforms=@io_bazel_rules_go//go/toolchain:linux_amd64
from my local osx machine and get the following errorSome investigation showed that I should set
--extra_execution_platforms=@platforms//host
, but this fails with the same error.Investigating some more I found bazelbuild/bazel#19645 and https://github.com/bazel-contrib/rules_oci/blob/main/oci/private/push.bzl#L142-L155.
Together with the the fact that I am using Bazel 7.x and this commit bazelbuild/bazel@c602cec
I figured I can make it work with the snippet below. Instead of overwriting
extra_execution_platforms
, we preserve previous contents.I am not sure if this is the 'real' fix, but if it were then it would at least need a check for the Bazel version to do the right thing.
The text was updated successfully, but these errors were encountered: