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
14 changes: 13 additions & 1 deletion js/private/js_image_layer.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,10 @@ def _js_image_layer_impl(ctx):
args.add("--create")
args.add("--file")
args.add(output)
tar_lib.common.add_compression_args(compress, args)
if ctx.executable.compressor:
args.add_joined("--use-compress-program", [ctx.executable.compressor.path, ctx.attr.compressor_args], join_with = " ")
else:
tar_lib.common.add_compression_args(compress, args)
args.add(mtree, format = "@%s")

ctx.actions.run(
Expand All @@ -475,6 +478,7 @@ def _js_image_layer_impl(ctx):
),
arguments = [args],
executable = tarinfo.binary,
tools = [ctx.executable.compressor] if ctx.executable.compressor else [],
unused_inputs_list = unused_inputs,
env = tarinfo.default_env,
outputs = [output],
Expand Down Expand Up @@ -539,6 +543,14 @@ js_image_layer_lib = struct(
values = tar_lib.common.accepted_compression_types + ["none"],
default = "gzip",
),
"compressor": attr.label(
doc = "External tool which compresses each layer archive, e.g. `@pigz` for parallel gzip. Overrides bsdtar's built-in single-threaded compressor; `compression` still determines the output file extension.",
executable = True,
cfg = "exec",
),
"compressor_args": attr.string(
doc = "Arg list for `compressor`.",
),
"platform": attr.label(
doc = "Platform to transition.",
),
Expand Down
Loading