-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Cannot resolve FileSystem root resource in Native Image #5020
Comments
Since you have permission, could you assign this issue to me? (and close #1108) |
@jovanstevanovic Sorry I don't have permission on this repository. I think the labels were added automatically by the GitHub issue template. |
I've updated my sample with a different yet related problem - how slashes are dealt with when walking the filesystem. I can create a different issue for this if you think this is a different problem; I'm not just familiar with this area, see this section. |
@bclozel, doesn't it also fail if you run your example with I believe the issue is that For example, when using the OS file system on a Mac, you can supply a trailing slash ( So it appears to be twofold:
|
@sbrannen No it doesn't fail in my sample
It also works with the following:
Maybe this is something related to how the API is being used in Framework vs. in my sample? |
OK. Thanks for checking. I'll get back to you if I come up with anything else definitive. |
If you get a
Whereas, a |
The fix for root path resolution is on the merge queue. Regarding trailing slashes and empty strings, I would suggest not merging them as a part of this issue, so please derivate all edge cases in separate GH issue(s), and I'll take a look afterward. @sbrannen What is the output (return value) in OS |
System.out.println("FileSystems.getDefault().getPath(\"\"): [%s]".formatted(FileSystems.getDefault().getPath("")));
System.out.println("FileSystems.getDefault().getPath(\"\").resolve(\"test\"): [%s]".formatted(FileSystems.getDefault().getPath("").resolve("test"))); Prints:
In the following line of code... Line 302 in 3950e04
... if |
Thanks @jovanstevanovic I've created #5080 to address #5020 (comment) @sbrannen Could you create a separate issue for the behavior you're describing? This issue is going to be closed when the merge goes in. |
I raised #5081 to address that. |
Fix is on a master. |
Could you please make sure it is backported to release/graal-vm/22.3 and update the milestone of this issue accordingly? |
@sdeleuze Yes, I'm trying to backport it now. |
Describe the issue
When adding resources to the native image, the native image
FileSystemProvider
is used to resolve resources at runtime. The root directory of this file system is not available; this prevents applications from listing all available resources in the application.This is being extracted from #1108, which conflates several issues.
Steps to reproduce the issue
Please include both build steps as well as run steps
git clone git@github.com:bclozel/native-resources.git
./gradlew nativeCompile
Describe GraalVM and your environment:
The repo README explains how to reproduce the behavior step by step.
Please tag this issue with the "Spring" tag.
The text was updated successfully, but these errors were encountered: