Skip to content

Commit

Permalink
Remove unused repoMapping data in ResolvedToolchainContext.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 368199684
  • Loading branch information
katre authored and copybara-github committed Apr 13, 2021
1 parent 274c3f4 commit 04ab8d0
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import com.google.devtools.build.lib.analysis.platform.ToolchainInfo;
import com.google.devtools.build.lib.analysis.platform.ToolchainTypeInfo;
import com.google.devtools.build.lib.cmdline.Label;
import com.google.devtools.build.lib.cmdline.RepositoryName;
import com.google.devtools.build.lib.concurrent.ThreadSafety.Immutable;
import com.google.devtools.build.lib.concurrent.ThreadSafety.ThreadSafe;
import com.google.devtools.build.lib.server.FailureDetails.Toolchain.Code;
Expand All @@ -44,7 +43,6 @@ public abstract class ResolvedToolchainContext implements ToolchainContext {
* providers to be used for each toolchain type.
*/
public static ResolvedToolchainContext load(
ImmutableMap<RepositoryName, RepositoryName> repoMapping,
UnloadedToolchainContext unloadedToolchainContext,
String targetDescription,
Iterable<ConfiguredTargetAndData> toolchainTargets)
Expand Down Expand Up @@ -91,16 +89,12 @@ public static ResolvedToolchainContext load(
unloadedToolchainContext.requiredToolchainTypes(),
unloadedToolchainContext.resolvedToolchainLabels(),
// this:
repoMapping,
targetDescription,
unloadedToolchainContext.requestedLabelToToolchainType(),
toolchains.build(),
templateVariableProviders.build());
}

/** Returns the repository mapping applied by the Starlark 'in' operator to string-form labels. */
public abstract ImmutableMap<RepositoryName, RepositoryName> repoMapping();

/** Returns a description of the target being used, for error messaging. */
public abstract String targetDescription();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ private Label transformKey(StarlarkThread starlarkThread, Object key) throws Eva
.label(),
bazelStarlarkContext.getRepoMapping(),
bazelStarlarkContext.getConvertedLabelsInPackage());

return context.convert((String) key);
} catch (LabelSyntaxException e) {
throw Starlark.errorf("Unable to parse toolchain label '%s': %s", key, e.getMessage());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,6 @@ public SkyValue compute(SkyKey skyKey, Environment env)
associatedConfiguredTargetAndData.getTarget());
toolchainContext =
ResolvedToolchainContext.load(
targetPkg.getRepositoryMapping(),
unloadedToolchainContext,
targetDescription,
// TODO(161222568): Support exec groups on aspects.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,6 @@ public SkyValue compute(SkyKey key, Environment env) throws ConfiguredTargetFunc
contextsBuilder.addContext(
unloadedContext.getKey(),
ResolvedToolchainContext.load(
target.getPackage().getRepositoryMapping(),
unloadedContext.getValue(),
targetDescription,
toolchainDependencies));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ public void load() throws Exception {
// Resolve toolchains.
ResolvedToolchainContext toolchainContext =
ResolvedToolchainContext.load(
toolchain.getTarget().getPackage().getRepositoryMapping(),
unloadedToolchainContext,
"test",
ImmutableList.of(toolchain));
Expand Down Expand Up @@ -128,7 +127,6 @@ public void load_aliasedToolchain() throws Exception {
// Resolve toolchains.
ResolvedToolchainContext toolchainContext =
ResolvedToolchainContext.load(
toolchain.getTarget().getPackage().getRepositoryMapping(),
unloadedToolchainContext,
"test",
ImmutableList.of(toolchain));
Expand Down Expand Up @@ -173,7 +171,6 @@ public void load_notToolchain() throws Exception {
ToolchainException.class,
() ->
ResolvedToolchainContext.load(
toolchain.getTarget().getPackage().getRepositoryMapping(),
unloadedToolchainContext,
"test",
ImmutableList.of(toolchain)));
Expand Down Expand Up @@ -234,7 +231,6 @@ public void load_withTemplateVariables() throws Exception {
Label.parseAbsoluteUnchecked("//variable:variable_toolchain_impl"), targetConfig);
ResolvedToolchainContext toolchainContext =
ResolvedToolchainContext.load(
toolchain.getTarget().getPackage().getRepositoryMapping(),
unloadedToolchainContext,
"test",
ImmutableList.of(toolchain));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,6 @@ public RuleContext getRuleContextForTesting(
unloadedToolchainCollection.getContextMap().entrySet()) {
ResolvedToolchainContext toolchainContext =
ResolvedToolchainContext.load(
target.getPackage().getRepositoryMapping(),
unloadedToolchainContext.getValue(),
targetDescription,
prerequisiteMap.get(DependencyKind.forExecGroup(unloadedToolchainContext.getKey())));
Expand Down

0 comments on commit 04ab8d0

Please sign in to comment.