From e3ed60d6e9d7fd222daeb881652ae5403e9ab550 Mon Sep 17 00:00:00 2001 From: Lukacs Berki Date: Fri, 9 Sep 2016 15:20:49 +0000 Subject: Make cc_toolchain not croak if something that is not a shared library is mentioned in the dynamic_runtime_libs attribute. -- MOS_MIGRATED_REVID=132676097 --- .../com/google/devtools/build/lib/rules/cpp/CppHelper.java | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'src/main/java/com/google/devtools/build/lib/rules/cpp/CppHelper.java') diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppHelper.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppHelper.java index 49eefe9413..f5e0ab5f39 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppHelper.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppHelper.java @@ -457,18 +457,18 @@ public class CppHelper { * before populating the set of files necessary to execute an action. */ static List getAggregatingMiddlemanForCppRuntimes(RuleContext ruleContext, - String purpose, TransitiveInfoCollection dep, String solibDirOverride, + String purpose, Iterable artifacts, String solibDirOverride, BuildConfiguration configuration) { return getMiddlemanInternal(ruleContext, ruleContext.getActionOwner(), purpose, - dep, true, true, solibDirOverride, configuration); + artifacts, true, true, solibDirOverride, configuration); } @VisibleForTesting public static List getAggregatingMiddlemanForTesting( - RuleContext ruleContext, ActionOwner owner, String purpose, TransitiveInfoCollection dep, + RuleContext ruleContext, ActionOwner owner, String purpose, Iterable artifacts, boolean useSolibSymlinks, BuildConfiguration configuration) { return getMiddlemanInternal( - ruleContext, owner, purpose, dep, useSolibSymlinks, false, null, configuration); + ruleContext, owner, purpose, artifacts, useSolibSymlinks, false, null, configuration); } /** @@ -476,13 +476,9 @@ public class CppHelper { */ private static List getMiddlemanInternal( RuleContext ruleContext, ActionOwner actionOwner, String purpose, - TransitiveInfoCollection dep, boolean useSolibSymlinks, boolean isCppRuntime, + Iterable artifacts, boolean useSolibSymlinks, boolean isCppRuntime, String solibDirOverride, BuildConfiguration configuration) { - if (dep == null) { - return ImmutableList.of(); - } MiddlemanFactory factory = ruleContext.getAnalysisEnvironment().getMiddlemanFactory(); - Iterable artifacts = dep.getProvider(FileProvider.class).getFilesToBuild(); if (useSolibSymlinks) { List symlinkedArtifacts = new ArrayList<>(); for (Artifact artifact : artifacts) { -- cgit v1.2.3