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

gix-object v0.44.0 fail to compile #1538

Closed
NobodyXu opened this issue Aug 23, 2024 · 2 comments · Fixed by #1540
Closed

gix-object v0.44.0 fail to compile #1538

NobodyXu opened this issue Aug 23, 2024 · 2 comments · Fixed by #1540
Assignees
Labels
acknowledged an issue is accepted as shortcoming to be fixed

Comments

@NobodyXu
Copy link
Contributor

Current behavior 😯

https://github.com/cargo-bins/simple-git/actions/runs/10517678165/job/29142235436?pr=35

error[E0599]: `(&[u8], impl Parser<_, <_ as Stream>::Slice, _>, &[u8], fn(&mut _) -> Result<..., ...> {rest::<..., ...>})` is not an iterator
  --> /Users/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/gix-object-0.44.0/src/tag/decode.rs:59:26
   |
53 | /                     (
54 | |                         &PGP_SIGNATURE_BEGIN[1..],
55 | |                         take_until(0.., PGP_SIGNATURE_END),
56 | |                         PGP_SIGNATURE_END,
57 | |                         rest,
58 | |                     )
59 | |                         .take()
   | |                         -^^^^ `(&[u8], impl Parser<_, <_ as Stream>::Slice, _>, &[u8], fn(&mut _) -> Result<..., ...> {rest::<..., ...>})` is not an iterator
   | |_________________________|
   |
   |
   = note: the full type name has been written to '/Users/runner/work/simple-git/simple-git/target/aarch64-apple-darwin/debug/deps/gix_object-976e30f84e72c296.long-type-4190708012872330450.txt'
   = note: consider using `--verbose` to print the full type name to the console
   = note: the full name for the type has been written to '/Users/runner/work/simple-git/simple-git/target/aarch64-apple-darwin/debug/deps/gix_object-976e30f84e72c296.long-type-4190708012872330450.txt'
   = note: consider using `--verbose` to print the full type name to the console
   = note: the following trait bounds were not satisfied:
           `(&[u8], impl winnow::Parser<_, <_ as Stream>::Slice, _>, &'static [u8], for<'a> fn(&'a mut _) -> Result<<_ as Stream>::Slice, ErrMode<_>> {rest::<_, _>}): Iterator`
           which is required by `&mut (&[u8], impl winnow::Parser<_, <_ as Stream>::Slice, _>, &'static [u8], for<'a> fn(&'a mut _) -> Result<<_ as Stream>::Slice, ErrMode<_>> {rest::<_, _>}): Iterator`

error[E0599]: the method `take` exists for tuple `(impl Parser<_, <_ as Stream>::Slice, _>, &[u8], Map<..., ..., ..., ..., ..., ...>)`, but its trait bounds were not satisfied
  --> /Users/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/gix-object-0.44.0/src/parse.rs:25:14
   |
20 | /         (
21 | |             take_till(1.., NL),
22 | |             NL,
23 | |             repeat(1.., terminated((SPACE, take_until(0.., NL)), NL)).map(|()| ()),
24 | |         )
25 | |             .take()
   | |             -^^^^ method cannot be called due to unsatisfied trait bounds
   | |_____________|
   |
   |
   = note: the full type name has been written to '/Users/runner/work/simple-git/simple-git/target/aarch64-apple-darwin/debug/deps/gix_object-976e30f84e72c296.long-type-16570815735586947285.txt'
   = note: consider using `--verbose` to print the full type name to the console
   = note: the following trait bounds were not satisfied:
           `(impl winnow::Parser<_, <_ as Stream>::Slice, _>, &'static [u8], winnow::combinator::Map<winnow::combinator::Repeat<impl winnow::Parser<_, (_, _), _>, _, (_, _), (), _>, {closure@/Users/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/gix-object-0.44.0/src/parse.rs:23:75: 23:79}, _, (), (), _>): Iterator`
           which is required by `&mut (impl winnow::Parser<_, <_ as Stream>::Slice, _>, &'static [u8], winnow::combinator::Map<winnow::combinator::Repeat<impl winnow::Parser<_, (_, _), _>, _, (_, _), (), _>, {closure@/Users/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/gix-object-0.44.0/src/parse.rs:23:75: 23:79}, _, (), (), _>): Iterator`

Expected behavior 🤔

Should compile without error

Git behavior

No response

Steps to reproduce 🕹

No response

@Byron Byron added the acknowledged an issue is accepted as shortcoming to be fixed label Aug 23, 2024
@Byron Byron self-assigned this Aug 23, 2024
@Byron
Copy link
Owner

Byron commented Aug 23, 2024

I have cloned the simple-git repository and could reproduce the issue after using gix v0.66.

The issue seems to be due to gix assuming a more recent patch-level of winnow, which the repository locks into place.

simple-git ( main) +100 -228 [!] took 7s
❯ cargo update -p winnow
    Updating crates.io index
     Locking 1 package to latest compatible version
    Updating winnow v0.6.13 -> v0.6.18
note: pass `--verbose` to see 79 unchanged dependencies behind latest

simple-git ( main) +102 -230 [!]
❯ cargo check
    Checking winnow v0.6.18
    Checking hyper v1.4.1
    Checking hyper-util v0.1.6
    Checking gix-actor v0.32.0
    Checking reqwest v0.12.5
    Checking gix-object v0.44.0
    Checking gix-transport v0.42.3
    Checking gix-revwalk v0.15.0
    Checking gix-ref v0.47.0
    Checking gix-filter v0.13.0
    Checking gix-pack v0.53.0
    Checking gix-diff v0.46.0
    Checking gix-traverse v0.41.0
    Checking gix-revision v0.29.0
    Checking gix-negotiate v0.15.0
    Checking gix-protocol v0.45.3
    Checking gix-refspec v0.25.0
    Checking gix-index v0.35.0
    Checking gix-config v0.40.0
    Checking gix-discover v0.35.0
    Checking gix-odb v0.63.0
    Checking gix-worktree v0.36.0
    Checking gix-worktree-state v0.13.0
    Checking gix-submodule v0.14.0
    Checking gix v0.66.0
    Checking simple-git v0.2.11 (/Users/byron/dev/github.com/Byron/simple-git)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 3.42s

simple-git ( main) +102 -230 [!] took 3s

Updating the patch level of winnow in the Cargo.lock file seems to do the trick.

CC @epage

@Byron Byron closed this as not planned Won't fix, can't repro, duplicate, stale Aug 23, 2024
@NobodyXu
Copy link
Contributor Author

@Byron I think you should bump it in gix?

This is technically still a problem in gix, the older version of winnow should not be selectable, if it is not usable.

@Byron You could use cargo +nightly update -Zminimal-versions in CI to test this, I believe this issue should be re-opened.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
acknowledged an issue is accepted as shortcoming to be fixed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants