From 04707bd618c536d1fdecda2f354084eebd0b40d4 Mon Sep 17 00:00:00 2001 From: Lionel Fleury Date: Fri, 25 Apr 2025 12:45:13 +0200 Subject: [PATCH 1/2] Remove transition of crane & jq to target platforms - these binaries are run on an exec platform --- oci/private/push.bzl | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/oci/private/push.bzl b/oci/private/push.bzl index c2143a61..8695b6f1 100644 --- a/oci/private/push.bzl +++ b/oci/private/push.bzl @@ -140,23 +140,6 @@ multirun( [rules_multirun]: https://github.com/keith/rules_multirun """ -# Helper rule for ensuring that the crane and yq toolchains are actually -# resolved for the architecture we are targeting. -def _transition_to_target_impl(settings, _attr): - return { - # String conversion is needed to prevent a crash with Bazel 6.x. - "//command_line_option:extra_execution_platforms": [ - str(platform) - for platform in settings["//command_line_option:platforms"] - ], - } - -_transition_to_target = transition( - implementation = _transition_to_target_impl, - inputs = ["//command_line_option:platforms"], - outputs = ["//command_line_option:extra_execution_platforms"], -) - _attrs = { "image": attr.label( allow_single_file = True, @@ -188,7 +171,6 @@ _attrs = { default = "@bazel_tools//tools/allowlists/function_transition_allowlist", ), "_crane": attr.label( - cfg = _transition_to_target, default = "@oci_crane_toolchains//:current_toolchain", ), "_push_sh_tpl": attr.label( @@ -198,7 +180,6 @@ _attrs = { "_runfiles": attr.label(default = "@bazel_tools//tools/bash/runfiles"), "_windows_constraint": attr.label(default = "@platforms//os:windows"), "_jq": attr.label( - cfg = _transition_to_target, default = "@jq_toolchains//:resolved_toolchain", ), } From 0d64588507e369190219b2701c549092088edef0 Mon Sep 17 00:00:00 2001 From: Lionel Fleury Date: Mon, 6 Oct 2025 11:57:07 +0200 Subject: [PATCH 2/2] cfg --- oci/private/push.bzl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/oci/private/push.bzl b/oci/private/push.bzl index 8695b6f1..7d36b2dd 100644 --- a/oci/private/push.bzl +++ b/oci/private/push.bzl @@ -172,6 +172,7 @@ _attrs = { ), "_crane": attr.label( default = "@oci_crane_toolchains//:current_toolchain", + cfg = "exec", ), "_push_sh_tpl": attr.label( default = "push.sh.tpl", @@ -181,6 +182,7 @@ _attrs = { "_windows_constraint": attr.label(default = "@platforms//os:windows"), "_jq": attr.label( default = "@jq_toolchains//:resolved_toolchain", + cfg = "exec", ), }