-
Notifications
You must be signed in to change notification settings - Fork 716
statfs: fixes for s390x+musl #1835
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
Conversation
207fa1c to
cf327d3
Compare
s390x musl with `allow_failures`, because it currently does not compile (see nix-rust#1835)
s390x musl with `allow_failures`, because it currently does not compile (see nix-rust#1835)
|
@selfisekai thanks for the contribution! Unfortunately it doesn't look like things are quite right, yet. You can test compiling for the cargo build --target s390x-unknown-linux-musl -Zbuild-stdI am getting more errors with these changes than without, unfortunately. Do you have a use case for the |
|
unfortunately I'm unable to run it with the use case is Alpine Linux supported architectures, I made an RFC for testing on this and more architectures: nix-rust/rfcs#5 |
|
Thanks for the link to the RFC; I hadn't seen it. As a hack to unblock yourself, you might try temporarily setting |
the errors appear to all be caused by libc now instead. things like f_namelen use u_long even though the actual musl source is the other issues are also most likely also caused by libc definitions, but i didn't look too deeply. the reason there are "more errors" is because the compilation does not abort early on these first ones fixed here, and then gets to the rest of the issues. that said, the same issue has to be raised in |
linux/musl/s390x: change f_* constants to uint from ulong musl defines these as `unsigned`, not `unsigned long` https://github.com/bminor/musl/blob/7d756e1c04de6eb3f2b3d3e1141a218bb329fcfb/arch/s390x/bits/statfs.h#L2 mostly relevant to also fixing nix-rust/nix#1835 that said, i don't know if this is a huge breaking change or not, only that the current one isn't correct afaict
|
libc 0.2.145 now has the necessary changes, you should try testing this again |
|
disregard- that also made it in |
cf327d3 to
c04295a
Compare
|
What is the status of this PR ? |
|
Hi @selfisekai, interested in rebasing your branch to run the CI again, the CI failures do not seem to be related to this PR |
a0ad4b1 to
158e65b
Compare
|
rebased, seems to compile fine for s390x-unknown-linux-musl |
|
ah, no. the other way |
158e65b to
e6ab008
Compare
SteveLauC
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
I believe this should fix problems in the log, except the one related to the libc crate. however, I'm not sure how to test these changes.
log from an s390x build
Compiling nix v0.24.2 error[E0428]: the name `fs_type_t` is defined multiple times --> /home/buildozer/.cargo/registry/src/github.com-eae4ba8cbf2ce1c7/nix-0.24.2/src/sys/statfs.rs:33:1 | 31 | type fs_type_t = libc::c_uint; | ------------------------------ previous definition of the type `fs_type_t` here 32 | #[cfg(all(target_os = "linux", target_env = "musl"))] 33 | type fs_type_t = libc::c_ulong; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `fs_type_t` redefined here | = note: `fs_type_t` must be defined only once in the type namespace of this module Compiling regex v1.6.0 error[E0425]: cannot find value `O_LARGEFILE` in crate `libc` --> /home/buildozer/.cargo/registry/src/github.com-eae4ba8cbf2ce1c7/nix-0.24.2/src/fcntl.rs:121:9 | 121 | O_LARGEFILE; | ^^^^^^^^^^^ not found in `libc` error[E0201]: duplicate definitions with name `optimal_transfer_size`: --> /home/buildozer/.cargo/registry/src/github.com-eae4ba8cbf2ce1c7/nix-0.24.2/src/sys/statfs.rs:258:5 | 248 | pub fn optimal_transfer_size(&self) -> u32 { | ------------------------------------------ previous definition of `optimal_transfer_size` here ... 258 | pub fn optimal_transfer_size(&self) -> libc::c_ulong { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ duplicate definition error[E0201]: duplicate definitions with name `block_size`: --> /home/buildozer/.cargo/registry/src/github.com-eae4ba8cbf2ce1c7/nix-0.24.2/src/sys/statfs.rs:309:5 | 301 | pub fn block_size(&self) -> u32 { | ------------------------------- previous definition of `block_size` here ... 309 | pub fn block_size(&self) -> libc::c_ulong { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ duplicate definition error[E0201]: duplicate definitions with name `maximum_name_length`: --> /home/buildozer/.cargo/registry/src/github.com-eae4ba8cbf2ce1c7/nix-0.24.2/src/sys/statfs.rs:367:5 | 360 | pub fn maximum_name_length(&self) -> u32 { | ---------------------------------------- previous definition of `maximum_name_length` here ... 367 | pub fn maximum_name_length(&self) -> libc::c_ulong { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ duplicate definition Some errors have detailed explanations: E0201, E0425, E0428. For more information about an error, try `rustc --explain E0201`. error: could not compile `nix` due to 5 previous errors