Skip to content

cargo doesn't rebuild either main or test binaries in a mixed language project #4979

Closed
@yshui

Description

@yshui

Demo repo: https://github.com/yshui/cargo-bug
This project uses a build script to compile a C file.

Steps to reproduce

  1. Clone the repo. Run cargo build, and cargo test. Both commands should do some compiling, which is expected.

  2. Change the C file, c/test.c. You can simply touch it.

  3. Run cargo {build, test} again, in any order.

Expected behaviour

Both cargo build and cargo test rebuilds

Actual behaviour

Only the first run command rebuilds, the second one doesn't. Leaving either the test binary or the main binary out-of-date

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