Skip to content

Commit

Permalink
fix(tar): allow --action_env to override LC_ALL
Browse files Browse the repository at this point in the history
`bsdtar` will fail to extract archives with unicode characters in a filename, on systems where the default locale is `C` or some non-UTF value.

Users encounter this as strange extract failures, but only on a subset of the systems they work on; this is non-hermetic behavior.

Workaround bazelbuild/bazel-central-registry#2256
  • Loading branch information
alexeagle authored Dec 19, 2024
1 parent d042d56 commit 1e4b065
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/private/tar.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,10 @@ def _tar_impl(ctx):
mnemonic = "Tar",
unused_inputs_list = unused_inputs_file,
toolchain = "@aspect_bazel_lib//lib:tar_toolchain_type",
# Allow users to set --action_env=LC_ALL=C.UTF-8 for example,
# on systems where default locale is wrong.
# See https://github.com/bazelbuild/bazel-central-registry/issues/2256
use_default_shell_env = True,
)

# TODO(3.0): Always return a list of providers.
Expand Down

0 comments on commit 1e4b065

Please sign in to comment.