diff --git a/tests/testsuite/build.rs b/tests/testsuite/build.rs index dd67161d6..176ec706d 100644 --- a/tests/testsuite/build.rs +++ b/tests/testsuite/build.rs @@ -4161,7 +4161,7 @@ fn compiler_json_error_format() { ) .file( "build.rs", - "fn main() { println!(\"cargo:rustc-cfg=xyz\") }", + "fn main() { println!(\"cargo::rustc-cfg=xyz\") }", ) .file("src/main.rs", "fn main() { let unused = 92; }") .file("bar/Cargo.toml", &basic_manifest("bar", "0.5.0")) @@ -5314,11 +5314,11 @@ fn deterministic_cfg_flags() { "build.rs", r#" fn main() { - println!("cargo:rustc-cfg=cfg_a"); - println!("cargo:rustc-cfg=cfg_b"); - println!("cargo:rustc-cfg=cfg_c"); - println!("cargo:rustc-cfg=cfg_d"); - println!("cargo:rustc-cfg=cfg_e"); + println!("cargo::rustc-cfg=cfg_a"); + println!("cargo::rustc-cfg=cfg_b"); + println!("cargo::rustc-cfg=cfg_c"); + println!("cargo::rustc-cfg=cfg_d"); + println!("cargo::rustc-cfg=cfg_e"); } "#, ) diff --git a/tests/testsuite/build_script_env.rs b/tests/testsuite/build_script_env.rs index 5220506a7..94c096124 100644 --- a/tests/testsuite/build_script_env.rs +++ b/tests/testsuite/build_script_env.rs @@ -12,7 +12,7 @@ fn rerun_if_env_changes() { "build.rs", r#" fn main() { - println!("cargo:rerun-if-env-changed=FOO"); + println!("cargo::rerun-if-env-changed=FOO"); } "#, ) @@ -66,8 +66,8 @@ fn rerun_if_env_or_file_changes() { "build.rs", r#" fn main() { - println!("cargo:rerun-if-env-changed=FOO"); - println!("cargo:rerun-if-changed=foo"); + println!("cargo::rerun-if-env-changed=FOO"); + println!("cargo::rerun-if-changed=foo"); } "#, ) @@ -112,7 +112,7 @@ fn rerun_if_env_or_file_changes() { fn rustc_bootstrap() { let build_rs = r#" fn main() { - println!("cargo:rustc-env=RUSTC_BOOTSTRAP=1"); + println!("cargo::rustc-env=RUSTC_BOOTSTRAP=1"); } "#; let p = project() diff --git a/tests/testsuite/build_script_extra_link_arg.rs b/tests/testsuite/build_script_extra_link_arg.rs index 964a55e97..49c33d979 100644 --- a/tests/testsuite/build_script_extra_link_arg.rs +++ b/tests/testsuite/build_script_extra_link_arg.rs @@ -16,7 +16,7 @@ fn build_script_extra_link_arg_bin() { "build.rs", r#" fn main() { - println!("cargo:rustc-link-arg-bins=--this-is-a-bogus-flag"); + println!("cargo::rustc-link-arg-bins=--this-is-a-bogus-flag"); } "#, ) @@ -53,9 +53,9 @@ fn build_script_extra_link_arg_bin_single() { "build.rs", r#" fn main() { - println!("cargo:rustc-link-arg-bins=--bogus-flag-all"); - println!("cargo:rustc-link-arg-bin=foo=--bogus-flag-foo"); - println!("cargo:rustc-link-arg-bin=bar=--bogus-flag-bar"); + println!("cargo::rustc-link-arg-bins=--bogus-flag-all"); + println!("cargo::rustc-link-arg-bin=foo=--bogus-flag-foo"); + println!("cargo::rustc-link-arg-bin=bar=--bogus-flag-bar"); } "#, ) @@ -81,7 +81,7 @@ fn build_script_extra_link_arg() { "build.rs", r#" fn main() { - println!("cargo:rustc-link-arg=--this-is-a-bogus-flag"); + println!("cargo::rustc-link-arg=--this-is-a-bogus-flag"); } "#, ) @@ -102,7 +102,7 @@ fn link_arg_missing_target() { .file("src/lib.rs", "") .file( "build.rs", - r#"fn main() { println!("cargo:rustc-link-arg-cdylib=--bogus"); }"#, + r#"fn main() { println!("cargo::rustc-link-arg-cdylib=--bogus"); }"#, ) .build(); @@ -112,28 +112,28 @@ fn link_arg_missing_target() { // .with_status(101) // .with_stderr("\ // [COMPILING] foo [..] - // error: invalid instruction `cargo:rustc-link-arg-cdylib` from build script of `foo v0.0.1 ([ROOT]/foo)` + // error: invalid instruction `cargo::rustc-link-arg-cdylib` from build script of `foo v0.0.1 ([ROOT]/foo)` // The package foo v0.0.1 ([ROOT]/foo) does not have a cdylib target. // ") // .run(); p.change_file( "build.rs", - r#"fn main() { println!("cargo:rustc-link-arg-bins=--bogus"); }"#, + r#"fn main() { println!("cargo::rustc-link-arg-bins=--bogus"); }"#, ); p.cargo("check") .with_status(101) .with_stderr("\ [COMPILING] foo [..] -error: invalid instruction `cargo:rustc-link-arg-bins` from build script of `foo v0.0.1 ([ROOT]/foo)` +error: invalid instruction `cargo::rustc-link-arg-bins` from build script of `foo v0.0.1 ([ROOT]/foo)` The package foo v0.0.1 ([ROOT]/foo) does not have a bin target. ") .run(); p.change_file( "build.rs", - r#"fn main() { println!("cargo:rustc-link-arg-bin=abc=--bogus"); }"#, + r#"fn main() { println!("cargo::rustc-link-arg-bin=abc=--bogus"); }"#, ); p.cargo("check") @@ -141,7 +141,7 @@ The package foo v0.0.1 ([ROOT]/foo) does not have a bin target. .with_stderr( "\ [COMPILING] foo [..] -error: invalid instruction `cargo:rustc-link-arg-bin` from build script of `foo v0.0.1 ([ROOT]/foo)` +error: invalid instruction `cargo::rustc-link-arg-bin` from build script of `foo v0.0.1 ([ROOT]/foo)` The package foo v0.0.1 ([ROOT]/foo) does not have a bin target with the name `abc`. ", ) @@ -149,7 +149,7 @@ The package foo v0.0.1 ([ROOT]/foo) does not have a bin target with the name `ab p.change_file( "build.rs", - r#"fn main() { println!("cargo:rustc-link-arg-bin=abc"); }"#, + r#"fn main() { println!("cargo::rustc-link-arg-bin=abc"); }"#, ); p.cargo("check") @@ -157,8 +157,8 @@ The package foo v0.0.1 ([ROOT]/foo) does not have a bin target with the name `ab .with_stderr( "\ [COMPILING] foo [..] -error: invalid instruction `cargo:rustc-link-arg-bin=abc` from build script of `foo v0.0.1 ([ROOT]/foo)` -The instruction should have the form cargo:rustc-link-arg-bin=BIN=ARG +error: invalid instruction `cargo::rustc-link-arg-bin=abc` from build script of `foo v0.0.1 ([ROOT]/foo)` +The instruction should have the form cargo::rustc-link-arg-bin=BIN=ARG ", ) .run(); @@ -192,7 +192,7 @@ fn cdylib_link_arg_transitive() { "bar/build.rs", r#" fn main() { - println!("cargo:rustc-link-arg-cdylib=--bogus"); + println!("cargo::rustc-link-arg-cdylib=--bogus"); } "#, ) @@ -204,7 +204,7 @@ fn cdylib_link_arg_transitive() { [COMPILING] bar v1.0.0 [..] [RUNNING] `rustc --crate-name build_script_build bar/build.rs [..] [RUNNING] `[..]build-script-build[..] -warning: bar@1.0.0: cargo:rustc-link-arg-cdylib was specified in the build script of bar v1.0.0 \ +warning: bar@1.0.0: cargo::rustc-link-arg-cdylib was specified in the build script of bar v1.0.0 \ ([ROOT]/foo/bar), but that package does not contain a cdylib target Allowing this was an unintended change in the 1.50 release, and may become an error in \ @@ -230,7 +230,7 @@ fn link_arg_transitive_not_allowed() { "build.rs", r#" fn main() { - println!("cargo:rustc-link-arg=--bogus"); + println!("cargo::rustc-link-arg=--bogus"); } "#, ) @@ -289,7 +289,7 @@ fn link_arg_with_doctest() { "build.rs", r#" fn main() { - println!("cargo:rustc-link-arg=--this-is-a-bogus-flag"); + println!("cargo::rustc-link-arg=--this-is-a-bogus-flag"); } "#, ) @@ -313,7 +313,7 @@ fn build_script_extra_link_arg_tests() { "build.rs", r#" fn main() { - println!("cargo:rustc-link-arg-tests=--this-is-a-bogus-flag"); + println!("cargo::rustc-link-arg-tests=--this-is-a-bogus-flag"); } "#, ) @@ -337,7 +337,7 @@ fn build_script_extra_link_arg_benches() { "build.rs", r#" fn main() { - println!("cargo:rustc-link-arg-benches=--this-is-a-bogus-flag"); + println!("cargo::rustc-link-arg-benches=--this-is-a-bogus-flag"); } "#, ) @@ -361,7 +361,7 @@ fn build_script_extra_link_arg_examples() { "build.rs", r#" fn main() { - println!("cargo:rustc-link-arg-examples=--this-is-a-bogus-flag"); + println!("cargo::rustc-link-arg-examples=--this-is-a-bogus-flag"); } "#, ) diff --git a/tests/testsuite/check_cfg.rs b/tests/testsuite/check_cfg.rs index 5a0ad7905..195dcf588 100644 --- a/tests/testsuite/check_cfg.rs +++ b/tests/testsuite/check_cfg.rs @@ -343,7 +343,7 @@ fn build_script_feedback() { .file("src/main.rs", "fn main() {}") .file( "build.rs", - r#"fn main() { println!("cargo:rustc-check-cfg=cfg(foo)"); }"#, + r#"fn main() { println!("cargo::rustc-check-cfg=cfg(foo)"); }"#, ) .build(); @@ -369,7 +369,7 @@ fn build_script_doc() { .file("src/main.rs", "fn main() {}") .file( "build.rs", - r#"fn main() { println!("cargo:rustc-check-cfg=cfg(foo)"); }"#, + r#"fn main() { println!("cargo::rustc-check-cfg=cfg(foo)"); }"#, ) .build(); @@ -478,8 +478,8 @@ fn build_script_test() { .file( "build.rs", r#"fn main() { - println!("cargo:rustc-check-cfg=cfg(foo)"); - println!("cargo:rustc-cfg=foo"); + println!("cargo::rustc-check-cfg=cfg(foo)"); + println!("cargo::rustc-cfg=foo"); }"#, ) .file( diff --git a/tests/testsuite/cross_compile.rs b/tests/testsuite/cross_compile.rs index b57ba2c7a..32c1a4bf5 100644 --- a/tests/testsuite/cross_compile.rs +++ b/tests/testsuite/cross_compile.rs @@ -721,7 +721,7 @@ fn build_script_needed_for_host_and_target() { use std::env; fn main() { let target = env::var("TARGET").unwrap(); - println!("cargo:rustc-flags=-L /path/to/{}", target); + println!("cargo::rustc-flags=-L /path/to/{}", target); } "#, ) @@ -1098,7 +1098,10 @@ fn platform_specific_variables_reflected_in_build_scripts() { build = "build.rs" "#, ) - .file("d1/build.rs", r#"fn main() { println!("cargo:val=1") }"#) + .file( + "d1/build.rs", + r#"fn main() { println!("cargo::metadata=val=1") }"#, + ) .file("d1/src/lib.rs", "") .file( "d2/Cargo.toml", @@ -1111,7 +1114,10 @@ fn platform_specific_variables_reflected_in_build_scripts() { build = "build.rs" "#, ) - .file("d2/build.rs", r#"fn main() { println!("cargo:val=1") }"#) + .file( + "d2/build.rs", + r#"fn main() { println!("cargo::metadata=val=1") }"#, + ) .file("d2/src/lib.rs", "") .build(); diff --git a/tests/testsuite/dep_info.rs b/tests/testsuite/dep_info.rs index e9ea47792..4741ebd2b 100644 --- a/tests/testsuite/dep_info.rs +++ b/tests/testsuite/dep_info.rs @@ -570,7 +570,7 @@ fn non_local_build_script() { "build.rs", r#" fn main() { - println!("cargo:rerun-if-changed=build.rs"); + println!("cargo::rerun-if-changed=build.rs"); } "#, ) diff --git a/tests/testsuite/doc.rs b/tests/testsuite/doc.rs index 37dd47d76..c80f23d91 100644 --- a/tests/testsuite/doc.rs +++ b/tests/testsuite/doc.rs @@ -1021,7 +1021,7 @@ fn features() { "bar/build.rs", r#" fn main() { - println!("cargo:rustc-cfg=bar"); + println!("cargo::rustc-cfg=bar"); } "#, ) diff --git a/tests/testsuite/features2.rs b/tests/testsuite/features2.rs index 125a293a0..29516d8ec 100644 --- a/tests/testsuite/features2.rs +++ b/tests/testsuite/features2.rs @@ -494,7 +494,7 @@ fn build_script_runtime_features() { if is_set("CARGO_FEATURE_BUILD") { res |= 4; } - println!("cargo:rustc-cfg=RunCustomBuild=\"{}\"", res); + println!("cargo::rustc-cfg=RunCustomBuild=\"{}\"", res); let mut res = 0; if cfg!(feature = "normal") { @@ -506,7 +506,7 @@ fn build_script_runtime_features() { if cfg!(feature = "build") { res |= 4; } - println!("cargo:rustc-cfg=CustomBuild=\"{}\"", res); + println!("cargo::rustc-cfg=CustomBuild=\"{}\"", res); } "#, ) @@ -562,7 +562,7 @@ fn build_script_runtime_features() { r#" fn main() { assert_eq!(common::foo(), common::build_time()); - println!("cargo:rustc-cfg=from_build=\"{}\"", common::foo()); + println!("cargo::rustc-cfg=from_build=\"{}\"", common::foo()); } "#, ) @@ -1792,8 +1792,8 @@ fn shared_dep_same_but_dependencies() { "subdep/src/lib.rs", r#" pub fn feat_func() { - #[cfg(feature = "feat")] println!("cargo:warning=feat: enabled"); - #[cfg(not(feature = "feat"))] println!("cargo:warning=feat: not enabled"); + #[cfg(feature = "feat")] println!("cargo::warning=feat: enabled"); + #[cfg(not(feature = "feat"))] println!("cargo::warning=feat: not enabled"); } "#, ) @@ -1813,7 +1813,7 @@ warning: bin2@0.1.0: feat: enabled ) .run(); p.process(p.bin("bin1")) - .with_stdout("cargo:warning=feat: not enabled") + .with_stdout("cargo::warning=feat: not enabled") .run(); // Make sure everything stays cached. diff --git a/tests/testsuite/freshness.rs b/tests/testsuite/freshness.rs index 2d9b3df68..1f81b544c 100644 --- a/tests/testsuite/freshness.rs +++ b/tests/testsuite/freshness.rs @@ -658,7 +658,7 @@ fn rerun_if_changed_in_dep() { "a/build.rs", r#" fn main() { - println!("cargo:rerun-if-changed=build.rs"); + println!("cargo::rerun-if-changed=build.rs"); } "#, ) @@ -1730,8 +1730,8 @@ fn dirty_both_lib_and_test() { .success(), "slib build failed" ); - println!("cargo:rustc-link-lib=slib"); - println!("cargo:rustc-link-search={}", out_dir.display()); + println!("cargo::rustc-link-lib=slib"); + println!("cargo::rustc-link-search={}", out_dir.display()); } "#, ) @@ -1772,7 +1772,7 @@ fn script_fails_stay_dirty() { r#" mod helper; fn main() { - println!("cargo:rerun-if-changed=build.rs"); + println!("cargo::rerun-if-changed=build.rs"); helper::doit(); } "#, @@ -1810,7 +1810,7 @@ fn simulated_docker_deps_stay_cached() { "build.rs", r#" fn main() { - println!("cargo:rerun-if-env-changed=SOMEVAR"); + println!("cargo::rerun-if-env-changed=SOMEVAR"); } "#, ) @@ -1821,7 +1821,7 @@ fn simulated_docker_deps_stay_cached() { "build.rs", r#" fn main() { - println!("cargo:rerun-if-changed=build.rs"); + println!("cargo::rerun-if-changed=build.rs"); } "#, ) @@ -2107,7 +2107,7 @@ fn move_target_directory_with_path_deps() { use std::path::Path; fn main() { - println!("cargo:rerun-if-changed=build.rs"); + println!("cargo::rerun-if-changed=build.rs"); let out_dir = env::var("OUT_DIR").unwrap(); let dest_path = Path::new(&out_dir).join("hello.rs"); fs::write(&dest_path, r#" @@ -2148,9 +2148,9 @@ fn rerun_if_changes() { "build.rs", r#" fn main() { - println!("cargo:rerun-if-env-changed=FOO"); + println!("cargo::rerun-if-env-changed=FOO"); if std::env::var("FOO").is_ok() { - println!("cargo:rerun-if-env-changed=BAR"); + println!("cargo::rerun-if-env-changed=BAR"); } } "#, @@ -2648,7 +2648,7 @@ fn env_build_script_no_rebuild() { "build.rs", r#" fn main() { - println!("cargo:rustc-env=FOO=bar"); + println!("cargo::rustc-env=FOO=bar"); } "#, ) diff --git a/tests/testsuite/profile_overrides.rs b/tests/testsuite/profile_overrides.rs index 65d9f3b51..eda34ad34 100644 --- a/tests/testsuite/profile_overrides.rs +++ b/tests/testsuite/profile_overrides.rs @@ -502,9 +502,9 @@ fn build_override_shared() { r#" fn main() { if std::env::var("DEBUG").unwrap() != "false" { - println!("cargo:rustc-cfg=foo_debug"); + println!("cargo::rustc-cfg=foo_debug"); } else { - println!("cargo:rustc-cfg=foo_release"); + println!("cargo::rustc-cfg=foo_release"); } } "#, diff --git a/tests/testsuite/run.rs b/tests/testsuite/run.rs index c7ddd5d9e..4537b2caa 100644 --- a/tests/testsuite/run.rs +++ b/tests/testsuite/run.rs @@ -1202,8 +1202,8 @@ fn run_with_library_paths() { &format!( r##" fn main() {{ - println!(r#"cargo:rustc-link-search=native={}"#); - println!(r#"cargo:rustc-link-search={}"#); + println!(r#"cargo::rustc-link-search=native={}"#); + println!(r#"cargo::rustc-link-search={}"#); }} "##, dir1.display(), @@ -1261,9 +1261,9 @@ fn library_paths_sorted_alphabetically() { &format!( r##" fn main() {{ - println!(r#"cargo:rustc-link-search=native={}"#); - println!(r#"cargo:rustc-link-search=native={}"#); - println!(r#"cargo:rustc-link-search=native={}"#); + println!(r#"cargo::rustc-link-search=native={}"#); + println!(r#"cargo::rustc-link-search=native={}"#); + println!(r#"cargo::rustc-link-search=native={}"#); }} "##, dir1.display(), @@ -1535,8 +1535,8 @@ fn run_link_system_path_macos() { &format!( r#" fn main() {{ - println!("cargo:rustc-link-lib=foo"); - println!("cargo:rustc-link-search={}"); + println!("cargo::rustc-link-lib=foo"); + println!("cargo::rustc-link-search={}"); }} "#, p.target_debug_dir().display() diff --git a/tests/testsuite/warn_on_failure.rs b/tests/testsuite/warn_on_failure.rs index f2c2bb071..110364c83 100644 --- a/tests/testsuite/warn_on_failure.rs +++ b/tests/testsuite/warn_on_failure.rs @@ -24,10 +24,10 @@ fn make_lib(lib_src: &str) { r#" fn main() {{ use std::io::Write; - println!("cargo:warning={{}}", "{}"); + println!("cargo::warning={{}}", "{}"); println!("hidden stdout"); write!(&mut ::std::io::stderr(), "hidden stderr"); - println!("cargo:warning={{}}", "{}"); + println!("cargo::warning={{}}", "{}"); }} "#, WARNING1, WARNING2