Skip to content

fs::set_permissions_nofollow: Android support, test cleanup - #163548

Merged
rust-bors[bot] merged 2 commits into
rust-lang:mainfrom
RalfJung:set_permissions_nofollow-tests
Oct 4, 2026
Merged

rust-bors[bot] merged 2 commits into
rust-lang:mainfrom
RalfJung:set_permissions_nofollow-tests

Conversation

@RalfJung

@RalfJung RalfJung commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

Tracking issue: #141607

try-job: various
try-job: android

@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 Sep 30, 2026
@rustbot

rustbot commented Sep 30, 2026

Copy link
Copy Markdown
Collaborator

r? @JohnTitor

rustbot has assigned @JohnTitor.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @ChrisDenton, libs
  • @ChrisDenton, libs expanded to 13 candidates
  • Random selection from ChrisDenton, Darksonn, JohnTitor, Mark-Simulacrum, clarfonthey

}
}

// Only Windows and Unix support `fs::set_permissions_nofollow`

@RalfJung RalfJung Sep 30, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I can't make sense of this comment as the test above runs on everything except for Android.
@asder8215 what did you mean when writing this comment?

View changes since the review

@asder8215 asder8215 Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This might be a stale comment that I forgot to change.

I think, at the time, I didn't have set_permissions_nofollow supported for wasi (since it didn't have fchmodat support, but pretty sure it works with the openat with no follow flag) or this test specifically didn't run on wasi.

Although technically, does this test may not run on wasi since I thought they use a different symlink create function, i.e. symlink_path. You might want to add an import to symlink_path as a symlink_file gated to wasi.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Nothing else in this file seems to special-case wasi so we probably just don't run these tests there.

@RalfJung

Copy link
Copy Markdown
Member Author

@bors try

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Sep 30, 2026
simplify and clarify fs::set_permissions_nofollow tests

try-job: *various*
@RalfJung RalfJung changed the title simplify and clarify fs::set_permissions_nofollow tests fs::set_permissions_nofollow: Android support, test cleanup Sep 30, 2026
@RalfJung

Copy link
Copy Markdown
Member Author

@bors try

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Sep 30, 2026
fs::set_permissions_nofollow: Android support, test cleanup

try-job: *various*
try-job: *android*
@RalfJung
RalfJung force-pushed the set_permissions_nofollow-tests branch from 16a71a6 to b500b0e Compare September 30, 2026 13:44
@rust-bors

rust-bors Bot commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 3f14e4a (3f14e4acad6443ba365e2d15ddb4807c0f8c49a8)
Base parent: 78ae589 (78ae589adaba26eed6660acc99a6eb515605e0ab)

@RalfJung

Copy link
Copy Markdown
Member Author

Looks like avoiding fchmodat indeed makes this work on Android as well. :)

@RalfJung

RalfJung commented Oct 1, 2026

Copy link
Copy Markdown
Member Author

r? @clarfonthey
follow-up to #160170

@rustbot rustbot assigned clarfonthey and unassigned JohnTitor Oct 1, 2026
@RalfJung
RalfJung force-pushed the set_permissions_nofollow-tests branch from b500b0e to 7bfad36 Compare October 3, 2026 09:42
@RalfJung
RalfJung force-pushed the set_permissions_nofollow-tests branch from 7bfad36 to afc0663 Compare October 3, 2026 10:22
#[test]
#[cfg(all(
any(windows, unix),
not(any(target_os = "espidf", target_os = "horizon", target_os = "wasi"))

@clarfonthey clarfonthey Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I assume this is why you wanted to run test-various as well? I guess it still works here, too?

View changes since the review

@RalfJung RalfJung Oct 3, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I observed that set_get_permissions_nofollows runs everywhere except android. That means the comment, "Only Windows and Unix support fs::set_permissions_nofollow", just does not make sense.

My guess is that some of these were disabled because e.g. espidf does not support symlinks. However the comment does not say that and there are other symlink tests in this file and they are not gating espidf. So I'd rather leave it to an espidf maintainer to add the necessary cfg everywhere in this file, with proper comments. Same for horizon. I have not the slightest idea why wasi was added here, that one actually has handling in the implementation so it really should work.

Comment thread library/std/src/fs/tests.rs
@clarfonthey

Copy link
Copy Markdown
Contributor

r=me assuming you actually can verify that the tests passed for espidf/horizon/wasi; small note.

@RalfJung

RalfJung commented Oct 3, 2026

Copy link
Copy Markdown
Member Author

I can't verify this any other way than running CI. I think the above are all the relevant CI jobs?
Those are tier 2 / 3 targets so we technically don't promise that tests always pass.

@clarfonthey

Copy link
Copy Markdown
Contributor

@bors r+ rollup

All good then.

@rust-bors

rust-bors Bot commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

📌 Commit afc0663 has been approved by clarfonthey

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 3, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Oct 3, 2026
…tests, r=clarfonthey

fs::set_permissions_nofollow: Android support, test cleanup

Tracking issue: rust-lang#141607

try-job: *various*
try-job: *android*
jhpratt added a commit to jhpratt/rust that referenced this pull request Oct 3, 2026
…tests, r=clarfonthey

fs::set_permissions_nofollow: Android support, test cleanup

Tracking issue: rust-lang#141607

try-job: *various*
try-job: *android*
rust-bors Bot pushed a commit that referenced this pull request Oct 4, 2026
Rollup of 18 pull requests

Successful merges:

 - #158102 (When compiling without a specified `--edition`, emit a message)
 - #162027 (std: add `fs::rename_noreplace`)
 - #162761 (Lower attributes for functions without bodies)
 - #163161 (implement FCW for `rustc_allowed_through_unstable_modules` items)
 - #163613 (Tweak the rendering of "not general enough" errors on the old trait solver)
 - #162062 (core: fix the docs of PanicInfo::location)
 - #163140 (document safety requirements for atomic intrinsics)
 - #163342 (Don't imply incorrect things about `Global` in the docs of `System`)
 - #163445 (Add safety comments for alloc::str)
 - #163503 (Mark Rc strong/weak count methods must_use)
 - #163548 (fs::set_permissions_nofollow: Android support, test cleanup)
 - #163585 ([triagebot] Create `debugger_visualizer` assign group)
 - #163597 (Add `SplitPathsRef` implementation for motor to make std build)
 - #163602 (Move media & home dirs tests to fs tests.)
 - #163667 (Finalize changes on expect messages for library/core/src/fmt/mod.rs)
 - #163682 ([rustdoc] Correctly link to (imported) enum variants with "jump to def")
 - #163683 (Fix GCC codegen backend comment in bootstrap)
 - #163703 (Move more `rustdoc-html tests` in the right location)

Failed merges:

 - #161491 (Rip out old solver coherence)
rust-bors Bot pushed a commit that referenced this pull request Oct 4, 2026
Rollup of 18 pull requests

Successful merges:

 - #158102 (When compiling without a specified `--edition`, emit a message)
 - #162761 (Lower attributes for functions without bodies)
 - #163161 (implement FCW for `rustc_allowed_through_unstable_modules` items)
 - #163613 (Tweak the rendering of "not general enough" errors on the old trait solver)
 - #162062 (core: fix the docs of PanicInfo::location)
 - #163140 (document safety requirements for atomic intrinsics)
 - #163342 (Don't imply incorrect things about `Global` in the docs of `System`)
 - #163445 (Add safety comments for alloc::str)
 - #163503 (Mark Rc strong/weak count methods must_use)
 - #163548 (fs::set_permissions_nofollow: Android support, test cleanup)
 - #163585 ([triagebot] Create `debugger_visualizer` assign group)
 - #163597 (Add `SplitPathsRef` implementation for motor to make std build)
 - #163602 (Move media & home dirs tests to fs tests.)
 - #163667 (Finalize changes on expect messages for library/core/src/fmt/mod.rs)
 - #163682 ([rustdoc] Correctly link to (imported) enum variants with "jump to def")
 - #163683 (Fix GCC codegen backend comment in bootstrap)
 - #163703 (Move more `rustdoc-html tests` in the right location)
 - #163725 (some crashes fixed with next-solver)

Failed merges:

 - #161491 (Rip out old solver coherence)
@rust-bors
rust-bors Bot merged commit 6728311 into rust-lang:main Oct 4, 2026
14 checks passed
@rustbot rustbot added this to the 1.101.0 milestone Oct 4, 2026
rust-bors Bot pushed a commit that referenced this pull request Oct 4, 2026
Rollup merge of #163548 - RalfJung:set_permissions_nofollow-tests, r=clarfonthey

fs::set_permissions_nofollow: Android support, test cleanup

Tracking issue: #141607

try-job: *various*
try-job: *android*
@RalfJung
RalfJung deleted the set_permissions_nofollow-tests branch October 5, 2026 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

5 participants