BuildOutput::parse_file(&output_file, &pkg_name, &prev_root_output, &root_output)?
}
};
+
+ if json_messages {
+ let library_paths = output
+ .library_paths
+ .iter()
+ .map(|l| l.display().to_string())
+ .collect::<Vec<_>>();
+ machine_message::emit(&machine_message::BuildScript {
+ package_id: &id,
+ linked_libs: &output.library_links,
+ linked_paths: &library_paths,
+ cfgs: &output.cfgs,
+ env: &output.env,
+ });
+ }
+
build_state.insert(id, kind, output);
Ok(())
});
name = "foo"
version = "0.5.0"
authors = ["wycats@example.com"]
+ build = "build.rs"
[dependencies.bar]
path = "bar"
"#,
)
+ .file("build.rs", "fn main() { println!(\"cargo:rustc-cfg=xyz\") }")
.file("src/main.rs", "fn main() { let unused = 92; }")
.file(
"bar/Cargo.toml",
"fresh": false
}
+ {
+ "reason":"compiler-artifact",
+ "package_id":"foo 0.5.0 ([..])",
+ "target":{
+ "kind":["custom-build"],
+ "crate_types":["bin"],
+ "name":"build-script-build",
+ "src_path":"[..]build.rs"
+ },
+ "profile": {
+ "debug_assertions": true,
+ "debuginfo": 2,
+ "opt_level": "0",
+ "overflow_checks": true,
+ "test": false
+ },
+ "features": [],
+ "filenames": "{...}",
+ "fresh": false
+ }
+
+ {
+ "reason":"build-script-executed",
+ "package_id":"foo 0.5.0 ([..])",
+ "linked_libs":[],
+ "linked_paths":[],
+ "env":[],
+ "cfgs":["xyz"]
+ }
+
{
"reason":"compiler-message",
"package_id":"foo 0.5.0 ([..])",
.arg("json"),
execs().with_status(0).with_json(
r#"
+ {
+ "reason":"compiler-artifact",
+ "package_id":"foo 0.5.0 ([..])",
+ "target":{
+ "kind":["custom-build"],
+ "crate_types":["bin"],
+ "name":"build-script-build",
+ "src_path":"[..]build.rs"
+ },
+ "profile": {
+ "debug_assertions": true,
+ "debuginfo": 2,
+ "opt_level": "0",
+ "overflow_checks": true,
+ "test": false
+ },
+ "features": [],
+ "filenames": "{...}",
+ "fresh": true
+ }
+
{
"reason":"compiler-artifact",
"profile": {
"fresh": true
}
+ {
+ "reason":"build-script-executed",
+ "package_id":"foo 0.5.0 ([..])",
+ "linked_libs":[],
+ "linked_paths":[],
+ "env":[],
+ "cfgs":["xyz"]
+ }
+
{
"reason":"compiler-artifact",
"package_id":"foo 0.5.0 ([..])",