Skip to content

Commit

Permalink
Automated rollback of commit d2f1971.
Browse files Browse the repository at this point in the history
*** Reason for rollback ***

This regressed support for non-ASCII characters in paths on systems that don't support C.UTF-8, see b/372094587

*** Original change description ***

Use `C.UTF-8` instead of `en_US.UTF-8` locale for Java compilation

`C.UTF-8` is now the universally accepted standard UTF-8 locale, to the point where some minimal distributions no longer ship with `en_US.UTF-8` (e.g. RHEL 9 with `glibc-minimal`). CentOS 7, the only major distribution that doesn't have the locale, is EOL now.

Note that the locale can't be detected automatically since the action may run on a machine that isn't the host....

***

PiperOrigin-RevId: 683672854
Change-Id: I6c1d4fe43066c068db345987f54388c6fcdd0539
  • Loading branch information
cushon authored and copybara-github committed Oct 8, 2024
1 parent 233a29c commit a3b8e31
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public final class JavaCompileActionBuilder {

/** Environment variable that sets the UTF-8 charset. */
static final ImmutableMap<String, String> UTF8_ENVIRONMENT =
ImmutableMap.of("LC_CTYPE", "C.UTF-8");
ImmutableMap.of("LC_CTYPE", "en_US.UTF-8");

static final String MNEMONIC = "Javac";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ public void testLocale() throws Exception {
""");
JavaCompileAction action =
(JavaCompileAction) getGeneratingActionForLabel("//java/com/google/test:liba.jar");
assertThat(action.getIncompleteEnvironmentForTesting()).containsEntry("LC_CTYPE", "C.UTF-8");
assertThat(action.getIncompleteEnvironmentForTesting())
.containsEntry("LC_CTYPE", "en_US.UTF-8");
}

@Test
Expand Down

0 comments on commit a3b8e31

Please sign in to comment.