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

Recommend the home crate in env::home_dir()'s deprecation #110665

Closed
wants to merge 1 commit into from

Conversation

utkarshgupta137
Copy link
Contributor

The home is now maintained by the cargo & rustup teams, so it seems like a no-brainer to recommend it in the standard library.

See also: #71684 (comment).

Closes #71684.

@rustbot label +T-libs-api -T-lib

r? @joshtriplett
r? @Dylan-DPC

@rustbot
Copy link
Collaborator

rustbot commented Apr 22, 2023

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @joshtriplett (or someone else) soon.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue

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

rustbot commented Apr 22, 2023

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with @rustbot label +T-libs-api -T-libs to tag it appropriately. If this PR contains changes to any unstable APIs please edit the PR description to add a link to the relevant API Change Proposal or create one if you haven't already. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

@rustbot rustbot added the T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. label Apr 22, 2023
@rust-log-analyzer

This comment has been minimized.

Copy link
Contributor

@tgross35 tgross35 left a comment

Choose a reason for hiding this comment

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

I don't think that rust typically likes endorsing third-party crates, but maybe it's OK here. reread the discussion, yeah this is wanted.

Could you update the deprecation section in the docs to say this same thing?

@rustbot label -T-libs +A-docs

@rustbot rustbot added A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools and removed T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jul 14, 2023
@rust-log-analyzer

This comment has been minimized.

@ChrisDenton
Copy link
Member

Personally i don't think that the crate being taken under cargo's wing should be construed to imply endorsement. Indeed part of the reason for doing so was that "the crate seems somewhat specific to cargo and rustup".

Linking to external crates in the std docs is very unusual nowadays so I think it warrants an fcp.

@bors
Copy link
Contributor

bors commented Jul 19, 2023

☔ The latest upstream changes (presumably #113777) made this pull request unmergeable. Please resolve the merge conflicts.

@tgross35
Copy link
Contributor

This should be rebased onto the latest master before merge fyi

@joshtriplett
Copy link
Member

Can I get a second opinion from @rust-lang/cargo here? My read is that the home crate, despite the generic name, is fairly Cargo-specific and not what we want to point most people to.

@weihanglo
Copy link
Member

Agree with @joshtriplett. See also a recent issue rust-lang/cargo#12297.

@workingjubilee
Copy link
Member

I'm afraid that means we should probably reject this PR.

@utkarshgupta137
Copy link
Contributor Author

I think it is fair to say that even though the home crate is fairly rustup & cargo specific, it is being used by a lot of major packages: https://crates.io/crates/home/reverse_dependencies
I think the discussion in the linked issue came to the same conclusion. Would it be better to change the wording from a recommendation to a suggestion instead?

@workingjubilee
Copy link
Member

workingjubilee commented Oct 5, 2023

The conclusion in that issue, as I read it, is that there should be an ACP for a new version of the deprecated function.

@tgross35
Copy link
Contributor

tgross35 commented Oct 5, 2023

With the above in mind, dirs may be better to recommend than home if anything, since it follows XDG. And is more popular than home

@utkarshgupta137
Copy link
Contributor Author

With the above in mind, dirs may be better to recommend than home if anything, since it follows XDG. And is more popular than home

I think the dirs crate does much more than this 1 function. AFAIK, the XDG spec doesn't say anything about the home directory, but if that is a consideration, then I don't think dirs is the right choice, since it doesn't allow you to follow XDG spec on other platforms, which is very popular on macOS: dirs-dev/directories-rs#47.
If it is important to link to a crate that supports XDG, I'd like to propose etcetera instead (which is maintained by me), which supports XDG on all platforms. But it indirectly uses the home crate, so I don't really see the point.

@workingjubilee
Copy link
Member

...The fact that there is any discussion at all on this PR about what crate to use suggests strongly that this case is not so open-and-shut as to recommend simply picking a crate.

@Dylan-DPC
Copy link
Member

Closing this as there are concerns with this pr , and this probably needs an ACP first

@Dylan-DPC Dylan-DPC closed this Feb 9, 2024
@Dylan-DPC Dylan-DPC added S-inactive Status: Inactive and waiting on the author. This is often applied to closed PRs. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools S-inactive Status: Inactive and waiting on the author. This is often applied to closed PRs. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Please reconsider endorsing dirs and deprecating std::env::home_dir
10 participants