extrawurst / gitui

Blazing 💥 fast terminal-ui for git written in rust 🦀
MIT License
18.5k stars 571 forks source link

v0.25/v0.25.1 does not build with cargo-1.70.0 (feature/dependency problem with env_logger and/or clap_builder) #2094

Open z1atk0 opened 8 months ago

z1atk0 commented 8 months ago

Describe the bug Out of old habit, I'm usually "rolling my own" instead of downloading binaries. The latest gitui-v0.25 does not build with cargo-1.70.0 for me, although this version should be fine according to the published build requirements.

To Reproduce

  1. download and extract v0.25 source tarball
  2. cd into gitui-0.25.0
  3. make build-release
  4. see the build fail immediately
[zlatko@disclosure:~/usrlocal/src]$ cd gitui-0.25.0/
[zlatko@disclosure:~/usrlocal/src/gitui-0.25.0]$ make build-release 
cargo build --release
    Updating crates.io index
error: failed to select a version for `env_logger`.
    ... required by package `asyncgit v0.25.0 (/usr/local/src/gitui-0.25.0/asyncgit)`
versions that meet the requirements `^0.11` (locked to 0.11.2) are: 0.11.2

the package `asyncgit` depends on `env_logger`, with features: `anstream` but `env_logger` does not have these features.
 It has an optional dependency with that name, but that dependency uses the "dep:" syntax in the features table, so it does not have an implicit feature with that name.

failed to select a version for `env_logger` which could resolve this conflict
make: *** [Makefile:19: build-release] Error 101
[zlatko@disclosure:~/usrlocal/src/gitui-0.25.0]$ cargo -V
cargo 1.70.0

Expected behavior Should either build fine as usual, or the build requirements should be updated (in case my rust/cargo is too old).

Context (please complete the following information):

extrawurst commented 8 months ago

its interesting. my first thought: impossible we build with our MSRV on CI, only to find out no, I forgot to update that. problem found? wrong, the update shows that CI builds fine with 1.70: #2097

extrawurst commented 8 months ago

damn maybe its just the same as #2090 - can you try building with cargo build --release --locked or cargo install --path "." --locked ?

z1atk0 commented 8 months ago

I did try both variants, but neither worked. Both resulted in exactly the same error message as before. I also tried cleaning out the package/crate cache in $CARGO_HOME first, which also didn't make any difference. :man_shrugging:

z1atk0 commented 8 months ago

Update: just tried 0.25.1 to see if this happens to fix my problem as well. Still the same error, though. However, when I tried to cargo install gitui --locked (as opposed to cargo build --release --locked), as mentioned in issue #2098, I now get a different error, which states that my rust/cargo is too old:

[zlatko@disclosure:~/usrlocal/src/gitui-0.25.1]$ cargo install gitui --locked
    Updating crates.io index
  Downloaded gitui v0.25.1
  Downloaded 1 crate (3.1 MB) in 1.17s
  Installing gitui v0.25.1
    Updating crates.io index
    Updating crates.io index
  Downloaded git-version v0.3.9
  Downloaded openssl-probe v0.1.5
  Downloaded num-traits v0.2.18
  Downloaded openssl-sys v0.9.101
  Downloaded git-version-macro v0.3.9
  Downloaded equivalent v1.0.1
  Downloaded fnv v1.0.7
  Downloaded fuzzy-matcher v0.3.7
  Downloaded strum v0.25.0
  Downloaded tinyvec_macros v0.1.1
  Downloaded indoc v2.0.4
  Downloaded inotify v0.9.6
  Downloaded gh-emoji v1.0.8
  Downloaded pkg-config v0.3.30
  Downloaded dirs v5.0.1
  Downloaded inotify-sys v0.1.5
  Downloaded bytesize v1.3.0
  Downloaded crossbeam-deque v0.8.5
  Downloaded phf v0.11.2
  Downloaded unicode-truncate v0.2.0
  Downloaded itoa v1.0.10
  Downloaded cfg-if v1.0.0
  Downloaded simplelog v0.12.1
  Downloaded form_urlencoded v1.2.1
  Downloaded signal-hook-mio v0.2.3
  Downloaded deranged v0.3.11
  Downloaded log v0.4.20
  Downloaded shell-escape v0.1.5
  Downloaded siphasher v0.3.11
  Downloaded bitflags v1.3.2
  Downloaded lru v0.12.2
  Downloaded crossbeam-epoch v0.9.18
  Downloaded unicode-segmentation v1.11.0
  Downloaded unicode-normalization v0.1.22
  Downloaded bwrap v1.3.0
  Downloaded option-ext v0.2.0
  Downloaded addr2line v0.21.0
  Downloaded vcpkg v0.2.15
  Downloaded ratatui v0.24.0
  Downloaded chrono v0.4.34
  Downloaded idna v0.5.0
  Downloaded git2 v0.18.2
  Downloaded gimli v0.28.1
  Downloaded num-conv v0.1.0
  Downloaded utf8parse v0.2.1
  Downloaded parking_lot v0.12.1
  Downloaded unicode-ident v1.0.12
  Downloaded version_check v0.9.4
  Downloaded dirs-sys v0.4.1
  Downloaded mio v0.8.10
  Downloaded time-core v0.1.2
  Downloaded crc32fast v1.4.0
  Downloaded smallvec v1.13.1
  Downloaded serde v1.0.197
  Downloaded colorchoice v1.0.0
  Downloaded scopeguard v1.2.0
  Downloaded notify v6.1.1
  Downloaded clap v4.5.1
  Downloaded same-file v1.0.6
  Downloaded flate2 v1.0.28
  Downloaded which v6.0.0
  Downloaded notify-debouncer-mini v0.4.1
  Downloaded memchr v2.7.1
  Downloaded time-macros v0.2.17
  Downloaded anstyle-query v1.0.2
  Downloaded jobserver v0.1.28
  Downloaded syn v2.0.49
  Downloaded aho-corasick v1.1.2
  Downloaded signal-hook v0.3.17
  Downloaded serde_json v1.0.113
  Downloaded rayon v1.8.1
  Downloaded rustix v0.38.31
  Downloaded libssh2-sys v0.3.0
  Downloaded object v0.32.2
  Downloaded libc v0.2.153
  Downloaded regex-automata v0.4.5
  Downloaded regex v1.10.3
  Downloaded syntect v5.2.0
  Downloaded linux-raw-sys v0.4.13
  Downloaded struct-patch v0.4.1
  Downloaded libgit2-sys v0.16.2+1.7.2
  Downloaded filetreelist v0.5.1
  Downloaded git2-hooks v0.3.1
  Downloaded easy-cast v0.5.2
  Downloaded struct-patch-derive v0.4.1
  Downloaded regex-syntax v0.8.2
  Downloaded clap_builder v4.5.1
  Downloaded itertools v0.12.1
  Downloaded bugreport v0.5.0
  Downloaded hashbrown v0.14.3
  Downloaded itertools v0.11.0
  Downloaded zerocopy v0.7.32
  Downloaded libz-sys v1.1.15
  Downloaded tui-textarea v0.4.0
  Downloaded crossterm v0.27.0
  Downloaded time v0.3.34
  Downloaded anyhow v1.0.80
  Downloaded url v2.5.0
  Downloaded indexmap v2.2.3
  Downloaded ron v0.8.1
  Downloaded rayon-core v1.12.1
  Downloaded fancy-regex v0.11.0
  Downloaded crossbeam-channel v0.5.11
  Downloaded base64 v0.21.7
  Downloaded tinyvec v1.6.0
  Downloaded ryu v1.0.16
  Downloaded backtrace v0.3.69
  Downloaded asyncgit v0.25.0
  Downloaded allocator-api2 v0.2.16
  Downloaded scopetime v0.1.2
  Downloaded walkdir v2.4.0
  Downloaded unicode-bidi v0.3.15
  Downloaded strum_macros v0.25.3
  Downloaded lock_api v0.4.11
  Downloaded miniz_oxide v0.7.2
  Downloaded bincode v1.3.3
  Downloaded anstream v0.6.12
  Downloaded errno v0.3.8
  Downloaded rustc-demangle v0.1.23
  Downloaded iana-time-zone v0.1.60
  Downloaded cc v1.0.83
  Downloaded serde_derive v1.0.197
  Downloaded crossbeam-utils v0.8.19
  Downloaded proc-macro2 v1.0.78
  Downloaded bitflags v2.4.2
  Downloaded openssl-src v300.2.3+3.2.1
  Downloaded strsim v0.11.0
  Downloaded shellexpand v3.1.0
  Downloaded anstyle v1.0.6
  Downloaded home v0.5.9
  Downloaded once_cell v1.19.0
  Downloaded autocfg v1.1.0
  Downloaded thread_local v1.1.7
  Downloaded sys-info v0.9.1
  Downloaded thiserror-impl v1.0.57
  Downloaded unicode-width v0.1.11
  Downloaded bit-vec v0.6.3
  Downloaded anstyle-parse v0.2.3
  Downloaded quote v1.0.35
  Downloaded parking_lot_core v0.9.9
  Downloaded ahash v0.8.9
  Downloaded signal-hook-registry v1.4.1
  Downloaded rustversion v1.0.14
  Downloaded thiserror v1.0.57
  Downloaded adler v1.0.2
  Downloaded either v1.10.0
  Downloaded bit-set v0.5.3
  Downloaded cassowary v0.3.0
  Downloaded clap_lex v0.7.0
  Downloaded heck v0.4.1
  Downloaded powerfmt v0.2.0
  Downloaded phf_shared v0.11.2
  Downloaded paste v1.0.14
  Downloaded percent-encoding v2.3.1
  Downloaded filetime v0.2.23
  Downloaded 155 crates (28.8 MB) in 2.78s (largest was `openssl-src` at 9.6 MB)
error: failed to compile `gitui v0.25.1`, intermediate artifacts can be found at `/tmp/cargo-installek2Zgw`

Caused by:
  package `clap_builder v4.5.1` cannot be built because it requires rustc 1.74 or newer, while the currently active rustc version is 1.70.0

Does this help to clear things up a bit, or does it make matters even more "WTF?" than before? :thinking: :man_shrugging: :innocent:

z1atk0 commented 7 months ago

Just for the record: make build-release (ie. cargo build --release --locked) works just fine with cargo-1.76.0. I upgraded from rust-1.70.0 to rust-1.76.0 today, after GNOME's loupe-46.0 build failed with the exact same error message that I got initially regarding env_logger (except for the ... required by package: part, of course :wink:):

error: failed to select a version for `env_logger`.
    ... required by package `asyncgit v0.25.0 (/usr/local/src/gitui-0.25.0/asyncgit)`
versions that meet the requirements `^0.11` (locked to 0.11.2) are: 0.11.2

the package `asyncgit` depends on `env_logger`, with features: `anstream` but `env_logger` does not have these features.
 It has an optional dependency with that name, but that dependency uses the "dep:" syntax in the features table, so it does not have an implicit feature with that name.

failed to select a version for `env_logger` which could resolve this conflict
haifengkao commented 6 months ago

I got the same issue with cargo 1.66.0-nightly (9210810d1 2022-10-25). rustup update solved the issue.

wugeer commented 2 weeks ago

You can try modifying it to the following code:

env_logger = { version = "0.11", default-features = false, features = [
    "color",
] }