Skip to content

cargo-sweep issue with Rust 1.85.0 #65

@JohnCMoon

Description

@JohnCMoon

Using this library, after upgrading to Rust version 1.85.0, I ran into an issue where cargo sweep was removing artifacts that were just built. For example, I have an Earthly job like this:

postgres-unit-test-image:
    FROM +pre-unit-test
    # Build the test binary
    DO rust+CARGO --args="build --tests --release --frozen --offline --features postgres" --output="release/deps/keylay-[^\./]+"
    # Copy the test binary as the container entrypoint
    RUN cp -a ./target/release/deps/keylay-* ./keylay-test
    ENTRYPOINT ["./keylay-test", "--test-threads=1"]

My build began failing at the RUN cp -a line. I noticed in the logs that cargo sweep -i -d was running immediately after the build completed and deleting the binaries that had just been built!

Digging in, I found that in Rust 1.85.0, the hash method used to fingerprint toolchains was modified, so cargo-sweep needed the same update.

I made a PR here that fixes the issue, but since this library has the dependency pinned to 0.7.0, the bug will persist here.

I don't know if the cargo-sweep team is planning on publishing another release soon, but I think this issue will bite anyone using this library with Rust 1.85.0+.

You can work around this issue by installing cargo-sweep yourself from their development branch before doing INIT in this library, but perhaps it would be better to install the fixed commit by default?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions