diff --git a/src/main/java/com/google/devtools/build/lib/buildtool/BuildTool.java b/src/main/java/com/google/devtools/build/lib/buildtool/BuildTool.java index 70e2849adde1bf..67f3531f117150 100644 --- a/src/main/java/com/google/devtools/build/lib/buildtool/BuildTool.java +++ b/src/main/java/com/google/devtools/build/lib/buildtool/BuildTool.java @@ -199,6 +199,7 @@ public void buildTargets(BuildRequest request, BuildResult result, TargetValidat buildCompleted = true; result.setBuildConfigurationCollection( analysisAndExecutionResult.getConfigurationCollection()); + executionTool.handleConvenienceSymlinks(analysisAndExecutionResult); } catch (InvalidConfigurationException | TargetParsingException | LoadingFailedException diff --git a/src/main/java/com/google/devtools/build/lib/buildtool/ExecutionTool.java b/src/main/java/com/google/devtools/build/lib/buildtool/ExecutionTool.java index c23d99f8a3009f..fb399ea8bb518e 100644 --- a/src/main/java/com/google/devtools/build/lib/buildtool/ExecutionTool.java +++ b/src/main/java/com/google/devtools/build/lib/buildtool/ExecutionTool.java @@ -673,19 +673,22 @@ private static BuildConfigurationValue getConfiguration( } /** - * Handles what action to perform on the convenience symlinks. If the the mode is {@link + * Handles what action to perform on the convenience symlinks. If the mode is {@link * ConvenienceSymlinksMode#IGNORE}, then skip any creating or cleaning of convenience symlinks. * Otherwise, manage the convenience symlinks and then post a {@link * ConvenienceSymlinksIdentifiedEvent} build event. */ - private void handleConvenienceSymlinks(AnalysisResult analysisResult) { - ImmutableList convenienceSymlinks = ImmutableList.of(); - if (request.getBuildOptions().experimentalConvenienceSymlinks - != ConvenienceSymlinksMode.IGNORE) { - convenienceSymlinks = createConvenienceSymlinks(request.getBuildOptions(), analysisResult); - } - if (request.getBuildOptions().experimentalConvenienceSymlinksBepEvent) { - env.getEventBus().post(new ConvenienceSymlinksIdentifiedEvent(convenienceSymlinks)); + public void handleConvenienceSymlinks(AnalysisResult analysisResult) { + try (SilentCloseable c = + Profiler.instance().profile("ExecutionTool.handleConvenienceSymlinks")) { + ImmutableList convenienceSymlinks = ImmutableList.of(); + if (request.getBuildOptions().experimentalConvenienceSymlinks + != ConvenienceSymlinksMode.IGNORE) { + convenienceSymlinks = createConvenienceSymlinks(request.getBuildOptions(), analysisResult); + } + if (request.getBuildOptions().experimentalConvenienceSymlinksBepEvent) { + env.getEventBus().post(new ConvenienceSymlinksIdentifiedEvent(convenienceSymlinks)); + } } }