-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Fix windows home dir implementation #46799
Conversation
@rust-lang/libs Check out the linked issue, especially #28940 (comment) and #28940 (comment). I believe this is going to hinge on whether fixing the incorrect behavior of @rfcbot fcp merge |
Team member @dtolnay has proposed to merge this. The next step is review by the rest of the tagged teams: Concerns:
Once these reviewers reach consensus, this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
Could someone explain the interaction with cygwin in more detail here? My reading of this comment seems to suggest that this might change the behavior of command line tools that are built to run in either cygwin or cmd on Windows. For example, is it possible that such command line tools might accidentally do the right thing for cygwin users today? |
Cygwin emulates a linux distribution on windows: the cygwin target is therefore a linux target and code compiled for that target should not use this code-path (or any As with any change in behaviour, it's possible that this is accidentally working for someone right now, but on the other hand there are definitely applications currently using |
I believe the main pushback on this issue was indeed the breaking changes that would come about with a change like this. For example Cargo and Rustup may be likely to break as tools which heavily use the home directory for caching and such. I'm not sure how many other tools rely on something like this. Cargo now depends on a crate called
I believe that rustup/Cargo are both intended to not use I'm not entirely sure how to guage the expected breakage across the rest of the ecosystem. It may be best to have a better story for this breakage, for example "use this crate for the old behavior" or something like that would be a great way to help mitigate the breakage. (aka the thing that cargo/rustup will transition to using). If we can get our ducks in a row via something like that I'd be ok landing this. |
@rfcbot concern cargo-rustup-breakage (see previous comment) |
@alexcrichton There's no way this change can break cargo or rustup, since as you pointed out, they don't call this function? The good thing is that with this change, the unsafe code in those tools could be removed: |
I think this would be my concern then. Right now I distribute a single binary that is intended to work well in both cygwin and cmd. Perhaps this is "wrong," but having two different bins for cygwin and cmd would be quite user hostile IMO. Anyway, I don't want to debate that aspect too much, but would rather just say that this is a source of potential breakage. |
I'm not even sure there's a single correct home directory under MSYS. "Globally installed" programs like rustc/cargo from rustup that just happen to be called from MSYS shell (but can be run outside of it) should still use the "global" home directory, i.e. the Windows one. If something is supposed to be installed locally into the MSYS's little Unix filesystem emulation, then it should use The way of treating and prioritizing home directories seems to be largely application-dependent. |
Sorry for the long delay on this! The libs team discussed this API in our previous meeting. While it seems good to pursue this change, we are wary of changing the behavior of stable APIs, and instead would like to propose the following:
How does that sound? |
@aturon the |
Triage ping @rust-lang/libs, given the comment in #46799 (comment) I suppose the FCP should be canceled? @Diggsey as you mentioned first step is already done in the
|
I don't think there should be a function to get this directory on Windows. Typical applications should not be accessing it. Having it in the standard library makes it too convenient to do so. |
@rfcbot fcp cancel Echoing #46799 (comment) -- breaking a stable API this way is not going to work even if the current behavior is allegedly never what someone should want. Let's work on figuring out a better API in an external crate. The As a first step I would recommend cataloguing as many use cases as possible among the crates that currently call |
@dtolnay proposal cancelled. |
I know this is an ancient thread but @alexcrichton the functionality you are pointing to in |
The actual 'home' definitions are legit, whereas the definitions in directories are MPL2. |
Fixes #28940
r? @dtolnay