Skip to content

Build script failure hidden by dependency build failure  #835

Closed
@huonw

Description

@huonw
# a/Cargo.toml
[package]

name = "a"
version = "0.0.1"
authors = []
build = "build.rs"

[dependencies.b]
path = "../b"
// a/build.rs
fn main() { std::os::set_exit_status(1) }
# b/Cargo.toml
[package]

name = "b"
version = "0.0.1"
authors = []
// b/src/lib.rs
invalid

Then in a:

cargo clean && cargo build 
   Compiling a v0.0.1 (file:///home/huon/projects/test-rust/tmp/a)
   Compiling b v0.0.1 (file:///home/huon/projects/test-rust/tmp/a)
/home/huon/projects/test-rust/tmp/b/src/lib.rs:1:1: 1:8 error: expected item, found `invalid`
/home/huon/projects/test-rust/tmp/b/src/lib.rs:1 invalid
                                                 ^~~~~~~
Build failed, waiting for other jobs to finish...
Could not compile `b`.

The user is probably certainly more interested in the build script failing to build/run than the dependency. @alexcrichton's suggested resolution of #832 would possibly resolve this automatically too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-build-executionArea: anything dealing with executing the compilerA-diagnosticsArea: Error and warning messages generated by Cargo itself.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions