Skip to content

DirEntry::metadata: use dirfd on more targets - #163552

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
RalfJung:dir-entry-metadata
Oct 25, 2026
Merged

rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
RalfJung:dir-entry-metadata

Conversation

@RalfJung

@RalfJung RalfJung commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

View all comments

Most of the BSDs support dirfd and fstatat just fine but for some reason we've not been using it for DirEntry::metadata. This syncs the cfg for using dirfd with the one that we use in Dir::close for the FD sanity check. Those target evidently all have dirfd as we're using it there, and that's a strict subset of the targets that have Dir handles, so they should support fstatat as well.

try-job: bsd
try-job: various

@rustbot

rustbot commented Sep 30, 2026

Copy link
Copy Markdown
Collaborator

Any special-casing of Miri in the standard library requires review.

cc @rust-lang/miri

@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

@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
DirEntry::metadata: use dirfd everywhere that we support Dir

try-job: *bsd*
try-job: *various*
@RalfJung RalfJung changed the title DirEntry::metadata: use dirfd everywhere that we support Dir DirEntry::metadata: use dirfd on more targets Sep 30, 2026
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@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
DirEntry::metadata: use dirfd on more targets

try-job: *bsd*
try-job: *various*
@rust-bors

rust-bors Bot commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 3fd119b (3fd119ba1227cb42fd7d84887708eb2c498e08db)
Base parent: 1625626 (1625626af12c1f95540530c6fc1242ff10aaba0a)

@rust-bors

This comment has been minimized.

@RalfJung
RalfJung force-pushed the dir-entry-metadata branch from a6b3a69 to c97c7de Compare October 2, 2026 20:53
@rustbot

rustbot commented Oct 2, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@RalfJung
RalfJung force-pushed the dir-entry-metadata branch from c97c7de to 6a7b5dd Compare October 2, 2026 20:55
target_os = "nto",
target_os = "qnx",
target_os = "vita",
target_os = "hurd",

@RalfJung RalfJung Oct 2, 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.

hurd has dirfd according to libc, and we've been using it for DirEntry::metadata, so it should be fine to use here as well.

View changes since the review

Comment thread library/std/src/sys/fs/unix.rs Resolved
@RalfJung
RalfJung force-pushed the dir-entry-metadata branch from 6a7b5dd to 3b1fc44 Compare October 3, 2026 10:43
@RalfJung
RalfJung force-pushed the dir-entry-metadata branch from 3b1fc44 to 46b2135 Compare October 3, 2026 18:36
@RalfJung

Copy link
Copy Markdown
Member Author

It's been more than two weeks without any feedback from the reviewer. I guess I should reroll.
@rustbot reroll

@rustbot rustbot assigned Mark-Simulacrum and unassigned JohnTitor Oct 17, 2026
@RalfJung

Copy link
Copy Markdown
Member Author

Also Cc @the8472 as it's related to directory handles (but this is about functions that are already stable)

@Mark-Simulacrum

Copy link
Copy Markdown
Member

@bors r+ rollup=iffy

@rust-bors

rust-bors Bot commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 46b2135 has been approved by Mark-Simulacrum

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 24, 2026
@rust-bors

This comment has been minimized.

@rust-bors rust-bors Bot added merged-by-bors This PR was explicitly merged by bors. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Oct 25, 2026
@rust-bors

rust-bors Bot commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

☀️ Test successful - CI
Approved by: Mark-Simulacrum
Duration: 3h 4m 30s
Pushing dc44e7f to main...

@rust-bors
rust-bors Bot merged commit dc44e7f into rust-lang:main Oct 25, 2026
15 checks passed
@rustbot rustbot added this to the 1.101.0 milestone Oct 25, 2026
@github-actions

Copy link
Copy Markdown
Contributor
What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing 12433c3 (parent) -> dc44e7f (this PR)

Test differences

Show 2 test diffs

2 doctest diffs were found. These are ignored, as they are noisy.

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard dc44e7f2c436b6041742e138b9c2176f093196d5 --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. test-x86_64-gnu-aux: 1h 32m -> 2h 36m (+69.3%)
  2. test-x86_64-rust-for-linux: 1h 11m -> 33m 28s (-53.2%)
  3. test-x86_64-gnu-llvm-22-1: 49m 37s -> 1h 15m (+53.0%)
  4. test-x86_64-gnu-gcc: 52m 8s -> 1h 17m (+49.3%)
  5. dist-x86_64-msvc: 3h 24m -> 2h 2m (-40.2%)
  6. dist-powerpc64le-linux-gnu: 1h 10m -> 1h 39m (+40.1%)
  7. dist-x86_64-msvc-alt: 2h 48m -> 1h 41m (-39.4%)
  8. test-x86_64-msvc-ext1: 1h 44m -> 2h 21m (+35.5%)
  9. dist-armhf-linux: 1h 4m -> 1h 27m (+35.0%)
  10. test-armhf-gnu: 1h 9m -> 1h 32m (+34.2%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (dc44e7f): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This perf run didn't have relevant results for this metric.

Max RSS (memory usage)

Results (primary 0.2%, secondary 0.4%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
0.7% [0.5%, 1.2%] 4
Regressions ❌
(secondary)
0.4% [0.4%, 0.5%] 2
Improvements ✅
(primary)
-0.9% [-1.3%, -0.5%] 2
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.2% [-1.3%, 1.2%] 6

Cycles

Results (primary -0.2%, secondary -0.4%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
0.6% [0.4%, 1.0%] 5
Regressions ❌
(secondary)
0.5% [0.5%, 0.5%] 1
Improvements ✅
(primary)
-0.6% [-0.9%, -0.4%] 8
Improvements ✅
(secondary)
-0.6% [-0.9%, -0.4%] 4
All ❌✅ (primary) -0.2% [-0.9%, 1.0%] 13

Binary size

This perf run didn't have relevant results for this metric.

Bootstrap: 488.652s -> 487.351s (-0.27%)
Artifact size: 405.92 MiB -> 405.87 MiB (-0.01%)

@RalfJung
RalfJung deleted the dir-entry-metadata branch October 26, 2026 07:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged-by-bors This PR was explicitly merged by bors. 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.

6 participants