Set LC_CTYPE=C.UTF-8 in the default action env#25801
Set LC_CTYPE=C.UTF-8 in the default action env#25801fmeum wants to merge 7 commits intobazelbuild:masterfrom
LC_CTYPE=C.UTF-8 in the default action env#25801Conversation
| // Signal Unicode support to locale-aware tools. A samdboxed environment | ||
| // without any locale variable set would typically be interpreted as an | ||
| // ASCII-only setup, which may not support special characters in filenames. | ||
| env.put("LC_CTYPE", "C.UTF-8"); |
There was a problem hiding this comment.
Idle thought: since we're setting LC_CTYPE here, should we also have set it instead of the broader LC_ALL in #26279? (OTOH, it's unclear to me that the other LC_* affect the JVM in any way that matters to us.)
There was a problem hiding this comment.
That would have made a difference if we didn't have #17702, I think.
src/main/java/com/google/devtools/build/lib/bazel/rules/BazelRuleClassProvider.java
Outdated
Show resolved
Hide resolved
…uleClassProvider.java
|
https://bazelbuild.slack.com/archives/CD3QY5C2X/p1752873180194609 has made me slightly concerned about this change, but I still think it's a net positive: Bazel power users that already use RBE and keep their macOS versions downgraded presumably will be able to figure out that they might need to set |
|
Do we still want to do this? |
|
Yes, I think that it's the better default despite the concern I mentioned above. It makes sense to get the local build experience on a regular up-to-date macOS device right by default and ask more experienced users with specific macOS version requirements to potentially tweak a setting. @meisterT Could you take over the review? |
|
@meisterT friendly ping |
RELNOTES[INC]: The environment variable
LC_CTYPEnow defaults toC.UTF-8for actions that setuse_default_shell_env = True, which results in a Unicode-aware locale on most Linux distributions, with MSYS2 as well as macOS 15.4 and higher. Pass--action_env==LC_CTYPE(note the two=s) to explicitly unset this variable, which restores the previous behavior. On older versions of macOS, you can set--action_env=LC_CTYPE=UTF-8instead.