commit | 10587b1b819c8b1ae15d064a7bb3d2a7ac2149da | [log] [tgz] |
---|---|---|
author | Julio Merino <julio.merino+oss@snowflake.com> | Thu Mar 09 08:59:12 2023 -0800 |
committer | Copybara-Service <copybara-worker@google.com> | Thu Mar 09 09:00:24 2023 -0800 |
tree | 888bd963bd4c33221a4769cf2c6da84298e8b1ab | |
parent | daa3dbe22adb03338c75b53ea97954c9434099b4 [diff] |
Silence setlocale warnings in Java stub Since 17cfa015d73, the java_stub_template.txt file calls into the locale tool to check for the presence of cetain locales. These calls correctly send error messages to stderr. Unfortunately, *bash* itself is doing locale lookups as soon as it sees that the LANG or LC_* variables are touched, and this results in warnings that pollute the output. In our builds, the output is polluted with hundreds of warnings like these: ``` bazel-out/aarch64-opt-exec-CF41B97/bin/external/bfg/lang/java/src/main/java/com/google/devtools/build/bfg/JavaSourceFileParserCli: line 100: warning: setlocale: LC_CTYPE: cannot change locale (): No such file or directory bazel-out/aarch64-opt-exec-CF41B97/bin/external/bfg/lang/java/src/main/java/com/google/devtools/build/bfg/JavaSourceFileParserCli: line 102: warning: setlocale: LC_CTYPE: cannot change locale (): No such file or directory ``` There is nothing we can do to avoid these warnings. Trying to set the LANG or LC_* variables via --action_env and --host_action_env has no effect (other than trigger more/different warnings). The problem stems from https://bugzilla.redhat.com/show_bug.cgi?id=1361965, which has been fixed in various distros but hasn't made its way to the one we are currently using. Given that it's bash that is complaining, we can easily side-step this issue by patching the template and wrapping the problematic invocations behind "env". In this way, bash never gets to see the locale changes. This change does precisely this. Closes #17670. PiperOrigin-RevId: 515350095 Change-Id: I1887003802aa329e7fb96f644a2fba906daf5165
{Fast, Correct} - Choose two
Build and test software of any size, quickly and reliably.
Speed up your builds and tests: Bazel rebuilds only what is necessary. With advanced local and distributed caching, optimized dependency analysis and parallel execution, you get fast and incremental builds.
One tool, multiple languages: Build and test Java, C++, Android, iOS, Go, and a wide variety of other language platforms. Bazel runs on Windows, macOS, and Linux.
Scalable: Bazel helps you scale your organization, codebase, and continuous integration solution. It handles codebases of any size, in multiple repositories or a huge monorepo.
Extensible to your needs: Easily add support for new languages and platforms with Bazel's familiar extension language. Share and re-use language rules written by the growing Bazel community.
Follow our tutorials:
To report a security issue, please email security@bazel.build with a description of the issue, the steps you took to create the issue, affected versions, and, if known, mitigations for the issue. Our vulnerability management team will respond within 3 working days of your email. If the issue is confirmed as a vulnerability, we will open a Security Advisory. This project follows a 90 day disclosure timeline.
See CONTRIBUTING.md