Skip to content
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

Redeclaration of fs_type_t on musl + s390x #1968

Closed
ptrcnull opened this issue Jan 11, 2023 · 5 comments
Closed

Redeclaration of fs_type_t on musl + s390x #1968

ptrcnull opened this issue Jan 11, 2023 · 5 comments

Comments

@ptrcnull
Copy link

On a musl-based system running on s390x both of these lines are applicable:

#[cfg(all(target_os = "linux", target_arch = "s390x"))]
type fs_type_t = libc::c_uint;
#[cfg(all(target_os = "linux", target_env = "musl"))]
type fs_type_t = libc::c_ulong;

As such, trying to compile anything returns an error:

error[E0428]: the name `fs_type_t` is defined multiple times
  --> /home/buildozer/.cargo/registry/src/github.com-eae4ba8cbf2ce1c7/nix-0.26.1/src/sys/statfs.rs:68:1
   |
66 | type fs_type_t = libc::c_uint;
   | ------------------------------ previous definition of the type `fs_type_t` here
67 | #[cfg(all(target_os = "linux", target_env = "musl"))]
68 | 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
@ptrcnull
Copy link
Author

Same issue occurs with optimal_transfer_size and maximum_name_length

@nekopsykose
Copy link

this is addressed by #1835

@nekopsykose
Copy link

(see the last comment in particular- there are equivalent changes to make to libc first)

@williamdes
Copy link

Here is my build log on s390x while compiling rustpython: https://github.com/sudo-bot/docker-rustpython/actions/runs/4242719422/jobs/7374576275#step:5:615

#22 1769.0 error[E0428]: the name `fs_type_t` is defined multiple times
#22 1769.0   --> /workdir/registry/src/github.com-eae4ba8cbf2ce1c7/nix-0.24.2/src/sys/statfs.rs:33:1
#22 1769.0    |
#22 1769.0 31 | type fs_type_t = libc::c_uint;
#22 1769.0    | ------------------------------ previous definition of the type `fs_type_t` here
#22 1769.0 32 | #[cfg(all(target_os = "linux", target_env = "musl"))]
#22 1769.0 33 | type fs_type_t = libc::c_ulong;
#22 1769.0    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `fs_type_t` redefined here
#22 1769.0    |
#22 1769.0    = note: `fs_type_t` must be defined only once in the type namespace of this module
#22 1769.0 
#22 1772.7 error[E0425]: cannot find value `O_LARGEFILE` in crate `libc`
#22 1772.7    --> /workdir/registry/src/github.com-eae4ba8cbf2ce1c7/nix-0.24.2/src/fcntl.rs:121:9
#22 1772.7     |
#22 1772.7 121 |         O_LARGEFILE;
#22 1772.7     |         ^^^^^^^^^^^ not found in `libc`
#22 1772.7 
#22 1772.7 error[E0412]: cannot find type `ucontext_t` in crate `libc`
#22 1772.7   --> /workdir/registry/src/github.com-eae4ba8cbf2ce1c7/nix-0.24.2/src/ucontext.rs:11:20
#22 1772.7    |
#22 1772.7 11 |     context: libc::ucontext_t,
#22 1772.7    |                    ^^^^^^^^^^ not found in `libc`
#22 1772.7 
#22 1777.9 error[E0592]: duplicate definitions with name `optimal_transfer_size`
#22 1777.9    --> /workdir/registry/src/github.com-eae4ba8cbf2ce1c7/nix-0.24.2/src/sys/statfs.rs:258:5
#22 1777.9     |
#22 1777.9 248 |     pub fn optimal_transfer_size(&self) -> u32 {
#22 1777.9     |     ------------------------------------------ other definition for `optimal_transfer_size`
#22 1777.9 ...
#22 1777.9 258 |     pub fn optimal_transfer_size(&self) -> libc::c_ulong {
#22 1777.9     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ duplicate definitions for `optimal_transfer_size`
#22 1777.9 
#22 1777.9 error[E0592]: duplicate definitions with name `block_size`
#22 1777.9    --> /workdir/registry/src/github.com-eae4ba8cbf2ce1c7/nix-0.24.2/src/sys/statfs.rs:309:5
#22 1777.9     |
#22 1777.9 301 |     pub fn block_size(&self) -> u32 {
#22 1777.9     |     ------------------------------- other definition for `block_size`
#22 1777.9 ...
#22 1777.9 309 |     pub fn block_size(&self) -> libc::c_ulong {
#22 1777.9     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ duplicate definitions for `block_size`
#22 1777.9 
#22 1777.9 error[E0592]: duplicate definitions with name `maximum_name_length`
#22 1777.9    --> /workdir/registry/src/github.com-eae4ba8cbf2ce1c7/nix-0.24.2/src/sys/statfs.rs:367:5
#22 1777.9     |
#22 1777.9 360 |     pub fn maximum_name_length(&self) -> u32 {
#22 1777.9     |     ---------------------------------------- other definition for `maximum_name_length`
#22 1777.9 ...
#22 1777.9 367 |     pub fn maximum_name_length(&self) -> libc::c_ulong {
#22 1777.9     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ duplicate definitions for `maximum_name_length`
#22 1777.9 
#22 1777.9 Some errors have detailed explanations: E0412, E0425, E0428, E0592.
#22 1777.9 For more information about an error, try `rustc --explain E0412`.
#22 1778.0 error: could not compile `nix` due to 6 previous errors
#22 1778.0 warning: build failed, waiting for other jobs to finish...
#22 ERROR: process "/bin/sh -c cargo build --features freeze-stdlib --release --locked --offline --bin rustpython" did not complete successfully: exit code: 101
------
 > [builder 13/13] RUN cargo build --features freeze-stdlib --release --locked --offline --bin rustpython:
#22 1772.7 error[E0412]: cannot find type `ucontext_t` in crate `libc`
#22 1772.7   --> /workdir/registry/src/github.com-eae4ba8cbf2ce1c7/nix-0.24.2/src/ucontext.rs:11:20
#22 1772.7    |
#22 1772.7 11 |     context: libc::ucontext_t,
#22 1772.7    |                    ^^^^^^^^^^ not found in `libc`
#22 1772.7 

@SteveLauC
Copy link
Member

Close as completed in #1835

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants