Skip to content
This repository has been archived by the owner on Oct 2, 2023. It is now read-only.

Add toolchain param to the affected actions #2271

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions container/image.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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(
Expand Down
5 changes: 4 additions & 1 deletion container/layer.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -168,6 +170,7 @@ def build_layer(
outputs = [layer],
use_default_shell_env = True,
mnemonic = "ImageLayer",
toolchain = toolchain_type,
)
return layer, _sha256(ctx, layer)

Expand Down
2 changes: 2 additions & 0 deletions container/layer_tools.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -199,6 +200,7 @@ def assemble(
tools = inputs,
outputs = [output],
mnemonic = "JoinLayers",
toolchain = None,
)

def incremental_load(
Expand Down