From d8eebe6f2e16a9941344206f85d22e7162280b61 Mon Sep 17 00:00:00 2001 From: Michael Krasnitski Date: Sat, 18 May 2024 09:36:22 -1000 Subject: [PATCH] Switch to `cargo::` syntax for build.rs output --- rust/binaryninjacore-sys/build.rs | 8 ++++---- rust/examples/basic_script/build.rs | 11 +++++++---- rust/examples/decompile/build.rs | 11 +++++++---- rust/examples/dwarf/dwarf_export/build.rs | 11 +++++++---- rust/examples/hlil_lifter/build.rs | 11 +++++++---- rust/examples/hlil_visitor/build.rs | 11 +++++++---- rust/examples/minidump/build.rs | 11 +++++++---- rust/examples/mlil_lifter/build.rs | 11 +++++++---- rust/examples/mlil_visitor/build.rs | 11 +++++++---- rust/examples/template/build.rs | 11 +++++++---- 10 files changed, 67 insertions(+), 40 deletions(-) diff --git a/rust/binaryninjacore-sys/build.rs b/rust/binaryninjacore-sys/build.rs index 243178d58..eb5cd595d 100644 --- a/rust/binaryninjacore-sys/build.rs +++ b/rust/binaryninjacore-sys/build.rs @@ -44,7 +44,7 @@ fn link_path() -> PathBuf { } fn main() { - println!("cargo:rerun-if-changed=../../binaryninjacore.h"); + println!("cargo::rerun-if-changed=../../binaryninjacore.h"); //Cargo's output directory let out_dir = env::var("OUT_DIR").unwrap(); @@ -69,11 +69,11 @@ fn main() { ) .expect("failed to create required symlink"); } - println!("cargo:rustc-link-search={}", out_dir); + println!("cargo::rustc-link-search={}", out_dir); } - println!("cargo:rustc-link-lib=binaryninjacore"); - println!("cargo:rustc-link-search={}", link_path.to_str().unwrap()); + println!("cargo::rustc-link-lib=binaryninjacore"); + println!("cargo::rustc-link-search={}", link_path.to_str().unwrap()); let current_line = "#define BN_CURRENT_UI_ABI_VERSION "; let minimum_line = "#define BN_MINIMUM_UI_ABI_VERSION "; diff --git a/rust/examples/basic_script/build.rs b/rust/examples/basic_script/build.rs index 5ba9bcde4..85fe25e9e 100644 --- a/rust/examples/basic_script/build.rs +++ b/rust/examples/basic_script/build.rs @@ -48,21 +48,24 @@ fn main() { #[cfg(target_os = "linux")] println!( - "cargo:rustc-link-arg=-Wl,-rpath,{},-L{},-l:libbinaryninjacore.so.1", + "cargo::rustc-link-arg=-Wl,-rpath,{},-L{},-l:libbinaryninjacore.so.1", install_path.to_str().unwrap(), install_path.to_str().unwrap(), ); #[cfg(target_os = "macos")] println!( - "cargo:rustc-link-arg=-Wl,-rpath,{},-L{},-lbinaryninjacore", + "cargo::rustc-link-arg=-Wl,-rpath,{},-L{},-lbinaryninjacore", install_path.to_str().unwrap(), install_path.to_str().unwrap(), ); #[cfg(target_os = "windows")] { - println!("cargo:rustc-link-lib=binaryninjacore"); - println!("cargo:rustc-link-search={}", install_path.to_str().unwrap()); + println!("cargo::rustc-link-lib=binaryninjacore"); + println!( + "cargo::rustc-link-search={}", + install_path.to_str().unwrap() + ); } } diff --git a/rust/examples/decompile/build.rs b/rust/examples/decompile/build.rs index 5ba9bcde4..85fe25e9e 100644 --- a/rust/examples/decompile/build.rs +++ b/rust/examples/decompile/build.rs @@ -48,21 +48,24 @@ fn main() { #[cfg(target_os = "linux")] println!( - "cargo:rustc-link-arg=-Wl,-rpath,{},-L{},-l:libbinaryninjacore.so.1", + "cargo::rustc-link-arg=-Wl,-rpath,{},-L{},-l:libbinaryninjacore.so.1", install_path.to_str().unwrap(), install_path.to_str().unwrap(), ); #[cfg(target_os = "macos")] println!( - "cargo:rustc-link-arg=-Wl,-rpath,{},-L{},-lbinaryninjacore", + "cargo::rustc-link-arg=-Wl,-rpath,{},-L{},-lbinaryninjacore", install_path.to_str().unwrap(), install_path.to_str().unwrap(), ); #[cfg(target_os = "windows")] { - println!("cargo:rustc-link-lib=binaryninjacore"); - println!("cargo:rustc-link-search={}", install_path.to_str().unwrap()); + println!("cargo::rustc-link-lib=binaryninjacore"); + println!( + "cargo::rustc-link-search={}", + install_path.to_str().unwrap() + ); } } diff --git a/rust/examples/dwarf/dwarf_export/build.rs b/rust/examples/dwarf/dwarf_export/build.rs index 5ba9bcde4..85fe25e9e 100644 --- a/rust/examples/dwarf/dwarf_export/build.rs +++ b/rust/examples/dwarf/dwarf_export/build.rs @@ -48,21 +48,24 @@ fn main() { #[cfg(target_os = "linux")] println!( - "cargo:rustc-link-arg=-Wl,-rpath,{},-L{},-l:libbinaryninjacore.so.1", + "cargo::rustc-link-arg=-Wl,-rpath,{},-L{},-l:libbinaryninjacore.so.1", install_path.to_str().unwrap(), install_path.to_str().unwrap(), ); #[cfg(target_os = "macos")] println!( - "cargo:rustc-link-arg=-Wl,-rpath,{},-L{},-lbinaryninjacore", + "cargo::rustc-link-arg=-Wl,-rpath,{},-L{},-lbinaryninjacore", install_path.to_str().unwrap(), install_path.to_str().unwrap(), ); #[cfg(target_os = "windows")] { - println!("cargo:rustc-link-lib=binaryninjacore"); - println!("cargo:rustc-link-search={}", install_path.to_str().unwrap()); + println!("cargo::rustc-link-lib=binaryninjacore"); + println!( + "cargo::rustc-link-search={}", + install_path.to_str().unwrap() + ); } } diff --git a/rust/examples/hlil_lifter/build.rs b/rust/examples/hlil_lifter/build.rs index 5ba9bcde4..85fe25e9e 100644 --- a/rust/examples/hlil_lifter/build.rs +++ b/rust/examples/hlil_lifter/build.rs @@ -48,21 +48,24 @@ fn main() { #[cfg(target_os = "linux")] println!( - "cargo:rustc-link-arg=-Wl,-rpath,{},-L{},-l:libbinaryninjacore.so.1", + "cargo::rustc-link-arg=-Wl,-rpath,{},-L{},-l:libbinaryninjacore.so.1", install_path.to_str().unwrap(), install_path.to_str().unwrap(), ); #[cfg(target_os = "macos")] println!( - "cargo:rustc-link-arg=-Wl,-rpath,{},-L{},-lbinaryninjacore", + "cargo::rustc-link-arg=-Wl,-rpath,{},-L{},-lbinaryninjacore", install_path.to_str().unwrap(), install_path.to_str().unwrap(), ); #[cfg(target_os = "windows")] { - println!("cargo:rustc-link-lib=binaryninjacore"); - println!("cargo:rustc-link-search={}", install_path.to_str().unwrap()); + println!("cargo::rustc-link-lib=binaryninjacore"); + println!( + "cargo::rustc-link-search={}", + install_path.to_str().unwrap() + ); } } diff --git a/rust/examples/hlil_visitor/build.rs b/rust/examples/hlil_visitor/build.rs index 5ba9bcde4..85fe25e9e 100644 --- a/rust/examples/hlil_visitor/build.rs +++ b/rust/examples/hlil_visitor/build.rs @@ -48,21 +48,24 @@ fn main() { #[cfg(target_os = "linux")] println!( - "cargo:rustc-link-arg=-Wl,-rpath,{},-L{},-l:libbinaryninjacore.so.1", + "cargo::rustc-link-arg=-Wl,-rpath,{},-L{},-l:libbinaryninjacore.so.1", install_path.to_str().unwrap(), install_path.to_str().unwrap(), ); #[cfg(target_os = "macos")] println!( - "cargo:rustc-link-arg=-Wl,-rpath,{},-L{},-lbinaryninjacore", + "cargo::rustc-link-arg=-Wl,-rpath,{},-L{},-lbinaryninjacore", install_path.to_str().unwrap(), install_path.to_str().unwrap(), ); #[cfg(target_os = "windows")] { - println!("cargo:rustc-link-lib=binaryninjacore"); - println!("cargo:rustc-link-search={}", install_path.to_str().unwrap()); + println!("cargo::rustc-link-lib=binaryninjacore"); + println!( + "cargo::rustc-link-search={}", + install_path.to_str().unwrap() + ); } } diff --git a/rust/examples/minidump/build.rs b/rust/examples/minidump/build.rs index 5ba9bcde4..85fe25e9e 100644 --- a/rust/examples/minidump/build.rs +++ b/rust/examples/minidump/build.rs @@ -48,21 +48,24 @@ fn main() { #[cfg(target_os = "linux")] println!( - "cargo:rustc-link-arg=-Wl,-rpath,{},-L{},-l:libbinaryninjacore.so.1", + "cargo::rustc-link-arg=-Wl,-rpath,{},-L{},-l:libbinaryninjacore.so.1", install_path.to_str().unwrap(), install_path.to_str().unwrap(), ); #[cfg(target_os = "macos")] println!( - "cargo:rustc-link-arg=-Wl,-rpath,{},-L{},-lbinaryninjacore", + "cargo::rustc-link-arg=-Wl,-rpath,{},-L{},-lbinaryninjacore", install_path.to_str().unwrap(), install_path.to_str().unwrap(), ); #[cfg(target_os = "windows")] { - println!("cargo:rustc-link-lib=binaryninjacore"); - println!("cargo:rustc-link-search={}", install_path.to_str().unwrap()); + println!("cargo::rustc-link-lib=binaryninjacore"); + println!( + "cargo::rustc-link-search={}", + install_path.to_str().unwrap() + ); } } diff --git a/rust/examples/mlil_lifter/build.rs b/rust/examples/mlil_lifter/build.rs index 5ba9bcde4..85fe25e9e 100644 --- a/rust/examples/mlil_lifter/build.rs +++ b/rust/examples/mlil_lifter/build.rs @@ -48,21 +48,24 @@ fn main() { #[cfg(target_os = "linux")] println!( - "cargo:rustc-link-arg=-Wl,-rpath,{},-L{},-l:libbinaryninjacore.so.1", + "cargo::rustc-link-arg=-Wl,-rpath,{},-L{},-l:libbinaryninjacore.so.1", install_path.to_str().unwrap(), install_path.to_str().unwrap(), ); #[cfg(target_os = "macos")] println!( - "cargo:rustc-link-arg=-Wl,-rpath,{},-L{},-lbinaryninjacore", + "cargo::rustc-link-arg=-Wl,-rpath,{},-L{},-lbinaryninjacore", install_path.to_str().unwrap(), install_path.to_str().unwrap(), ); #[cfg(target_os = "windows")] { - println!("cargo:rustc-link-lib=binaryninjacore"); - println!("cargo:rustc-link-search={}", install_path.to_str().unwrap()); + println!("cargo::rustc-link-lib=binaryninjacore"); + println!( + "cargo::rustc-link-search={}", + install_path.to_str().unwrap() + ); } } diff --git a/rust/examples/mlil_visitor/build.rs b/rust/examples/mlil_visitor/build.rs index 5ba9bcde4..85fe25e9e 100644 --- a/rust/examples/mlil_visitor/build.rs +++ b/rust/examples/mlil_visitor/build.rs @@ -48,21 +48,24 @@ fn main() { #[cfg(target_os = "linux")] println!( - "cargo:rustc-link-arg=-Wl,-rpath,{},-L{},-l:libbinaryninjacore.so.1", + "cargo::rustc-link-arg=-Wl,-rpath,{},-L{},-l:libbinaryninjacore.so.1", install_path.to_str().unwrap(), install_path.to_str().unwrap(), ); #[cfg(target_os = "macos")] println!( - "cargo:rustc-link-arg=-Wl,-rpath,{},-L{},-lbinaryninjacore", + "cargo::rustc-link-arg=-Wl,-rpath,{},-L{},-lbinaryninjacore", install_path.to_str().unwrap(), install_path.to_str().unwrap(), ); #[cfg(target_os = "windows")] { - println!("cargo:rustc-link-lib=binaryninjacore"); - println!("cargo:rustc-link-search={}", install_path.to_str().unwrap()); + println!("cargo::rustc-link-lib=binaryninjacore"); + println!( + "cargo::rustc-link-search={}", + install_path.to_str().unwrap() + ); } } diff --git a/rust/examples/template/build.rs b/rust/examples/template/build.rs index 5ba9bcde4..85fe25e9e 100644 --- a/rust/examples/template/build.rs +++ b/rust/examples/template/build.rs @@ -48,21 +48,24 @@ fn main() { #[cfg(target_os = "linux")] println!( - "cargo:rustc-link-arg=-Wl,-rpath,{},-L{},-l:libbinaryninjacore.so.1", + "cargo::rustc-link-arg=-Wl,-rpath,{},-L{},-l:libbinaryninjacore.so.1", install_path.to_str().unwrap(), install_path.to_str().unwrap(), ); #[cfg(target_os = "macos")] println!( - "cargo:rustc-link-arg=-Wl,-rpath,{},-L{},-lbinaryninjacore", + "cargo::rustc-link-arg=-Wl,-rpath,{},-L{},-lbinaryninjacore", install_path.to_str().unwrap(), install_path.to_str().unwrap(), ); #[cfg(target_os = "windows")] { - println!("cargo:rustc-link-lib=binaryninjacore"); - println!("cargo:rustc-link-search={}", install_path.to_str().unwrap()); + println!("cargo::rustc-link-lib=binaryninjacore"); + println!( + "cargo::rustc-link-search={}", + install_path.to_str().unwrap() + ); } }