Skip to content

fix: Switch from temp-dir to a homemade NamedTempFile implementation - #23206

Open
ChayimFriedman2 wants to merge 1 commit into
rust-lang:masterfrom
ChayimFriedman2:tempfile
Open

fix: Switch from temp-dir to a homemade NamedTempFile implementation#23206
ChayimFriedman2 wants to merge 1 commit into
rust-lang:masterfrom
ChayimFriedman2:tempfile

Conversation

@ChayimFriedman2

Copy link
Copy Markdown
Contributor

That also deletes the file when the process exits without being dropped; this is important especially for the proc macro server since it is killed and does not exit normally.

Linux and the BSDs unlink the file then access it via /proc/self/fd or /dev/fd; Windows has a dedicated API for that; and macOS unfortunately does not support that (the file is not removed after being unlinked, but you cannot access it anymore via /dev/fd, or at least that's what the AI said - I don't have a macOS machine to check).

Fixes #23203.

That also deletes the file when the process exits without being dropped; this is important especially for the proc macro server since it is killed and does not exit normally.

Linux and the BSDs unlink the file then access it via `/proc/self/fd` or `/dev/fd`; Windows has a dedicated API for that; and macOS unfortunately does not support that (the file is not removed after being unlinked, but you cannot access it anymore via `/dev/fd`, or at least that's what the AI said - I don't have a macOS machine to check).
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ra leaves empty proc-macro-srv dir behind

2 participants