Skip to content

Commit

Permalink
Don't precompute coverage environment in cc_toolchain
Browse files Browse the repository at this point in the history
    Instead, compute it for each target separately using its rule context.

    bazelbuild/bazel#6516

    RELNOTES: None
    PiperOrigin-RevId: 240330179
  • Loading branch information
Luca Di Grazia committed Sep 4, 2022
1 parent ebdf7d7 commit e8911d8
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,8 @@ public Artifact getDynamicLibrarySymlink(Artifact library, boolean preserveName)
ccToolchain.getSolibDirectory(),
library,
preserveName,
/* prefixConsumer= */ true);
true,
ruleContext.getConfiguration());
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -986,9 +986,5 @@ public boolean isHostConfiguration() {
public LicensesProvider getLicensesProvider() {
return licensesProvider;
}

public PathFragment getDefaultSysroot() {
return toolchainInfo.getDefaultSysroot();
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,11 @@ static CcToolchainProvider getCcToolchainProvider(
dynamicRuntimeLinkInputs.add(artifact);
dynamicRuntimeLinkSymlinksBuilder.add(
SolibSymlinkAction.getCppRuntimeSymlink(
ruleContext, artifact, toolchainInfo.getSolibDirectory(), runtimeSolibDirBase));
ruleContext,
artifact,
toolchainInfo.getSolibDirectory(),
runtimeSolibDirBase,
configuration));
}
}
if (dynamicRuntimeLinkInputs.isEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -625,14 +625,15 @@ private static List<Artifact> getMiddlemanInternal(
symlinkedArtifacts.add(
isCppRuntime
? SolibSymlinkAction.getCppRuntimeSymlink(
ruleContext, artifact, solibDir, solibDirOverride)
ruleContext, artifact, solibDir, solibDirOverride, configuration)
: SolibSymlinkAction.getDynamicLibrarySymlink(
/* actionRegistry= */ ruleContext,
/* actionConstructionContext= */ ruleContext,
solibDir,
artifact,
/* preserveName= */ false,
/* prefixConsumer= */ true));
/* prefixConsumer= */ true,
configuration));
}
artifacts = symlinkedArtifacts;
purpose += "_with_solib";
Expand Down

0 comments on commit e8911d8

Please sign in to comment.