Use `ConfiguredTarget#getOriginalLabel` instead of `ConfiguredTarget#getLabel` when assigning a `runUnderTarget` in `RunCommand#getBuiltTargets`.
This fixes a bug when `--run_under` is set to an aliased target and blaze incorrectly fails the build complaning that more than one target was specified to run.
@@ -333,7 +333,7 @@ public class RunCommand implements BlazeCommand {
if (!targetValidationResult.isSuccess()) {
throw new RunCommandException(targetValidationResult);
}
- if (runUnder != null && target.getLabel().equals(runUnder.getLabel())) {
+ if (runUnder != null && target.getOriginalLabel().equals(runUnder.getLabel())) {
if (runUnderTarget != null) {
throw new RunCommandException(
reportAndCreateFailureResult(
