@@ -455,9 +455,12 @@ private static BuiltTargets getBuiltTargets(
455
455
configuration = result .getBuildConfiguration ();
456
456
}
457
457
458
- // When virtual paths are enabled, assume runfiles staging is handled elsewhere.
458
+ // When --nobuild_runfile_manifests is enabled, either virtual roots are also enabled (in which
459
+ // case we assume runfiles staging is handled elsewhere) or the output service is responsible
460
+ // for staging runfiles.
459
461
if (!configuration .buildRunfileManifests ()
460
- && env .getDirectories ().getVirtualSourceRoot () == null ) {
462
+ && env .getDirectories ().getVirtualSourceRoot () == null
463
+ && !env .getOutputService ().stagesTopLevelRunfiles ()) {
461
464
throw new RunCommandException (
462
465
reportAndCreateFailureResult (
463
466
env ,
@@ -945,8 +948,10 @@ private static Path ensureRunfilesBuilt(
945
948
workingDir = workingDir .getRelative (runfilesSupport .getRunfiles ().getPrefix ());
946
949
}
947
950
948
- // When virtual paths are enabled, assume runfiles staging is handled elsewhere.
949
- if (env .getDirectories ().getVirtualSourceRoot () != null ) {
951
+ // Return early if runfiles staging is handled elsewhere (i.e. either if virtual roots are
952
+ // enabled or if it's managed by the output service).
953
+ if (env .getDirectories ().getVirtualSourceRoot () != null
954
+ || env .getOutputService ().stagesTopLevelRunfiles ()) {
950
955
return workingDir .devirtualize ();
951
956
}
952
957
0 commit comments