Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Prompt Logger #4134

Merged
merged 1 commit into from
Dec 14, 2024
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
5 changes: 0 additions & 5 deletions main/client/src/mill/main/client/ServerLauncher.java
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,6 @@ public Result acquireLocksAndRun(String outDir) throws Exception {
}

int run(Path serverDir, boolean setJnaNoSys, Locks locks) throws Exception {
// Clear out run-related files from the server folder to make sure we
// never hit issues where we are reading the files from a previous run
Files.deleteIfExists(serverDir.resolve(ServerFiles.exitCode));
Files.deleteIfExists(serverDir.resolve(ServerFiles.terminfo));
Files.deleteIfExists(serverDir.resolve(ServerFiles.runArgs));

try (OutputStream f = Files.newOutputStream(serverDir.resolve(ServerFiles.runArgs))) {
f.write(System.console() != null ? 1 : 0);
Expand Down
2 changes: 1 addition & 1 deletion runner/client/src/mill/runner/client/MillClientMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public void initServer(Path serverDir, boolean setJnaNoSys, Locks locks)
}

public void preRun(Path serverDir) throws Exception {
MillProcessLauncher.runTermInfoThread(serverDir);
MillProcessLauncher.prepareMillRunFolder(serverDir);
}
};
int exitCode = launcher.acquireLocksAndRun(OutFiles.out).exitCode;
Expand Down
10 changes: 8 additions & 2 deletions runner/client/src/mill/runner/client/MillProcessLauncher.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ static int launchMillNoServer(String[] args) throws Exception {
boolean interrupted = false;

try {
MillProcessLauncher.runTermInfoThread(processDir);
MillProcessLauncher.prepareMillRunFolder(processDir);
Process p = configureRunMillProcess(builder, processDir);
return p.waitFor();

Expand Down Expand Up @@ -255,7 +255,13 @@ public static boolean checkTputExists() {
}
}

public static void runTermInfoThread(Path serverDir) throws Exception {
public static void prepareMillRunFolder(Path serverDir) throws Exception {
// Clear out run-related files from the server folder to make sure we
// never hit issues where we are reading the files from a previous run
Files.deleteIfExists(serverDir.resolve(ServerFiles.exitCode));
Files.deleteIfExists(serverDir.resolve(ServerFiles.terminfo));
Files.deleteIfExists(serverDir.resolve(ServerFiles.runArgs));

Path sandbox = serverDir.resolve(ServerFiles.sandbox);
Files.createDirectories(sandbox);
boolean tputExists = checkTputExists();
Expand Down
Loading