Repository navigation
fix: construct timespec with default() - #99
Merged
Merged
Conversation
depending on the libc crate version, target architecture and target
libc, timespec may contain private padding fields. on such targets, rust
1.99.0 with libc 0.2.187 hits the following error:
error: cannot construct `timespec` with struct literal syntax due to private fields
--> /home/buildozer/aports/community/kubie/tmp/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/interprocess-2.4.0/src/os/unix/c_wrappers.rs:435:8
|
435 | Ok(libc::timespec { tv_sec, tv_nsec: d.subsec_nanos() as _ })
| ^^^^^^^^^^^^^^
|
= note: ...and other private field `__pad0` that was not provided
help: consider using the `Default` trait
|
435 - Ok(libc::timespec { tv_sec, tv_nsec: d.subsec_nanos() as _ })
435 + Ok(<libc::timespec as std::default::Default>::default())
|
so, use timespec::default() to avoid the error. Default was implemented
for timespec in libc 0.2.183, so bump the dependency.
algitbot
pushed a commit
to alpinelinux/aports
that referenced
this pull request
Oct 16, 2026
kubie 0.28.0 transitively depends on interprocess via skim, and
interprocess has the following build issue on armv7:
error: cannot construct `timespec` with struct literal syntax due to private fields
--> /home/buildozer/aports/community/kubie/tmp/cargo/registry/src/index.crates.io-1949cf8c6b5b557f/interprocess-2.4.0/src/os/unix/c_wrappers.rs:435:8
|
435 | Ok(libc::timespec { tv_sec, tv_nsec: d.subsec_nanos() as _ })
| ^^^^^^^^^^^^^^
|
= note: ...and other private field `__pad0` that was not provided
help: consider using the `Default` trait
|
435 - Ok(libc::timespec { tv_sec, tv_nsec: d.subsec_nanos() as _ })
435 + Ok(<libc::timespec as std::default::Default>::default())
|
so, backport the updates to skim 5.1.0 from kubie master -- that removes
the interprocess dependency entirely.
Link: kotauskas/interprocess#99
kotauskas
added a commit
that referenced
this pull request
Oct 16, 2026
depending on the libc crate version, target architecture and target libc, `timespec` may contain private padding fields. Use `timespec::default()` to avoid the error. Default was implemented for timespec in libc 0.2.183, so bump the dependency. --------- Co-authored-by: Goat <v.toncharov@gmail.com>
kotauskas
added a commit
that referenced
this pull request
Oct 16, 2026
depending on the libc crate version, target architecture and target libc, `timespec` may contain private padding fields. Use `timespec::default()` to avoid the error. Default was implemented for timespec in libc 0.2.183, so bump the dependency. --------- Co-authored-by: Goat <v.toncharov@gmail.com>
kotauskas
added a commit
that referenced
this pull request
Oct 16, 2026
depending on the libc crate version, target architecture and target libc, `timespec` may contain private padding fields. Use `timespec::default()` to avoid the error. Default was implemented for timespec in libc 0.2.183, so bump the dependency. --------- Co-authored-by: Goat <v.toncharov@gmail.com>
kotauskas
added a commit
that referenced
this pull request
Oct 16, 2026
depending on the libc crate version, target architecture and target libc, `timespec` may contain private padding fields. Use `timespec::default()` to avoid the error. Default was implemented for timespec in libc 0.2.183, so bump the dependency. --------- Co-authored-by: Goat <v.toncharov@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
depending on the libc crate version, target architecture and target libc, timespec may contain private padding fields. on such targets, rust 1.99.0 with libc 0.2.187 hits the following error:
so, use timespec::default() to avoid the error. Default was implemented for timespec in libc 0.2.183, so bump the dependency.