C++: Deletes CcLinkParamsInfo This class is not necessary anymore. We can use CcLinkParamsStoreImpl directly which has been renamed to CcLinkParamsStore. RELNOTES:none PiperOrigin-RevId: 196656488
diff --git a/src/main/java/com/google/devtools/build/lib/bazel/rules/java/BazelJavaSemantics.java b/src/main/java/com/google/devtools/build/lib/bazel/rules/java/BazelJavaSemantics.java index bcc9ea8..4d95e44430 100644 --- a/src/main/java/com/google/devtools/build/lib/bazel/rules/java/BazelJavaSemantics.java +++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/java/BazelJavaSemantics.java
@@ -42,8 +42,8 @@ import com.google.devtools.build.lib.collect.nestedset.Order; import com.google.devtools.build.lib.packages.BuildType; import com.google.devtools.build.lib.packages.TargetUtils; +import com.google.devtools.build.lib.rules.cpp.AbstractCcLinkParamsStore; import com.google.devtools.build.lib.rules.cpp.CcLinkParams; -import com.google.devtools.build.lib.rules.cpp.CcLinkParamsInfo; import com.google.devtools.build.lib.rules.cpp.CcLinkParamsStore; import com.google.devtools.build.lib.rules.cpp.CcLinkingInfo; import com.google.devtools.build.lib.rules.java.DeployArchiveBuilder; @@ -568,16 +568,16 @@ RuleConfiguredTargetBuilder ruleBuilder) { // TODO(plf): Figure out whether we can remove support for C++ dependencies in Bazel. CcLinkingInfo.Builder ccLinkingInfoBuilder = CcLinkingInfo.Builder.create(); - ccLinkingInfoBuilder.setCcLinkParamsInfo( - new CcLinkParamsInfo( - new CcLinkParamsStore() { + ccLinkingInfoBuilder.setCcLinkParamsStore( + new CcLinkParamsStore( + new AbstractCcLinkParamsStore() { @Override protected void collect( CcLinkParams.Builder builder, boolean linkingStatically, boolean linkShared) { builder.addTransitiveTargets( javaCommon.targetsTreatedAsDeps(ClasspathType.BOTH), JavaCcLinkParamsProvider.TO_LINK_PARAMS, - CcLinkParamsInfo.TO_LINK_PARAMS); + CcLinkParamsStore.TO_LINK_PARAMS); } })); ruleBuilder.addNativeDeclaredProvider(ccLinkingInfoBuilder.build());
diff --git a/src/main/java/com/google/devtools/build/lib/bazel/rules/python/BazelPythonSemantics.java b/src/main/java/com/google/devtools/build/lib/bazel/rules/python/BazelPythonSemantics.java index eeaf5f2..a2269fb 100644 --- a/src/main/java/com/google/devtools/build/lib/bazel/rules/python/BazelPythonSemantics.java +++ b/src/main/java/com/google/devtools/build/lib/bazel/rules/python/BazelPythonSemantics.java
@@ -39,7 +39,7 @@ import com.google.devtools.build.lib.cmdline.Label; import com.google.devtools.build.lib.collect.nestedset.NestedSet; import com.google.devtools.build.lib.collect.nestedset.NestedSetBuilder; -import com.google.devtools.build.lib.rules.cpp.CcLinkParamsStore; +import com.google.devtools.build.lib.rules.cpp.AbstractCcLinkParamsStore; import com.google.devtools.build.lib.rules.python.PyCommon; import com.google.devtools.build.lib.rules.python.PythonConfiguration; import com.google.devtools.build.lib.rules.python.PythonSemantics; @@ -128,7 +128,7 @@ public Artifact createExecutable( RuleContext ruleContext, PyCommon common, - CcLinkParamsStore ccLinkParamsStore, + AbstractCcLinkParamsStore ccLinkParamsStore, NestedSet<PathFragment> imports) throws InterruptedException { String main = common.determineMainExecutableSource(/*withWorkspaceName=*/ true);
diff --git a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidCcLinkParamsProvider.java b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidCcLinkParamsProvider.java index 0e21694..405e68b 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidCcLinkParamsProvider.java +++ b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidCcLinkParamsProvider.java
@@ -18,20 +18,20 @@ import com.google.devtools.build.lib.analysis.TransitiveInfoCollection; import com.google.devtools.build.lib.analysis.TransitiveInfoProvider; import com.google.devtools.build.lib.concurrent.ThreadSafety.Immutable; +import com.google.devtools.build.lib.rules.cpp.AbstractCcLinkParamsStore; import com.google.devtools.build.lib.rules.cpp.CcLinkParamsStore; -import com.google.devtools.build.lib.rules.cpp.CcLinkParamsStore.CcLinkParamsStoreImpl; /** A target that provides C++ libraries to be linked into Android targets. */ @AutoValue @Immutable public abstract class AndroidCcLinkParamsProvider implements TransitiveInfoProvider { - public static AndroidCcLinkParamsProvider create(CcLinkParamsStore store) { - return new AutoValue_AndroidCcLinkParamsProvider(new CcLinkParamsStoreImpl(store)); + public static AndroidCcLinkParamsProvider create(AbstractCcLinkParamsStore store) { + return new AutoValue_AndroidCcLinkParamsProvider(new CcLinkParamsStore(store)); } - public abstract CcLinkParamsStore getLinkParams(); + public abstract AbstractCcLinkParamsStore getLinkParams(); - public static final Function<TransitiveInfoCollection, CcLinkParamsStore> TO_LINK_PARAMS = + public static final Function<TransitiveInfoCollection, AbstractCcLinkParamsStore> TO_LINK_PARAMS = (TransitiveInfoCollection input) -> { AndroidCcLinkParamsProvider provider = input.getProvider(AndroidCcLinkParamsProvider.class); return provider == null ? null : provider.getLinkParams();
diff --git a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidCommon.java b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidCommon.java index 42147be..1ebd4ab 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidCommon.java +++ b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidCommon.java
@@ -44,8 +44,8 @@ import com.google.devtools.build.lib.packages.RuleClass.ConfiguredTargetFactory.RuleErrorException; import com.google.devtools.build.lib.packages.TriState; import com.google.devtools.build.lib.rules.android.ZipFilterBuilder.CheckHashMismatchMode; +import com.google.devtools.build.lib.rules.cpp.AbstractCcLinkParamsStore; import com.google.devtools.build.lib.rules.cpp.CcLinkParams; -import com.google.devtools.build.lib.rules.cpp.CcLinkParamsInfo; import com.google.devtools.build.lib.rules.cpp.CcLinkParamsStore; import com.google.devtools.build.lib.rules.java.ClasspathConfiguredFragment; import com.google.devtools.build.lib.rules.java.JavaCcLinkParamsProvider; @@ -800,14 +800,14 @@ return asNeverLink; } - public CcLinkParamsStore getCcLinkParamsStore() { + public AbstractCcLinkParamsStore getCcLinkParamsStore() { return getCcLinkParamsStore( javaCommon.targetsTreatedAsDeps(ClasspathType.BOTH), ImmutableList.<String>of()); } - public static CcLinkParamsStore getCcLinkParamsStore( + public static AbstractCcLinkParamsStore getCcLinkParamsStore( final Iterable<? extends TransitiveInfoCollection> deps, final Collection<String> linkOpts) { - return new CcLinkParamsStore() { + return new AbstractCcLinkParamsStore() { @Override protected void collect( CcLinkParams.Builder builder, boolean linkingStatically, boolean linkShared) { @@ -818,7 +818,7 @@ // Link in Android-specific C++ code (e.g., android_libraries) in the transitive closure AndroidCcLinkParamsProvider.TO_LINK_PARAMS, // Link in non-language-specific C++ code in the transitive closure - CcLinkParamsInfo.TO_LINK_PARAMS); + CcLinkParamsStore.TO_LINK_PARAMS); builder.addLinkOpts(linkOpts); } };
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/AbstractCcLinkParamsStore.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/AbstractCcLinkParamsStore.java new file mode 100644 index 0000000..2849d55 --- /dev/null +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/AbstractCcLinkParamsStore.java
@@ -0,0 +1,128 @@ +// Copyright 2014 The Bazel Authors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package com.google.devtools.build.lib.rules.cpp; + +import com.google.common.base.Preconditions; +import com.google.devtools.build.lib.skyframe.serialization.ObjectCodec; +import com.google.devtools.build.lib.skyframe.serialization.autocodec.AutoCodec; +import com.google.devtools.build.lib.skyframe.serialization.autocodec.AutoCodec.VisibleForSerialization; + +/** + * A cache of C link parameters. + * + * <p>The cache holds instances of {@link com.google.devtools.build.lib.rules.cpp.CcLinkParams} for + * combinations of linkingStatically and linkShared. If a requested value is not available in the + * cache, it is computed and then stored. + * + * <p>Typically this class is used on targets that may be linked in as C libraries as in the + * following example: + * + * <pre> + * class SomeTarget implements CcLinkParamsStore { + * private final AbstractCcLinkParamsStore ccLinkParamsStore = new AbstractCcLinkParamsStore() { + * @Override + * protected void collect(CcLinkParams.Builder builder, boolean linkingStatically, + * boolean linkShared) { + * builder.add[...] + * } + * }; + * + * @Override + * public CcLinkParams getCcLinkParams(boolean linkingStatically, boolean linkShared) { + * return ccLinkParamsStore.get(linkingStatically, linkShared); + * } + * } + * </pre> + */ +public abstract class AbstractCcLinkParamsStore { + protected CcLinkParams staticSharedParams; + protected CcLinkParams staticNoSharedParams; + protected CcLinkParams noStaticSharedParams; + protected CcLinkParams noStaticNoSharedParams; + + private CcLinkParams compute(boolean linkingStatically, boolean linkShared) { + CcLinkParams.Builder builder = CcLinkParams.builder(linkingStatically, linkShared); + collect(builder, linkingStatically, linkShared); + return builder.build(); + } + + /** + * Returns {@link com.google.devtools.build.lib.rules.cpp.CcLinkParams} for a combination of + * parameters. + * + * <p>The {@link com.google.devtools.build.lib.rules.cpp.CcLinkParams} instance is computed lazily + * and cached. + */ + public synchronized CcLinkParams get(boolean linkingStatically, boolean linkShared) { + CcLinkParams result = lookup(linkingStatically, linkShared); + if (result == null) { + result = compute(linkingStatically, linkShared); + put(linkingStatically, linkShared, result); + } + return result; + } + + private CcLinkParams lookup(boolean linkingStatically, boolean linkShared) { + if (linkingStatically) { + return linkShared ? staticSharedParams : staticNoSharedParams; + } else { + return linkShared ? noStaticSharedParams : noStaticNoSharedParams; + } + } + + private void put(boolean linkingStatically, boolean linkShared, CcLinkParams params) { + Preconditions.checkNotNull(params); + if (linkingStatically) { + if (linkShared) { + staticSharedParams = params; + } else { + staticNoSharedParams = params; + } + } else { + if (linkShared) { + noStaticSharedParams = params; + } else { + noStaticNoSharedParams = params; + } + } + } + + /** + * Hook for building the actual link params. + * + * <p>Users should override this method and call methods of the builder to + * set up the actual CcLinkParams objects. + * + * <p>Implementations of this method must not fail or try to report errors on the + * configured target. + */ + protected abstract void collect(CcLinkParams.Builder builder, boolean linkingStatically, + boolean linkShared); + + @AutoCodec + @VisibleForSerialization + static class EmptyCcLinkParamsStore extends AbstractCcLinkParamsStore { + public static final ObjectCodec<EmptyCcLinkParamsStore> CODEC = + new AbstractCcLinkParamsStore_EmptyCcLinkParamsStore_AutoCodec(); + + @Override + protected void collect( + CcLinkParams.Builder builder, boolean linkingStatically, boolean linkShared) {} + } + + /** An empty CcLinkParamStore. */ + public static final AbstractCcLinkParamsStore EMPTY = new EmptyCcLinkParamsStore(); +} +
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcLibrary.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcLibrary.java index 77d4f1e..245af2e 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcLibrary.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcLibrary.java
@@ -374,7 +374,7 @@ CcLinkingInfo ccLinkingInfo = (CcLinkingInfo) linkingInfo.getProviders().getProvider(CcLinkingInfo.PROVIDER.getKey()); CcLinkingInfo.Builder ccLinkingInfoBuilder = CcLinkingInfo.Builder.create(); - ccLinkingInfoBuilder.setCcLinkParamsInfo(ccLinkingInfo.getCcLinkParamsInfo()); + ccLinkingInfoBuilder.setCcLinkParamsStore(ccLinkingInfo.getCcLinkParamsStore()); ccLinkingInfoBuilder.setCcExecutionDynamicLibrariesInfo( ccLinkingInfo.getCcExecutionDynamicLibrariesInfo()); ccLinkingInfoBuilder.setCcRunfiles(new CcRunfiles(staticRunfiles, sharedRunfiles));
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcLinkParams.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcLinkParams.java index 4ad7a1b..294ebe9 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcLinkParams.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcLinkParams.java
@@ -218,7 +218,7 @@ nonCodeInputs); } - public boolean add(CcLinkParamsStore store) { + public boolean add(AbstractCcLinkParamsStore store) { if (store != null) { CcLinkParams args = store.get(linkingStatically, linkShared); addTransitiveArgs(args); @@ -239,14 +239,17 @@ /** * Includes link parameters from a dependency target. * - * <p>The target should implement {@link CcLinkParamsInfo}. If it does not, - * the method does not do anything. + * <p>The target should implement {@link CcLinkParamsStore}. If it does not, the method does not + * do anything. */ public Builder addTransitiveTarget(TransitiveInfoCollection target) { CcLinkingInfo ccLinkingInfo = target.get(CcLinkingInfo.PROVIDER); - CcLinkParamsInfo ccLinkParamsInfo = - ccLinkingInfo == null ? null : ccLinkingInfo.getCcLinkParamsInfo(); - return addTransitiveProvider(ccLinkParamsInfo); + CcLinkParamsStore ccLinkParamsStore = + ccLinkingInfo == null ? null : ccLinkingInfo.getCcLinkParamsStore(); + if (ccLinkParamsStore != null) { + add(ccLinkParamsStore); + } + return this; } /** @@ -255,14 +258,16 @@ * added. */ @SafeVarargs - public final Builder addTransitiveTarget(TransitiveInfoCollection target, - Function<TransitiveInfoCollection, CcLinkParamsStore> firstMapping, + public final Builder addTransitiveTarget( + TransitiveInfoCollection target, + Function<TransitiveInfoCollection, AbstractCcLinkParamsStore> firstMapping, @SuppressWarnings("unchecked") // Java arrays don't preserve generic arguments. - Function<TransitiveInfoCollection, CcLinkParamsStore>... remainingMappings) { + Function<TransitiveInfoCollection, AbstractCcLinkParamsStore>... remainingMappings) { if (add(firstMapping.apply(target))) { return this; } - for (Function<TransitiveInfoCollection, CcLinkParamsStore> mapping : remainingMappings) { + for (Function<TransitiveInfoCollection, AbstractCcLinkParamsStore> mapping : + remainingMappings) { if (add(mapping.apply(target))) { return this; } @@ -271,16 +276,6 @@ } /** - * Includes link parameters from a CcLinkParamsInfo provider. - */ - public Builder addTransitiveProvider(CcLinkParamsInfo provider) { - if (provider != null) { - add(provider.getCcLinkParamsStore()); - } - return this; - } - - /** * Includes link parameters from the given targets. Each target is checked for the given * mappings in the order specified, and the first mapping that returns a non-null result is * added. @@ -288,9 +283,9 @@ @SafeVarargs public final Builder addTransitiveTargets( Iterable<? extends TransitiveInfoCollection> targets, - Function<TransitiveInfoCollection, CcLinkParamsStore> firstMapping, - @SuppressWarnings("unchecked") // Java arrays don't preserve generic arguments. - Function<TransitiveInfoCollection, CcLinkParamsStore>... remainingMappings) { + Function<TransitiveInfoCollection, AbstractCcLinkParamsStore> firstMapping, + @SuppressWarnings("unchecked") // Java arrays don't preserve generic arguments. + Function<TransitiveInfoCollection, AbstractCcLinkParamsStore>... remainingMappings) { for (TransitiveInfoCollection target : targets) { addTransitiveTarget(target, firstMapping, remainingMappings); } @@ -387,7 +382,7 @@ public Builder addCcLibrary(RuleContext context) { addTransitiveTargets( context.getPrerequisites("deps", Mode.TARGET), - CcLinkParamsInfo.TO_LINK_PARAMS, + CcLinkParamsStore.TO_LINK_PARAMS, CcSpecificLinkParamsProvider.TO_LINK_PARAMS); return this; }
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcLinkParamsInfo.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcLinkParamsInfo.java deleted file mode 100644 index 1727e83..0000000 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcLinkParamsInfo.java +++ /dev/null
@@ -1,80 +0,0 @@ -// Copyright 2014 The Bazel Authors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package com.google.devtools.build.lib.rules.cpp; - -import com.google.common.base.Function; -import com.google.devtools.build.lib.analysis.TransitiveInfoCollection; -import com.google.devtools.build.lib.concurrent.ThreadSafety.Immutable; -import com.google.devtools.build.lib.rules.cpp.CcLinkParamsStore.CcLinkParamsStoreImpl; -import com.google.devtools.build.lib.skyframe.serialization.autocodec.AutoCodec; -import com.google.devtools.build.lib.skyframe.serialization.autocodec.AutoCodec.VisibleForSerialization; - -/** A target that provides C linker parameters. */ -@Immutable -@AutoCodec -public final class CcLinkParamsInfo { - public static final Function<TransitiveInfoCollection, CcLinkParamsStore> TO_LINK_PARAMS = - input -> { - // ... then try Skylark. - CcLinkingInfo provider = input.get(CcLinkingInfo.PROVIDER); - CcLinkParamsInfo ccLinkParamsInfo = - provider == null ? null : provider.getCcLinkParamsInfo(); - if (ccLinkParamsInfo != null) { - return ccLinkParamsInfo.getCcLinkParamsStore(); - } - return null; - }; - - private final CcLinkParamsStoreImpl store; - - @AutoCodec.Instantiator - public CcLinkParamsInfo(CcLinkParamsStore store) { - this.store = new CcLinkParamsStoreImpl(store); - } - - @AutoCodec - @VisibleForSerialization - static class CcLinkParamsInfoCollection extends CcLinkParamsStore { - private final Iterable<CcLinkParamsInfo> providers; - - CcLinkParamsInfoCollection(Iterable<CcLinkParamsInfo> providers) { - this.providers = providers; - } - - @Override - protected void collect( - CcLinkParams.Builder builder, boolean linkingStatically, boolean linkShared) { - for (CcLinkParamsInfo provider : providers) { - builder.add(provider.getCcLinkParamsStore()); - } - } - } - - public static CcLinkParamsInfo merge(final Iterable<CcLinkParamsInfo> providers) { - return new CcLinkParamsInfo(new CcLinkParamsInfoCollection(providers)); - } - - /** Returns the link params store. */ - public CcLinkParamsStore getCcLinkParamsStore() { - return store; - } - - /** - * Returns link parameters given static / shared linking settings. - */ - public CcLinkParams getCcLinkParams(boolean linkingStatically, boolean linkShared) { - return store.get(linkingStatically, linkShared); - } -}
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcLinkParamsStore.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcLinkParamsStore.java index 0ef8828..f93943e 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcLinkParamsStore.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcLinkParamsStore.java
@@ -14,147 +14,78 @@ package com.google.devtools.build.lib.rules.cpp; -import com.google.common.base.Preconditions; +import com.google.common.base.Function; +import com.google.devtools.build.lib.analysis.TransitiveInfoCollection; import com.google.devtools.build.lib.skyframe.serialization.ObjectCodec; import com.google.devtools.build.lib.skyframe.serialization.autocodec.AutoCodec; import com.google.devtools.build.lib.skyframe.serialization.autocodec.AutoCodec.VisibleForSerialization; -/** - * A cache of C link parameters. - * - * <p>The cache holds instances of {@link com.google.devtools.build.lib.rules.cpp.CcLinkParams} for - * combinations of linkingStatically and linkShared. If a requested value is not available in the - * cache, it is computed and then stored. - * - * <p>Typically this class is used on targets that may be linked in as C libraries as in the - * following example: - * - * <pre> - * class SomeTarget implements CcLinkParamsInfo { - * private final CcLinkParamsStore ccLinkParamsStore = new CcLinkParamsStore() { - * @Override - * protected void collect(CcLinkParams.Builder builder, boolean linkingStatically, - * boolean linkShared) { - * builder.add[...] - * } - * }; - * - * @Override - * public CcLinkParams getCcLinkParams(boolean linkingStatically, boolean linkShared) { - * return ccLinkParamsStore.get(linkingStatically, linkShared); - * } - * } - * </pre> - */ -public abstract class CcLinkParamsStore { - private CcLinkParams staticSharedParams; - private CcLinkParams staticNoSharedParams; - private CcLinkParams noStaticSharedParams; - private CcLinkParams noStaticNoSharedParams; - - private CcLinkParams compute(boolean linkingStatically, boolean linkShared) { - CcLinkParams.Builder builder = CcLinkParams.builder(linkingStatically, linkShared); - collect(builder, linkingStatically, linkShared); - return builder.build(); - } - - /** - * Returns {@link com.google.devtools.build.lib.rules.cpp.CcLinkParams} for a combination of - * parameters. - * - * <p>The {@link com.google.devtools.build.lib.rules.cpp.CcLinkParams} instance is computed lazily - * and cached. - */ - public synchronized CcLinkParams get(boolean linkingStatically, boolean linkShared) { - CcLinkParams result = lookup(linkingStatically, linkShared); - if (result == null) { - result = compute(linkingStatically, linkShared); - put(linkingStatically, linkShared, result); - } - return result; - } - - private CcLinkParams lookup(boolean linkingStatically, boolean linkShared) { - if (linkingStatically) { - return linkShared ? staticSharedParams : staticNoSharedParams; - } else { - return linkShared ? noStaticSharedParams : noStaticNoSharedParams; - } - } - - private void put(boolean linkingStatically, boolean linkShared, CcLinkParams params) { - Preconditions.checkNotNull(params); - if (linkingStatically) { - if (linkShared) { - staticSharedParams = params; - } else { - staticNoSharedParams = params; - } - } else { - if (linkShared) { - noStaticSharedParams = params; - } else { - noStaticNoSharedParams = params; - } - } - } - - /** - * Hook for building the actual link params. - * - * <p>Users should override this method and call methods of the builder to - * set up the actual CcLinkParams objects. - * - * <p>Implementations of this method must not fail or try to report errors on the - * configured target. - */ - protected abstract void collect(CcLinkParams.Builder builder, boolean linkingStatically, - boolean linkShared); +/** An implementation class for the AbstractCcLinkParamsStore. */ +@AutoCodec +public final class CcLinkParamsStore extends AbstractCcLinkParamsStore { + public static final ObjectCodec<com.google.devtools.build.lib.rules.cpp.CcLinkParamsStore> CODEC = + new CcLinkParamsStore_AutoCodec(); + public static final Function<TransitiveInfoCollection, AbstractCcLinkParamsStore> TO_LINK_PARAMS = + input -> { + // ... then try Skylark. + CcLinkingInfo provider = input.get(CcLinkingInfo.PROVIDER); + return provider == null ? null : provider.getCcLinkParamsStore(); + }; @AutoCodec @VisibleForSerialization - static class EmptyCcLinkParamsStore extends CcLinkParamsStore { - public static final ObjectCodec<EmptyCcLinkParamsStore> CODEC = - new CcLinkParamsStore_EmptyCcLinkParamsStore_AutoCodec(); + static class CcLinkParamsInfoCollection extends AbstractCcLinkParamsStore { + private final Iterable<com.google.devtools.build.lib.rules.cpp.CcLinkParamsStore> + ccLinkParamStores; + + CcLinkParamsInfoCollection( + Iterable<com.google.devtools.build.lib.rules.cpp.CcLinkParamsStore> ccLinkParamStores) { + this.ccLinkParamStores = ccLinkParamStores; + } @Override protected void collect( - CcLinkParams.Builder builder, boolean linkingStatically, boolean linkShared) {} + CcLinkParams.Builder builder, boolean linkingStatically, boolean linkShared) { + for (com.google.devtools.build.lib.rules.cpp.CcLinkParamsStore ccLinkParamsStore : + ccLinkParamStores) { + builder.add(ccLinkParamsStore); + } + } } - /** An empty CcLinkParamStore. */ - public static final CcLinkParamsStore EMPTY = new EmptyCcLinkParamsStore(); + public CcLinkParamsStore(AbstractCcLinkParamsStore store) { + this( + store.get(true, true), + store.get(true, false), + store.get(false, true), + store.get(false, false)); + } - /** An implementation class for the CcLinkParamsStore. */ - @AutoCodec - public static final class CcLinkParamsStoreImpl extends CcLinkParamsStore { - public static final ObjectCodec<CcLinkParamsStoreImpl> CODEC = - new CcLinkParamsStore_CcLinkParamsStoreImpl_AutoCodec(); + @VisibleForSerialization + @AutoCodec.Instantiator + CcLinkParamsStore( + CcLinkParams staticSharedParams, + CcLinkParams staticNoSharedParams, + CcLinkParams noStaticSharedParams, + CcLinkParams noStaticNoSharedParams) { + super.staticSharedParams = staticSharedParams; + super.staticNoSharedParams = staticNoSharedParams; + super.noStaticSharedParams = noStaticSharedParams; + super.noStaticNoSharedParams = noStaticNoSharedParams; + } - public CcLinkParamsStoreImpl(CcLinkParamsStore store) { - this( - store.get(true, true), - store.get(true, false), - store.get(false, true), - store.get(false, false)); - } + public static com.google.devtools.build.lib.rules.cpp.CcLinkParamsStore merge( + final Iterable<com.google.devtools.build.lib.rules.cpp.CcLinkParamsStore> providers) { + return new com.google.devtools.build.lib.rules.cpp.CcLinkParamsStore( + new CcLinkParamsInfoCollection(providers)); + } - @VisibleForSerialization - @AutoCodec.Instantiator - CcLinkParamsStoreImpl( - CcLinkParams staticSharedParams, - CcLinkParams staticNoSharedParams, - CcLinkParams noStaticSharedParams, - CcLinkParams noStaticNoSharedParams) { - super.staticSharedParams = staticSharedParams; - super.staticNoSharedParams = staticNoSharedParams; - super.noStaticSharedParams = noStaticSharedParams; - super.noStaticNoSharedParams = noStaticNoSharedParams; - } + @Override + protected void collect( + CcLinkParams.Builder builder, boolean linkingStatically, boolean linkShared) {} - @Override - protected void collect( - CcLinkParams.Builder builder, boolean linkingStatically, boolean linkShared) {} + /** Returns link parameters given static / shared linking settings. */ + public CcLinkParams getCcLinkParams(boolean linkingStatically, boolean linkShared) { + return get(linkingStatically, linkShared); } } -
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcLinkingHelper.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcLinkingHelper.java index e794eb5..23abb5b 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcLinkingHelper.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcLinkingHelper.java
@@ -381,7 +381,7 @@ /** * This adds the {@link CcSpecificLinkParamsProvider} to the providers created by this class. - * Otherwise the result will contain an instance of {@link CcLinkParamsInfo}. + * Otherwise the result will contain an instance of {@link CcLinkParamsStore}. */ public CcLinkingHelper enableCcSpecificLinkParamsProvider() { this.emitCcSpecificLinkParamsProvider = true; @@ -551,8 +551,8 @@ new CcSpecificLinkParamsProvider( createCcLinkParamsStore(ccLinkingOutputs, ccCompilationContext, forcePic))); } else { - ccLinkingInfoBuilder.setCcLinkParamsInfo( - new CcLinkParamsInfo( + ccLinkingInfoBuilder.setCcLinkParamsStore( + new CcLinkParamsStore( createCcLinkParamsStore(ccLinkingOutputs, ccCompilationContext, forcePic))); } providers.put(ccLinkingInfoBuilder.build()); @@ -633,17 +633,17 @@ return builder.build(); } - private CcLinkParamsStore createCcLinkParamsStore( + private AbstractCcLinkParamsStore createCcLinkParamsStore( final CcLinkingOutputs ccLinkingOutputs, final CcCompilationContext ccCompilationContext, final boolean forcePic) { - return new CcLinkParamsStore() { + return new AbstractCcLinkParamsStore() { @Override protected void collect( CcLinkParams.Builder builder, boolean linkingStatically, boolean linkShared) { builder.addLinkstamps(linkstamps.build(), ccCompilationContext); builder.addTransitiveTargets( - deps, CcLinkParamsInfo.TO_LINK_PARAMS, CcSpecificLinkParamsProvider.TO_LINK_PARAMS); + deps, CcLinkParamsStore.TO_LINK_PARAMS, CcSpecificLinkParamsProvider.TO_LINK_PARAMS); if (!neverlink) { builder.addLibraries( ccLinkingOutputs.getPreferredLibraries(
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcLinkingInfo.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcLinkingInfo.java index 4edbdf9..a331e70 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcLinkingInfo.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcLinkingInfo.java
@@ -36,24 +36,24 @@ public static final NativeProvider<CcLinkingInfo> PROVIDER = new NativeProvider<CcLinkingInfo>(CcLinkingInfo.class, "CcLinkingInfo") {}; - private final CcLinkParamsInfo ccLinkParamsInfo; + private final CcLinkParamsStore ccLinkParamsStore; private final CcRunfiles ccRunfiles; private final CcExecutionDynamicLibrariesInfo ccExecutionDynamicLibrariesInfo; @AutoCodec.Instantiator @VisibleForSerialization CcLinkingInfo( - CcLinkParamsInfo ccLinkParamsInfo, + CcLinkParamsStore ccLinkParamsStore, CcRunfiles ccRunfiles, CcExecutionDynamicLibrariesInfo ccExecutionDynamicLibrariesInfo) { super(PROVIDER); - this.ccLinkParamsInfo = ccLinkParamsInfo; + this.ccLinkParamsStore = ccLinkParamsStore; this.ccRunfiles = ccRunfiles; this.ccExecutionDynamicLibrariesInfo = ccExecutionDynamicLibrariesInfo; } - public CcLinkParamsInfo getCcLinkParamsInfo() { - return ccLinkParamsInfo; + public CcLinkParamsStore getCcLinkParamsStore() { + return ccLinkParamsStore; } public CcRunfiles getCcRunfiles() { @@ -66,7 +66,7 @@ /** A Builder for {@link CcLinkingInfo}. */ public static class Builder { - CcLinkParamsInfo ccLinkParamsInfo; + CcLinkParamsStore ccLinkParamsStore; CcRunfiles ccRunfiles; CcExecutionDynamicLibrariesInfo ccExecutionDynamicLibrariesInfo; @@ -74,9 +74,9 @@ return new CcLinkingInfo.Builder(); } - public Builder setCcLinkParamsInfo(CcLinkParamsInfo ccLinkParamsInfo) { - Preconditions.checkState(this.ccLinkParamsInfo == null); - this.ccLinkParamsInfo = ccLinkParamsInfo; + public Builder setCcLinkParamsStore(CcLinkParamsStore ccLinkParamsStore) { + Preconditions.checkState(this.ccLinkParamsStore == null); + this.ccLinkParamsStore = ccLinkParamsStore; return this; } @@ -94,7 +94,7 @@ } public CcLinkingInfo build() { - return new CcLinkingInfo(ccLinkParamsInfo, ccRunfiles, ccExecutionDynamicLibrariesInfo); + return new CcLinkingInfo(ccLinkParamsStore, ccRunfiles, ccExecutionDynamicLibrariesInfo); } } }
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcSkylarkApiProvider.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcSkylarkApiProvider.java index 88c959d..7a0aa93 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcSkylarkApiProvider.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcSkylarkApiProvider.java
@@ -66,8 +66,8 @@ public NestedSet<Artifact> getLibraries() { NestedSetBuilder<Artifact> libs = NestedSetBuilder.linkOrder(); CcLinkingInfo ccLinkingInfo = getInfo().get(CcLinkingInfo.PROVIDER); - CcLinkParamsInfo ccLinkParams = - ccLinkingInfo == null ? null : ccLinkingInfo.getCcLinkParamsInfo(); + CcLinkParamsStore ccLinkParams = + ccLinkingInfo == null ? null : ccLinkingInfo.getCcLinkParamsStore(); if (ccLinkParams == null) { return libs.build(); } @@ -87,8 +87,8 @@ + "(possibly empty but never <code>None</code>)") public ImmutableList<String> getLinkopts() { CcLinkingInfo ccLinkingInfo = getInfo().get(CcLinkingInfo.PROVIDER); - CcLinkParamsInfo ccLinkParams = - ccLinkingInfo == null ? null : ccLinkingInfo.getCcLinkParamsInfo(); + CcLinkParamsStore ccLinkParams = + ccLinkingInfo == null ? null : ccLinkingInfo.getCcLinkParamsStore(); if (ccLinkParams == null) { return ImmutableList.of(); }
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcSpecificLinkParamsProvider.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcSpecificLinkParamsProvider.java index 54ec8f9..2c6edfc 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcSpecificLinkParamsProvider.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcSpecificLinkParamsProvider.java
@@ -18,7 +18,6 @@ import com.google.devtools.build.lib.analysis.TransitiveInfoCollection; import com.google.devtools.build.lib.analysis.TransitiveInfoProvider; import com.google.devtools.build.lib.concurrent.ThreadSafety.Immutable; -import com.google.devtools.build.lib.rules.cpp.CcLinkParamsStore.CcLinkParamsStoreImpl; import com.google.devtools.build.lib.skyframe.serialization.autocodec.AutoCodec; /** @@ -28,23 +27,23 @@ @Immutable @AutoCodec public final class CcSpecificLinkParamsProvider implements TransitiveInfoProvider { - private final CcLinkParamsStoreImpl store; + private final CcLinkParamsStore store; - CcSpecificLinkParamsProvider(CcLinkParamsStore store) { - this(new CcLinkParamsStoreImpl(store)); + CcSpecificLinkParamsProvider(AbstractCcLinkParamsStore store) { + this(new CcLinkParamsStore(store)); } @AutoCodec.VisibleForSerialization @AutoCodec.Instantiator - CcSpecificLinkParamsProvider(CcLinkParamsStoreImpl store) { + CcSpecificLinkParamsProvider(CcLinkParamsStore store) { this.store = store; } - public CcLinkParamsStore getLinkParams() { + public AbstractCcLinkParamsStore getLinkParams() { return store; } - public static final Function<TransitiveInfoCollection, CcLinkParamsStore> TO_LINK_PARAMS = + public static final Function<TransitiveInfoCollection, AbstractCcLinkParamsStore> TO_LINK_PARAMS = input -> { CcSpecificLinkParamsProvider provider = input.getProvider(CcSpecificLinkParamsProvider.class);
diff --git a/src/main/java/com/google/devtools/build/lib/rules/java/JavaCcLinkParamsProvider.java b/src/main/java/com/google/devtools/build/lib/rules/java/JavaCcLinkParamsProvider.java index f8d73c7..1d9ff5a 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/java/JavaCcLinkParamsProvider.java +++ b/src/main/java/com/google/devtools/build/lib/rules/java/JavaCcLinkParamsProvider.java
@@ -18,31 +18,31 @@ import com.google.devtools.build.lib.analysis.TransitiveInfoCollection; import com.google.devtools.build.lib.analysis.TransitiveInfoProvider; import com.google.devtools.build.lib.concurrent.ThreadSafety.Immutable; +import com.google.devtools.build.lib.rules.cpp.AbstractCcLinkParamsStore; import com.google.devtools.build.lib.rules.cpp.CcLinkParamsStore; -import com.google.devtools.build.lib.rules.cpp.CcLinkParamsStore.CcLinkParamsStoreImpl; import com.google.devtools.build.lib.skyframe.serialization.autocodec.AutoCodec; /** A target that provides C++ libraries to be linked into Java targets. */ @Immutable @AutoCodec public final class JavaCcLinkParamsProvider implements TransitiveInfoProvider { - private final CcLinkParamsStoreImpl store; + private final CcLinkParamsStore store; - public JavaCcLinkParamsProvider(CcLinkParamsStore store) { - this(new CcLinkParamsStoreImpl(store)); + public JavaCcLinkParamsProvider(AbstractCcLinkParamsStore store) { + this(new CcLinkParamsStore(store)); } @AutoCodec.VisibleForSerialization @AutoCodec.Instantiator - JavaCcLinkParamsProvider(CcLinkParamsStoreImpl store) { + JavaCcLinkParamsProvider(CcLinkParamsStore store) { this.store = store; } - public CcLinkParamsStore getLinkParams() { + public AbstractCcLinkParamsStore getLinkParams() { return store; } - public static final Function<TransitiveInfoCollection, CcLinkParamsStore> TO_LINK_PARAMS = + public static final Function<TransitiveInfoCollection, AbstractCcLinkParamsStore> TO_LINK_PARAMS = input -> { JavaCcLinkParamsProvider provider = input.getProvider(JavaCcLinkParamsProvider.class); return provider == null ? null : provider.getLinkParams();
diff --git a/src/main/java/com/google/devtools/build/lib/rules/java/proto/JplCcLinkParams.java b/src/main/java/com/google/devtools/build/lib/rules/java/proto/JplCcLinkParams.java index f8e48db..b5a67af 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/java/proto/JplCcLinkParams.java +++ b/src/main/java/com/google/devtools/build/lib/rules/java/proto/JplCcLinkParams.java
@@ -18,8 +18,8 @@ import com.google.devtools.build.lib.analysis.RuleContext; import com.google.devtools.build.lib.analysis.TransitiveInfoCollection; import com.google.devtools.build.lib.analysis.configuredtargets.RuleConfiguredTarget; +import com.google.devtools.build.lib.rules.cpp.AbstractCcLinkParamsStore; import com.google.devtools.build.lib.rules.cpp.CcLinkParams; -import com.google.devtools.build.lib.rules.cpp.CcLinkParamsStore; import com.google.devtools.build.lib.rules.java.JavaCcLinkParamsProvider; import java.util.ArrayList; import java.util.List; @@ -30,7 +30,7 @@ public class JplCcLinkParams { /** - * Creates a CcLinkParamsInfo based on 'deps' and an explicit list of proto runtimes, in the + * Creates a CcLinkParamsStore based on 'deps' and an explicit list of proto runtimes, in the * context of a java_xxx_proto_library and its aspects. * * @param ruleContext used to extract 'deps'. the 'deps' are expected to provide @@ -41,7 +41,7 @@ */ public static JavaCcLinkParamsProvider createCcLinkParamsStore( final RuleContext ruleContext, final ImmutableList<TransitiveInfoCollection> protoRuntimes) { - List<CcLinkParamsStore> stores = new ArrayList<>(); + List<AbstractCcLinkParamsStore> stores = new ArrayList<>(); for (TransitiveInfoCollection t : ruleContext.getPrerequisites("deps", RuleConfiguredTarget.Mode.TARGET)) { stores.add(t.getProvider(JavaProtoLibraryAspectProvider.class) @@ -50,11 +50,11 @@ .getLinkParams()); } return new JavaCcLinkParamsProvider( - new CcLinkParamsStore() { + new AbstractCcLinkParamsStore() { @Override protected void collect( CcLinkParams.Builder builder, boolean linkingStatically, boolean linkShared) { - for (CcLinkParamsStore store : stores) { + for (AbstractCcLinkParamsStore store : stores) { builder.add(store); } builder.addTransitiveTargets(protoRuntimes);
diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcCommon.java b/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcCommon.java index f5a441e..b4d0bac 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcCommon.java +++ b/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcCommon.java
@@ -70,7 +70,7 @@ import com.google.devtools.build.lib.rules.cpp.CcCompilationContext; import com.google.devtools.build.lib.rules.cpp.CcCompilationInfo; import com.google.devtools.build.lib.rules.cpp.CcLinkParams; -import com.google.devtools.build.lib.rules.cpp.CcLinkParamsInfo; +import com.google.devtools.build.lib.rules.cpp.CcLinkParamsStore; import com.google.devtools.build.lib.rules.cpp.CcLinkingInfo; import com.google.devtools.build.lib.rules.cpp.CppFileTypes; import com.google.devtools.build.lib.rules.cpp.CppModuleMap; @@ -172,7 +172,7 @@ private Optional<Artifact> linkedBinary = Optional.absent(); private Optional<Artifact> linkmapFile = Optional.absent(); private Iterable<CcCompilationContext> depCcHeaderProviders = ImmutableList.of(); - private Iterable<CcLinkParamsInfo> depCcLinkProviders = ImmutableList.of(); + private Iterable<CcLinkParamsStore> depCcLinkProviders = ImmutableList.of(); /** * Builder for {@link ObjcCommon} obtaining both attribute data and configuration data from @@ -261,15 +261,15 @@ ImmutableList.Builder<ObjcProvider> propagatedObjcDeps = ImmutableList.<ObjcProvider>builder(); ImmutableList.Builder<CcCompilationInfo> cppDeps = ImmutableList.builder(); - ImmutableList.Builder<CcLinkParamsInfo> cppDepLinkParams = - ImmutableList.<CcLinkParamsInfo>builder(); + ImmutableList.Builder<CcLinkParamsStore> cppDepLinkParams = + ImmutableList.<CcLinkParamsStore>builder(); for (ConfiguredTargetAndData dep : deps) { ConfiguredTarget depCT = dep.getConfiguredTarget(); addAnyProviders(propagatedObjcDeps, depCT, ObjcProvider.SKYLARK_CONSTRUCTOR); addAnyProviders(cppDeps, depCT, CcCompilationInfo.PROVIDER); if (isCcLibrary(dep)) { - cppDepLinkParams.add(depCT.get(CcLinkingInfo.PROVIDER).getCcLinkParamsInfo()); + cppDepLinkParams.add(depCT.get(CcLinkingInfo.PROVIDER).getCcLinkParamsStore()); CcCompilationContext ccCompilationContext = depCT.get(CcCompilationInfo.PROVIDER).getCcCompilationContext(); addDefines(ccCompilationContext.getDefines()); @@ -463,7 +463,7 @@ objcProvider.addAll(DEFINE, headerProvider.getDefines()); textualHeaders.addAll(headerProvider.getTextualHdrs()); } - for (CcLinkParamsInfo linkProvider : depCcLinkProviders) { + for (CcLinkParamsStore linkProvider : depCcLinkProviders) { CcLinkParams params = linkProvider.getCcLinkParams(true, false); ImmutableList<String> linkOpts = params.flattenedLinkopts(); ImmutableSet.Builder<SdkFramework> frameworkLinkOpts = new ImmutableSet.Builder<>();
diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcLibrary.java b/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcLibrary.java index 979ae10..cd17931 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcLibrary.java +++ b/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcLibrary.java
@@ -26,7 +26,7 @@ import com.google.devtools.build.lib.collect.nestedset.NestedSetBuilder; import com.google.devtools.build.lib.rules.cpp.CcCompilationContext; import com.google.devtools.build.lib.rules.cpp.CcCompilationInfo; -import com.google.devtools.build.lib.rules.cpp.CcLinkParamsInfo; +import com.google.devtools.build.lib.rules.cpp.CcLinkParamsStore; import com.google.devtools.build.lib.rules.cpp.CcLinkingInfo; import com.google.devtools.build.lib.rules.objc.ObjcCommon.ResourceAttributes; import com.google.devtools.build.lib.syntax.Type; @@ -109,8 +109,8 @@ ccCompilationInfoBuilder.setCcCompilationContext(ccCompilationContext); CcLinkingInfo.Builder ccLinkingInfoBuilder = CcLinkingInfo.Builder.create(); - ccLinkingInfoBuilder.setCcLinkParamsInfo( - new CcLinkParamsInfo(new ObjcLibraryCcLinkParamsStore(common))); + ccLinkingInfoBuilder.setCcLinkParamsStore( + new CcLinkParamsStore(new ObjcLibraryCcLinkParamsStore(common))); return ObjcRuleClasses.ruleConfiguredTarget(ruleContext, filesToBuild.build()) .addNativeDeclaredProvider(common.getObjcProvider())
diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcLibraryCcLinkParamsStore.java b/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcLibraryCcLinkParamsStore.java index d0d46b0..a97ba84 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcLibraryCcLinkParamsStore.java +++ b/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcLibraryCcLinkParamsStore.java
@@ -17,17 +17,17 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableSet; import com.google.devtools.build.lib.actions.Artifact; +import com.google.devtools.build.lib.rules.cpp.AbstractCcLinkParamsStore; import com.google.devtools.build.lib.rules.cpp.ArtifactCategory; import com.google.devtools.build.lib.rules.cpp.CcLinkParams; -import com.google.devtools.build.lib.rules.cpp.CcLinkParamsStore; import com.google.devtools.build.lib.rules.cpp.LinkerInputs; import com.google.devtools.build.lib.rules.cpp.LinkerInputs.LibraryToLink; import com.google.devtools.build.lib.vfs.FileSystemUtils; /** - * A {@link CcLinkParamsStore} to be propagated to dependent cc_{library, binary} targets. + * A {@link AbstractCcLinkParamsStore} to be propagated to dependent cc_{library, binary} targets. */ -class ObjcLibraryCcLinkParamsStore extends CcLinkParamsStore { +class ObjcLibraryCcLinkParamsStore extends AbstractCcLinkParamsStore { private final ObjcCommon common;
diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcProvider.java b/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcProvider.java index 5998b72..127e503 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcProvider.java +++ b/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcProvider.java
@@ -33,7 +33,7 @@ import com.google.devtools.build.lib.packages.NativeInfo; import com.google.devtools.build.lib.packages.NativeProvider; import com.google.devtools.build.lib.packages.NativeProvider.WithLegacySkylarkName; -import com.google.devtools.build.lib.rules.cpp.CcLinkParamsInfo; +import com.google.devtools.build.lib.rules.cpp.CcLinkParamsStore; import com.google.devtools.build.lib.rules.cpp.CcLinkingInfo; import com.google.devtools.build.lib.rules.cpp.CppModuleMap; import com.google.devtools.build.lib.rules.cpp.LinkerInputs; @@ -950,16 +950,16 @@ // three possible locations (and may be duplicated!): // 1. ObjcProvider.LIBRARY // 2. ObjcProvider.CC_LIBRARY - // 3. CcLinkParamsInfo->LibraryToLink->getArtifact() + // 3. CcLinkParamsStore->LibraryToLink->getArtifact() // TODO(cpeyser): Clean up objc-cc interop. HashSet<PathFragment> avoidLibrariesSet = new HashSet<>(); for (CcLinkingInfo linkProvider : avoidCcProviders) { - CcLinkParamsInfo ccLinkParamsInfo = linkProvider.getCcLinkParamsInfo(); - if (ccLinkParamsInfo == null) { + CcLinkParamsStore ccLinkParamsStore = linkProvider.getCcLinkParamsStore(); + if (ccLinkParamsStore == null) { continue; } NestedSet<LibraryToLink> librariesToLink = - ccLinkParamsInfo.getCcLinkParams(true, false).getLibraries(); + ccLinkParamsStore.getCcLinkParams(true, false).getLibraries(); for (LibraryToLink libraryToLink : librariesToLink.toList()) { avoidLibrariesSet.add(libraryToLink.getArtifact().getRunfilesPath()); }
diff --git a/src/main/java/com/google/devtools/build/lib/rules/python/PyBinary.java b/src/main/java/com/google/devtools/build/lib/rules/python/PyBinary.java index 21b38c2..41e19c4 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/python/PyBinary.java +++ b/src/main/java/com/google/devtools/build/lib/rules/python/PyBinary.java
@@ -24,9 +24,9 @@ import com.google.devtools.build.lib.analysis.RunfilesSupport; import com.google.devtools.build.lib.analysis.configuredtargets.RuleConfiguredTarget.Mode; import com.google.devtools.build.lib.collect.nestedset.NestedSet; +import com.google.devtools.build.lib.rules.cpp.AbstractCcLinkParamsStore; import com.google.devtools.build.lib.rules.cpp.CcCommon.CcFlagsSupplier; import com.google.devtools.build.lib.rules.cpp.CcLinkParams; -import com.google.devtools.build.lib.rules.cpp.CcLinkParamsInfo; import com.google.devtools.build.lib.rules.cpp.CcLinkParamsStore; import com.google.devtools.build.lib.rules.cpp.CcLinkingInfo; import com.google.devtools.build.lib.syntax.Type; @@ -60,7 +60,7 @@ static RuleConfiguredTargetBuilder init(RuleContext ruleContext, PythonSemantics semantics, PyCommon common) throws InterruptedException { ruleContext.initConfigurationMakeVariableContext(new CcFlagsSupplier(ruleContext)); - CcLinkParamsStore ccLinkParamsStore = initializeCcLinkParamStore(ruleContext); + AbstractCcLinkParamsStore ccLinkParamsStore = initializeCcLinkParamStore(ruleContext); List<Artifact> srcs = common.validateSrcs(); List<Artifact> allOutputs = @@ -125,7 +125,7 @@ semantics.postInitBinary(ruleContext, runfilesSupport, common); CcLinkingInfo.Builder ccLinkingInfoBuilder = CcLinkingInfo.Builder.create(); - ccLinkingInfoBuilder.setCcLinkParamsInfo(new CcLinkParamsInfo(ccLinkParamsStore)); + ccLinkingInfoBuilder.setCcLinkParamsStore(new CcLinkParamsStore(ccLinkParamsStore)); return builder .setFilesToBuild(common.getFilesToBuild()) @@ -156,14 +156,16 @@ return builder.build(); } - private static CcLinkParamsStore initializeCcLinkParamStore(final RuleContext ruleContext) { - return new CcLinkParamsStore() { + private static AbstractCcLinkParamsStore initializeCcLinkParamStore( + final RuleContext ruleContext) { + return new AbstractCcLinkParamsStore() { @Override - protected void collect(CcLinkParams.Builder builder, boolean linkingStatically, - boolean linkShared) { - builder.addTransitiveTargets(ruleContext.getPrerequisites("deps", Mode.TARGET), + protected void collect( + CcLinkParams.Builder builder, boolean linkingStatically, boolean linkShared) { + builder.addTransitiveTargets( + ruleContext.getPrerequisites("deps", Mode.TARGET), PyCcLinkParamsProvider.TO_LINK_PARAMS, - CcLinkParamsInfo.TO_LINK_PARAMS); + CcLinkParamsStore.TO_LINK_PARAMS); } }; }
diff --git a/src/main/java/com/google/devtools/build/lib/rules/python/PyCcLinkParamsProvider.java b/src/main/java/com/google/devtools/build/lib/rules/python/PyCcLinkParamsProvider.java index 45dc9af..8a270ac 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/python/PyCcLinkParamsProvider.java +++ b/src/main/java/com/google/devtools/build/lib/rules/python/PyCcLinkParamsProvider.java
@@ -17,25 +17,25 @@ import com.google.devtools.build.lib.analysis.TransitiveInfoCollection; import com.google.devtools.build.lib.analysis.TransitiveInfoProvider; import com.google.devtools.build.lib.concurrent.ThreadSafety.Immutable; +import com.google.devtools.build.lib.rules.cpp.AbstractCcLinkParamsStore; import com.google.devtools.build.lib.rules.cpp.CcLinkParamsStore; -import com.google.devtools.build.lib.rules.cpp.CcLinkParamsStore.CcLinkParamsStoreImpl; import com.google.devtools.build.lib.skyframe.serialization.autocodec.AutoCodec; /** A target that provides C++ libraries to be linked into Python targets. */ @Immutable @AutoCodec public final class PyCcLinkParamsProvider implements TransitiveInfoProvider { - private final CcLinkParamsStoreImpl store; + private final CcLinkParamsStore store; - public PyCcLinkParamsProvider(CcLinkParamsStoreImpl store) { + public PyCcLinkParamsProvider(CcLinkParamsStore store) { this.store = store; } - public CcLinkParamsStore getLinkParams() { + public AbstractCcLinkParamsStore getLinkParams() { return store; } - public static final Function<TransitiveInfoCollection, CcLinkParamsStore> TO_LINK_PARAMS = + public static final Function<TransitiveInfoCollection, AbstractCcLinkParamsStore> TO_LINK_PARAMS = input -> { PyCcLinkParamsProvider provider = input.getProvider(PyCcLinkParamsProvider.class); return provider == null ? null : provider.getLinkParams();
diff --git a/src/main/java/com/google/devtools/build/lib/rules/python/PyLibrary.java b/src/main/java/com/google/devtools/build/lib/rules/python/PyLibrary.java index 4a51a4f..e40a1ab 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/python/PyLibrary.java +++ b/src/main/java/com/google/devtools/build/lib/rules/python/PyLibrary.java
@@ -25,8 +25,8 @@ import com.google.devtools.build.lib.collect.nestedset.NestedSet; import com.google.devtools.build.lib.collect.nestedset.NestedSetBuilder; import com.google.devtools.build.lib.collect.nestedset.Order; +import com.google.devtools.build.lib.rules.cpp.AbstractCcLinkParamsStore; import com.google.devtools.build.lib.rules.cpp.CcLinkParams; -import com.google.devtools.build.lib.rules.cpp.CcLinkParamsInfo; import com.google.devtools.build.lib.rules.cpp.CcLinkParamsStore; import com.google.devtools.build.lib.rules.cpp.CcLinkingInfo; import com.google.devtools.build.lib.vfs.PathFragment; @@ -64,15 +64,17 @@ NestedSetBuilder.wrap(Order.STABLE_ORDER, allOutputs); common.addPyExtraActionPseudoAction(); - CcLinkParamsStore ccLinkParamsStore = new CcLinkParamsStore() { - @Override - protected void collect(CcLinkParams.Builder builder, boolean linkingStatically, - boolean linkShared) { - builder.addTransitiveTargets(ruleContext.getPrerequisites("deps", Mode.TARGET), - PyCcLinkParamsProvider.TO_LINK_PARAMS, - CcLinkParamsInfo.TO_LINK_PARAMS); - } - }; + AbstractCcLinkParamsStore ccLinkParamsStore = + new AbstractCcLinkParamsStore() { + @Override + protected void collect( + CcLinkParams.Builder builder, boolean linkingStatically, boolean linkShared) { + builder.addTransitiveTargets( + ruleContext.getPrerequisites("deps", Mode.TARGET), + PyCcLinkParamsProvider.TO_LINK_PARAMS, + CcLinkParamsStore.TO_LINK_PARAMS); + } + }; NestedSet<PathFragment> imports = common.collectImports(ruleContext, semantics); if (ruleContext.hasErrors()) { @@ -93,7 +95,7 @@ common.addCommonTransitiveInfoProviders(builder, semantics, filesToBuild); CcLinkingInfo.Builder ccLinkingInfoBuilder = CcLinkingInfo.Builder.create(); - ccLinkingInfoBuilder.setCcLinkParamsInfo(new CcLinkParamsInfo(ccLinkParamsStore)); + ccLinkingInfoBuilder.setCcLinkParamsStore(new CcLinkParamsStore(ccLinkParamsStore)); return builder .setFilesToBuild(filesToBuild)
diff --git a/src/main/java/com/google/devtools/build/lib/rules/python/PythonSemantics.java b/src/main/java/com/google/devtools/build/lib/rules/python/PythonSemantics.java index df73f88..ee282cb 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/python/PythonSemantics.java +++ b/src/main/java/com/google/devtools/build/lib/rules/python/PythonSemantics.java
@@ -19,7 +19,7 @@ import com.google.devtools.build.lib.analysis.RunfilesSupport; import com.google.devtools.build.lib.analysis.test.InstrumentedFilesCollector.InstrumentationSpec; import com.google.devtools.build.lib.collect.nestedset.NestedSet; -import com.google.devtools.build.lib.rules.cpp.CcLinkParamsStore; +import com.google.devtools.build.lib.rules.cpp.AbstractCcLinkParamsStore; import com.google.devtools.build.lib.vfs.PathFragment; import java.util.Collection; import java.util.List; @@ -72,7 +72,7 @@ Artifact createExecutable( RuleContext ruleContext, PyCommon common, - CcLinkParamsStore ccLinkParamsStore, + AbstractCcLinkParamsStore ccLinkParamsStore, NestedSet<PathFragment> imports) throws InterruptedException;
diff --git a/src/test/java/com/google/devtools/build/lib/rules/cpp/CcImportConfiguredTargetTest.java b/src/test/java/com/google/devtools/build/lib/rules/cpp/CcImportConfiguredTargetTest.java index 1e096b4..a846306 100644 --- a/src/test/java/com/google/devtools/build/lib/rules/cpp/CcImportConfiguredTargetTest.java +++ b/src/test/java/com/google/devtools/build/lib/rules/cpp/CcImportConfiguredTargetTest.java
@@ -121,7 +121,7 @@ LinkerInputs.toNonSolibArtifacts( target .get(CcLinkingInfo.PROVIDER) - .getCcLinkParamsInfo() + .getCcLinkParamsStore() .getCcLinkParams(false, false) .getLibraries()); assertThat(artifactsToStrings(libraries)).containsExactly("src a/libfoo.a"); @@ -130,7 +130,7 @@ LinkerInputs.toNonSolibArtifacts( target .get(CcLinkingInfo.PROVIDER) - .getCcLinkParamsInfo() + .getCcLinkParamsStore() .getCcLinkParams(false, true) .getLibraries()); assertThat(artifactsToStrings(libraries)).containsExactly("src a/libfoo.a"); @@ -139,7 +139,7 @@ LinkerInputs.toNonSolibArtifacts( target .get(CcLinkingInfo.PROVIDER) - .getCcLinkParamsInfo() + .getCcLinkParamsStore() .getCcLinkParams(true, false) .getLibraries()); assertThat(artifactsToStrings(libraries)).containsExactly("src a/libfoo.a"); @@ -148,7 +148,7 @@ LinkerInputs.toNonSolibArtifacts( target .get(CcLinkingInfo.PROVIDER) - .getCcLinkParamsInfo() + .getCcLinkParamsStore() .getCcLinkParams(true, true) .getLibraries()); assertThat(artifactsToStrings(libraries)).containsExactly("src a/libfoo.a"); @@ -161,7 +161,7 @@ scratchConfiguredTarget( "a", "foo", "cc_import(name = 'foo', shared_library = 'libfoo.so')"); CcLinkParams ccLinkParams = - target.get(CcLinkingInfo.PROVIDER).getCcLinkParamsInfo().getCcLinkParams(false, false); + target.get(CcLinkingInfo.PROVIDER).getCcLinkParamsStore().getCcLinkParams(false, false); Iterable<Artifact> libraries = LinkerInputs.toNonSolibArtifacts(ccLinkParams.getLibraries()); Iterable<Artifact> executionDynamicLibraries = ccLinkParams.getExecutionDynamicLibraries(); assertThat(artifactsToStrings(libraries)).containsExactly("src a/libfoo.so"); @@ -169,7 +169,7 @@ .containsExactly("bin _solib_k8/_U_S_Sa_Cfoo___Ua/libfoo.so"); ccLinkParams = - target.get(CcLinkingInfo.PROVIDER).getCcLinkParamsInfo().getCcLinkParams(false, true); + target.get(CcLinkingInfo.PROVIDER).getCcLinkParamsStore().getCcLinkParams(false, true); libraries = LinkerInputs.toNonSolibArtifacts(ccLinkParams.getLibraries()); executionDynamicLibraries = ccLinkParams.getExecutionDynamicLibraries(); assertThat(artifactsToStrings(libraries)).containsExactly("src a/libfoo.so"); @@ -177,7 +177,7 @@ .containsExactly("bin _solib_k8/_U_S_Sa_Cfoo___Ua/libfoo.so"); ccLinkParams = - target.get(CcLinkingInfo.PROVIDER).getCcLinkParamsInfo().getCcLinkParams(true, false); + target.get(CcLinkingInfo.PROVIDER).getCcLinkParamsStore().getCcLinkParams(true, false); libraries = LinkerInputs.toNonSolibArtifacts(ccLinkParams.getLibraries()); executionDynamicLibraries = ccLinkParams.getExecutionDynamicLibraries(); assertThat(artifactsToStrings(libraries)).containsExactly("src a/libfoo.so"); @@ -185,7 +185,7 @@ .containsExactly("bin _solib_k8/_U_S_Sa_Cfoo___Ua/libfoo.so"); ccLinkParams = - target.get(CcLinkingInfo.PROVIDER).getCcLinkParamsInfo().getCcLinkParams(true, true); + target.get(CcLinkingInfo.PROVIDER).getCcLinkParamsStore().getCcLinkParams(true, true); libraries = LinkerInputs.toNonSolibArtifacts(ccLinkParams.getLibraries()); executionDynamicLibraries = ccLinkParams.getExecutionDynamicLibraries(); assertThat(artifactsToStrings(libraries)).containsExactly("src a/libfoo.so"); @@ -203,7 +203,7 @@ "cc_import(name = 'foo', shared_library = 'libfoo.so'," + " interface_library = 'libfoo.ifso')"); CcLinkParams ccLinkParams = - target.get(CcLinkingInfo.PROVIDER).getCcLinkParamsInfo().getCcLinkParams(false, false); + target.get(CcLinkingInfo.PROVIDER).getCcLinkParamsStore().getCcLinkParams(false, false); Iterable<Artifact> libraries = LinkerInputs.toNonSolibArtifacts(ccLinkParams.getLibraries()); Iterable<Artifact> executionDynamicLibraries = ccLinkParams.getExecutionDynamicLibraries(); assertThat(artifactsToStrings(libraries)).containsExactly("src b/libfoo.ifso"); @@ -211,7 +211,7 @@ .containsExactly("bin _solib_k8/_U_S_Sb_Cfoo___Ub/libfoo.so"); ccLinkParams = - target.get(CcLinkingInfo.PROVIDER).getCcLinkParamsInfo().getCcLinkParams(false, true); + target.get(CcLinkingInfo.PROVIDER).getCcLinkParamsStore().getCcLinkParams(false, true); libraries = LinkerInputs.toNonSolibArtifacts(ccLinkParams.getLibraries()); executionDynamicLibraries = ccLinkParams.getExecutionDynamicLibraries(); assertThat(artifactsToStrings(libraries)).containsExactly("src b/libfoo.ifso"); @@ -219,7 +219,7 @@ .containsExactly("bin _solib_k8/_U_S_Sb_Cfoo___Ub/libfoo.so"); ccLinkParams = - target.get(CcLinkingInfo.PROVIDER).getCcLinkParamsInfo().getCcLinkParams(true, false); + target.get(CcLinkingInfo.PROVIDER).getCcLinkParamsStore().getCcLinkParams(true, false); libraries = LinkerInputs.toNonSolibArtifacts(ccLinkParams.getLibraries()); executionDynamicLibraries = ccLinkParams.getExecutionDynamicLibraries(); assertThat(artifactsToStrings(libraries)).containsExactly("src b/libfoo.ifso"); @@ -227,7 +227,7 @@ .containsExactly("bin _solib_k8/_U_S_Sb_Cfoo___Ub/libfoo.so"); ccLinkParams = - target.get(CcLinkingInfo.PROVIDER).getCcLinkParamsInfo().getCcLinkParams(true, true); + target.get(CcLinkingInfo.PROVIDER).getCcLinkParamsStore().getCcLinkParams(true, true); libraries = LinkerInputs.toNonSolibArtifacts(ccLinkParams.getLibraries()); executionDynamicLibraries = ccLinkParams.getExecutionDynamicLibraries(); assertThat(artifactsToStrings(libraries)).containsExactly("src b/libfoo.ifso"); @@ -244,7 +244,7 @@ "foo", "cc_import(name = 'foo', static_library = 'libfoo.a', shared_library = 'libfoo.so')"); CcLinkParams ccLinkParams = - target.get(CcLinkingInfo.PROVIDER).getCcLinkParamsInfo().getCcLinkParams(false, false); + target.get(CcLinkingInfo.PROVIDER).getCcLinkParamsStore().getCcLinkParams(false, false); Iterable<Artifact> libraries = LinkerInputs.toNonSolibArtifacts(ccLinkParams.getLibraries()); Iterable<Artifact> executionDynamicLibraries = ccLinkParams.getExecutionDynamicLibraries(); assertThat(artifactsToStrings(libraries)).containsExactly("src a/libfoo.so"); @@ -252,7 +252,7 @@ .containsExactly("bin _solib_k8/_U_S_Sa_Cfoo___Ua/libfoo.so"); ccLinkParams = - target.get(CcLinkingInfo.PROVIDER).getCcLinkParamsInfo().getCcLinkParams(false, true); + target.get(CcLinkingInfo.PROVIDER).getCcLinkParamsStore().getCcLinkParams(false, true); libraries = LinkerInputs.toNonSolibArtifacts(ccLinkParams.getLibraries()); executionDynamicLibraries = ccLinkParams.getExecutionDynamicLibraries(); assertThat(artifactsToStrings(libraries)).containsExactly("src a/libfoo.so"); @@ -260,14 +260,14 @@ .containsExactly("bin _solib_k8/_U_S_Sa_Cfoo___Ua/libfoo.so"); ccLinkParams = - target.get(CcLinkingInfo.PROVIDER).getCcLinkParamsInfo().getCcLinkParams(true, false); + target.get(CcLinkingInfo.PROVIDER).getCcLinkParamsStore().getCcLinkParams(true, false); libraries = LinkerInputs.toNonSolibArtifacts(ccLinkParams.getLibraries()); executionDynamicLibraries = ccLinkParams.getExecutionDynamicLibraries(); assertThat(artifactsToStrings(libraries)).containsExactly("src a/libfoo.a"); assertThat(artifactsToStrings(executionDynamicLibraries)).isEmpty(); ccLinkParams = - target.get(CcLinkingInfo.PROVIDER).getCcLinkParamsInfo().getCcLinkParams(true, true); + target.get(CcLinkingInfo.PROVIDER).getCcLinkParamsStore().getCcLinkParams(true, true); libraries = LinkerInputs.toNonSolibArtifacts(ccLinkParams.getLibraries()); executionDynamicLibraries = ccLinkParams.getExecutionDynamicLibraries(); assertThat(artifactsToStrings(libraries)).containsExactly("src a/libfoo.a"); @@ -282,7 +282,7 @@ LibraryToLink libraryToLink = target .get(CcLinkingInfo.PROVIDER) - .getCcLinkParamsInfo() + .getCcLinkParamsStore() .getCcLinkParams(false, false) .getLibraries() .toList() @@ -299,7 +299,7 @@ "foo", "cc_import(name = 'foo', interface_library = 'libfoo.ifso', system_provided = 1)"); CcLinkParams ccLinkParams = - target.get(CcLinkingInfo.PROVIDER).getCcLinkParamsInfo().getCcLinkParams(false, false); + target.get(CcLinkingInfo.PROVIDER).getCcLinkParamsStore().getCcLinkParams(false, false); Iterable<Artifact> libraries = LinkerInputs.toNonSolibArtifacts(ccLinkParams.getLibraries()); Iterable<Artifact> executionDynamicLibraries = ccLinkParams.getExecutionDynamicLibraries(); assertThat(artifactsToStrings(libraries)).containsExactly("src a/libfoo.ifso");
diff --git a/src/test/java/com/google/devtools/build/lib/rules/cpp/CcLibraryConfiguredTargetTest.java b/src/test/java/com/google/devtools/build/lib/rules/cpp/CcLibraryConfiguredTargetTest.java index d860ba6..fc5b87b 100644 --- a/src/test/java/com/google/devtools/build/lib/rules/cpp/CcLibraryConfiguredTargetTest.java +++ b/src/test/java/com/google/devtools/build/lib/rules/cpp/CcLibraryConfiguredTargetTest.java
@@ -242,7 +242,7 @@ assertThat( hello .get(CcLinkingInfo.PROVIDER) - .getCcLinkParamsInfo() + .getCcLinkParamsStore() .getCcLinkParams(false, false) .getLinkopts() .isEmpty()) @@ -1239,7 +1239,7 @@ LinkerInputs.toNonSolibArtifacts( target .get(CcLinkingInfo.PROVIDER) - .getCcLinkParamsInfo() + .getCcLinkParamsStore() .getCcLinkParams(true, true) .getLibraries()); assertThat(artifactsToStrings(libraries)).contains("bin a/libfoo.a"); @@ -1255,7 +1255,7 @@ LinkerInputs.toNonSolibArtifacts( target .get(CcLinkingInfo.PROVIDER) - .getCcLinkParamsInfo() + .getCcLinkParamsStore() .getCcLinkParams(true, true) .getLibraries()); assertThat(artifactsToStrings(libraries)).doesNotContain("bin a/libfoo.a"); @@ -1272,7 +1272,7 @@ LinkerInputs.toNonSolibArtifacts( target .get(CcLinkingInfo.PROVIDER) - .getCcLinkParamsInfo() + .getCcLinkParamsStore() .getCcLinkParams(true, true) .getLibraries()); assertThat(artifactsToStrings(libraries)).doesNotContain("src a/libfoo.so"); @@ -1291,7 +1291,7 @@ Iterable<Artifact> libraries = target .get(CcLinkingInfo.PROVIDER) - .getCcLinkParamsInfo() + .getCcLinkParamsStore() .getCcLinkParams(false, true) .getExecutionDynamicLibraries(); assertThat(artifactsToStrings(libraries)).doesNotContain("bin a/libfoo.ifso"); @@ -1306,7 +1306,7 @@ Iterable<Artifact> libraries = target .get(CcLinkingInfo.PROVIDER) - .getCcLinkParamsInfo() + .getCcLinkParamsStore() .getCcLinkParams(false, true) .getExecutionDynamicLibraries(); assertThat(artifactsToStrings(libraries)).doesNotContain("bin _solib_k8/liba_Slibfoo.ifso"); @@ -1322,7 +1322,7 @@ Iterable<Artifact> libraries = target .get(CcLinkingInfo.PROVIDER) - .getCcLinkParamsInfo() + .getCcLinkParamsStore() .getCcLinkParams(false, true) .getExecutionDynamicLibraries(); assertThat(artifactsToStrings(libraries)).isEmpty();