Skip to content
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

fix(tar): allow --action_env to override LC_ALL #1019

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

alexeagle
Copy link
Collaborator

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

`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
@alexeagle alexeagle requested a review from fmeum December 19, 2024 15:54
@fmeum
Copy link
Member

fmeum commented Dec 19, 2024

I think that the default locale with no env vars set is always C on Linux and that's what happens in the sandbox, so I expect this problem to be rather common.

For Bazel's Java rules, I've been setting LC_CTYPE explicitly: bazelbuild/rules_java@c22454f

@fmeum
Copy link
Member

fmeum commented Dec 19, 2024

Since --action_env requires explicit configuration and makes it more easy to screw up cache performance, I would prefer a more explicit fix if we can find one.

@alexeagle
Copy link
Collaborator Author

I'm not certain we should merge this; created it mostly as the alternative to discuss. Feels to me that we should have global guidance across the whole Bazel ecosystem about whether system locale is a hermeticity failure, and we should be forcing a locale globally.

See https://github.com/google/copybara/blob/master/.bazelrc#L3-L10 as one example I've noticed

@alexeagle
Copy link
Collaborator Author

Yeah your Java example is like what I did with aspect-build/rules_js#2044 - the hard thing for me is how hopeless the project of finding every action that needs an env set

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants