Skip to content

openbsd: convert futex timeout managment to Timespec usage #96860

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 3 commits into from
May 12, 2022

Conversation

semarie
Copy link
Contributor

@semarie semarie commented May 9, 2022

unbreak openbsd build after #96657

r? cuviper

please note I made Timespec::zero() public to be able to use it. OpenBSD is using relative timeout for futex(2) and I don't find simple way to use Timespec this way.

@rustbot rustbot added the T-libs Relevant to the library team, which will review and decide on the PR/issue. label May 9, 2022
@rust-highfive
Copy link
Contributor

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with r? rust-lang/libs-api @rustbot label +T-libs-api -T-libs to request review from a libs-api team reviewer. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

@rust-highfive
Copy link
Contributor

r? @m-ou-se

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 9, 2022
@semarie
Copy link
Contributor Author

semarie commented May 9, 2022

ah, bad syntax for my r? command ... so just cc @cuviper , and I will let you rearrange assignation the way you prefer. thanks

@semarie
Copy link
Contributor Author

semarie commented May 9, 2022

the build previously failed with :

     Running `/data/semarie/build-rust/build_dir/build/bootstrap/debug/rustc --crate-name std --edition=2021 library/std/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type dylib
--crate-type rlib --emit=dep-info,link -C prefer-dynamic -C opt-level=3 -C embed-bitcode=no -C debuginfo=0 --cfg 'feature="addr2line"' --cfg 'feature="backtrace"' --cfg 'feature="compiler-builtins-c"' --cfg 'feature="gimli-symbolize"'
--cfg 'feature="miniz_oxide"' --cfg 'feature="object"' --cfg 'feature="panic_unwind"' --cfg 'feature="std_detect_dlsym_getauxval"' --cfg 'feature="std_detect_file_io"' -C metadata=378c766641f06cb7 -C extra-filename=-378c766641f06cb7
--out-dir /data/semarie/build-rust/build_dir/build/x86_64-unknown-openbsd/stage0-std/x86_64-unknown-openbsd/release/deps --target x86_64-unknown-openbsd -L
dependency=/data/semarie/build-rust/build_dir/build/x86_64-unknown-openbsd/stage0-std/x86_64-unknown-openbsd/release/deps -L dependency=/data/semarie/build-rust/build_dir/build/x86_64-unknown-openbsd/stage0-std/release/deps --extern
addr2line=/data/semarie/build-rust/build_dir/build/x86_64-unknown-openbsd/stage0-std/x86_64-unknown-openbsd/release/deps/libaddr2line-54699a61a4996e32.rlib --extern
alloc=/data/semarie/build-rust/build_dir/build/x86_64-unknown-openbsd/stage0-std/x86_64-unknown-openbsd/release/deps/liballoc-c1464684857de2fb.rlib --extern
cfg_if=/data/semarie/build-rust/build_dir/build/x86_64-unknown-openbsd/stage0-std/x86_64-unknown-openbsd/release/deps/libcfg_if-911ca56735f69dbf.rlib --extern
compiler_builtins=/data/semarie/build-rust/build_dir/build/x86_64-unknown-openbsd/stage0-std/x86_64-unknown-openbsd/release/deps/libcompiler_builtins-5e745fef8d64cade.rlib --extern
core=/data/semarie/build-rust/build_dir/build/x86_64-unknown-openbsd/stage0-std/x86_64-unknown-openbsd/release/deps/libcore-c340d24d8e18ebf7.rlib --extern
hashbrown=/data/semarie/build-rust/build_dir/build/x86_64-unknown-openbsd/stage0-std/x86_64-unknown-openbsd/release/deps/libhashbrown-24ee209395c036b6.rlib --extern
libc=/data/semarie/build-rust/build_dir/build/x86_64-unknown-openbsd/stage0-std/x86_64-unknown-openbsd/release/deps/liblibc-48a88cf05aef92e5.rlib --extern
miniz_oxide=/data/semarie/build-rust/build_dir/build/x86_64-unknown-openbsd/stage0-std/x86_64-unknown-openbsd/release/deps/libminiz_oxide-eeb523364a36f721.rlib --extern
object=/data/semarie/build-rust/build_dir/build/x86_64-unknown-openbsd/stage0-std/x86_64-unknown-openbsd/release/deps/libobject-6fcd64c1f2a7a79d.rlib --extern
panic_abort=/data/semarie/build-rust/build_dir/build/x86_64-unknown-openbsd/stage0-std/x86_64-unknown-openbsd/release/deps/libpanic_abort-9c65896c13c96c61.rlib --extern
panic_unwind=/data/semarie/build-rust/build_dir/build/x86_64-unknown-openbsd/stage0-std/x86_64-unknown-openbsd/release/deps/libpanic_unwind-1fc476adbfc951f7.rlib --extern
rustc_demangle=/data/semarie/build-rust/build_dir/build/x86_64-unknown-openbsd/stage0-std/x86_64-unknown-openbsd/release/deps/librustc_demangle-1fa31f1cfd9e0d48.rlib --extern
std_detect=/data/semarie/build-rust/build_dir/build/x86_64-unknown-openbsd/stage0-std/x86_64-unknown-openbsd/release/deps/libstd_detect-e6ac865e361f7f7b.rlib --extern
unwind=/data/semarie/build-rust/build_dir/build/x86_64-unknown-openbsd/stage0-std/x86_64-unknown-openbsd/release/deps/libunwind-6af071432b46fe34.rlib --cfg=bootstrap -Csymbol-mangling-version=legacy -Zunstable-options -Zmacro-backtrace
-Clink-args=-Wl,-z,origin '-Clink-args=-Wl,-rpath,$ORIGIN/../lib' -Zunstable-options -Csplit-debuginfo=off -Cprefer-dynamic '-Zcrate-attr=doc(html_root_url="https://doc.rust-lang.org/nightly/")' -Z binary-dep-depinfo --cfg
backtrace_in_libstd -L native=/usr/lib`
error: associated function is never used: `to_timespec`
   --> library/std/src/sys/unix/time.rs:129:12
    |
129 |     pub fn to_timespec(&self) -> Option<libc::timespec> {
    |            ^^^^^^^^^^^
    |
    = note: `-D dead-code` implied by `-D warnings`


Did not run successfully: exit status: 1

@m-ou-se
Copy link
Member

m-ou-se commented May 9, 2022

the build previously failed with

error: associated function is never used: `to_timespec`

Yeah, that's going to happen on more platforms.

Maybe we should just add

#[allow(dead_code)] // not used on all platforms

to to_timespec().

@semarie semarie force-pushed the openbsd-futex-time64 branch from 0c42393 to d8ccbb5 Compare May 9, 2022 09:32
@semarie
Copy link
Contributor Author

semarie commented May 9, 2022

Maybe we should just add

#[allow(dead_code)] // not used on all platforms

to to_timespec().

@cuviper what do you think about it ?

@m-ou-se m-ou-se assigned cuviper and unassigned cuviper May 9, 2022
@cuviper
Copy link
Member

cuviper commented May 9, 2022

I think #[allow(dead_code)] is fine -- we already do that in a number of places in sys to avoid cumbersome cfg blocks, and this one is a small bit of code anyway.

@bors
Copy link
Collaborator

bors commented May 10, 2022

☔ The latest upstream changes (presumably #96904) made this pull request unmergeable. Please resolve the merge conflicts.

@semarie semarie force-pushed the openbsd-futex-time64 branch from 05b0ec7 to 42f8e1f Compare May 11, 2022 04:55
@semarie
Copy link
Contributor Author

semarie commented May 11, 2022

rebased after #96861

@cuviper
Copy link
Member

cuviper commented May 11, 2022

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented May 11, 2022

📌 Commit 42f8e1f has been approved by cuviper

@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 May 11, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request May 12, 2022
…askrgr

Rollup of 5 pull requests

Successful merges:

 - rust-lang#95896 (Note the contacts for the nvptx64 target(s))
 - rust-lang#96860 (openbsd: convert futex timeout managment to Timespec usage)
 - rust-lang#96939 (Fix settings page CSS)
 - rust-lang#96941 (update graphviz links)
 - rust-lang#96968 (Add tests for rust-lang#96806)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 80e1dec into rust-lang:master May 12, 2022
@rustbot rustbot added this to the 1.62.0 milestone May 12, 2022
@semarie semarie deleted the openbsd-futex-time64 branch May 13, 2022 06:43
# for free to join this conversation on GitHub. Already have an account? # 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.

6 participants