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

Fails to install with stable rustc (1.71.1) and cargo (0.72.2) #332

Closed
ozanmakes opened this issue Aug 8, 2023 · 3 comments · Fixed by #333
Closed

Fails to install with stable rustc (1.71.1) and cargo (0.72.2) #332

ozanmakes opened this issue Aug 8, 2023 · 3 comments · Fixed by #333

Comments

@ozanmakes
Copy link

Our CI started failing with latest stable versions of the toolchain installed by rustup.

Error:

   ...
   Compiling gix-discover v0.18.1
   Compiling gix-config v0.22.0
   Compiling gix-transport v0.31.0
   Compiling crates-io v0.37.0
   Compiling gix-protocol v0.32.0
   Compiling gix v0.44.1
   Compiling git2 v0.17.2
   Compiling git2-curl v0.18.0
error[E0599]: `Vec<u8>` is not an iterator
   --> /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cargo-0.72.2/src/cargo/core/compiler/future_incompat.rs:275:18
    |
274 | /             strip_ansi_escapes::strip(&to_display)
275 | |                 .map(|v| String::from_utf8(v).expect("utf8"))
    | |                 -^^^ `Vec<u8>` is not an iterator; try calling `.into_iter()` or `.iter()`
    | |_________________|
    | 
   --> /rustc/eb26296b556cef10fb713a38f3d16b9886080f26/library/alloc/src/vec/mod.rs:396:1
    |
    = note: doesn't satisfy `Vec<u8>: Iterator`
    |
    = note: the following trait bounds were not satisfied:
            `Vec<u8>: Iterator`
            which is required by `&mut Vec<u8>: Iterator`
            `[u8]: Iterator`
            which is required by `&mut [u8]: Iterator`
    = help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
    |
36  + use winnow::parser::Parser;
    |

error[E0599]: `Vec<u8>` is not an iterator
    --> /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cargo-0.72.2/src/cargo/core/compiler/mod.rs:1644:26
     |
1643 | /                     strip_ansi_escapes::strip(&msg.rendered)
1644 | |                         .map(|v| String::from_utf8(v).expect("utf8"))
     | |                         -^^^ `Vec<u8>` is not an iterator; try calling `.into_iter()` or `.iter()`
     | |_________________________|
     | 
    --> /rustc/eb26296b556cef10fb713a38f3d16b9886080f26/library/alloc/src/vec/mod.rs:396:1
     |
     = note: doesn't satisfy `Vec<u8>: Iterator`
     |
     = note: the following trait bounds were not satisfied:
             `Vec<u8>: Iterator`
             which is required by `&mut Vec<u8>: Iterator`
             `[u8]: Iterator`
             which is required by `&mut [u8]: Iterator`
     = help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
     |
34   + use winnow::parser::Parser;
     |

error[E0599]: `Vec<u8>` is not an iterator
    --> /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cargo-0.72.2/src/cargo/core/compiler/mod.rs:1678:22
     |
1677 |                   error.rendered = strip_ansi_escapes::strip(&error.rendered)
     |  __________________________________-
1678 | |                     .map(|v| String::from_utf8(v).expect("utf8"))
     | |                     -^^^ `Vec<u8>` is not an iterator; try calling `.into_iter()` or `.iter()`
     | |_____________________|
     | 
    --> /rustc/eb26296b556cef10fb713a38f3d16b9886080f26/library/alloc/src/vec/mod.rs:396:1
     |
     = note: doesn't satisfy `Vec<u8>: Iterator`
     |
     = note: the following trait bounds were not satisfied:
             `Vec<u8>: Iterator`
             which is required by `&mut Vec<u8>: Iterator`
             `[u8]: Iterator`
             which is required by `&mut [u8]: Iterator`
     = help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
     |
34   + use winnow::parser::Parser;
     |

For more information about this error, try `rustc --explain E0599`.
error: could not compile `cargo` (lib) due to 3 previous errors
error: failed to compile `cargo-c v0.9.22+cargo-0.72`, intermediate artifacts can be found at `/tmp/cargo-installSEPbgS`

I used this command to reproduce it as of 8 Aug 2023:

docker run --rm ubuntu:22.04 bash -c 'apt-get update && apt-get install -y curl build-essential libssl-dev pkg-config && curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -y && env PATH="/root/.cargo/bin:${PATH}" cargo install cargo-c'
@sdroege
Copy link
Contributor

sdroege commented Aug 8, 2023

That's a bug in strip-ansi-escapes, see luser/strip-ansi-escapes#17

@Rajrup
Copy link

Rajrup commented Aug 8, 2023

Is there a way to install cargo-c using the older version (0.1.1) of strip-ansi-escapes?

@evaporei
Copy link

evaporei commented Aug 9, 2023

@Rajrup for now I've made a local copy of cargo-c, rolled strip-ansi-escapes version back and ran cargo install --path ..

If you want to do the same you can either add strip-ansi-escapes = "=0.1.1" to the [dependencies] section of Cargo.toml, or just run cargo update -p strip-ansi-escapes --precise 0.1.1 (in ithis case you'll have to add --locked to cargo install).

lu-zero added a commit that referenced this issue Aug 9, 2023
And update cargo to 0.72.2 and pin strip-ansi-escapes since 0.1.2 is
broken.

Fixes #332.
lu-zero added a commit that referenced this issue Aug 9, 2023
And update cargo to 0.72.2 and pin strip-ansi-escapes since 0.1.2 is
broken.

Fixes #332.
lu-zero added a commit that referenced this issue Aug 9, 2023
And update cargo to 0.72.2 and pin strip-ansi-escapes since 0.1.2 is
broken.

Fixes #332.
lu-zero added a commit that referenced this issue Aug 9, 2023
And update cargo to 0.72.2 and pin strip-ansi-escapes since 0.1.2 is
broken.

Fixes #332.
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

Successfully merging a pull request may close this issue.

4 participants