nix icon indicating copy to clipboard operation
nix copied to clipboard

add safe libc::clock_nanosleep wrapper

Open maxbla opened this issue 4 years ago • 6 comments

Fixes #1299

maxbla avatar Oct 13 '20 10:10 maxbla

libc::clock_nanosleep isn't defined for all platforms. https://github.com/rust-lang/libc/pull/1922 tries to fix this.

maxbla avatar Oct 14 '20 02:10 maxbla

this PR is waiting on the next minor release of libc

maxbla avatar Oct 15 '20 20:10 maxbla

@maxbla

this PR is waiting on the next minor release of libc

looks like libc 0.2.80 was cut a couple of weeks ago, and includes https://github.com/rust-lang/libc/pull/1922. could you bump the dependency version in Cargo.toml?

kamalmarhubi avatar Nov 11 '20 01:11 kamalmarhubi

@maxbla

looks like libc 0.2.80 was cut a couple of weeks ago, and includes rust-lang/libc#1922. could you bump the dependency version in Cargo.toml?

It seems to me that the bump is already part of the PR: https://github.com/nix-rust/nix/pull/1315/files#diff-2e9d962a08321605940b5a657135052fbcef87b5e360662bb527c96d9a615542R20

The libc dependency has been updated in master since then, so this needs a rebase.

jluebbe avatar Feb 15 '21 20:02 jluebbe

The new problem with this PR is that libc added clock_nanosleep for FreeBSD 12+ only. clock_nanosleep was implemented in FreeBSD 11.1, so libc couldn't add a wrapper for FreeBSD 11 (if it did, libc would fail to build for FreeBSD 11.0). As long as FreeBSD 11.x remains in tier 1 for nix, this PR can't be merged.

maxbla avatar Feb 15 '21 23:02 maxbla

The new problem with this PR is that libc added clock_nanosleep for FreeBSD 12+ only. clock_nanosleep was implemented in FreeBSD 11.1, so libc couldn't add a wrapper for FreeBSD 11 (if it did, libc would fail to build for FreeBSD 11.0). As long as FreeBSD 11.x remains in tier 1 for nix, this PR can't be merged.

Actually, that's not a problem. For one thing, Rust's FFI bindings don't know whether a function is present at build time. And they don't care whether it's present at runtime unless somebody tries to use it. For another thing, FreeBSD 11.0 is EoL. We shouldn't worry about it anymore. Long Live FreeBSD 11.4.

asomers avatar Feb 15 '21 23:02 asomers

Are there any updates to this?

wolthom avatar Feb 25 '23 20:02 wolthom

Is it realistic that there will be progress here?

marcfir avatar Dec 14 '23 07:12 marcfir

Gentle ping on the author @maxbla, are you still interested in finishing this PR? If not, I think I will pick it up add it to Nix:)

SteveLauC avatar Dec 16 '23 08:12 SteveLauC