-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Non-ascii filenames cause InvalidPathException
in java_test
#15106
Comments
InvalidPathException
in java_testInvalidPathException
in java_test
I don't see any For now I'll assume this is problem with underlying filesystem/OS, unless I'm missing something. |
It's not thrown from Bazel, it's thrown from the JVM that Bazel launches as part of the test, so there is no Bazel code running in that Java application. I think that, due to the environment defined by Bazel or sandboxing or something else, the JVM believes that the filesystem does not support unicode paths on linux - which it does. It seems like surprising behavior to me, as the JVM on linux usually has no problem dealing with unicode paths. |
If that's the case, further investigation is welcome and even a fix. |
In SystemProps, the value of On Linux, the JVM parses the current locale to determine the value of
In general, test actions on Linux would probably have to either inherit @comius Do you have a preference how to deal with this host-dependent configuration? |
Setting The former is slightly better because you can set a fixed value. |
It seems that the environment Bazel executes the JVM in on Linux does not allow for non-ascii filenames.
Example:
Test.java:
BUILD:
Executing this (on Linux):
Fails with this:
This issue seems to only happen on Linux (but I've only tried Ubuntu 20.04.3 LTS). On Mac, it works without issues. I have not tried on Windows.
Bazel version:
I have found some issues of people getting
InvalidPathException
, but they seem to be exceptions in Bazel itself. This is an exception from the application being tested instead.I have also tried setting
LANG
via--test_env
and--action_env
, and setting thesun.jnu.encoding
andfile.encoding
JVM parameters, but to no avail.The text was updated successfully, but these errors were encountered: