fix: no more UUID files in cwd - #45
Open
lejmr wants to merge 1 commit into
Open
Conversation
`std::env::current_dir()` inside the wasm sandbox is not the project directory, so the absolute path handed to the debug adapter did not match where zig wrote the binary. Use a path relative to the build task's cwd. Also drop the UUID from the name. The extension has no post-session hook, so every debug run left another `zig_test_<uuid>` executable behind in the project root; a fixed name is overwritten instead of accumulating.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I agree this is up for discussion — I just really didn't like how my cwd got littered with so many ZIG_TEST_EXE_BASENAME_ files! (The extension has no post-session hook, so nothing ever deletes them.)
I wouldn't mind storing them in .zig-cache/ or the system tmp dir where they'd get cleaned up automatically. Two practical catches I ran into: zig won't create a missing output directory (error: unable to open output directory), so .zig-cache/ breaks on a fresh checkout before the first build — and the extension runs in a wasm sandbox, so it can't reliably resolve the host's tmp path.
So I chose the least-magic option that doesn't break anything: a fixed name relative to the task cwd that auto-overwrites, keeping the number of generated files at exactly one.