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-plan fails when dev-dependencies are present #6082

Closed
KodrAus opened this issue Sep 24, 2018 · 3 comments · Fixed by #6086
Closed

--build-plan fails when dev-dependencies are present #6082

KodrAus opened this issue Sep 24, 2018 · 3 comments · Fixed by #6086

Comments

@KodrAus
Copy link

KodrAus commented Sep 24, 2018

Hi! It looks like there's a problem attempting to grab a build plan from libraries that use dev-dependencies.

Toolchain that fails:

rustc 1.30.0-nightly (f49f6e73a 2018-09-23)
cargo 1.31.0-nightly (de314a8b2 2018-09-21)

Toolchain that succeeds:

rustc 1.30.0-nightly (63c75d375 2018-09-21)
cargo 1.30.0-nightly (a5d829494 2018-09-13)

If I have a Cargo.toml that looks like:

[package]
name = "build-plan-test"
version = "0.0.0"

[dev-dependencies]
libc = "*"

When running cargo build -Z unstable-options --build-plan --verbose, I get the following output:

     Running `rustc
        --crate-name build_plan_test src/lib.rs
        --color always
        --crate-type lib
        --emit=dep-info,link
        -C debuginfo=2
        -C metadata=2746e0b9ac45f8b8
        -C extra-filename=-2746e0b9ac45f8b8
        --out-dir /Users/user/dev/build-plan-test/target/debug/deps
        -C incremental=/Users/user/dev/build-plan-test/target/debug/incremental
        -L dependency=/Users/user/dev/build-plan-test/target/debug/deps`
error: failed to find libc v0.2.43 
@KodrAus
Copy link
Author

KodrAus commented Sep 24, 2018

Sorry, I forgot to note that this Cargo.toml does output a build plan successfully:

[package]
name = "build-plan-test"
version = "0.0.0"

[dependencies]
libc = "*"

The difference there is that libc is declared as a regular dependency rather than a dev-dependency.

@ehuss
Copy link
Contributor

ehuss commented Sep 24, 2018

@alexcrichton This seems to be caused by #6005.

@alexcrichton
Copy link
Member

Indeed! Should be fixed by #6086

alexcrichton added a commit to alexcrichton/cargo that referenced this issue Sep 24, 2018
Regressed in rust-lang#6005 it looks like the build plan requires all packages to
be downloaded rather than just those coming out of `unit_dependenices`,
so let's make sure to download everything!

Closes rust-lang#6082
bors added a commit that referenced this issue Sep 24, 2018
Fix `--build-plan` with dev-dependencies

Regressed in #6005 it looks like the build plan requires all packages to
be downloaded rather than just those coming out of `unit_dependenices`,
so let's make sure to download everything!

Closes #6082
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.

3 participants