Skip to content

Keep a setup step's temp folder while programs it started still run - #587

Open
thehobbit85 wants to merge 1 commit into
elripalda:mainfrom
thehobbit85:claude/fix-setup-temp-for-running-helpers
Open

thehobbit85 wants to merge 1 commit into
elripalda:mainfrom
thehobbit85:claude/fix-setup-temp-for-running-helpers

Conversation

@thehobbit85

Copy link
Copy Markdown
Contributor

What this changes

Refs #551.

A setup step gets its own temp folder (.recomplauncher-tmp, given as TEMP, TMP and TMPDIR), and the folder was taken away as soon as the step's own program ended. A step can start other programs and exit before they finish, for example a build it hands off to, and the launcher deliberately lets those keep running. They still had their temp variables pointing at the deleted folder, so the next temp file they wrote failed, for example a compiler's "unable to make temporary file: No such file or directory".

When the step ends, the launcher now checks whether its process group (Linux and Mac) or its job (Windows) still has a process in it. If it does, the temp folder stays. The next setup run already empties a leftover folder the launcher made, so it doesn't pile up. A step that leaves nothing running is cleaned up exactly as before.

Limits:

How you tested it

Run on macOS against eaf7ca2, with synthetic step scripts.

  • New test: a step that starts a helper and exits at once. The helper looks for its temp folder a second later. It found the folder gone on main and finds it kept with this change. A Windows version of the same test, using a .bat and start /b, runs only on Windows, so CI is its first run.

  • Control test: a step that leaves nothing running still has its temp folder taken away.

  • cargo check --tests passes for x86_64-pc-windows-gnu.

  • Rust: 1,217 passed, 1 ignored. UI: 1,019 passed, 11 skipped. git diff --check clean.

  • npm test passes

  • node --test tests/*.test.cjs passes

  • Tried it in the launcher (npm run dev)

Checklist

  • One change per pull request
  • No version bump or patch notes (those are done at release time)
  • Does not change what developers can write in recomplauncher.json

A setup step's temp folder was taken away as soon as the step's own program ended. Programs it started and left running, such as a build it handed off to, still had TEMP, TMP and TMPDIR pointing there, and failed when they next wrote a temp file. The folder now stays when the step's process group (Linux and Mac) or job (Windows) still has a process in it; the next setup run empties it, as it already does for a leftover folder.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant