From 68c3741b23a4c0c510b9e6ff8ea4b74c1b90b6b0 Mon Sep 17 00:00:00 2001 From: Cedric Champeau Date: Tue, 28 Oct 2025 15:30:54 +0100 Subject: [PATCH] Fix relativlization bug If the temporary directory and the working directory are not on the same drive, relativization will fail. This commit uses an absolute path in case relativization is not possible. Fixes #777 --- .../org/graalvm/buildtools/utils/NativeImageUtils.java | 6 +++++- docs/src/docs/asciidoc/changelog.adoc | 8 ++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/common/utils/src/main/java/org/graalvm/buildtools/utils/NativeImageUtils.java b/common/utils/src/main/java/org/graalvm/buildtools/utils/NativeImageUtils.java index 2e1949bf0..3bf3d4023 100644 --- a/common/utils/src/main/java/org/graalvm/buildtools/utils/NativeImageUtils.java +++ b/common/utils/src/main/java/org/graalvm/buildtools/utils/NativeImageUtils.java @@ -101,7 +101,11 @@ public static List convertToArgsFile(List cliArgs, Path outputDi Path resultingPath = tmpFile.toPath().toAbsolutePath(); if (projectDir != null) { // We know where the project dir is, so want to use relative paths - resultingPath = projectDir.toAbsolutePath().relativize(resultingPath); + Path absProjectDir = projectDir.toAbsolutePath(); + // Only relativize if both paths are on the same file system (same drive on Windows) + if (resultingPath.getRoot() != null && resultingPath.getRoot().equals(absProjectDir.getRoot())) { + resultingPath = absProjectDir.relativize(resultingPath); + } } return Collections.singletonList("@" + resultingPath); } catch (IOException e) { diff --git a/docs/src/docs/asciidoc/changelog.adoc b/docs/src/docs/asciidoc/changelog.adoc index 47d890feb..0b980b1f9 100644 --- a/docs/src/docs/asciidoc/changelog.adoc +++ b/docs/src/docs/asciidoc/changelog.adoc @@ -1,6 +1,14 @@ [[changelog]] == Changelog +== Release 0.11.3 + +- Fixed use of argument file when the temporary directory is not on the same drive as the project + +== Release 0.11.2 + +- Fixed missing JUnit types in build time initialization + == Release 0.11.1 - Fix `NoClassDefFoundError` when JUnit feature is missing some dependency