@@ -396,7 +396,8 @@ void executeBuild(
396
396
createActionLogDirectory ();
397
397
}
398
398
399
- handleConvenienceSymlinks (analysisResult );
399
+ handleConvenienceSymlinks (
400
+ analysisResult .getTargetsToBuild (), analysisResult .getConfiguration ());
400
401
401
402
BuildRequestOptions options = request .getBuildOptions ();
402
403
ActionCache actionCache = null ;
@@ -702,13 +703,15 @@ private static BuildConfigurationValue getConfiguration(
702
703
* Otherwise, manage the convenience symlinks and then post a {@link
703
704
* ConvenienceSymlinksIdentifiedEvent} build event.
704
705
*/
705
- public void handleConvenienceSymlinks (AnalysisResult analysisResult ) {
706
+ public void handleConvenienceSymlinks (
707
+ ImmutableSet <ConfiguredTarget > targetsToBuild , BuildConfigurationValue configuration ) {
706
708
try (SilentCloseable c =
707
709
Profiler .instance ().profile ("ExecutionTool.handleConvenienceSymlinks" )) {
708
710
ImmutableList <ConvenienceSymlink > convenienceSymlinks = ImmutableList .of ();
709
711
if (request .getBuildOptions ().experimentalConvenienceSymlinks
710
712
!= ConvenienceSymlinksMode .IGNORE ) {
711
- convenienceSymlinks = createConvenienceSymlinks (request .getBuildOptions (), analysisResult );
713
+ convenienceSymlinks =
714
+ createConvenienceSymlinks (request .getBuildOptions (), targetsToBuild , configuration );
712
715
}
713
716
if (request .getBuildOptions ().experimentalConvenienceSymlinksBepEvent ) {
714
717
env .getEventBus ().post (new ConvenienceSymlinksIdentifiedEvent (convenienceSymlinks ));
@@ -730,22 +733,23 @@ public void handleConvenienceSymlinks(AnalysisResult analysisResult) {
730
733
* in fact gets removed if it was already present from a previous invocation.
731
734
*/
732
735
private ImmutableList <ConvenienceSymlink > createConvenienceSymlinks (
733
- BuildRequestOptions buildRequestOptions , AnalysisResult analysisResult ) {
736
+ BuildRequestOptions buildRequestOptions ,
737
+ ImmutableSet <ConfiguredTarget > targetsToBuild ,
738
+ BuildConfigurationValue configuration ) {
734
739
SkyframeExecutor executor = env .getSkyframeExecutor ();
735
740
Reporter reporter = env .getReporter ();
736
741
737
742
// Gather configurations to consider.
738
743
Set <BuildConfigurationValue > targetConfigurations =
739
- buildRequestOptions .useTopLevelTargetsForSymlinks ()
740
- && !analysisResult .getTargetsToBuild ().isEmpty ()
741
- ? analysisResult .getTargetsToBuild ().stream ()
744
+ buildRequestOptions .useTopLevelTargetsForSymlinks () && !targetsToBuild .isEmpty ()
745
+ ? targetsToBuild .stream ()
742
746
.map (ConfiguredTarget ::getActual )
743
747
.map (ConfiguredTarget ::getConfigurationKey )
744
748
.filter (Objects ::nonNull )
745
749
.distinct ()
746
750
.map ((key ) -> executor .getConfiguration (reporter , key ))
747
751
.collect (toImmutableSet ())
748
- : ImmutableSet .of (analysisResult . getConfiguration () );
752
+ : ImmutableSet .of (configuration );
749
753
750
754
String productName = runtime .getProductName ();
751
755
try (SilentCloseable c =
0 commit comments