Skip to content

Nextest compiles all the deps #305

Open

Description

@dmitrmax

Hi!

I would like to make use of cargo-chief in the CI for unit tests stage, so I've prepared the docker image for the CI pipeline containing following two directives:

RUN cargo chef cook --clippy --all-targets --all-features --recipe-path recipe.json
RUN cargo chef cook --tests --benches --all-features --recipe-path recipe.json

In the pipeline I copy all the sources into the /app directory (where commands above took place) and run the CI commands. Clippy stage works like a charm - only my project is checked. When it comes to the unit test stage it runs the following command:

cargo nextest run --all-features --profile ci --config-file=.cargo/nextest.toml

But it does the compilation of all the dependencies. Only the downloading is skipped.

I wonder if I'm doing something wrong or nextest is incompatible with the cargo-chief?

Activity

  1. kylewlacy commented on May 11, 2025

    @kylewlacy

    I noticed the same thing when trying to build cargo-nextest. I noticed that cargo-chef changes the Cargo.lock lockfile when running cargo chef prepare: specifically, it changes the version fields of a few dependencies to 0.0.1. I'm not 100% sure this is the cause, but at least cargo vendor --locked fails because it considers the lockfile to be out of date.

    With cargo-nextest v0.9.95 here's the diff I got when using cargo-chef v0.1.71:

    --- _local/output/cargo-lock-a.toml     2025-05-10 23:34:07.719222264 -0700
    +++ _local/output/cargo-lock-b.toml     2025-05-10 23:34:07.719222264 -0700
    @@ -255,7 +255,7 @@
    [[package]]
    dependencies = ['camino', 'camino-tempfile', 'cfg-if', 'clap', 'color-eyre', 'dialoguer', 'duct', 'enable-ansi-support', 'guppy', 'idna_adapter', 'indent_write', 'itertools', 'miette', 'nextest-filtering', 'nextest-metadata', 'nextest-runner', 'nextest-workspace-hack', 'owo-colors 4.2.0', 'pathdiff', 'quick-junit', 'semver', 'serde_json', 'shell-words', 'supports-color', 'supports-unicode', 'swrite', 'thiserror 2.0.12', 'tracing', 'tracing-subscriber']
    name = 'cargo-nextest'
    -  version = '0.9.95'
    +  version = '0.0.1'
    
    [[package]]
    checksum = 'e35af189006b9c0f00a064685c727031e3ed2d8020f7ba284d78cc2671bd36ea'
    @@ -649,7 +649,7 @@
    [[package]]
    dependencies = ['maplit', 'nextest-metadata', 'nextest-workspace-hack']
    name = 'fixture-data'
    -  version = '0.1.0'
    +  version = '0.0.1'
    
    [[package]]
    checksum = 'c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c'
    @@ -1020,7 +1020,7 @@
    [[package]]
    dependencies = ['camino', 'camino-tempfile', 'cargo-nextest', 'cfg-if', 'clap', 'color-eyre', 'cp_r', 'datatest-stable', 'enable-ansi-support', 'fixture-data', 'fs-err', 'hex', 'insta', 'itertools', 'libtest-mimic', 'nextest-metadata', 'nextest-workspace-hack', 'num_threads', 'pathdiff', 'regex', 'serde_json', 'sha2', 'target-spec', 'target-spec-miette', 'tokio', 'whoami']
    name = 'integration-tests'
    -  version = '0.1.0'
    +  version = '0.0.1'
    
    [[package]]
    checksum = '469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130'
    @@ -1226,22 +1226,22 @@
    [[package]]
    dependencies = ['camino', 'clap', 'globset', 'guppy', 'miette', 'nextest-metadata', 'nextest-workspace-hack', 'proptest', 'recursion', 'regex', 'regex-syntax0.8.5', 'smol_str', 'test-case', 'test-strategy', 'thiserror 2.0.12', 'winnow','xxhash-rust']
    name = 'nextest-filtering'
    -  version = '0.15.0'
    +  version = '0.0.1'
    
    [[package]]
    dependencies = ['camino', 'nextest-workspace-hack', 'serde', 'serde_json', 'smol_str', 'target-spec', 'test-case']
    name = 'nextest-metadata'
    -  version = '0.12.2'
    +  version = '0.0.1'
    
    [[package]]
    dependencies = ['aho-corasick', 'async-scoped', 'atomicwrites', 'bstr', 'bytes', 'camino', 'camino-tempfile', 'cargo_metadata', 'cfg-if', 'chrono', 'color-eyre', 'config', 'console-subscriber', 'crossterm', 'debug-ignore', 'derive-where', 'duct', 'dunce', 'fixture-data', 'future-queue', 'futures', 'guppy', 'hex', 'home', 'http', 'humantime-serde', 'indent_write', 'indexmap 2.9.0', 'indicatif', 'indoc', 'insta', 'is_ci', 'itertools', 'libc', 'maplit', 'miette', 'mukti-metadata', 'newtype-uuid', 'nextest-filtering', 'nextest-metadata', 'nextest-workspace-hack', 'nix', 'owo-colors 4.2.0', 'pathdiff', 'pin-project-lite', 'pretty_assertions', 'proptest', 'quick-junit', 'rand 0.9.1', 'regex', 'self_update', 'semver', 'serde', 'serde_ignored', 'serde_json', 'serde_path_to_error', 'sha2', 'shell-words', 'smallvec', 'smol_str', 'strip-ansi-escapes', 'supports-unicode', 'swrite', 'tar', 'target-spec', 'target-spec-miette', 'test-case', 'test-strategy', 'thiserror 2.0.12', 'tokio', 'tokio-stream', 'toml', 'toml_edit', 'tracing', 'tracing-subscriber', 'unicode-ident', 'unicode-normalization', 'win32job', 'windows-sys 0.59.0', 'xxhash-rust', 'zstd']
    name = 'nextest-runner'
    -  version = '0.78.0'
    +  version = '0.0.1'
    
    [[package]]
    dependencies = ['aho-corasick', 'backtrace', 'bit-set', 'bit-vec', 'bitflags', 'camino', 'cc', 'clap', 'clap_builder', 'console', 'either', 'futures-channel', 'futures-core', 'futures-sink', 'getrandom 0.2.15', 'getrandom 0.3.1', 'idna_adapter', 'indexmap 2.9.0', 'libc', 'linux-raw-sys 0.4.15', 'log', 'memchr', 'miette', 'mio', 'num-traits', 'proc-macro2', 'quote', 'regex-automata 0.4.9', 'regex-syntax 0.8.5', 'rustix 0.38.44', 'serde', 'serde_json', 'smallvec', 'syn', 'target-spec', 'target-spec-miette', 'tokio', 'tracing-core', 'tracing-subscriber','windows-sys 0.52.0', 'windows-sys 0.59.0', 'xxhash-rust', 'zerocopy 0.7.35']
    name = 'nextest-workspace-hack'
    -  version = '0.1.0'
    +  version = '0.0.1'
    
    [[package]]
    checksum = '537bc3c4a347b87fd52ac6c03a02ab1302962cfd93373c5d7a112cdc337854cc'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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