Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 2 additions & 19 deletions oci/private/push.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -188,8 +171,8 @@ _attrs = {
default = "@bazel_tools//tools/allowlists/function_transition_allowlist",
),
"_crane": attr.label(
cfg = _transition_to_target,
default = "@oci_crane_toolchains//:current_toolchain",
cfg = "exec",
),
"_push_sh_tpl": attr.label(
default = "push.sh.tpl",
Expand All @@ -198,8 +181,8 @@ _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",
cfg = "exec",
),
}

Expand Down