From bb32b6718d80112460c2b8668dc8c8a68a25f14d Mon Sep 17 00:00:00 2001 From: Andre Brisco Date: Mon, 23 Nov 2020 09:21:12 -0800 Subject: [PATCH 1/5] Added deprecation warnings --- impl/src/settings.rs | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/impl/src/settings.rs b/impl/src/settings.rs index f3173f2a0..b768f7b7f 100644 --- a/impl/src/settings.rs +++ b/impl/src/settings.rs @@ -531,6 +531,45 @@ impl RawRazeSettings { || self.rust_rules_workspace_name.is_some() || self.vendor_dir.is_some() } + + fn print_deprecation_warnings(&self) { + if self.incompatible_relative_workspace_path.is_some() { + eprintln!( + "WARNING: `[*.raze.incompatible_relative_workspace_path]` will soon be deprecated. Please \ + update your project to use the `true` behavior." + ); + } + + if self.target.is_some() { + eprintln!( + "WARNING: `[*.raze.target]` will soon be deprecated. Please update your project to use \ + `[*.raze.targets]`." + ); + } + + if self.default_gen_buildrs.is_none() { + eprintln!( + "WARNING: The default of `[*.raze.default_gen_buildrs]` will soon be set to `true`. \ + Please explicitly set this flag to prevent a change in behavior." + ); + } + + if self.rust_rules_workspace_name.is_none() { + eprintln!( + "WARNING: The default of `[*.raze.rust_rules_workspace_name]` will soon be set to \ + `\"rules_rust\"`. Please explicitly set this flag to prevent a change in behavior or \ + upgrade your code to use the latest version of `rules_rust` with the new workspace name." + ); + } + + if self.package_aliases_dir.is_none() { + eprintln!( + "WARNING: The default of `[*.raze.package_aliases_dir]` will soon be set to `\"cargo\"`. \ + Please explicitly set this flag to `\".\"` to prevent a change in behavior or update \ + your project structure to account for this change." + ); + } + } } /** Grows a list with duplicate keys between two maps */ @@ -560,6 +599,7 @@ fn parse_raze_settings_workspace( metadata_value: &serde_json::value::Value, metadata: &Metadata, ) -> Result { + RawRazeSettings::deserialize(metadata_value)?.print_deprecation_warnings(); let mut settings = RazeSettings::deserialize(metadata_value)?; let workspace_packages: Vec<&Package> = metadata @@ -626,6 +666,7 @@ fn parse_raze_settings_root_package( metadata_value: &serde_json::value::Value, root_package: &Package, ) -> Result { + RawRazeSettings::deserialize(metadata_value)?.print_deprecation_warnings(); return RazeSettings::deserialize(metadata_value).with_context(|| { format!( "Failed to load raze settings from root package: {}", @@ -660,6 +701,7 @@ fn parse_raze_settings_any_package(metadata: &Metadata) -> Result // UNWRAP: Safe due to checks above let settings_value = settings_packages[0].metadata.get("raze").unwrap(); + RawRazeSettings::deserialize(settings_value)?.print_deprecation_warnings(); RazeSettings::deserialize(settings_value) .with_context(|| format!("Failed to deserialize raze settings: {:?}", settings_value)) } From 75184dc2b409245159f0f051a25b14d544116153 Mon Sep 17 00:00:00 2001 From: Andre Brisco Date: Thu, 26 Nov 2020 11:30:20 -0800 Subject: [PATCH 2/5] Updated smoketests --- smoke_test/remote/complicated_cargo_library/Cargo.toml | 1 + smoke_test/remote/no_deps/Cargo.toml | 1 + smoke_test/remote/non_cratesio/Cargo.toml | 9 ++++++++- smoke_test/vendored/complicated_cargo_library/Cargo.toml | 1 + smoke_test/vendored/hello_cargo_library/Cargo.toml | 9 ++++++++- smoke_test/vendored/non_cratesio_library/Cargo.toml | 9 ++++++++- 6 files changed, 27 insertions(+), 3 deletions(-) diff --git a/smoke_test/remote/complicated_cargo_library/Cargo.toml b/smoke_test/remote/complicated_cargo_library/Cargo.toml index 6a64b7763..4f4617667 100644 --- a/smoke_test/remote/complicated_cargo_library/Cargo.toml +++ b/smoke_test/remote/complicated_cargo_library/Cargo.toml @@ -19,6 +19,7 @@ workspace_path = "//remote/complicated_cargo_library/cargo" gen_workspace_prefix = "remote_complicated_cargo_library" genmode = "Remote" package_aliases_dir = "cargo" +default_gen_buildrs = false [package.metadata.raze.crates.proc-macro2.'0.4.30'] additional_flags = [ diff --git a/smoke_test/remote/no_deps/Cargo.toml b/smoke_test/remote/no_deps/Cargo.toml index fe020873a..278456cc4 100644 --- a/smoke_test/remote/no_deps/Cargo.toml +++ b/smoke_test/remote/no_deps/Cargo.toml @@ -12,3 +12,4 @@ workspace_path = "//remote/no_deps/cargo" genmode = "Remote" gen_workspace_prefix = "remote_no_deps" package_aliases_dir = "cargo" +default_gen_buildrs = true diff --git a/smoke_test/remote/non_cratesio/Cargo.toml b/smoke_test/remote/non_cratesio/Cargo.toml index 74f96d48f..3f82dedd1 100644 --- a/smoke_test/remote/non_cratesio/Cargo.toml +++ b/smoke_test/remote/non_cratesio/Cargo.toml @@ -17,10 +17,17 @@ path = "src/main.rs" [package.metadata.raze] workspace_path = "//remote/non_cratesio/cargo" -target = "x86_64-unknown-linux-gnu" +targets = [ + "aarch64-apple-darwin", + "aarch64-unknown-linux-gnu", + "x86_64-apple-darwin", + "x86_64-pc-windows-msvc", + "x86_64-unknown-linux-gnu", +] genmode = "Remote" gen_workspace_prefix = "remote_non_cratesio" package_aliases_dir = "cargo" +default_gen_buildrs = false [package.metadata.raze.crates.log.'0.4.11'] additional_flags = [ diff --git a/smoke_test/vendored/complicated_cargo_library/Cargo.toml b/smoke_test/vendored/complicated_cargo_library/Cargo.toml index 652c625e9..eb0b1a786 100644 --- a/smoke_test/vendored/complicated_cargo_library/Cargo.toml +++ b/smoke_test/vendored/complicated_cargo_library/Cargo.toml @@ -17,6 +17,7 @@ workspace_path = "//vendored/complicated_cargo_library/cargo" gen_workspace_prefix = "vendored_complicated_cargo_library" genmode = "Vendored" package_aliases_dir = "cargo" +default_gen_buildrs = false [package.metadata.raze.crates.proc-macro2.'0.4.30'] additional_flags = [ diff --git a/smoke_test/vendored/hello_cargo_library/Cargo.toml b/smoke_test/vendored/hello_cargo_library/Cargo.toml index 4966e3a1d..9d41dab2d 100644 --- a/smoke_test/vendored/hello_cargo_library/Cargo.toml +++ b/smoke_test/vendored/hello_cargo_library/Cargo.toml @@ -13,8 +13,15 @@ path = "src/main.rs" [package.metadata.raze] workspace_path = "//vendored/hello_cargo_library/cargo" -target = "x86_64-unknown-linux-gnu" +targets = [ + "aarch64-apple-darwin", + "aarch64-unknown-linux-gnu", + "x86_64-apple-darwin", + "x86_64-pc-windows-msvc", + "x86_64-unknown-linux-gnu", +] output_buildfile_suffix = "BUILD.bazel" gen_workspace_prefix = "vendored_hello_cargo_library" genmode = "Vendored" package_aliases_dir = "cargo" +default_gen_buildrs = false diff --git a/smoke_test/vendored/non_cratesio_library/Cargo.toml b/smoke_test/vendored/non_cratesio_library/Cargo.toml index b9f4aec5b..985606424 100644 --- a/smoke_test/vendored/non_cratesio_library/Cargo.toml +++ b/smoke_test/vendored/non_cratesio_library/Cargo.toml @@ -18,10 +18,17 @@ path = "src/main.rs" [package.metadata.raze] workspace_path = "//vendored/non_cratesio_library/cargo" -target = "x86_64-unknown-linux-gnu" +targets = [ + "aarch64-apple-darwin", + "aarch64-unknown-linux-gnu", + "x86_64-apple-darwin", + "x86_64-pc-windows-msvc", + "x86_64-unknown-linux-gnu", +] gen_workspace_prefix = "vendored_non_cratesio_library" genmode = "Vendored" package_aliases_dir = "cargo" +default_gen_buildrs = false [package.metadata.raze.crates.log.'0.4.11'] additional_flags = [ From c35dd3b48d775a42cb17e6faa83002ba40b7b1a4 Mon Sep 17 00:00:00 2001 From: Andre Brisco Date: Thu, 26 Nov 2020 11:30:28 -0800 Subject: [PATCH 3/5] Updated examples --- .../complicated_cargo_library/Cargo.toml | 1 + examples/remote/no_deps/Cargo.toml | 1 + examples/remote/non_cratesio/Cargo.toml | 9 ++++++++- .../cargo/remote/BUILD.atty-0.2.14.bazel | 20 ++++++++----------- .../cargo/remote/BUILD.termcolor-0.3.6.bazel | 12 ++++++++++- .../complicated_cargo_library/Cargo.toml | 1 + .../vendored/hello_cargo_library/Cargo.toml | 9 ++++++++- .../vendored/non_cratesio_library/Cargo.toml | 9 ++++++++- .../cargo/vendor/atty-0.2.14/BUILD.bazel | 20 ++++++++----------- .../cargo/vendor/iovec-0.1.4/BUILD.bazel | 12 ----------- .../cargo/vendor/termcolor-0.3.6/BUILD.bazel | 12 ++++++++++- 11 files changed, 65 insertions(+), 41 deletions(-) diff --git a/examples/remote/complicated_cargo_library/Cargo.toml b/examples/remote/complicated_cargo_library/Cargo.toml index 6a64b7763..4f4617667 100644 --- a/examples/remote/complicated_cargo_library/Cargo.toml +++ b/examples/remote/complicated_cargo_library/Cargo.toml @@ -19,6 +19,7 @@ workspace_path = "//remote/complicated_cargo_library/cargo" gen_workspace_prefix = "remote_complicated_cargo_library" genmode = "Remote" package_aliases_dir = "cargo" +default_gen_buildrs = false [package.metadata.raze.crates.proc-macro2.'0.4.30'] additional_flags = [ diff --git a/examples/remote/no_deps/Cargo.toml b/examples/remote/no_deps/Cargo.toml index fe020873a..278456cc4 100644 --- a/examples/remote/no_deps/Cargo.toml +++ b/examples/remote/no_deps/Cargo.toml @@ -12,3 +12,4 @@ workspace_path = "//remote/no_deps/cargo" genmode = "Remote" gen_workspace_prefix = "remote_no_deps" package_aliases_dir = "cargo" +default_gen_buildrs = true diff --git a/examples/remote/non_cratesio/Cargo.toml b/examples/remote/non_cratesio/Cargo.toml index 74f96d48f..3f82dedd1 100644 --- a/examples/remote/non_cratesio/Cargo.toml +++ b/examples/remote/non_cratesio/Cargo.toml @@ -17,10 +17,17 @@ path = "src/main.rs" [package.metadata.raze] workspace_path = "//remote/non_cratesio/cargo" -target = "x86_64-unknown-linux-gnu" +targets = [ + "aarch64-apple-darwin", + "aarch64-unknown-linux-gnu", + "x86_64-apple-darwin", + "x86_64-pc-windows-msvc", + "x86_64-unknown-linux-gnu", +] genmode = "Remote" gen_workspace_prefix = "remote_non_cratesio" package_aliases_dir = "cargo" +default_gen_buildrs = false [package.metadata.raze.crates.log.'0.4.11'] additional_flags = [ diff --git a/examples/remote/non_cratesio/cargo/remote/BUILD.atty-0.2.14.bazel b/examples/remote/non_cratesio/cargo/remote/BUILD.atty-0.2.14.bazel index 55a61524f..c2cd423a3 100644 --- a/examples/remote/non_cratesio/cargo/remote/BUILD.atty-0.2.14.bazel +++ b/examples/remote/non_cratesio/cargo/remote/BUILD.atty-0.2.14.bazel @@ -57,24 +57,20 @@ rust_library( # cfg(unix) ( "@io_bazel_rules_rust//rust/platform:aarch64-apple-darwin", - "@io_bazel_rules_rust//rust/platform:aarch64-apple-ios", - "@io_bazel_rules_rust//rust/platform:aarch64-linux-android", "@io_bazel_rules_rust//rust/platform:aarch64-unknown-linux-gnu", - "@io_bazel_rules_rust//rust/platform:arm-unknown-linux-gnueabi", - "@io_bazel_rules_rust//rust/platform:i686-apple-darwin", - "@io_bazel_rules_rust//rust/platform:i686-linux-android", - "@io_bazel_rules_rust//rust/platform:i686-unknown-freebsd", - "@io_bazel_rules_rust//rust/platform:i686-unknown-linux-gnu", - "@io_bazel_rules_rust//rust/platform:powerpc-unknown-linux-gnu", - "@io_bazel_rules_rust//rust/platform:s390x-unknown-linux-gnu", "@io_bazel_rules_rust//rust/platform:x86_64-apple-darwin", - "@io_bazel_rules_rust//rust/platform:x86_64-apple-ios", - "@io_bazel_rules_rust//rust/platform:x86_64-linux-android", - "@io_bazel_rules_rust//rust/platform:x86_64-unknown-freebsd", "@io_bazel_rules_rust//rust/platform:x86_64-unknown-linux-gnu", ): [ "@remote_non_cratesio__libc__0_2_77//:libc", ], "//conditions:default": [], + }) + selects.with_or({ + # cfg(windows) + ( + "@io_bazel_rules_rust//rust/platform:x86_64-pc-windows-msvc", + ): [ + "@remote_non_cratesio__winapi__0_3_9//:winapi", + ], + "//conditions:default": [], }), ) diff --git a/examples/remote/non_cratesio/cargo/remote/BUILD.termcolor-0.3.6.bazel b/examples/remote/non_cratesio/cargo/remote/BUILD.termcolor-0.3.6.bazel index cc36142fb..af187f836 100644 --- a/examples/remote/non_cratesio/cargo/remote/BUILD.termcolor-0.3.6.bazel +++ b/examples/remote/non_cratesio/cargo/remote/BUILD.termcolor-0.3.6.bazel @@ -33,6 +33,8 @@ licenses([ rust_library( name = "termcolor", srcs = glob(["**/*.rs"]), + aliases = { + }, crate_features = [ ], crate_root = "src/lib.rs", @@ -49,5 +51,13 @@ rust_library( version = "0.3.6", # buildifier: leave-alone deps = [ - ], + ] + selects.with_or({ + # cfg(windows) + ( + "@io_bazel_rules_rust//rust/platform:x86_64-pc-windows-msvc", + ): [ + "@remote_non_cratesio__wincolor__0_1_6//:wincolor", + ], + "//conditions:default": [], + }), ) diff --git a/examples/vendored/complicated_cargo_library/Cargo.toml b/examples/vendored/complicated_cargo_library/Cargo.toml index 652c625e9..eb0b1a786 100644 --- a/examples/vendored/complicated_cargo_library/Cargo.toml +++ b/examples/vendored/complicated_cargo_library/Cargo.toml @@ -17,6 +17,7 @@ workspace_path = "//vendored/complicated_cargo_library/cargo" gen_workspace_prefix = "vendored_complicated_cargo_library" genmode = "Vendored" package_aliases_dir = "cargo" +default_gen_buildrs = false [package.metadata.raze.crates.proc-macro2.'0.4.30'] additional_flags = [ diff --git a/examples/vendored/hello_cargo_library/Cargo.toml b/examples/vendored/hello_cargo_library/Cargo.toml index 4966e3a1d..9d41dab2d 100644 --- a/examples/vendored/hello_cargo_library/Cargo.toml +++ b/examples/vendored/hello_cargo_library/Cargo.toml @@ -13,8 +13,15 @@ path = "src/main.rs" [package.metadata.raze] workspace_path = "//vendored/hello_cargo_library/cargo" -target = "x86_64-unknown-linux-gnu" +targets = [ + "aarch64-apple-darwin", + "aarch64-unknown-linux-gnu", + "x86_64-apple-darwin", + "x86_64-pc-windows-msvc", + "x86_64-unknown-linux-gnu", +] output_buildfile_suffix = "BUILD.bazel" gen_workspace_prefix = "vendored_hello_cargo_library" genmode = "Vendored" package_aliases_dir = "cargo" +default_gen_buildrs = false diff --git a/examples/vendored/non_cratesio_library/Cargo.toml b/examples/vendored/non_cratesio_library/Cargo.toml index b9f4aec5b..985606424 100644 --- a/examples/vendored/non_cratesio_library/Cargo.toml +++ b/examples/vendored/non_cratesio_library/Cargo.toml @@ -18,10 +18,17 @@ path = "src/main.rs" [package.metadata.raze] workspace_path = "//vendored/non_cratesio_library/cargo" -target = "x86_64-unknown-linux-gnu" +targets = [ + "aarch64-apple-darwin", + "aarch64-unknown-linux-gnu", + "x86_64-apple-darwin", + "x86_64-pc-windows-msvc", + "x86_64-unknown-linux-gnu", +] gen_workspace_prefix = "vendored_non_cratesio_library" genmode = "Vendored" package_aliases_dir = "cargo" +default_gen_buildrs = false [package.metadata.raze.crates.log.'0.4.11'] additional_flags = [ diff --git a/examples/vendored/non_cratesio_library/cargo/vendor/atty-0.2.14/BUILD.bazel b/examples/vendored/non_cratesio_library/cargo/vendor/atty-0.2.14/BUILD.bazel index 87caa3eb6..377d4d305 100644 --- a/examples/vendored/non_cratesio_library/cargo/vendor/atty-0.2.14/BUILD.bazel +++ b/examples/vendored/non_cratesio_library/cargo/vendor/atty-0.2.14/BUILD.bazel @@ -57,24 +57,20 @@ rust_library( # cfg(unix) ( "@io_bazel_rules_rust//rust/platform:aarch64-apple-darwin", - "@io_bazel_rules_rust//rust/platform:aarch64-apple-ios", - "@io_bazel_rules_rust//rust/platform:aarch64-linux-android", "@io_bazel_rules_rust//rust/platform:aarch64-unknown-linux-gnu", - "@io_bazel_rules_rust//rust/platform:arm-unknown-linux-gnueabi", - "@io_bazel_rules_rust//rust/platform:i686-apple-darwin", - "@io_bazel_rules_rust//rust/platform:i686-linux-android", - "@io_bazel_rules_rust//rust/platform:i686-unknown-freebsd", - "@io_bazel_rules_rust//rust/platform:i686-unknown-linux-gnu", - "@io_bazel_rules_rust//rust/platform:powerpc-unknown-linux-gnu", - "@io_bazel_rules_rust//rust/platform:s390x-unknown-linux-gnu", "@io_bazel_rules_rust//rust/platform:x86_64-apple-darwin", - "@io_bazel_rules_rust//rust/platform:x86_64-apple-ios", - "@io_bazel_rules_rust//rust/platform:x86_64-linux-android", - "@io_bazel_rules_rust//rust/platform:x86_64-unknown-freebsd", "@io_bazel_rules_rust//rust/platform:x86_64-unknown-linux-gnu", ): [ "//vendored/non_cratesio_library/cargo/vendor/libc-0.2.77:libc", ], "//conditions:default": [], + }) + selects.with_or({ + # cfg(windows) + ( + "@io_bazel_rules_rust//rust/platform:x86_64-pc-windows-msvc", + ): [ + "//vendored/non_cratesio_library/cargo/vendor/winapi-0.3.9:winapi", + ], + "//conditions:default": [], }), ) diff --git a/examples/vendored/non_cratesio_library/cargo/vendor/iovec-0.1.4/BUILD.bazel b/examples/vendored/non_cratesio_library/cargo/vendor/iovec-0.1.4/BUILD.bazel index afbf13fca..9f6cd1f54 100644 --- a/examples/vendored/non_cratesio_library/cargo/vendor/iovec-0.1.4/BUILD.bazel +++ b/examples/vendored/non_cratesio_library/cargo/vendor/iovec-0.1.4/BUILD.bazel @@ -55,20 +55,8 @@ rust_library( # cfg(unix) ( "@io_bazel_rules_rust//rust/platform:aarch64-apple-darwin", - "@io_bazel_rules_rust//rust/platform:aarch64-apple-ios", - "@io_bazel_rules_rust//rust/platform:aarch64-linux-android", "@io_bazel_rules_rust//rust/platform:aarch64-unknown-linux-gnu", - "@io_bazel_rules_rust//rust/platform:arm-unknown-linux-gnueabi", - "@io_bazel_rules_rust//rust/platform:i686-apple-darwin", - "@io_bazel_rules_rust//rust/platform:i686-linux-android", - "@io_bazel_rules_rust//rust/platform:i686-unknown-freebsd", - "@io_bazel_rules_rust//rust/platform:i686-unknown-linux-gnu", - "@io_bazel_rules_rust//rust/platform:powerpc-unknown-linux-gnu", - "@io_bazel_rules_rust//rust/platform:s390x-unknown-linux-gnu", "@io_bazel_rules_rust//rust/platform:x86_64-apple-darwin", - "@io_bazel_rules_rust//rust/platform:x86_64-apple-ios", - "@io_bazel_rules_rust//rust/platform:x86_64-linux-android", - "@io_bazel_rules_rust//rust/platform:x86_64-unknown-freebsd", "@io_bazel_rules_rust//rust/platform:x86_64-unknown-linux-gnu", ): [ "//vendored/non_cratesio_library/cargo/vendor/libc-0.2.77:libc", diff --git a/examples/vendored/non_cratesio_library/cargo/vendor/termcolor-0.3.6/BUILD.bazel b/examples/vendored/non_cratesio_library/cargo/vendor/termcolor-0.3.6/BUILD.bazel index 9ba598275..381699296 100644 --- a/examples/vendored/non_cratesio_library/cargo/vendor/termcolor-0.3.6/BUILD.bazel +++ b/examples/vendored/non_cratesio_library/cargo/vendor/termcolor-0.3.6/BUILD.bazel @@ -33,6 +33,8 @@ licenses([ rust_library( name = "termcolor", srcs = glob(["**/*.rs"]), + aliases = { + }, crate_features = [ ], crate_root = "src/lib.rs", @@ -49,5 +51,13 @@ rust_library( version = "0.3.6", # buildifier: leave-alone deps = [ - ], + ] + selects.with_or({ + # cfg(windows) + ( + "@io_bazel_rules_rust//rust/platform:x86_64-pc-windows-msvc", + ): [ + "//vendored/non_cratesio_library/cargo/vendor/wincolor-0.1.6:wincolor", + ], + "//conditions:default": [], + }), ) From 9e3737f350781b7daef48f3def82151acb6edd8a Mon Sep 17 00:00:00 2001 From: Andre Brisco Date: Tue, 15 Dec 2020 12:20:04 -0800 Subject: [PATCH 4/5] Addressed PR feedback. --- impl/src/settings.rs | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/impl/src/settings.rs b/impl/src/settings.rs index b768f7b7f..ec56c771f 100644 --- a/impl/src/settings.rs +++ b/impl/src/settings.rs @@ -532,25 +532,26 @@ impl RawRazeSettings { || self.vendor_dir.is_some() } - fn print_deprecation_warnings(&self) { - if self.incompatible_relative_workspace_path.is_some() { + fn print_notices_and_warnings(&self) { + if self.default_gen_buildrs.is_none() { eprintln!( - "WARNING: `[*.raze.incompatible_relative_workspace_path]` will soon be deprecated. Please \ - update your project to use the `true` behavior." + "NOTICE: The default of `[*.raze.default_gen_buildrs]` will soon be set to `true`. Please \ + explicitly set this flag to prevent a change in behavior." ); } - if self.target.is_some() { + if self.incompatible_relative_workspace_path.unwrap_or(false) { eprintln!( - "WARNING: `[*.raze.target]` will soon be deprecated. Please update your project to use \ - `[*.raze.targets]`." + "WARNING: `[*.raze.incompatible_relative_workspace_path]` will is deprecated. Please set \ + this flag to true and make sure `workspace_path` is the label where the Cargo-raze is \ + expected to write it's output." ); } - if self.default_gen_buildrs.is_none() { + if self.target.is_some() { eprintln!( - "WARNING: The default of `[*.raze.default_gen_buildrs]` will soon be set to `true`. \ - Please explicitly set this flag to prevent a change in behavior." + "WARNING: `[*.raze.target]` will soon be deprecated. Please update your project to use \ + `[*.raze.targets]`." ); } @@ -558,7 +559,8 @@ impl RawRazeSettings { eprintln!( "WARNING: The default of `[*.raze.rust_rules_workspace_name]` will soon be set to \ `\"rules_rust\"`. Please explicitly set this flag to prevent a change in behavior or \ - upgrade your code to use the latest version of `rules_rust` with the new workspace name." + upgrade your code to use the latest version of `rules_rust` and change references of \ + `io_bazel_rules_rust` to `rules_rust` in your project." ); } @@ -599,7 +601,7 @@ fn parse_raze_settings_workspace( metadata_value: &serde_json::value::Value, metadata: &Metadata, ) -> Result { - RawRazeSettings::deserialize(metadata_value)?.print_deprecation_warnings(); + RawRazeSettings::deserialize(metadata_value)?.print_notices_and_warnings(); let mut settings = RazeSettings::deserialize(metadata_value)?; let workspace_packages: Vec<&Package> = metadata @@ -666,7 +668,7 @@ fn parse_raze_settings_root_package( metadata_value: &serde_json::value::Value, root_package: &Package, ) -> Result { - RawRazeSettings::deserialize(metadata_value)?.print_deprecation_warnings(); + RawRazeSettings::deserialize(metadata_value)?.print_notices_and_warnings(); return RazeSettings::deserialize(metadata_value).with_context(|| { format!( "Failed to load raze settings from root package: {}", @@ -701,7 +703,7 @@ fn parse_raze_settings_any_package(metadata: &Metadata) -> Result // UNWRAP: Safe due to checks above let settings_value = settings_packages[0].metadata.get("raze").unwrap(); - RawRazeSettings::deserialize(settings_value)?.print_deprecation_warnings(); + RawRazeSettings::deserialize(settings_value)?.print_notices_and_warnings(); RazeSettings::deserialize(settings_value) .with_context(|| format!("Failed to deserialize raze settings: {:?}", settings_value)) } From 9dfa14cdd4125ed6aa03ca8d355d87d43434e25f Mon Sep 17 00:00:00 2001 From: Andre Brisco Date: Tue, 15 Dec 2020 12:21:52 -0800 Subject: [PATCH 5/5] Addressed PR feedback. --- impl/src/settings.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/impl/src/settings.rs b/impl/src/settings.rs index ec56c771f..677a71a0d 100644 --- a/impl/src/settings.rs +++ b/impl/src/settings.rs @@ -542,7 +542,7 @@ impl RawRazeSettings { if self.incompatible_relative_workspace_path.unwrap_or(false) { eprintln!( - "WARNING: `[*.raze.incompatible_relative_workspace_path]` will is deprecated. Please set \ + "WARNING: `[*.raze.incompatible_relative_workspace_path]` is deprecated. Please set \ this flag to true and make sure `workspace_path` is the label where the Cargo-raze is \ expected to write it's output." ); @@ -550,7 +550,7 @@ impl RawRazeSettings { if self.target.is_some() { eprintln!( - "WARNING: `[*.raze.target]` will soon be deprecated. Please update your project to use \ + "WARNING: `[*.raze.target]` is deprecated. Please update your project to use \ `[*.raze.targets]`." ); }