diff --git a/cargo/private/cargo_build_script.bzl b/cargo/private/cargo_build_script.bzl index 7ede86794b..ecabd037ea 100644 --- a/cargo/private/cargo_build_script.bzl +++ b/cargo/private/cargo_build_script.bzl @@ -625,7 +625,7 @@ cargo_build_script = rule( doc = "The binary script to run, generally a `rust_binary` target.", executable = True, mandatory = True, - cfg = "target", + cfg = "exec", providers = [CargoBuildScriptRunfilesInfo], ), "tools": attr.label_list( diff --git a/test/cargo_build_script/location_expansion/test.rs b/test/cargo_build_script/location_expansion/test.rs index e981cb692d..aeeae70801 100644 --- a/test/cargo_build_script/location_expansion/test.rs +++ b/test/cargo_build_script/location_expansion/test.rs @@ -63,24 +63,19 @@ pub fn test_execpath() { ) .1; - let (data_cfg, data_short_path) = data_path.split_at( + let (_data_cfg, data_short_path) = data_path.split_at( data_path .find("/bin/") .unwrap_or_else(|| panic!("Failed to find bin in {}", data_path)) + "/bin/".len(), ); - let (tool_cfg, tool_short_path) = tool_path.split_at( + let (_tool_cfg, tool_short_path) = tool_path.split_at( tool_path .find("/bin/") .unwrap_or_else(|| panic!("Failed to find bin in {}", tool_path)) + "/bin/".len(), ); - assert_ne!( - data_cfg, tool_cfg, - "Data and tools should not be from the same configuration." - ); - assert_eq!( data_short_path, "test/cargo_build_script/location_expansion/target_data.txt"