From 6170438f303548743eff9c29bdbee0e28c74047c Mon Sep 17 00:00:00 2001 From: Nevena Kotlaja Date: Thu, 31 Aug 2023 16:18:36 +0200 Subject: [PATCH] Add toolchain param to the affected actions --- container/image.bzl | 2 ++ container/layer.bzl | 5 ++++- container/layer_tools.bzl | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/container/image.bzl b/container/image.bzl index bb27848d1..7a1905fa6 100644 --- a/container/image.bzl +++ b/container/image.bzl @@ -229,6 +229,7 @@ def _image_config( outputs = [config, manifest], use_default_shell_env = True, mnemonic = "ImageConfig", + toolchain = None, ) return config, _sha256(ctx, config), manifest, _sha256(ctx, manifest) @@ -259,6 +260,7 @@ def _assemble_image_digest(ctx, name, image, image_tarball, output_digest): arguments = [args], mnemonic = "ImageDigest", progress_message = "Extracting image digest of %s" % image_tarball.short_path, + toolchain = None, ) def _impl( diff --git a/container/layer.bzl b/container/layer.bzl index d7c1732dd..be9227f4c 100644 --- a/container/layer.bzl +++ b/container/layer.bzl @@ -100,12 +100,14 @@ def build_layer( the layer tar and its sha256 digest """ - toolchain_info = ctx.toolchains["@io_bazel_rules_docker//toolchains/docker:toolchain_type"].info + toolchain_type = "@io_bazel_rules_docker//toolchains/docker:toolchain_type" + toolchain_info = ctx.toolchains[toolchain_type].info layer = output_layer if toolchain_info.build_tar_target: build_layer_exec = toolchain_info.build_tar_target.files_to_run.executable else: build_layer_exec = ctx.executable.build_layer + toolchain_type = None args = ctx.actions.args() args.add(layer, format = "--output=%s") args.add(directory, format = "--directory=%s") @@ -168,6 +170,7 @@ def build_layer( outputs = [layer], use_default_shell_env = True, mnemonic = "ImageLayer", + toolchain = toolchain_type, ) return layer, _sha256(ctx, layer) diff --git a/container/layer_tools.bzl b/container/layer_tools.bzl index a15f94e61..7ad77e758 100644 --- a/container/layer_tools.bzl +++ b/container/layer_tools.bzl @@ -40,6 +40,7 @@ def _extract_layers(ctx, name, artifact): tools = [artifact], outputs = [config_file, manifest_file], mnemonic = "ExtractConfig", + toolchain = None, ) return { "config": config_file, @@ -199,6 +200,7 @@ def assemble( tools = inputs, outputs = [output], mnemonic = "JoinLayers", + toolchain = None, ) def incremental_load(