Skip to content

fix: Fix NamedTempFile - #23257

Merged
ChayimFriedman2 merged 1 commit into
rust-lang:masterfrom
ChayimFriedman2:tmp-file
Aug 30, 2026
Merged

fix: Fix NamedTempFile#23257
ChayimFriedman2 merged 1 commit into
rust-lang:masterfrom
ChayimFriedman2:tmp-file

Conversation

@ChayimFriedman2

Copy link
Copy Markdown
Contributor
  • Use OpenOptions::write(true), otherwise it always fails.
  • If unable to copy the proc macro DLL in the proc macro server, use the original instead to at least succeed.
  • For Cargo.lock, use a temporary directory instead as Cargo only accepts literally-named Cargo.lock files, and also because /proc/self/fd does not work for other processes. Fortunately unlike the proc macro server we do run Drop for those.

Thanks to @onlycs for discovering those.

I'm merging this myself because this can make the proc macro server not working at all on Windows. @lnicola may I also invite a sync?

 - Use `OpenOptions::write(true)`, otherwise it always fails.
 - If unable to copy the proc macro DLL in the proc macro server, use the original instead to at least succeed.
 - For Cargo.lock, use a temporary directory instead as Cargo only accepts literally-named Cargo.lock files, and also because `/proc/self/fd` does not work for other processes. Fortunately unlike the proc macro server we do run `Drop` for those.
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 30, 2026
@ChayimFriedman2
ChayimFriedman2 added this pull request to the merge queue Aug 30, 2026
Merged via the queue into rust-lang:master with commit 7015591 Aug 30, 2026
18 checks passed
@ChayimFriedman2
ChayimFriedman2 deleted the tmp-file branch August 30, 2026 00:53
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 30, 2026
@lnicola

lnicola commented Aug 30, 2026

Copy link
Copy Markdown
Member

@ChayimFriedman2 would tomorrow be fine, so it matches the normal release syncs?

@ChayimFriedman2

ChayimFriedman2 commented Aug 30, 2026

Copy link
Copy Markdown
Contributor Author

Oh the previous PR wasn't synced yet (if it would, Windows nightly users wouldn't have proc macro support at all). Then yes this is fine.

@lnicola

lnicola commented Aug 31, 2026

Copy link
Copy Markdown
Member

@ChayimFriedman2

Copy link
Copy Markdown
Contributor Author

Wait. Don't we check proc-macro-srv in CI? That's not good.

Anyway it doesn't really matter to me if we remove this logging or add tracing as a dependency.

@lnicola

lnicola commented Aug 31, 2026

Copy link
Copy Markdown
Member

I don't remember exactly, but if we do, we probably check on Linux only.

@ChayimFriedman2

Copy link
Copy Markdown
Contributor Author

That shouldn't matter for this because stdx is still included for Linux.

But we also should check on other platforms.

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.

3 participants