Apply get_lib_name correctly to the C++ runtime libraries #1508
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#1500 added an additional
for_windows
parameter toget_lib_name
. I missed the fact that we also pass that function tomap_each
here: https://github.com/bazelbuild/rules_rust/blob/main/rust/private/rustc.bzl#L1671and as such, this code does not always work correctly (we don't get to pass the
for_windows
parameter, and internally at Google it ended up evaluating toTrue
on Linux builds).I tried to avoid flattening the
cc_toolchain.dynamic_runtime_lib
andcc_toolchain.static_runtime_lib
depsets by using a lambda:However it looks like such usage of lambdas is not allowed:
So instead of
get_lib_name
we now haveget_lib_name_default
andget_lib_name_for_windows
.