nix icon indicating copy to clipboard operation
nix copied to clipboard

type mismatch in if_.rs on Solaris

Open gco opened this issue 1 year ago • 3 comments

Several flags added for Solaris are 64-bit unsigned integers causing:

error[E0308]: mismatched types
   --> /pool/projects/rust/rust-1.67.0/.cargo/registry/src/github.com-1ecc6299db9ec823/nix-0.22.3/src/macros.rs:56:35
    |
41  |  / macro_rules! libc_bitflags {
42  |  |     (
43  |  |         $(#[$outer:meta])*
44  |  |         pub struct $BitFlags:ident: $T:ty {
...    |
56  |  |                     const $Flag = libc::$Flag $(as $cast)*;
    |  |                                   ^^^^^^^^^^^ expected `i32`, found `i64`
...    |
60  |  |     };
61  |  | }
    |  |_- in this expansion of `libc_bitflags!`
    |
   ::: /pool/projects/rust/rust-1.67.0/.cargo/registry/src/github.com-1ecc6299db9ec823/nix-0.22.3/src/net/if_.rs:20:1
    |
20  | /  libc_bitflags!(
21  | |      /// Standard interface flags, used by `getifaddrs`
22  | |      pub struct InterfaceFlags: libc::c_int {
23  | |          /// Interface is running. (see
...   |
268 | |      }
269 | |  );
    | |__- in this macro invocation

gco avatar Jan 29 '23 08:01 gco

Is this a problem for Illumos too?

asomers avatar Jan 30 '23 23:01 asomers

No, it looks like all of the enumeration tags larger than i32 are conditional on Solaris.

gco avatar Jan 31 '23 00:01 gco

Nix doesn't have any CI for solaris and the maintainers don't make any attempt to support it. But if you submit a PR to fix this, we'll accept it.

asomers avatar Jul 15 '23 17:07 asomers