|
48 | 48 | import java.io.IOException;
|
49 | 49 | import java.nio.file.FileVisitResult;
|
50 | 50 | import java.nio.file.Files;
|
51 |
| -import java.nio.file.LinkOption; |
52 | 51 | import java.nio.file.Path;
|
53 | 52 | import java.nio.file.Paths;
|
54 | 53 | import java.nio.file.SimpleFileVisitor;
|
@@ -392,9 +391,15 @@ public void log(CharSequence var1) {
|
392 | 391 | }
|
393 | 392 | }
|
394 | 393 |
|
395 |
| - public static void createVenv(Path venvDirectory, List<String> packages, Path laucherPath, LauncherClassPath launcherClassPath, String graalPyVersion, SubprocessLog subprocessLog, Log log) |
| 394 | + public static void createVenv(Path venvDirectory, List<String> packages, Path launcher, LauncherClassPath launcherClassPath, String graalPyVersion, SubprocessLog subprocessLog, Log log) |
396 | 395 | throws IOException {
|
397 |
| - generateLaunchers(laucherPath, launcherClassPath, subprocessLog, log); |
| 396 | + Path launcherPath = launcher; |
| 397 | + String externalLauncher = System.getProperty("graalpy.vfs.venvLauncher"); |
| 398 | + if (externalLauncher == null || externalLauncher.trim().isEmpty()) { |
| 399 | + generateLaunchers(launcherPath, launcherClassPath, subprocessLog, log); |
| 400 | + } else { |
| 401 | + launcherPath = Path.of(externalLauncher); |
| 402 | + } |
398 | 403 |
|
399 | 404 | if (packages != null) {
|
400 | 405 | trim(packages);
|
@@ -424,7 +429,7 @@ public static void createVenv(Path venvDirectory, List<String> packages, Path la
|
424 | 429 |
|
425 | 430 | if (!Files.exists(venvDirectory)) {
|
426 | 431 | log.info(String.format("Creating GraalPy %s venv", graalPyVersion));
|
427 |
| - runLauncher(laucherPath.toString(), subprocessLog, "-m", "venv", venvDirectory.toString(), "--without-pip"); |
| 432 | + runLauncher(launcherPath.toString(), subprocessLog, "-m", "venv", venvDirectory.toString(), "--without-pip"); |
428 | 433 | runVenvBin(venvDirectory, "graalpy", subprocessLog, "-I", "-m", "ensurepip");
|
429 | 434 | }
|
430 | 435 |
|
|
0 commit comments