Skip to content

fs: Run file lock tests on all platforms that support it - #149111

Merged
bors merged 3 commits into
rust-lang:mainfrom
tgross35:fs-test-updates
Nov 21, 2025
Merged

fs: Run file lock tests on all platforms that support it#149111
bors merged 3 commits into
rust-lang:mainfrom
tgross35:fs-test-updates

Conversation

@tgross35

@tgross35tgross35 commented Nov 19, 2025

Copy link
Copy Markdown
Member

There are a number of platforms that support file locking but aren't getting tested. Synchronize the list and mark the tests should_panic otherwise, to make sure they get updated if more platforms add locking support.

The supported platform list comes from

#[cfg(any(
target_os = "freebsd",
target_os = "fuchsia",
target_os = "linux",
target_os = "netbsd",
target_os = "openbsd",
target_os = "cygwin",
target_os = "illumos",
target_os = "aix",
target_vendor = "apple",
))]
pubfnlock(&self) -> io::Result<()>{
cvt(unsafe{ libc::flock(self.as_raw_fd(), libc::LOCK_EX)})?;
returnOk(());
}
#[cfg(target_os = "solaris")]
pubfnlock(&self) -> io::Result<()>{
. Windows also supports file locks, all other platforms are unsupported.

The list of platforms for which file locks are tested is smaller than
the list of platforms that support it. Synchronize these here.
Link: https://github.com/rust-lang/rust/blob/07bdbaedc63094281483c40a88a1a8f2f8ffadc5/library/std/src/sys/fs/unix.rs#L1291-L1308
@rustbotrustbot 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 Nov 19, 2025
@rustbot

Copy link
Copy Markdown
Collaborator

r? @ChrisDenton

rustbot has assigned @ChrisDenton.
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

@tgross35

This comment was marked as outdated.

@tgross35

Copy link
Copy Markdown
MemberAuthor

Sorry bors3

@bors2 try jobs=arm-android,test-various

@rust-bors

This comment has been minimized.

rust-borsBot added a commit that referenced this pull request Nov 19, 2025
fs: Run file lock tests on all platforms that support it
try-job: arm-android
try-job: test-various
@rust-log-analyzer

This comment has been minimized.

@rust-bors

rust-borsBot commented Nov 19, 2025

Copy link
Copy Markdown
Contributor

💔 Test for 534bfac failed: CI. Failed jobs:

Rather than skipping the tests, make sure that they fail. This ensures
that if file locking support is added for more platforms in the future,
the tests don't wind up quietly skipped.
@tgross35

Copy link
Copy Markdown
MemberAuthor

@bors2 try jobs=arm-android,test-various

rust-borsBot added a commit that referenced this pull request Nov 19, 2025
fs: Run file lock tests on all platforms that support it
try-job: arm-android
try-job: test-various
@rust-bors

This comment has been minimized.

@rust-bors

rust-borsBot commented Nov 20, 2025

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: eb7fa5a (eb7fa5adff9becc0b258d7730b9afab7defca4d6, parent: 07bdbaedc63094281483c40a88a1a8f2f8ffadc5)

@mati865

Copy link
Copy Markdown
Member

FYI, you no longer need to call bors2 because bors try already uses the new one: https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Testing.20try.20builds.20with.20new.20bors/near/530101996

@tgross35

Copy link
Copy Markdown
MemberAuthor

Thanks! I know it works now, just something that I ingrained pretty hard after having caused a try->r+ shootthrough to master a while back.

@ChrisDenton

Copy link
Copy Markdown
Member

I'm slightly nervous that something will break on full CI but let's find out...

@bors r+

@bors

bors commented Nov 20, 2025

Copy link
Copy Markdown
Collaborator

📌 Commit cea9dd8 has been approved by ChrisDenton

It is now in the queue for this repository.

@borsbors 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 Nov 20, 2025
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Nov 20, 2025
…enton
fs: Run file lock tests on all platforms that support it
There are a number of platforms that support file locking but aren't getting tested. Synchronize the list and mark the tests `should_panic` otherwise, to make sure they get updated if more platforms add locking support.
The supported platform list comes from https://github.com/rust-lang/rust/blob/07bdbaedc63094281483c40a88a1a8f2f8ffadc5/library/std/src/sys/fs/unix.rs#L1291-L1308. Windows also supports file locks, all other platforms are unsupported.
bors added a commit that referenced this pull request Nov 20, 2025
Rollup of 9 pull requests
Successful merges:
- #149033 (autodiff rlib handling)
- #149088 (Add missing trailing period to RustDoc for fn create_dir().)
- #149111 (fs: Run file lock tests on all platforms that support it)
- #149113 (sgx: avoid unnecessarily creating a slice)
- #149123 (std: sys: fs: uefi: Fix FileAttr size)
- #149125 (In `BTreeMap::eq`, do not compare the elements if the sizes are different.)
- #149133 (Remove an unused variable)
- #149134 (std: sys: net: uefi: Implement read_vectored)
- #149139 (Enable host tools for aarch64-unknown-linux-ohos)
r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit that referenced this pull request Nov 20, 2025
Rollup of 9 pull requests
Successful merges:
- #149033 (autodiff rlib handling)
- #149088 (Add missing trailing period to RustDoc for fn create_dir().)
- #149111 (fs: Run file lock tests on all platforms that support it)
- #149113 (sgx: avoid unnecessarily creating a slice)
- #149123 (std: sys: fs: uefi: Fix FileAttr size)
- #149133 (Remove an unused variable)
- #149139 (Enable host tools for aarch64-unknown-linux-ohos)
- #149144 (Reject `async fn` in `const impl` during AST validation)
- #149154 (Fix platform supports docs tiny typo)
r? `@ghost`
`@rustbot` modify labels: rollup
@bors
bors merged commit 001158a into rust-lang:mainNov 21, 2025
12 checks passed
@rustbotrustbot added this to the 1.93.0 milestone Nov 21, 2025
rust-timer added a commit that referenced this pull request Nov 21, 2025
Rollup merge of #149111 - tgross35:fs-test-updates, r=ChrisDenton
fs: Run file lock tests on all platforms that support it
There are a number of platforms that support file locking but aren't getting tested. Synchronize the list and mark the tests `should_panic` otherwise, to make sure they get updated if more platforms add locking support.
The supported platform list comes from https://github.com/rust-lang/rust/blob/07bdbaedc63094281483c40a88a1a8f2f8ffadc5/library/std/src/sys/fs/unix.rs#L1291-L1308. Windows also supports file locks, all other platforms are unsupported.
@tgross35
tgross35 deleted the fs-test-updates branch November 21, 2025 01:52
github-actionsBot pushed a commit to model-checking/verify-rust-std that referenced this pull request Jan 17, 2026
…enton
fs: Run file lock tests on all platforms that support it
There are a number of platforms that support file locking but aren't getting tested. Synchronize the list and mark the tests `should_panic` otherwise, to make sure they get updated if more platforms add locking support.
The supported platform list comes from https://github.com/rust-lang/rust/blob/07bdbaedc63094281483c40a88a1a8f2f8ffadc5/library/std/src/sys/fs/unix.rs#L1291-L1308. Windows also supports file locks, all other platforms are unsupported.
github-actionsBot pushed a commit to model-checking/verify-rust-std that referenced this pull request Jan 17, 2026
…iaskrgr
Rollup of 9 pull requests
Successful merges:
- rust-lang#149033 (autodiff rlib handling)
- rust-lang#149088 (Add missing trailing period to RustDoc for fn create_dir().)
- rust-lang#149111 (fs: Run file lock tests on all platforms that support it)
- rust-lang#149113 (sgx: avoid unnecessarily creating a slice)
- rust-lang#149123 (std: sys: fs: uefi: Fix FileAttr size)
- rust-lang#149133 (Remove an unused variable)
- rust-lang#149139 (Enable host tools for aarch64-unknown-linux-ohos)
- rust-lang#149144 (Reject `async fn` in `const impl` during AST validation)
- rust-lang#149154 (Fix platform supports docs tiny typo)
r? `@ghost`
`@rustbot` modify labels: rollup
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

@tgross35@rustbot@rust-log-analyzer@mati865@ChrisDenton@bors