nix icon indicating copy to clipboard operation
nix copied to clipboard

Build failure with 0.30.1 on s390x

Open Kladki opened this issue 2 months ago • 3 comments

When trying to build a package that depends on nix 0.30.1 on an s390x system, I get the following errors:

error[E0308]: mismatched types
   --> /home/buildozer/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/nix-0.30.1/src/sys/statfs.rs:306:16
    |
306 |         FsType(self.0.f_type)
    |         ------ ^^^^^^^^^^^^^ expected `u64`, found `u32`
    |         |
    |         arguments to this struct are incorrect
    |
note: tuple struct defined here
   --> /home/buildozer/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/nix-0.30.1/src/sys/statfs.rs:94:12
    |
 94 | pub struct FsType(pub fs_type_t);
    |            ^^^^^^
help: you can convert a `u32` to a `u64`
    |
306 |         FsType(self.0.f_type.into())
    |                             +++++++
error[E0308]: mismatched types
   --> /home/buildozer/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/nix-0.30.1/src/sys/statfs.rs:345:9
    |
344 |     pub fn optimal_transfer_size(&self) -> libc::c_ulong {
    |                                            ------------- expected `u64` because of return type
345 |         self.0.f_bsize
    |         ^^^^^^^^^^^^^^ expected `u64`, found `u32`
    |
help: you can convert a `u32` to a `u64`
    |
345 |         self.0.f_bsize.into()
    |                       +++++++
error[E0308]: mismatched types
   --> /home/buildozer/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/nix-0.30.1/src/sys/statfs.rs:401:9
    |
400 |     pub fn block_size(&self) -> libc::c_ulong {
    |                                 ------------- expected `u64` because of return type
401 |         self.0.f_bsize
    |         ^^^^^^^^^^^^^^ expected `u64`, found `u32`
    |
help: you can convert a `u32` to a `u64`
    |
401 |         self.0.f_bsize.into()
    |                       +++++++
error[E0308]: mismatched types
   --> /home/buildozer/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/nix-0.30.1/src/sys/statfs.rs:485:9
    |
484 |     pub fn maximum_name_length(&self) -> libc::c_ulong {
    |                                          ------------- expected `u64` because of return type
485 |         self.0.f_namelen
    |         ^^^^^^^^^^^^^^^^ expected `u64`, found `u32`
    |
help: you can convert a `u32` to a `u64`
    |
485 |         self.0.f_namelen.into()
    |                         +++++++
For more information about this error, try `rustc --explain E0308`.
error: could not compile `nix` (lib) due to 4 previous errors
warning: build failed, waiting for other jobs to finish...

Non-default features enabled: "user", "fs"

Kladki avatar Oct 05 '25 12:10 Kladki

Confirmed on nix-0.29.0 on an Alpine Linux build

williamdes avatar Oct 28 '25 21:10 williamdes

Currently affecting ruff on Alpine: https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/93818

WhyNotHugo avatar Nov 27 '25 12:11 WhyNotHugo

it will affect an increasing number of our aports

omnivagant avatar Dec 10 '25 10:12 omnivagant