Skip to content

Commit

Permalink
Add convenience symlink for Skymeld.
Browse files Browse the repository at this point in the history
This will be done after execution. This is different from regular blaze, which
does it before execution.

PiperOrigin-RevId: 464996449
Change-Id: I1198e4b787598eef0ec1f5a6211e8743dc9bef84
  • Loading branch information
joeleba authored and copybara-github committed Aug 3, 2022
1 parent d9806c0 commit f4b5239
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<ConvenienceSymlink> 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<ConvenienceSymlink> convenienceSymlinks = ImmutableList.of();
if (request.getBuildOptions().experimentalConvenienceSymlinks
!= ConvenienceSymlinksMode.IGNORE) {
convenienceSymlinks = createConvenienceSymlinks(request.getBuildOptions(), analysisResult);
}
if (request.getBuildOptions().experimentalConvenienceSymlinksBepEvent) {
env.getEventBus().post(new ConvenienceSymlinksIdentifiedEvent(convenienceSymlinks));
}
}
}

Expand Down

0 comments on commit f4b5239

Please sign in to comment.