Skip to content

Commit a17a0f8

Browse files
committed
remove deprecated vfs/proj folder
1 parent b40e1ba commit a17a0f8

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

graalpython/org.graalvm.python.embedding/src/org/graalvm/python/embedding/utils/GraalPyResources.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
import org.graalvm.polyglot.io.FileSystem;
5050
import org.graalvm.polyglot.io.IOAccess;
5151

52-
import java.io.File;
5352
import java.io.IOException;
5453
import java.nio.file.Files;
5554
import java.nio.file.Path;
@@ -261,7 +260,7 @@ public static Context.Builder contextBuilder(VirtualFileSystem vfs) {
261260
option("python.PythonHome", vfs.vfsHomePath()).
262261
// Set python path to point to sources stored in
263262
// src/main/resources/org.graalvm.python.vfs/src
264-
option("python.PythonPath", vfs.vfsSrcPath() + File.pathSeparator + vfs.vfsProjPath()).
263+
option("python.PythonPath", vfs.vfsSrcPath()).
265264
// pass the path to be executed
266265
option("python.InputFilePath", vfs.vfsSrcPath());
267266
}

graalpython/org.graalvm.python.embedding/src/org/graalvm/python/embedding/utils/VirtualFileSystem.java

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,12 @@ public final class VirtualFileSystem implements FileSystem, AutoCloseable {
8686

8787
private static final Logger LOGGER = Logger.getLogger(VirtualFileSystem.class.getName());
8888
static {
89+
LOGGER.setUseParentHandlers(false);
8990
ConsoleHandler consoleHandler = new ConsoleHandler();
9091
consoleHandler.setFormatter(new SimpleFormatter() {
9192
@Override
9293
public synchronized String format(LogRecord lr) {
93-
return String.format("%s: %s %n", lr.getLevel().getName(), lr.getMessage());
94+
return String.format("%s: %s\n", lr.getLevel().getName(), lr.getMessage());
9495
}
9596
});
9697
LOGGER.addHandler(consoleHandler);
@@ -103,7 +104,6 @@ public synchronized String format(LogRecord lr) {
103104

104105
static final String VFS_HOME = "home";
105106
static final String VFS_VENV = "venv";
106-
static final String VFS_PROJ = "proj";
107107
static final String VFS_SRC = "src";
108108

109109
/*
@@ -114,8 +114,7 @@ public synchronized String format(LogRecord lr) {
114114
private static final String FILES_LIST_PATH = VFS_ROOT + "/fileslist.txt";
115115
private static final String VENV_PREFIX = VFS_ROOT + "/" + VFS_VENV;
116116
private static final String HOME_PREFIX = VFS_ROOT + "/" + VFS_HOME;
117-
// TODO see GR-54915, deprecated and should be removed after 24.2.0
118-
private static final String PROJ_PREFIX = VFS_ROOT + "/" + VFS_PROJ;
117+
private static final String PROJ_PREFIX = VFS_ROOT + "/proj";
119118
private static final String SRC_PREFIX = VFS_ROOT + "/" + VFS_SRC;
120119

121120
private boolean extractOnStartup = "true".equals(System.getProperty("graalpy.vfs.extractOnStartup"));
@@ -414,10 +413,6 @@ String vfsHomePath() {
414413
return resourcePathToPlatformPath(HOME_PREFIX);
415414
}
416415

417-
String vfsProjPath() {
418-
return resourcePathToPlatformPath(PROJ_PREFIX);
419-
}
420-
421416
String vfsSrcPath() {
422417
return resourcePathToPlatformPath(SRC_PREFIX);
423418
}
@@ -473,6 +468,8 @@ private String toCaseComparable(String file) {
473468
return caseInsensitive ? file.toLowerCase(Locale.ROOT) : file;
474469
}
475470

471+
private boolean projWarning = false;
472+
476473
private void initEntries() throws IOException {
477474
vfsEntries = new HashMap<>();
478475
try (InputStream stream = this.resourceLoadingClass.getResourceAsStream(FILES_LIST_PATH)) {
@@ -484,6 +481,14 @@ private void initEntries() throws IOException {
484481
String line;
485482
finest("VFS entries:");
486483
while ((line = br.readLine()) != null) {
484+
485+
if (!projWarning && line.startsWith(PROJ_PREFIX)) {
486+
projWarning = true;
487+
LOGGER.warning("");
488+
LOGGER.warning(String.format("%s source root was deprecated, use %s instead.", PROJ_PREFIX, SRC_PREFIX));
489+
LOGGER.warning("");
490+
}
491+
487492
String platformPath = resourcePathToPlatformPath(line);
488493
int i = 0;
489494
DirEntry parent = null;

0 commit comments

Comments
 (0)