denisidoro/navi

2.22.1 fails to build due to fs_at crate

0323pin opened this issue Β· 9 comments

Describe the bug
2.22.1 fails to build on NetBSD.

Versions:

  • OS: NetBSD-current (development branch)
  • Rust-1.68.2

Additional context
Build fails due to fs_at as follows:

   Compiling fs_at v0.1.4
error[E0425]: cannot find value `O_PATH` in crate `libc`
   --> /usr/pkgsrc/wip/navi/work/vendor/fs_at-0.1.4/src/unix.rs:130:55
    |
130 |             libc::O_RDONLY | libc::O_NOFOLLOW | libc::O_PATH | libc::O_CLOEXEC | libc::O_NOCTTY;
    |                                                       ^^^^^^ not found in `libc`

For more information about this error, try `rustc --explain E0425`.
error: could not compile `fs_at` due to previous error
warning: build failed, waiting for other jobs to finish...
*** Error code 101

Stop.
make[1]: stopped in /usr/pkgsrc/wip/navi
*** Error code 1

Stop.

Thanks for opening your first issue here! In case you're facing a bug, please update navi to the latest version first. Maybe the bug is already solved! :)

Could you please try to use the same versions as defined by the repo?

Namely, rust 1.67.0 instead of 1.68.2 with locked dependencies from Cargo.lock?

@denisidoro

I'm the NetBSD package maintainer and all our package builds are done in offline mode. The crate dependency versions used are the ones specified in Cargo.lock.

I don't see how downgrading Rust would help solving an issue related to a unknown variable.

I understand that this is basically not a navi issue, rather a problem in fs_at but, our package is currently stuck at 2.20.1 which, didn't depend on fs_at.

EDIT: Building fs_at standalone:

fs_at-0.1.4 > cargo build --release --locked
    Updating crates.io index
  Downloaded static_assertions v1.1.0
  Downloaded nix v0.26.2
  Downloaded cfg-if v0.1.10
  Downloaded bitflags v1.3.2
  Downloaded libc v0.2.140
  Downloaded cvt v0.1.1
  Downloaded cfg-if v1.0.0
  Downloaded 7 crates (1010.8 KB) in 1.19s
   Compiling libc v0.2.140
   Compiling bitflags v1.3.2
   Compiling static_assertions v1.1.0
   Compiling cfg-if v0.1.10
   Compiling cfg-if v1.0.0
   Compiling cvt v0.1.1
   Compiling nix v0.26.2
   Compiling fs_at v0.1.4 (/home/pin/Downloads/fs_at-0.1.4)
error[E0425]: cannot find value `O_PATH` in crate `libc`
   --> src/unix.rs:130:55
    |
130 |             libc::O_RDONLY | libc::O_NOFOLLOW | libc::O_PATH | libc::O_CLOEXEC | libc::O_NOCTTY;
    |                                                       ^^^^^^ not found in `libc`

For more information about this error, try `rustc --explain E0425`.
error: could not compile `fs_at` due to previous error
Exception: cargo exited with 101

@denisidoro This is worst than I thought, although I was afraid this would be the case :(

~ > grep -r "O_PATH" libc-0.2.141
...
libc-0.2.141/src/unix/bsd/freebsdlike/freebsd/mod.rs:pub const O_PATH: ::c_int = 0x00400000;
libc-0.2.141/src/unix/linux_like/android/mod.rs:pub const O_PATH: ::c_int = 0o10000000;
libc-0.2.141/src/unix/linux_like/emscripten/mod.rs:pub const O_PATH: ::c_int = 0o10000000;
libc-0.2.141/src/unix/linux_like/linux/gnu/b32/mod.rs:        pub const O_PATH: ::c_int = 0x1000000;
libc-0.2.141/src/unix/linux_like/linux/gnu/b32/mod.rs:        pub const O_PATH: ::c_int = 0o10000000;
libc-0.2.141/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs:pub const O_PATH: ::c_int = 0o10000000;
libc-0.2.141/src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs:pub const O_PATH: ::c_int = 0o10000000;
libc-0.2.141/src/unix/linux_like/linux/gnu/b64/mips64/mod.rs:pub const O_PATH: ::c_int = 0o10000000;
libc-0.2.141/src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs:pub const O_PATH: ::c_int = 0o10000000;
libc-0.2.141/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs:pub const O_PATH: ::c_int = 2097152;
libc-0.2.141/src/unix/linux_like/linux/gnu/b64/s390x.rs:pub const O_PATH: ::c_int = 0o10000000;
libc-0.2.141/src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs:pub const O_PATH: ::c_int = 0x1000000;
libc-0.2.141/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs:pub const O_PATH: ::c_int = 0o10000000;
libc-0.2.141/src/unix/linux_like/linux/musl/mod.rs:pub const O_PATH: ::c_int = 0o10000000;
libc-0.2.141/src/unix/linux_like/linux/uclibc/arm/mod.rs:pub const O_PATH: ::c_int = 0o10000000;
libc-0.2.141/src/unix/linux_like/linux/uclibc/mips/mod.rs:pub const O_PATH: ::c_int = 0o010000000;

No NetBSD support in libc :(

When I find some time, I'll check cargo tree to understand why fs_at is being included.

If it's not being used by the core logic, in theory I could put the logic behind a cargo feature so that we can build a more stripped down version for NetBSD

Seria Γ³ptimo, se for possΓ­vel. Obrigado!

navi v2.22.1 (/home/pin/Downloads/navi)
β”œβ”€β”€ anyhow v1.0.70
β”œβ”€β”€ clap v4.2.1
β”‚   β”œβ”€β”€ clap_builder v4.2.1
β”‚   β”‚   β”œβ”€β”€ anstream v0.2.6
β”‚   β”‚   β”‚   β”œβ”€β”€ anstyle v0.3.5
β”‚   β”‚   β”‚   β”œβ”€β”€ anstyle-parse v0.1.1
β”‚   β”‚   β”‚   β”‚   └── utf8parse v0.2.1
β”‚   β”‚   β”‚   β”œβ”€β”€ concolor-override v1.0.0
β”‚   β”‚   β”‚   β”œβ”€β”€ concolor-query v0.3.3
β”‚   β”‚   β”‚   β”œβ”€β”€ is-terminal v0.4.6
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ io-lifetimes v1.0.9
β”‚   β”‚   β”‚   β”‚   β”‚   └── libc v0.2.140
β”‚   β”‚   β”‚   β”‚   └── rustix v0.37.7
β”‚   β”‚   β”‚   β”‚       β”œβ”€β”€ bitflags v1.3.2
β”‚   β”‚   β”‚   β”‚       β”œβ”€β”€ errno v0.3.0
β”‚   β”‚   β”‚   β”‚       β”‚   └── libc v0.2.140
β”‚   β”‚   β”‚   β”‚       β”œβ”€β”€ io-lifetimes v1.0.9 (*)
β”‚   β”‚   β”‚   β”‚       └── libc v0.2.140
β”‚   β”‚   β”‚   └── utf8parse v0.2.1
β”‚   β”‚   β”œβ”€β”€ anstyle v0.3.5
β”‚   β”‚   β”œβ”€β”€ bitflags v1.3.2
β”‚   β”‚   β”œβ”€β”€ clap_lex v0.4.1
β”‚   β”‚   β”œβ”€β”€ once_cell v1.17.1
β”‚   β”‚   └── strsim v0.10.0
β”‚   β”œβ”€β”€ clap_derive v4.2.0 (proc-macro)
β”‚   β”‚   β”œβ”€β”€ heck v0.4.0
β”‚   β”‚   β”œβ”€β”€ proc-macro2 v1.0.56
β”‚   β”‚   β”‚   └── unicode-ident v1.0.8
β”‚   β”‚   β”œβ”€β”€ quote v1.0.26
β”‚   β”‚   β”‚   └── proc-macro2 v1.0.56 (*)
β”‚   β”‚   └── syn v2.0.13
β”‚   β”‚       β”œβ”€β”€ proc-macro2 v1.0.56 (*)
β”‚   β”‚       β”œβ”€β”€ quote v1.0.26 (*)
β”‚   β”‚       └── unicode-ident v1.0.8
β”‚   └── once_cell v1.17.1
β”œβ”€β”€ crossterm v0.26.1
β”‚   β”œβ”€β”€ bitflags v1.3.2
β”‚   β”œβ”€β”€ libc v0.2.140
β”‚   β”œβ”€β”€ mio v0.8.3
β”‚   β”‚   β”œβ”€β”€ libc v0.2.140
β”‚   β”‚   └── log v0.4.14
β”‚   β”‚       └── cfg-if v1.0.0
β”‚   β”œβ”€β”€ parking_lot v0.12.0
β”‚   β”‚   β”œβ”€β”€ lock_api v0.4.6
β”‚   β”‚   β”‚   └── scopeguard v1.1.0
β”‚   β”‚   └── parking_lot_core v0.9.1
β”‚   β”‚       β”œβ”€β”€ cfg-if v1.0.0
β”‚   β”‚       β”œβ”€β”€ libc v0.2.140
β”‚   β”‚       └── smallvec v1.10.0
β”‚   β”œβ”€β”€ signal-hook v0.3.13
β”‚   β”‚   β”œβ”€β”€ libc v0.2.140
β”‚   β”‚   └── signal-hook-registry v1.4.0
β”‚   β”‚       └── libc v0.2.140
β”‚   └── signal-hook-mio v0.2.3
β”‚       β”œβ”€β”€ libc v0.2.140
β”‚       β”œβ”€β”€ mio v0.8.3 (*)
β”‚       └── signal-hook v0.3.13 (*)
β”œβ”€β”€ directories-next v2.0.0
β”‚   β”œβ”€β”€ cfg-if v1.0.0
β”‚   └── dirs-sys-next v0.1.2
β”‚       └── libc v0.2.140
β”œβ”€β”€ dns_common v0.2.1
β”‚   β”œβ”€β”€ anyhow v1.0.70
β”‚   β”œβ”€β”€ directories-next v2.0.0 (*)
β”‚   β”œβ”€β”€ serde v1.0.159
β”‚   β”‚   └── serde_derive v1.0.159 (proc-macro)
β”‚   β”‚       β”œβ”€β”€ proc-macro2 v1.0.56 (*)
β”‚   β”‚       β”œβ”€β”€ quote v1.0.26 (*)
β”‚   β”‚       └── syn v2.0.13 (*)
β”‚   β”œβ”€β”€ serde_json v1.0.95
β”‚   β”‚   β”œβ”€β”€ itoa v1.0.6
β”‚   β”‚   β”œβ”€β”€ ryu v1.0.9
β”‚   β”‚   └── serde v1.0.159 (*)
β”‚   β”œβ”€β”€ serde_yaml v0.9.21
β”‚   β”‚   β”œβ”€β”€ indexmap v1.9.3
β”‚   β”‚   β”‚   └── hashbrown v0.12.3
β”‚   β”‚   β”‚   [build-dependencies]
β”‚   β”‚   β”‚   └── autocfg v1.0.1
β”‚   β”‚   β”œβ”€β”€ itoa v1.0.6
β”‚   β”‚   β”œβ”€β”€ ryu v1.0.9
β”‚   β”‚   β”œβ”€β”€ serde v1.0.159 (*)
β”‚   β”‚   └── unsafe-libyaml v0.2.8
β”‚   β”œβ”€β”€ tracing v0.1.37
β”‚   β”‚   β”œβ”€β”€ cfg-if v1.0.0
β”‚   β”‚   β”œβ”€β”€ pin-project-lite v0.2.9
β”‚   β”‚   β”œβ”€β”€ tracing-attributes v0.1.23 (proc-macro)
β”‚   β”‚   β”‚   β”œβ”€β”€ proc-macro2 v1.0.56 (*)
β”‚   β”‚   β”‚   β”œβ”€β”€ quote v1.0.26 (*)
β”‚   β”‚   β”‚   └── syn v1.0.109
β”‚   β”‚   β”‚       β”œβ”€β”€ proc-macro2 v1.0.56 (*)
β”‚   β”‚   β”‚       β”œβ”€β”€ quote v1.0.26 (*)
β”‚   β”‚   β”‚       └── unicode-ident v1.0.8
β”‚   β”‚   └── tracing-core v0.1.30
β”‚   β”‚       └── once_cell v1.17.1
β”‚   └── tracing-subscriber v0.3.16
β”‚       β”œβ”€β”€ matchers v0.1.0
β”‚       β”‚   └── regex-automata v0.1.10
β”‚       β”‚       └── regex-syntax v0.6.29
β”‚       β”œβ”€β”€ nu-ansi-term v0.46.0
β”‚       β”‚   └── overload v0.1.1
β”‚       β”œβ”€β”€ once_cell v1.17.1
β”‚       β”œβ”€β”€ regex v1.7.3
β”‚       β”‚   β”œβ”€β”€ aho-corasick v0.7.18
β”‚       β”‚   β”‚   └── memchr v2.4.0
β”‚       β”‚   β”œβ”€β”€ memchr v2.4.0
β”‚       β”‚   └── regex-syntax v0.6.29
β”‚       β”œβ”€β”€ sharded-slab v0.1.4
β”‚       β”‚   └── lazy_static v1.4.0
β”‚       β”œβ”€β”€ smallvec v1.10.0
β”‚       β”œβ”€β”€ thread_local v1.1.7
β”‚       β”‚   β”œβ”€β”€ cfg-if v1.0.0
β”‚       β”‚   └── once_cell v1.17.1
β”‚       β”œβ”€β”€ tracing v0.1.37 (*)
β”‚       β”œβ”€β”€ tracing-core v0.1.30 (*)
β”‚       └── tracing-log v0.1.3
β”‚           β”œβ”€β”€ lazy_static v1.4.0
β”‚           β”œβ”€β”€ log v0.4.14 (*)
β”‚           └── tracing-core v0.1.30 (*)
β”œβ”€β”€ dns_common_derive v0.2.1 (proc-macro)
β”‚   β”œβ”€β”€ proc-macro2 v1.0.56 (*)
β”‚   β”œβ”€β”€ quote v1.0.26 (*)
β”‚   └── synstructure v0.12.6
β”‚       β”œβ”€β”€ proc-macro2 v1.0.56 (*)
β”‚       β”œβ”€β”€ quote v1.0.26 (*)
β”‚       β”œβ”€β”€ syn v1.0.109 (*)
β”‚       └── unicode-xid v0.2.2
β”œβ”€β”€ edit v0.1.4
β”‚   β”œβ”€β”€ tempfile v3.2.0
β”‚   β”‚   β”œβ”€β”€ cfg-if v1.0.0
β”‚   β”‚   β”œβ”€β”€ libc v0.2.140
β”‚   β”‚   β”œβ”€β”€ rand v0.8.3
β”‚   β”‚   β”‚   β”œβ”€β”€ libc v0.2.140
β”‚   β”‚   β”‚   β”œβ”€β”€ rand_chacha v0.3.1
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ ppv-lite86 v0.2.10
β”‚   β”‚   β”‚   β”‚   └── rand_core v0.6.2
β”‚   β”‚   β”‚   β”‚       └── getrandom v0.2.3
β”‚   β”‚   β”‚   β”‚           β”œβ”€β”€ cfg-if v1.0.0
β”‚   β”‚   β”‚   β”‚           └── libc v0.2.140
β”‚   β”‚   β”‚   └── rand_core v0.6.2 (*)
β”‚   β”‚   └── remove_dir_all v0.5.3
β”‚   └── which v4.1.0
β”‚       β”œβ”€β”€ either v1.6.1
β”‚       └── libc v0.2.140
β”œβ”€β”€ lazy_static v1.4.0
β”œβ”€β”€ regex v1.7.3 (*)
β”œβ”€β”€ remove_dir_all v0.8.2
β”‚   β”œβ”€β”€ cfg-if v1.0.0
β”‚   β”œβ”€β”€ cvt v0.1.2
β”‚   β”‚   └── cfg-if v1.0.0
β”‚   β”œβ”€β”€ fs_at v0.1.4
β”‚   β”‚   β”œβ”€β”€ cfg-if v1.0.0
β”‚   β”‚   β”œβ”€β”€ cvt v0.1.2 (*)
β”‚   β”‚   β”œβ”€β”€ libc v0.2.140
β”‚   β”‚   └── nix v0.26.2
β”‚   β”‚       β”œβ”€β”€ bitflags v1.3.2
β”‚   β”‚       β”œβ”€β”€ cfg-if v1.0.0
β”‚   β”‚       β”œβ”€β”€ libc v0.2.140
β”‚   β”‚       └── static_assertions v1.1.0
β”‚   β”œβ”€β”€ lazy_static v1.4.0
β”‚   β”œβ”€β”€ libc v0.2.140
β”‚   └── normpath v1.1.1
β”œβ”€β”€ serde v1.0.159 (*)
β”œβ”€β”€ serde_yaml v0.9.21 (*)
β”œβ”€β”€ shellwords v1.1.0
β”‚   β”œβ”€β”€ lazy_static v1.4.0
β”‚   └── regex v1.7.3 (*)
β”œβ”€β”€ strip-ansi-escapes v0.1.1
β”‚   └── vte v0.10.1
β”‚       β”œβ”€β”€ arrayvec v0.5.2
β”‚       β”œβ”€β”€ utf8parse v0.2.1
β”‚       └── vte_generate_state_changes v0.1.1 (proc-macro)
β”‚           β”œβ”€β”€ proc-macro2 v1.0.56 (*)
β”‚           └── quote v1.0.26 (*)
β”œβ”€β”€ thiserror v1.0.40
β”‚   └── thiserror-impl v1.0.40 (proc-macro)
β”‚       β”œβ”€β”€ proc-macro2 v1.0.56 (*)
β”‚       β”œβ”€β”€ quote v1.0.26 (*)
β”‚       └── syn v2.0.13 (*)
β”œβ”€β”€ unicode-width v0.1.10
└── walkdir v2.3.3
    └── same-file v1.0.6

Looks like remove_dir_all v0.8.2 is pulling it in.

@denisidoro Workaround patch submitted, rbtcollins/fs_at#74

...
   Compiling navi v2.22.1 (/usr/pkgsrc/wip/navi/work/navi-2.22.1)
    Finished release [optimized] target(s) in 3m 48s