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

Commit

Permalink
Add toolchain param to the affected actions
Browse files Browse the repository at this point in the history
  • Loading branch information
kotlaja committed Aug 31, 2023
1 parent 8e70c6b commit 6170438
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
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

0 comments on commit 6170438

Please sign in to comment.