Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
public abstract class OptionOrigin {

public static final OptionOrigin commandLineOptionOriginSingleton = new CommandLineOptionOrigin();
public static final String argFilePrefix = "argfile:";

public URI container() {
return null;
Expand All @@ -66,7 +67,7 @@ public List<String> getRedirectionValues(@SuppressWarnings("unused") Path values

public static OptionOrigin from(String origin) {

if (origin == null) {
if (origin == null || origin.startsWith(argFilePrefix)) {
return commandLineOptionOriginSingleton;
}

Expand All @@ -78,10 +79,6 @@ public static OptionOrigin from(String origin) {
}
throw VMError.shouldNotReachHere("Unsupported OptionOrigin: " + origin);
}
if (originURI.getScheme() == null) {
/* @argument files use path as origin */
return commandLineOptionOriginSingleton;
}
switch (originURI.getScheme()) {
case "jar":
return new JarOptionOrigin(originURI);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@

import org.graalvm.compiler.options.OptionType;

import com.oracle.svm.core.option.OptionOrigin;
import com.oracle.svm.core.option.OptionUtils;
import com.oracle.svm.driver.NativeImage.ArgumentQueue;

Expand Down Expand Up @@ -319,7 +320,7 @@ public boolean consume(ArgumentQueue args) {
args.poll();
headArg = headArg.substring(1);
Path argFile = Paths.get(headArg);
NativeImage.NativeImageArgsProcessor processor = nativeImage.new NativeImageArgsProcessor(argFile.toString());
NativeImage.NativeImageArgsProcessor processor = nativeImage.new NativeImageArgsProcessor(OptionOrigin.argFilePrefix + argFile);
readArgFile(argFile).forEach(processor::accept);
List<String> leftoverArgs = processor.apply(false);
if (leftoverArgs.size() > 0) {
Expand Down