Skip to content

Conversation

@Qelxiros
Copy link
Contributor

@Qelxiros Qelxiros commented Sep 8, 2025

This is the first of four smaller PRs that will eventually be equivalent to #139514.

A few notes:

  • I renamed new to open because open_dir takes &self and opens a subdirectory.
    • I also renamed open to open_file.
  • I'm not sure how to impl AsRawFd and friends because the common implementation uses PathBufs. How should I proceed here?

The other PRs will be based on this one, so I'll make drafts and mark them ready as their predecessors get merged. They might take a bit though; I've never done this particular thing with git before.

Tracking issue: #120426

r? @tgross35

try-job: aarch64-apple
try-job: dist-various*
try-job: test-various*
try-job: x86_64-msvc-1
try-job: x86_64-mingw*

@rustbot rustbot added O-windows Operating system: Windows 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 8, 2025
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 10, 2025
@tgross35
Copy link
Contributor

@ChrisDenton I'll need your help for the Windows review

@Qelxiros
Copy link
Contributor Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Sep 10, 2025
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.

Looks pretty good to me, just a few mechanical things here. There are a couple left over from the previous review, #146341 (comment), #146341 (comment), and (newly) #146341 (comment).

View changes since this review

let mut handle = ptr::null_mut();
let mut io_status = c::IO_STATUS_BLOCK::PENDING;
let access = opts.get_access_mode()? | c::SYNCHRONIZE;
let options = create_options | c::FILE_SYNCHRONOUS_IO_NONALERT;
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you add a note about why this flag is set?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I no longer remember why I chose this one, and looking at it now, I'm not sure whether we should set this one, FILE_SYNCHRONOUS_IO_ALERT, or neither. Maybe @ChrisDenton has thoughts?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Update, using neither causes an error, so I've added back FILE_SYNCHRONOUS_IO_NONALERT

Choose a reason for hiding this comment

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

Yeah, passing this flag is equivalent to not passing FILE_FLAG_OVERLAPPED to CreateFile. So if you don't pass this flag, other APIs using the handle need to follow the usual overlapped rules, otherwise they may behave improperly.

@tgross35
Copy link
Contributor

From the top post:

* I'm not sure how to `impl AsRawFd` and friends because the `common` implementation uses `PathBuf`s. How should I proceed here?

I think it would be fine to include the impl AsRawFd only in unix/dir so it's only implemented if we have dirfd. I'll add an unresolved question to the tracking issue.

The other PRs will be based on this one, so I'll make drafts and mark them ready as their predecessors get merged. They might take a bit though; I've never done this particular thing with git before.

That is quite alright, there is no hurry :) For reference, the --update-refs rebase flag can be pretty useful when you're working with a stack (e.g. https://andrewlock.net/working-with-stacked-branches-in-git-is-easier-with-update-refs/)

@tgross35

This comment was marked as outdated.

rust-bors bot added a commit that referenced this pull request Sep 10, 2025
minimal dirfd implementation (1/4)

try-job: aarch64-apple
try-job: dist-various*
try-job: test-various*
try-job: x86_64-msvc*
try-job: x86_64-mingw
@rust-bors

This comment has been minimized.

@rust-bors

This comment was marked as outdated.

@rust-log-analyzer

This comment was marked as outdated.

@tgross35

This comment was marked as outdated.

rust-bors bot added a commit that referenced this pull request Sep 10, 2025
minimal dirfd implementation (1/4)

try-job: aarch64-apple
try-job: dist-various*
try-job: test-various*
try-job: x86_64-msvc*
try-job: x86_64-mingw*
@rustbot
Copy link
Collaborator

rustbot commented Jan 3, 2026

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.

@rust-log-analyzer

This comment has been minimized.

@tgross35
Copy link
Contributor

tgross35 commented Jan 3, 2026

@bors2 try jobs=dist-x86_64-netbsd

rust-bors bot added a commit that referenced this pull request Jan 3, 2026
minimal dirfd implementation (1/4)

try-job: dist-x86_64-netbsd
@rust-bors

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-bors
Copy link
Contributor

rust-bors bot commented Jan 3, 2026

☀️ Try build successful (CI)
Build commit: b99ccc9 (b99ccc98e2bbe90c252d13c5983c8109e640ee51, parent: 1d22b964dfa858eeb7a74ee3d8c06adfcd79d702)

@tgross35
Copy link
Contributor

tgross35 commented Jan 4, 2026

@bors r+ rollup=iffy

@bors
Copy link
Collaborator

bors commented Jan 4, 2026

📌 Commit d236b8a has been approved by tgross35

It is now in the queue for this repository.

@bors bors 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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 4, 2026
@bors
Copy link
Collaborator

bors commented Jan 4, 2026

⌛ Testing commit d236b8a with merge f8b1d59...

@bors
Copy link
Collaborator

bors commented Jan 4, 2026

☀️ Test successful - checks-actions
Approved by: tgross35
Pushing f8b1d59 to main...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jan 4, 2026
@bors bors merged commit f8b1d59 into rust-lang:main Jan 4, 2026
12 checks passed
@rustbot rustbot added this to the 1.94.0 milestone Jan 4, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Jan 4, 2026

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 f280e76 (parent) -> f8b1d59 (this PR)

Test differences

Show 303 test diffs

Stage 1

  • fs::tests::test_dir_read_file: [missing] -> pass (J0)
  • fs::tests::test_dir_smoke_test: [missing] -> pass (J0)

Stage 2

  • fs::tests::test_dir_read_file: [missing] -> pass (J1)
  • fs::tests::test_dir_smoke_test: [missing] -> pass (J1)

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

Job group index

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard f8b1d59a81c700cb7aa25cf69e3032b3ce333150 --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. dist-x86_64-apple: 8512.8s -> 6600.9s (-22.5%)
  2. dist-aarch64-apple: 7136.0s -> 5551.6s (-22.2%)
  3. dist-powerpc-linux: 5650.6s -> 4765.6s (-15.7%)
  4. i686-msvc-1: 9526.3s -> 10902.0s (+14.4%)
  5. dist-arm-linux-gnueabi: 4649.6s -> 5271.1s (+13.4%)
  6. aarch64-apple: 8644.7s -> 9719.4s (+12.4%)
  7. pr-check-1: 1506.0s -> 1660.5s (+10.3%)
  8. x86_64-msvc-ext1: 7858.8s -> 7162.4s (-8.9%)
  9. aarch64-gnu: 7977.3s -> 7281.4s (-8.7%)
  10. dist-armv7-linux: 5406.1s -> 4943.4s (-8.6%)
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
Collaborator

Finished benchmarking commit (f8b1d59): comparison URL.

Overall result: ❌✅ regressions and improvements - no action needed

@rustbot label: -perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.3% [0.2%, 0.3%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.1% [-0.2%, -0.0%] 4
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary 0.3%)

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

mean range count
Regressions ❌
(primary)
1.7% [1.0%, 2.3%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-2.3% [-2.3%, -2.3%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.3% [-2.3%, 2.3%] 3

Cycles

Results (secondary 0.3%)

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

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
3.0% [3.0%, 3.0%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.5% [-2.5%, -2.5%] 1
All ❌✅ (primary) - - 0

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 474.288s -> 475.255s (0.20%)
Artifact size: 390.82 MiB -> 390.83 MiB (0.00%)

lasiotus added a commit to moturus/rust that referenced this pull request Jan 5, 2026
PR rust-lang#146341 introduced
a compilation error. This fixes it.
jhpratt added a commit to jhpratt/rust that referenced this pull request Jan 5, 2026
Motor OS: fix compile error

PR rust-lang#146341 introduced a compilation error. This fixes it.
rust-timer added a commit that referenced this pull request Jan 5, 2026
Rollup merge of #150684 - moturus:main, r=jhpratt

Motor OS: fix compile error

PR #146341 introduced a compilation error. This fixes it.
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. O-windows Operating system: Windows 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.

10 participants