Skip to content

Commit

Permalink
only compare the paths after shaders to fix issues with symbolic links
Browse files Browse the repository at this point in the history
  • Loading branch information
fayer3 committed Aug 31, 2024
1 parent fb234aa commit 9963dbc
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,15 @@ public IncludeGraph(Path root, ImmutableList<AbsolutePackPath> startingPaths, bo

try {
Path p = next.resolved(root);
if (Iris.getIrisConfig().areDebugOptionsEnabled() && !isZip && !p.toAbsolutePath().toString().equals(p.toFile().getCanonicalPath())) {
throw new FileIncludeException("'" + next.getPathString() + "' doesn't exist, did you mean '" +
root.relativize(p.toFile().getCanonicalFile().toPath()).toString().replace("\\", "/") + "'?");
if (Iris.getIrisConfig().areDebugOptionsEnabled() && !isZip) {
String absolute = p.toAbsolutePath().toString().replace("\\", "/");
absolute = absolute.substring(absolute.lastIndexOf("shaders/") + 8);

String canonical = p.toFile().getCanonicalPath().replace("\\", "/");
canonical = canonical.substring(canonical.lastIndexOf("shaders/") + 8);
if (!absolute.equals(canonical)) {
throw new FileIncludeException("'" + next.getPathString() + "' doesn't exist, did you mean '" + canonical + "'?");
}
}
source = readFile(p);
} catch (IOException e) {
Expand Down

0 comments on commit 9963dbc

Please sign in to comment.