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

Build failure when pulled in via cargo-outdated #1092

Closed
MaxG87 opened this issue Oct 22, 2024 · 5 comments
Closed

Build failure when pulled in via cargo-outdated #1092

MaxG87 opened this issue Oct 22, 2024 · 5 comments

Comments

@MaxG87
Copy link

MaxG87 commented Oct 22, 2024

I try do define a Rust base image to be used in several CI pipelines. This is what a MWE looks like:

ARG RUST_VERSION
FROM rust:${RUST_VERSION}-slim-bullseye

# The Rust base images seem to be created only once. Thus, in order to prevent
# using outdated packages, we need to update the image.
RUN apt update \
    && apt full-upgrade -y \
    && apt install -y curl git libssl-dev pkg-config \
    && apt clean \
    && rm -rf /var/lib/apt/lists/*

RUN cargo install cargo-outdated

Note that I install curl and git via apt. Before adding curl the container build fine. After adding curl I got the following error message:

100.7    Compiling git2-curl v0.19.0
101.6 error[E0425]: cannot find value `__deserializer` in this scope
101.6    --> /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/cargo-0.76.0/src/cargo/core/features.rs:734:32
101.6     |
101.6 734 |     #[serde(deserialize_with = "deserialize_build_std")]
101.6     |                                ^^^^^^^^^^^^^^^^^^^^^^^ not found in this scope
101.6
108.8 For more information about this error, try `rustc --explain E0425`.
108.8 error: could not compile `cargo` (lib) due to 1 previous error
108.9 error: failed to compile `cargo-outdated v0.15.0`, intermediate artifacts can be found at `/tmp/cargo-installMAtqaR`.
108.9 To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.
------
Dockerfile:12
--------------------
  10 |         && rm -rf /var/lib/apt/lists/*
  11 |
  12 | >>> RUN cargo install cargo-outdated
  13 |
--------------------
ERROR: failed to solve: process "/bin/sh -c cargo install cargo-outdated" did not complete successfully: exit code: 101

I find that puzzling and wanted to report the bug here. If you think the responsibility is with cargo-outdated, let me know. I'll open the ticket there.

edit: I forgot to add that this error appears when setting RUST_VERSION=1.82.0.

@weihanglo
Copy link
Member

weihanglo commented Oct 22, 2024

Which version of

  • curl
  • Rust toolchain
  • cargo-outdated

you were using or installing?

@ehuss
Copy link
Contributor

ehuss commented Oct 22, 2024

This does not look related to git2. The error is coming from building cargo-0.76.0 (which is quite an old version).

@MaxG87
Copy link
Author

MaxG87 commented Oct 22, 2024

Thank you for the replies so far.

How can cargo be outdated if I am using the most recent Rust image? 1.82-slim-bullseye was published only four days ago.

@weihanglo
Copy link
Member

https://crates.io/crates/cargo-outdated

The latest cargo-outdated (0.15.0) depends on an outdated [email protected] library, which is corresponding to Cargo 1.76.0. I suspect this is the root cause. There is already an open PR for it kbknapp/cargo-outdated#403.

@MaxG87
Copy link
Author

MaxG87 commented Oct 23, 2024

Thank you for the hint. I will move this to cargo-outdated.

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

No branches or pull requests

3 participants