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

Fix compilation error on Solaris due to flock usage #132977

Merged
merged 1 commit into from
Nov 15, 2024

Conversation

cberner
Copy link
Contributor

@cberner cberner commented Nov 13, 2024

PR 130999 added the file_lock feature, but libc does not define flock() for the Solaris platform leading to a compilation error.

Additionally, I went through all the Tier 2 platforms and read through their documentation to see whether flock was implemented. This turned up 5 more Unix platforms where flock is not supported, even though it may exist in the libc crate.

Fixes #132921

Related to #130999

@rustbot
Copy link
Collaborator

rustbot commented Nov 13, 2024

r? @thomcc

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

@rustbot rustbot added O-unix Operating system: Unix-like 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 13, 2024
Copy link
Member

@workingjubilee workingjubilee left a comment

Choose a reason for hiding this comment

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

squash?

@psumbera
Copy link
Contributor

I can confirm I can build Rust with these two commits on Solaris.

(I just wonder if there is any implication not implementing this feature...)

PR 130999 added the file_lock feature, but libc does not define
flock() for the Solaris platform leading to a compilation error.

Additionally, I went through all the Tier 2 platforms and read through
their documentation to see whether flock was implemented. This turned up
5 more Unix platforms where flock is not supported, even though it may
exist in the libc crate.
@cberner
Copy link
Contributor Author

cberner commented Nov 13, 2024

squash?

yep, done.

I can confirm I can build Rust with these two commits on Solaris.

(I just wonder if there is any implication not implementing this feature...)

I believe it's fine. This is a new unstable feature, and in the ACP it was decided that OSs without support should return ErrorKind::Unsupported

@tgross35
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Nov 14, 2024

📌 Commit 0df3ef4 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-review Status: Awaiting review from the assignee but also interested parties. labels Nov 14, 2024
@tgross35 tgross35 assigned tgross35 and unassigned thomcc Nov 14, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 15, 2024
…kingjubilee

Rollup of 8 pull requests

Successful merges:

 - rust-lang#132790 (Add as_slice/into_slice for IoSlice/IoSliceMut.)
 - rust-lang#132905 ([AIX] Add crate "unwind" to link with libunwind)
 - rust-lang#132977 (Fix compilation error on Solaris due to flock usage)
 - rust-lang#132984 ([illumos] use pipe2 to create anonymous pipes)
 - rust-lang#133019 (docs: Fix missing period and colon in methods for primitive types)
 - rust-lang#133048 (use `&raw` in `{read, write}_unaligned` documentation)
 - rust-lang#133050 (Always inline functions signatures containing `f16` or `f128`)
 - rust-lang#133053 (tests: Fix the SIMD FFI tests with certain x86 configuration)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 3f9f7c4 into rust-lang:master Nov 15, 2024
6 checks passed
@rustbot rustbot added this to the 1.84.0 milestone Nov 15, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Nov 15, 2024
Rollup merge of rust-lang#132977 - cberner:fix_solaris, r=tgross35

Fix compilation error on Solaris due to flock usage

PR 130999 added the file_lock feature, but libc does not define flock() for the Solaris platform leading to a compilation error.

Additionally, I went through all the Tier 2 platforms and read through their documentation to see whether flock was implemented. This turned up 5 more Unix platforms where flock is not supported, even though it may exist in the libc crate.

Fixes rust-lang#132921

Related to rust-lang#130999
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-unix Operating system: Unix-like 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.

Rust build fails on Solaris after: Implement file_lock feature
7 participants