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

Stabilize Windows FileTypeExt with is_symlink_dir and is_symlink_file #98583

Merged
merged 2 commits into from
Jul 27, 2022

Conversation

joshtriplett
Copy link
Member

These calls allow detecting whether a symlink is a file or a directory,
a distinction Windows maintains, and one important to software that
wants to do further operations on the symlink (e.g. removing it).

…_file`

These calls allow detecting whether a symlink is a file or a directory,
a distinction Windows maintains, and one important to software that
wants to do further operations on the symlink (e.g. removing it).
@rustbot rustbot added the T-libs Relevant to the library team, which will review and decide on the PR/issue. label Jun 27, 2022
@rust-highfive
Copy link
Collaborator

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

@rust-highfive
Copy link
Collaborator

r? @thomcc

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 27, 2022
@joshtriplett
Copy link
Member Author

These methods didn't have a tracking issue.

@joshtriplett joshtriplett added T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. needs-fcp This change is insta-stable, so needs a completed FCP to proceed. and removed T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jun 27, 2022
Copy link
Member

@thomcc thomcc left a comment

Choose a reason for hiding this comment

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

Impl looks fine, r=me once fcp happens

@joshtriplett joshtriplett force-pushed the stabilize-windows-symlink-types branch from 00a2e05 to a4cb0b9 Compare June 27, 2022 18:01
@ChrisDenton
Copy link
Member

I would definitely love this to be stable.


This is not necessarily a problem but I thought it might be worth pointing out the difference between stdlib semantics and Windows semantics here. For example, if you want to know if a file is some kind of directory then you'd do:

file.is_dir() || file.is_symlink_dir()

Which ends up roughly translating to:

file.is_directory() && (!file.is_symlink() || file.is_symlink())

Presumably this is optimized to file.is_directory() or if not then it doesn't matter too much anyway. As I said, I'm only mentioning it because it highlights the difference in semantics.

@joshtriplett
Copy link
Member Author

@ChrisDenton That seems reasonable. I think we'd get much more confusing results if is_dir returned true on a symlink.

@joshtriplett
Copy link
Member Author

@rfcbot merge

@rfcbot
Copy link

rfcbot commented Jul 2, 2022

Team member @joshtriplett has proposed to merge this. The next step is review by the rest of the tagged team members:

No concerns currently listed.

Once a majority of reviewers approve (and at most 2 approvals are outstanding), 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.

@rfcbot rfcbot added proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. labels Jul 2, 2022
@joshtriplett joshtriplett added the relnotes Marks issues that should be documented in the release notes of the next release. label Jul 2, 2022
@rfcbot rfcbot added the final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. label Jul 6, 2022
@rfcbot
Copy link

rfcbot commented Jul 6, 2022

🔔 This is now entering its final comment period, as per the review above. 🔔

@rfcbot rfcbot removed the proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. label Jul 6, 2022
@rfcbot rfcbot added finished-final-comment-period The final comment period is finished for this PR / Issue. to-announce Announce this issue on triage meeting and removed final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. labels Jul 16, 2022
@rfcbot
Copy link

rfcbot commented Jul 16, 2022

The final comment period, with a disposition to merge, as per the review above, is now complete.

As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed.

This will be merged soon.

@joshtriplett
Copy link
Member Author

@bors r=thomcc

@bors
Copy link
Contributor

bors commented Jul 26, 2022

📌 Commit a4cb0b9 has been approved by thomcc

It is now in the queue for this repository.

@bors bors removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 26, 2022
@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Jul 26, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 27, 2022
Rollup of 8 pull requests

Successful merges:

 - rust-lang#98583 (Stabilize Windows `FileTypeExt` with `is_symlink_dir` and `is_symlink_file`)
 - rust-lang#99698 (Prefer visibility map parents that are not `doc(hidden)` first)
 - rust-lang#99700 (Add a clickable link to the layout section)
 - rust-lang#99712 (passes: port more of `check_attr` module)
 - rust-lang#99759 (Remove dead code from cg_llvm)
 - rust-lang#99765 (Don't build std for *-uefi targets)
 - rust-lang#99771 (Update pulldown-cmark version to 0.9.2 (fixes url encoding for some chars))
 - rust-lang#99775 (rustdoc: do not allocate String when writing path full name)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 1ff84f0 into rust-lang:master Jul 27, 2022
@rustbot rustbot added this to the 1.64.0 milestone Jul 27, 2022
@joshtriplett joshtriplett deleted the stabilize-windows-symlink-types branch July 27, 2022 07:39
@apiraino apiraino removed the to-announce Announce this issue on triage meeting label Sep 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. finished-final-comment-period The final comment period is finished for this PR / Issue. needs-fcp This change is insta-stable, so needs a completed FCP to proceed. relnotes Marks issues that should be documented in the release notes of the next release. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

8 participants