Skip to content

Commit

Permalink
bazel/website: Prefer gtar over tar to fix macos build (#2552)
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Northey <[email protected]>
  • Loading branch information
phlax authored Feb 4, 2025
1 parent 67e5954 commit 7da9e26
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions bazel/website/macros.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,22 @@ def static_website(
EXCLUDES="%s"
%s
tar "$${DECOMPRESS_ARGS}" -xf $$SOURCE
# prefer gtar over tar and unbreak macs
if command -v gtar >/dev/null 2>&1; then
TAR_COMMAND=$$(which gtar)
else
TAR_COMMAND=$$(which tar)
fi
$$TAR_COMMAND -xf $$SOURCE "$${DECOMPRESS_ARGS}"
while IFS= read -r CMD; do
$$CMD
done <<< "$$MAPPING"
$$GENERATOR "$$CONTENT"
tar cfh $@ $$EXCLUDES -C "$$OUTPUT" .
$$TAR_COMMAND cfh $@ $$EXCLUDES -C "$$OUTPUT" .
""" % (name_sources, decompressor_args, generator, content_path, output_path, mapping_commands, exclude_args, url),
outs = [name_website_tarball],
srcs = extra_srcs,
Expand Down

0 comments on commit 7da9e26

Please sign in to comment.