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

fails cross check --target x86_64-pc-solaris on 1.72.1 #2540

Open
jtmoon79 opened this issue Nov 16, 2024 · 3 comments
Open

fails cross check --target x86_64-pc-solaris on 1.72.1 #2540

jtmoon79 opened this issue Nov 16, 2024 · 3 comments

Comments

@jtmoon79
Copy link

jtmoon79 commented Nov 16, 2024

Cross-compiling nix 0.29.0 fails for platform x86_64-pc-solaris.

Running on Ubuntu 22, using rust 1.72.1

$ cross --version
cross 0.2.5
cargo 1.72.1 (103a7ff2e 2023-08-15)

$ cross check --locked --lib --bins --target x86_64-pc-solaris
...
   Compiling kinded_macros v0.3.0
error[E0425]: cannot find value `O_DIRECT` in crate `libc`
   --> /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/nix-0.29.0/src/fcntl.rs:113:9
    |
113 |         O_DIRECT;
    |         ^^^^^^^^ not found in `libc`

error[E0425]: cannot find value `SIGINFO` in crate `libc`
    --> /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/nix-0.29.0/src/sys/signal.rs:119:9
     |
119  |         SIGINFO,
     |         ^^^^^^^
     |
    ::: /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.164/src/unix/solarish/mod.rs:1285:1
     |
1285 | pub const SIGINT: ::c_int = 2;
     | ------------------------- similarly named constant `SIGINT` defined here
     |
help: a constant with a similar name exists
     |
119  |         SIGINT,
     |         ~~~~~~
help: consider importing this unit variant
     |
6    + use crate::sys::signal::Signal::SIGINFO;
     |

error[E0531]: cannot find unit struct, unit variant or constant `SIGINFO` in crate `libc`
    --> /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/nix-0.29.0/src/sys/signal.rs:119:9
     |
119  |         SIGINFO,
     |         ^^^^^^^
     |
    ::: /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libc-0.2.164/src/unix/solarish/mod.rs:1285:1
     |
1285 | pub const SIGINT: ::c_int = 2;
     | ------------------------- similarly named constant `SIGINT` defined here
     |
help: a constant with a similar name exists
     |
119  |         SIGINT,
     |         ~~~~~~
help: consider importing this unit variant
     |
6    + use crate::sys::signal::Signal::SIGINFO;
     |

    Checking hashbrown v0.14.2
error[E0081]: discriminant value `8` assigned more than once
   --> /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/nix-0.29.0/src/macros.rs:131:9
    |
131 | /         $v enum $BitFlags {
132 | |             $($entries)*
133 | |         }
    | |_________^
...
255 |                   $entry = libc::$entry,
    |                            ------------
    |                            |
    |                            `8` assigned here
    |                            `8` assigned here
    |
   ::: /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/nix-0.29.0/src/sys/signal.rs:28:1
    |
28  | / libc_enum! {
29  | |     /// Types of operating system signals
30  | |     // Currently there is only one definition of c_int in libc, as well as only one
31  | |     // type for signal constants.
...   |
121 | |     impl TryFrom<i32>
122 | | }
    | |_- in this macro invocation
    |
    = note: this error originates in the macro `libc_enum` (in Nightly build)

I found this by way of updating dependency tempfile from 3.13.0 to 3.14.0, which compiles kinded_macros 0.3.0, which compiles nix 0.29.0.

I have not tried other rust versions or platform configurations.

@jtmoon79
Copy link
Author

Closing. I'm unable to reproduce this error when compiling only the nix project.

$ git clone https://github.com/nix-rust/nix.git
$ cd nix
$ rustup override set 1.72.1
$ cross --version
cross 0.2.5
[cross] note: Falling back to `cargo` on the host.
cargo 1.72.1 (103a7ff2e 2023-08-15)
$ cross check --locked --lib --bins --target x86_64-pc-solaris

@SteveLauC
Copy link
Member

I think the build failure is expected because O_DIRECT is indeed unavailable on that target, the reason why you cannot reproduce it with Nix is that Nix has feature-gates, without enabling any of them, you are building a tiny set of Nix, checking it with --all-features should give you the errors.

@SteveLauC SteveLauC reopened this Nov 17, 2024
@SteveLauC
Copy link
Member

SteveLauC commented Nov 17, 2024

The thing that makes me confused is your crate has already been using Nix 0.29.0 (tempfile does not use Nix so it should be irrelated), why didn't this build fail in the past? 🤔

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

2 participants