-
Notifications
You must be signed in to change notification settings - Fork 377
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Hermeticity issue with libarchive depending on LANG environment variable #2256
Comments
It seems to me that this is a runtime issue, not a build-time issue. Does this behaviour differ if compiled without bazel? It seems like reading the
A configuration option would probably be good to change this behaviour though! |
I think reading |
Yea that's completely understandable especially if you're using it as a tool in a bazel rule. I do wonder would setting the |
Ah, I just ran across this as well downstream in bazel-lib where we have the |
@fmeum said on the linked slack thread
@zaucy do you happen to know whether that's possible? I'm looking at |
maaaaybe setting But that would just remove the |
That should work: The default locale of a C program is |
Ah, nvm, forcing the C locale could be a problem if it ends up disallowing UTF-8 characters in filenames. In that case forcing |
`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
What happened?
There is a problem where the tar binary from libarchive is behaving non-hermetically as it depends on the system's LANG environment variable. Maybe we could patch it to hard-code something like
en_US.UTF-8
?This problem appeared as tar was failing for me when coming across UTF-8 characters in filenames, until I set LANG to
en_US.UTF-8
.Full context of issue on bazel slack.
Version
Development (host) and target OS/architectures:
macOS Sonoma 14.5
Output of
bazel --version
:bazel 7.2.0
How to reproduce
Use the tar toolchain to extract an archive containing files which have utf8 characters in their names, making sure that LANG is not set. This should fail to extract (for me just outputting
tar: (null)
as an error message).Set LANG to a UTF-8 locale and it should work.
The text was updated successfully, but these errors were encountered: