From a4b514615796b9b4a2cac1b73935304447897805 Mon Sep 17 00:00:00 2001 From: Bert Belder Date: Sat, 3 Nov 2018 06:54:46 +0100 Subject: [PATCH] build: infer label name for versioned Rust crates --- build_extra/rust/BUILD.gn | 5 ----- build_extra/rust/rust.gni | 7 ++++--- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/build_extra/rust/BUILD.gn b/build_extra/rust/BUILD.gn index 56e0aaa96f..9f396b3162 100644 --- a/build_extra/rust/BUILD.gn +++ b/build_extra/rust/BUILD.gn @@ -196,7 +196,6 @@ rust_crate("kernel32") { source_root = "$registry_github/kernel32-sys-0.2.2/src/lib.rs" extern_version = [ { - label = ":winapi-0.2" crate_name = "winapi" crate_version = "0.2" }, @@ -208,7 +207,6 @@ rust_crate("ws2_32") { source_root = "$registry_github/ws2_32-sys-0.2.1/src/lib.rs" extern_version = [ { - label = ":winapi-0.2" crate_name = "winapi" crate_version = "0.2" }, @@ -244,7 +242,6 @@ rust_crate("mio") { # See https://github.com/denoland/deno/issues/484. extern_version = [ { - label = ":winapi-0.2" crate_name = "winapi" crate_version = "0.2" }, @@ -272,7 +269,6 @@ rust_crate("miow") { # See https://github.com/denoland/deno/issues/484. extern_version = [ { - label = ":winapi-0.2" crate_name = "winapi" crate_version = "0.2" }, @@ -288,7 +284,6 @@ rust_crate("iovec") { # See https://github.com/denoland/deno/issues/484. extern_version = [ { - label = ":winapi-0.2" crate_name = "winapi" crate_version = "0.2" }, diff --git a/build_extra/rust/rust.gni b/build_extra/rust/rust.gni index c7ad376d0d..3263f0018f 100644 --- a/build_extra/rust/rust.gni +++ b/build_extra/rust/rust.gni @@ -113,14 +113,15 @@ template("rust_crate") { foreach(info, invoker.extern_version) { extern_rlibs += [ { + crate_name = info.crate_name + crate_version = info.crate_version crate_suffix = exec_script("//tools/sha256sum.py", [ - "--input=${info.crate_version}", + "--input=$crate_version", "--format=-%.8s", ], "trim string") - label = info.label - crate_name = info.crate_name + label = ":$crate_name-$crate_version" rlib = "$out_dir/lib$crate_name$crate_suffix.rlib" }, ]