From 2ed7d14717b723d014d0ceca9712c49fe12ec330 Mon Sep 17 00:00:00 2001 From: Daniel Wagner-Hall Date: Thu, 18 Mar 2021 21:00:10 +0000 Subject: [PATCH] Set links attribute (#400) This was added to rules_rust in https://github.com/bazelbuild/rules_rust/pull/480 and we started parsing out the metadata in cargo_raze in #281 but didn't start populating it in generated BUILD files. This enables us to remove a hack in rules_rust where we try to infer the correct value for the `links` attribute if it wasn't set, based on the name, which in turn will allow us to remove the `crate_name` attribute completely. --- impl/src/rendering/templates/partials/build_script.template | 3 +++ 1 file changed, 3 insertions(+) diff --git a/impl/src/rendering/templates/partials/build_script.template b/impl/src/rendering/templates/partials/build_script.template index 1ef40a4ac..59e81dc9b 100644 --- a/impl/src/rendering/templates/partials/build_script.template +++ b/impl/src/rendering/templates/partials/build_script.template @@ -38,6 +38,9 @@ cargo_build_script( {%- else %}, {%- endif %} edition = "{{ crate.edition }}", + {%- if crate.links %} + links = "{{ crate.links }}", + {%- endif %} {%- if crate.default_deps.build_proc_macro_dependencies %} proc_macro_deps = [ {%- for dependency in crate.default_deps.build_proc_macro_dependencies %}