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

Try not to use verbatim paths in Command::current_dir #138869

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ChrisDenton
Copy link
Member

@ChrisDenton ChrisDenton commented Mar 23, 2025

If possible, we should try not to use verbatim paths in Command::current_dir. It might work but it might also break code in the subprocess that assume the current directory isn't verbatim (including Windows APIs). cc @ehuss

Side note: we now have a lot of ad-hoc fixes like this spread about the place. It'd be good to make a proper WindowsPath type that handles all this in one place. But that's a bigger job for another PR.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Mar 23, 2025
Copy link
Member

@Noratrieb Noratrieb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks reasonable to me, but I'd like someone with more clues about Windows to take a look as well. I don't know who'd be a great fit, feel free to assign whoever you want

If possible, we should try not to use verbatim paths in Command::current_dir. It might work but it might also break code (including some Windows APIs) that assume the current directory isn't verbatim.
@ChrisDenton
Copy link
Member Author

I'd like someone with more clues about Windows to take a look as well

I'm honestly not sure, so choosing someone at random:
r? @tgross35
Want to take a stab at this? Feel free to pass.

@rustbot rustbot assigned tgross35 and unassigned Noratrieb Mar 24, 2025
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. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants