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

bsdtar is locale-sensitive #1018

Open
alexeagle opened this issue Dec 18, 2024 · 1 comment
Open

bsdtar is locale-sensitive #1018

alexeagle opened this issue Dec 18, 2024 · 1 comment

Comments

@alexeagle
Copy link
Collaborator

alexeagle commented Dec 18, 2024

Callers of libarchive's tar may get a locale from their system.

libarchive is sensitive to LC_ALL (https://github.com/libarchive/libarchive/blob/819a50a0436531276e388fc97eb0b1b61d2134a3/tar/bsdtar.c#L191) and we do enable the preprocessor directive in the BCR entry.

As an example of a problem this causes: Aspect customers have observed errors extracting NPM packages, but only locally on Mac or in a linux devbox but not on CI. See aspect-build/rules_js#2039

Currently users of the tar rule, as well as custom rules that use our tar toolchain, are subject to ambiguity:

  • if the action has use_default_shell_env=True then a setting like --action_env=LC_ALL=C will break ability to work with archives that contain unicode characters in some file path. the tar rule's action does not set that.
  • otherwise the result will depend on the users system, meaning it's not hermetic.

Perhaps we should document that all users of the tar toolchain hard-code a value like LC_ALL=C.UTF-8 and we should add that to the env of actions created by our tar rule?

@alexeagle alexeagle changed the title bsdtar is locale bsdtar is locale-sensitive Dec 18, 2024
@alexeagle
Copy link
Collaborator Author

@fmeum I'm sure you have informed guidance on what's the correct approach here.

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

No branches or pull requests

1 participant