ogham / exa

A modern replacement for ‘ls’.
https://the.exa.website/
MIT License
23.68k stars 659 forks source link

rust nightly build failed #1163

Closed lucasjinreal closed 1 year ago

lucasjinreal commented 1 year ago

\users-0.11.0\src\switch.rs:72:26 | 72 | match unsafe { libc::setgid(gid) } { | ^^^^^^ help: a function with a similar name exists: `getpid ``

ariasuni commented 1 year ago

It seems you’re using Windows. I supposed you tried building exa after #820 was merged? Could you give more info and a more complete backtrace?

lucasjinreal commented 1 year ago

Yes, am on windows, so I am not able make it install or built.

ariasuni commented 1 year ago

It seems like you posted a small extract of the error message you get. Could you post the command you ran and the complete output?

mimikun commented 1 year ago

I have same issue.

my specifications:

PowerShell version table:

$PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.22621.963
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.22621.963
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

rustup toolchain:

➜ rustup toolchain list
stable-x86_64-pc-windows-msvc
nightly-x86_64-pc-windows-msvc (default)

rustc version

➜ rustc --version
rustc 1.70.0-nightly (7820b62d2 2023-03-05)

Install log(full, very long)

➜ cargo install exa
    Updating crates.io index
  Downloaded exa v0.10.1
  Downloaded 1 crate (136.6 KB) in 0.58s
  Installing exa v0.10.1
  Downloaded glob v0.3.1
  Downloaded pkg-config v0.3.26
  Downloaded number_prefix v0.4.0
  Downloaded percent-encoding v2.2.0
  Downloaded tinyvec_macros v0.1.1
  Downloaded vcpkg v0.2.15
  Downloaded num_cpus v1.15.0
  Downloaded unicode-normalization v0.1.22
  Downloaded unicode-bidi v0.3.10
  Downloaded form_urlencoded v1.1.0
  Downloaded cc v1.0.79
  Downloaded users v0.11.0
  Downloaded tinyvec v1.6.0
  Downloaded url v2.3.1
  Downloaded scoped_threadpool v0.1.9
  Downloaded lazy_static v1.4.0
  Downloaded pad v0.1.6
  Downloaded term_grid v0.1.7
  Downloaded cfg-if v1.0.0
  Downloaded locale v0.2.2
  Downloaded libc v0.2.139
  Downloaded git2 v0.13.25
  Downloaded unicode-width v0.1.10
  Downloaded term_size v0.3.2
  Downloaded zoneinfo_compiled v0.5.1
  Downloaded natord v1.0.9
  Downloaded datetime v0.5.2
  Downloaded libgit2-sys v0.12.26+1.3.0
  Downloaded winapi v0.3.9
  Downloaded byteorder v1.4.3
  Downloaded libz-sys v1.1.8
  Downloaded bitflags v1.3.2
  Downloaded jobserver v0.1.26
  Downloaded ansi_term v0.12.1
  Downloaded idna v0.3.0
  Downloaded log v0.4.17
  Downloaded 36 crates (7.3 MB) in 3.20s (largest was `libz-sys` at 2.5 MB)
   Compiling libc v0.2.139
   Compiling winapi v0.3.9
   Compiling jobserver v0.1.26
   Compiling pkg-config v0.3.26
   Compiling vcpkg v0.2.15
   Compiling tinyvec_macros v0.1.1
   Compiling unicode-width v0.1.10
   Compiling log v0.4.17
   Compiling cfg-if v1.0.0
   Compiling unicode-bidi v0.3.10
   Compiling percent-encoding v2.2.0
   Compiling byteorder v1.4.3
   Compiling bitflags v1.3.2
   Compiling lazy_static v1.4.0
   Compiling glob v0.3.1
   Compiling natord v1.0.9
   Compiling scoped_threadpool v0.1.9
   Compiling number_prefix v0.4.0
   Compiling num_cpus v1.15.0
   Compiling tinyvec v1.6.0
   Compiling pad v0.1.6
   Compiling term_grid v0.1.7
   Compiling form_urlencoded v1.1.0
   Compiling cc v1.0.79
   Compiling locale v0.2.2
   Compiling users v0.11.0
error[E0433]: failed to resolve: could not find `unix` in `os`
  --> C:\Users\dzdzb\.cargo\registry\src\github.com-1ecc6299db9ec823\users-0.11.0\src\base.rs:36:14
   |
36 | use std::os::unix::ffi::OsStrExt;
   |              ^^^^ could not find `unix` in `os`

error[E0432]: unresolved imports `libc::uid_t`, `libc::gid_t`
   --> C:\Users\dzdzb\.cargo\registry\src\github.com-1ecc6299db9ec823\users-0.11.0\src\lib.rs:128:16
    |
128 | pub use libc::{uid_t, gid_t};
    |                ^^^^^  ^^^^^ no `gid_t` in the root
    |                |
    |                no `uid_t` in the root

error[E0432]: unresolved imports `libc::uid_t`, `libc::gid_t`
  --> C:\Users\dzdzb\.cargo\registry\src\github.com-1ecc6299db9ec823\users-0.11.0\src\base.rs:45:20
   |
45 | use libc::{c_char, uid_t, gid_t, c_int};
   |                    ^^^^^  ^^^^^ no `gid_t` in the root
   |                    |
   |                    no `uid_t` in the root
   |
   = help: consider importing this unresolved item instead:
           uid_t
   = help: consider importing this unresolved item instead:
           gid_t

error[E0432]: unresolved import `libc::passwd`
  --> C:\Users\dzdzb\.cargo\registry\src\github.com-1ecc6299db9ec823\users-0.11.0\src\base.rs:46:5
   |
46 | use libc::passwd as c_passwd;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^ no `passwd` in the root

error[E0432]: unresolved import `libc::group`
  --> C:\Users\dzdzb\.cargo\registry\src\github.com-1ecc6299db9ec823\users-0.11.0\src\base.rs:47:5
   |
47 | use libc::group as c_group;
   |     ^^^^^^^^^^^^^^^^^^^^^^ no `group` in the root

error[E0432]: unresolved imports `libc::uid_t`, `libc::gid_t`
  --> C:\Users\dzdzb\.cargo\registry\src\github.com-1ecc6299db9ec823\users-0.11.0\src\cache.rs:87:12
   |
87 | use libc::{uid_t, gid_t};
   |            ^^^^^  ^^^^^ no `gid_t` in the root
   |            |
   |            no `uid_t` in the root
   |
   = help: consider importing this unresolved item instead:
           uid_t
   = help: consider importing this unresolved item instead:
           gid_t

error[E0432]: unresolved imports `libc::uid_t`, `libc::gid_t`
  --> C:\Users\dzdzb\.cargo\registry\src\github.com-1ecc6299db9ec823\users-0.11.0\src\mock.rs:63:16
   |
63 | pub use libc::{uid_t, gid_t};
   |                ^^^^^  ^^^^^ no `gid_t` in the root
   |                |
   |                no `uid_t` in the root
   |
   = help: consider importing this unresolved item instead:
           uid_t
   = help: consider importing this unresolved item instead:
           gid_t

error[E0432]: unresolved imports `libc::uid_t`, `libc::gid_t`
 --> C:\Users\dzdzb\.cargo\registry\src\github.com-1ecc6299db9ec823\users-0.11.0\src\switch.rs:4:12
  |
4 | use libc::{uid_t, gid_t, c_int};
  |            ^^^^^  ^^^^^ no `gid_t` in the root
  |            |
  |            no `uid_t` in the root
  |
  = help: consider importing this unresolved item instead:
          uid_t
  = help: consider importing this unresolved item instead:
          gid_t

error[E0432]: unresolved imports `libc::uid_t`, `libc::gid_t`
 --> C:\Users\dzdzb\.cargo\registry\src\github.com-1ecc6299db9ec823\users-0.11.0\src\traits.rs:4:12
  |
4 | use libc::{uid_t, gid_t};
  |            ^^^^^  ^^^^^ no `gid_t` in the root
  |            |
  |            no `uid_t` in the root
  |
  = help: consider importing this unresolved item instead:
          uid_t
  = help: consider importing this unresolved item instead:
          gid_t

error[E0433]: failed to resolve: could not find `UserExtras` in `os`
  --> C:\Users\dzdzb\.cargo\registry\src\github.com-1ecc6299db9ec823\users-0.11.0\src\base.rs:78:26
   |
78 |         let extras = os::UserExtras::default();
   |                          ^^^^^^^^^^ could not find `UserExtras` in `os`

error[E0433]: failed to resolve: could not find `GroupExtras` in `os`
   --> C:\Users\dzdzb\.cargo\registry\src\github.com-1ecc6299db9ec823\users-0.11.0\src\base.rs:192:26
    |
192 |         let extras = os::GroupExtras::default();
    |                          ^^^^^^^^^^^ could not find `GroupExtras` in `os`

error[E0433]: failed to resolve: could not find `UserExtras` in `os`
   --> C:\Users\dzdzb\.cargo\registry\src\github.com-1ecc6299db9ec823\users-0.11.0\src\base.rs:266:28
    |
266 |         extras:        os::UserExtras::from_passwd(passwd),
    |                            ^^^^^^^^^^ could not find `UserExtras` in `os`

error[E0433]: failed to resolve: could not find `GroupExtras` in `os`
   --> C:\Users\dzdzb\.cargo\registry\src\github.com-1ecc6299db9ec823\users-0.11.0\src\base.rs:280:23
    |
280 |         extras:   os::GroupExtras::from_struct(group),
    |                       ^^^^^^^^^^^ could not find `GroupExtras` in `os`

error[E0412]: cannot find type `UserExtras` in module `os`
  --> C:\Users\dzdzb\.cargo\registry\src\github.com-1ecc6299db9ec823\users-0.11.0\src\base.rs:57:17
   |
57 |     extras: os::UserExtras,
   |                 ^^^^^^^^^^ not found in `os`

error[E0412]: cannot find type `GroupExtras` in module `os`
   --> C:\Users\dzdzb\.cargo\registry\src\github.com-1ecc6299db9ec823\users-0.11.0\src\base.rs:171:17
    |
171 |     extras: os::GroupExtras,
    |                 ^^^^^^^^^^^ not found in `os`

error[E0425]: cannot find function `getpwuid_r` in crate `libc`
   --> C:\Users\dzdzb\.cargo\registry\src\github.com-1ecc6299db9ec823\users-0.11.0\src\base.rs:336:19
    |
336 |             libc::getpwuid_r(uid, &mut passwd, buf.as_mut_ptr(), buf.len(), &mut result)
    |                   ^^^^^^^^^^ not found in `libc`

error[E0425]: cannot find function `getpwnam_r` in crate `libc`
   --> C:\Users\dzdzb\.cargo\registry\src\github.com-1ecc6299db9ec823\users-0.11.0\src\base.rs:398:19
    |
398 |             libc::getpwnam_r(username.as_ptr(), &mut passwd, buf.as_mut_ptr(), buf.len(), &mut result)
    |                   ^^^^^^^^^^ not found in `libc`

error[E0425]: cannot find function `getgrgid_r` in crate `libc`
   --> C:\Users\dzdzb\.cargo\registry\src\github.com-1ecc6299db9ec823\users-0.11.0\src\base.rs:451:19
    |
451 |             libc::getgrgid_r(gid, &mut passwd, buf.as_mut_ptr(), buf.len(), &mut result)
    |                   ^^^^^^^^^^ not found in `libc`

error[E0425]: cannot find function `getgrnam_r` in crate `libc`
   --> C:\Users\dzdzb\.cargo\registry\src\github.com-1ecc6299db9ec823\users-0.11.0\src\base.rs:513:19
    |
513 |             libc::getgrnam_r(groupname.as_ptr(), &mut group, buf.as_mut_ptr(), buf.len(), &mut result)
    |                   ^^^^^^^^^^ not found in `libc`

error[E0425]: cannot find function `getuid` in crate `libc`
   --> C:\Users\dzdzb\.cargo\registry\src\github.com-1ecc6299db9ec823\users-0.11.0\src\base.rs:556:20
    |
556 |     unsafe { libc::getuid() }
    |                    ^^^^^^ help: a function with a similar name exists: `getpid`
    |
   ::: C:\Users\dzdzb\.cargo\registry\src\github.com-1ecc6299db9ec823\libc-0.2.139\src\windows\mod.rs:486:5
    |
486 |     pub fn getpid() -> ::c_int;
    |     -------------------------- similarly named function `getpid` defined here

error[E0425]: cannot find function `geteuid` in crate `libc`
   --> C:\Users\dzdzb\.cargo\registry\src\github.com-1ecc6299db9ec823\users-0.11.0\src\base.rs:603:20
    |
603 |     unsafe { libc::geteuid() }
    |                    ^^^^^^^ help: a function with a similar name exists: `getpid`
    |
   ::: C:\Users\dzdzb\.cargo\registry\src\github.com-1ecc6299db9ec823\libc-0.2.139\src\windows\mod.rs:486:5
    |
486 |     pub fn getpid() -> ::c_int;
    |     -------------------------- similarly named function `getpid` defined here

error[E0425]: cannot find function `getgid` in crate `libc`
   --> C:\Users\dzdzb\.cargo\registry\src\github.com-1ecc6299db9ec823\users-0.11.0\src\base.rs:647:20
    |
647 |     unsafe { libc::getgid() }
    |                    ^^^^^^ help: a function with a similar name exists: `getpid`
    |
   ::: C:\Users\dzdzb\.cargo\registry\src\github.com-1ecc6299db9ec823\libc-0.2.139\src\windows\mod.rs:486:5
    |
486 |     pub fn getpid() -> ::c_int;
    |     -------------------------- similarly named function `getpid` defined here

error[E0425]: cannot find function `getegid` in crate `libc`
   --> C:\Users\dzdzb\.cargo\registry\src\github.com-1ecc6299db9ec823\users-0.11.0\src\base.rs:691:20
    |
691 |     unsafe { libc::getegid() }
    |                    ^^^^^^^ help: a function with a similar name exists: `getpid`
    |
   ::: C:\Users\dzdzb\.cargo\registry\src\github.com-1ecc6299db9ec823\libc-0.2.139\src\windows\mod.rs:486:5
    |
486 |     pub fn getpid() -> ::c_int;
    |     -------------------------- similarly named function `getpid` defined here

error[E0425]: cannot find function `getgroups` in crate `libc`
   --> C:\Users\dzdzb\.cargo\registry\src\github.com-1ecc6299db9ec823\users-0.11.0\src\base.rs:745:15
    |
745 |         libc::getgroups(1024, buff.as_mut_ptr())
    |               ^^^^^^^^^ not found in `libc`

error[E0425]: cannot find value `buff` in this scope
   --> C:\Users\dzdzb\.cargo\registry\src\github.com-1ecc6299db9ec823\users-0.11.0\src\base.rs:783:21
    |
783 |     let mut count = buff.len() as c_int;
    |                     ^^^^ not found in this scope

error[E0425]: cannot find value `res` in this scope
   --> C:\Users\dzdzb\.cargo\registry\src\github.com-1ecc6299db9ec823\users-0.11.0\src\base.rs:799:8
    |
799 |     if res < 0 {
    |        ^^^ not found in this scope

error[E0425]: cannot find value `buff` in this scope
   --> C:\Users\dzdzb\.cargo\registry\src\github.com-1ecc6299db9ec823\users-0.11.0\src\base.rs:803:9
    |
803 |         buff.dedup();
    |         ^^^^ not found in this scope

error[E0425]: cannot find value `buff` in this scope
   --> C:\Users\dzdzb\.cargo\registry\src\github.com-1ecc6299db9ec823\users-0.11.0\src\base.rs:804:9
    |
804 |         buff.into_iter()
    |         ^^^^ not found in this scope

error[E0425]: cannot find function `setpwent` in crate `libc`
   --> C:\Users\dzdzb\.cargo\registry\src\github.com-1ecc6299db9ec823\users-0.11.0\src\base.rs:858:11
    |
858 |     libc::setpwent();
    |           ^^^^^^^^ not found in `libc`

error[E0425]: cannot find function `endpwent` in crate `libc`
   --> C:\Users\dzdzb\.cargo\registry\src\github.com-1ecc6299db9ec823\users-0.11.0\src\base.rs:873:24
    |
873 |         unsafe { libc::endpwent() };
    |                        ^^^^^^^^ not found in `libc`

error[E0425]: cannot find function `getpwent` in crate `libc`
   --> C:\Users\dzdzb\.cargo\registry\src\github.com-1ecc6299db9ec823\users-0.11.0\src\base.rs:890:37
    |
890 |         let result = unsafe { libc::getpwent() };
    |                                     ^^^^^^^^ not found in `libc`

error[E0425]: cannot find function `setuid` in crate `libc`
   --> C:\Users\dzdzb\.cargo\registry\src\github.com-1ecc6299db9ec823\users-0.11.0\src\switch.rs:41:26
    |
41  |     match unsafe { libc::setuid(uid) } {
    |                          ^^^^^^ help: a function with a similar name exists: `getpid`
    |
   ::: C:\Users\dzdzb\.cargo\registry\src\github.com-1ecc6299db9ec823\libc-0.2.139\src\windows\mod.rs:486:5
    |
486 |     pub fn getpid() -> ::c_int;
    |     -------------------------- similarly named function `getpid` defined here

error[E0425]: cannot find function `setgid` in crate `libc`
   --> C:\Users\dzdzb\.cargo\registry\src\github.com-1ecc6299db9ec823\users-0.11.0\src\switch.rs:72:26
    |
72  |     match unsafe { libc::setgid(gid) } {
    |                          ^^^^^^ help: a function with a similar name exists: `getpid`
    |
   ::: C:\Users\dzdzb\.cargo\registry\src\github.com-1ecc6299db9ec823\libc-0.2.139\src\windows\mod.rs:486:5
    |
486 |     pub fn getpid() -> ::c_int;
    |     -------------------------- similarly named function `getpid` defined here

error[E0425]: cannot find function `seteuid` in crate `libc`
   --> C:\Users\dzdzb\.cargo\registry\src\github.com-1ecc6299db9ec823\users-0.11.0\src\switch.rs:103:26
    |
103 |     match unsafe { libc::seteuid(uid) } {
    |                          ^^^^^^^ not found in `libc`

error[E0425]: cannot find function `setegid` in crate `libc`
   --> C:\Users\dzdzb\.cargo\registry\src\github.com-1ecc6299db9ec823\users-0.11.0\src\switch.rs:134:26
    |
134 |     match unsafe { libc::setegid(gid) } {
    |                          ^^^^^^^ not found in `libc`

   Compiling unicode-normalization v0.1.22
error[E0599]: no function or associated item named `from_bytes` found for struct `OsStr` in the current scope
   --> C:\Users\dzdzb\.cargo\registry\src\github.com-1ecc6299db9ec823\users-0.11.0\src\base.rs:252:20
    |
252 |     T::from(OsStr::from_bytes(CStr::from_ptr(p).to_bytes()))
    |                    ^^^^^^^^^^ function or associated item not found in `OsStr`

error[E0599]: no method named `as_bytes` found for reference `&OsStr` in the current scope
   --> C:\Users\dzdzb\.cargo\registry\src\github.com-1ecc6299db9ec823\users-0.11.0\src\base.rs:380:57
    |
380 |     let username = match CString::new(username.as_ref().as_bytes()) {
    |                                                         ^^^^^^^^ method not found in `&OsStr`

error[E0599]: no method named `as_bytes` found for reference `&OsStr` in the current scope
   --> C:\Users\dzdzb\.cargo\registry\src\github.com-1ecc6299db9ec823\users-0.11.0\src\base.rs:495:59
    |
495 |     let groupname = match CString::new(groupname.as_ref().as_bytes()) {
    |                                                           ^^^^^^^^ method not found in `&OsStr`

error[E0599]: no method named `as_bytes` found for reference `&OsStr` in the current scope
   --> C:\Users\dzdzb\.cargo\registry\src\github.com-1ecc6299db9ec823\users-0.11.0\src\base.rs:782:47
    |
782 |     let name = CString::new(username.as_ref().as_bytes()).unwrap();
    |                                               ^^^^^^^^ method not found in `&OsStr`

   Compiling libz-sys v1.1.8
   Compiling libgit2-sys v0.12.26+1.3.0
Some errors have detailed explanations: E0412, E0425, E0432, E0433, E0599.
For more information about an error, try `rustc --explain E0412`.
error: could not compile `users` due to 39 previous errors
warning: build failed, waiting for other jobs to finish...
error: failed to compile `exa v0.10.1`, intermediate artifacts can be found at `C:\Users\dzdzb\AppData\Local\Temp\cargo-installHyKfWn`
~ took 1m3s
lucasjinreal commented 1 year ago

Yes, same issue here

ariasuni commented 1 year ago

Any idea @skyline75489?

Maybe same as #1167.

skyline75489 commented 1 year ago

cargo install exa won't work, because there's no release containing Windows support yet. I can compile it using source code and rustc 1.63.0 (4b91a6ea7 2022-08-08) just fine

lucasjinreal commented 1 year ago

I was unable to build with rustc 1.65 on windows.

skyline75489 commented 1 year ago

I think 1.65 is untested & unsupported atm. In rust-toolchain.toml, 1.63 is specified.

lucasjinreal commented 1 year ago

that would be sad since all my toolchains using rust 1.65

lucasjinreal commented 1 year ago

I think it would be better for a utility lib support a more widely toolchains versions

skyline75489 commented 1 year ago

I just tired a clean build from source with rust 1.65 and it works. Are you building from source or using cargo install exa? The newest release 0.10.1 doesn't have the Windows support code, so cargo install exa won't work

lucasjinreal commented 1 year ago

Update: I was using 1.67actually, 2023-01-10 version. cargo install exa not work.

图片

skyline75489 commented 1 year ago

Yeah, as I said cargo install exa does not work because there's no newer release with Windows support. To build it on Windows, you have to build it from source.

lucasjinreal commented 1 year ago

I tried source not work as well

domsleee commented 1 year ago

I was able to install exa from source on windows with this command:

cargo install --git https://github.com/ogham/exa.git

This builds the latest code from the master branch.

The reason cargo install exa doesn't work is because it would use the latest release on crates.io, which doesn't have the windows support code merged, right?