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

Document RUSTUP_WINDOWS_PATH_ADD_BIN #4196

Open
BD103 opened this issue Feb 24, 2025 · 7 comments
Open

Document RUSTUP_WINDOWS_PATH_ADD_BIN #4196

BD103 opened this issue Feb 24, 2025 · 7 comments

Comments

@BD103
Copy link

BD103 commented Feb 24, 2025

RUSTUP_WINDOWS_PATH_ADD_BIN, as mentioned in #3703, isn't documented on the website: https://rust-lang.github.io/rustup/environment-variables.html. I think it should be documented, however, because it's useful when writing a program that links to rustc_driver.dll. (See TheBevyFlock/bevy_cli#267 for context.)

@ChrisDenton
Copy link
Member

ChrisDenton commented Feb 24, 2025

This will be default enabled in the next version of rustup and, once that transition is successful, the intent is to eventually remove the option entirely.

@BD103
Copy link
Author

BD103 commented Feb 24, 2025

This will be default enabled in the next version of rustup and, once that transition is successful, the intent is to eventually remove the option entirely.

I'm not sure I understand. Are you implying that RUSTUP_WINDOWS_PATH_ADD_BIN=1 will become the default next release, reverting #3507?

@ChrisDenton
Copy link
Member

Oh sorry, you're right. I got that true/false flipped around. The default will indeed be false.

@ehuss
Copy link
Contributor

ehuss commented Feb 24, 2025

I didn't really intend it to be permanent. I'm not sure if it really makes sense to keep it, since it is quite a hack (and will break things if you change its value). One solution is to query the path like nextest does. I'm not sure if there is really a good solution here.

@BD103
Copy link
Author

BD103 commented Feb 24, 2025

Oh sorry, you're right. I got that true/false flipped around. The default will indeed be false.

No worries! :)

I didn't really intend it to be permanent. I'm not sure if it really makes sense to keep it, since it is quite a hack (and will break things if you change its value). One solution is to query the path like nextest does. I'm not sure if there is really a good solution here.

I'm using RUSTUP_WINDOWS_PATH_ADD_BIN in a closed environment where I control spawning cargo and rustc, meaning I can ensure that they do not accidentally use the proxy +toolchain syntax. This is nice, as I don't have to worry about breaking anything beyond my control.

Though I realize I'm in the minority here, I still think RUSTUP_WINDOWS_PATH_ADD_BIN is useful enough to keep. I think a compromise can be found here, perhaps by:

  • Adding a warning that setting RUSTUP_WINDOWS_PATH_ADD_BIN may break programs that you call, especially user-defined ones.
  • Marking the variable as unstable, and that it may be removed at any point. (And suggest modifying the PATH yourself instead.)

As a side note, how does nextest query what folders need to be added to the path? In case you do decide to remove RUSTUP_WINDOWS_PATH_ADD_BIN, I'll need to switch my code to use that instead.

@ehuss
Copy link
Contributor

ehuss commented Feb 24, 2025

Sorry, meant to link to #3825, where there is more discussion about this. I don't really know much about nextest, but they linked nextest-rs/nextest#1499.

@BD103
Copy link
Author

BD103 commented Feb 24, 2025

Thank you! For now I'll continue using RUSTUP_WINDOWS_PATH_ADD_BIN, but I'll keep an eye on #3825 in case it becomes deprecated / removed in the future.

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

No branches or pull requests

3 participants