Skip to content

[GR-32195] Fix resource inclusion on Windows. #3498

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

Merged
merged 1 commit into from
Jun 22, 2021

Conversation

graalvmbot
Copy link
Collaborator

@graalvmbot graalvmbot commented Jun 21, 2021

Currently, resources don't work as expected on Windows as we don't properly include resources in the image. The core reason for this failure is passing platform specific file paths to our resource inclusion pattern matcher. This PR addresses that by replacing the platform specific file separator in that path with "/"

Closes #3496

@olpaw
Copy link
Member

olpaw commented Jun 21, 2021

@jperedadnr can you test if this fix solves the Windows issue that you reported recently?

@@ -252,13 +253,16 @@ private static void scanDirectory(DebugContext debugContext, File root, Pattern[
Map<String, List<String>> matchedDirectoryResources = new HashMap<>();
Set<String> allEntries = new HashSet<>();
ArrayList<File> queue = new ArrayList<>();
String separator = FileSystems.getDefault().getSeparator();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a simpler way to write this without defining a new variable. File.separator is a system-dependent variable with the same value.

@graalvmbot graalvmbot force-pushed the github/gradinac/GR-32195-windows-resources branch from 8cfbb20 to 429b04e Compare June 21, 2021 13:18
@jperedadnr
Copy link

I've tested successfully this patch, the three tests reported in #3336 that were failing now pass.

@graalvmbot graalvmbot force-pushed the github/gradinac/GR-32195-windows-resources branch from 429b04e to b451eb5 Compare June 21, 2021 14:53
@graalvmbot graalvmbot merged commit 7e310bc into master Jun 22, 2021
@graalvmbot graalvmbot deleted the github/gradinac/GR-32195-windows-resources branch February 8, 2022 01:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improved resource support does not work properly on Windows
4 participants