|
70 | 70 | import com.google.devtools.build.lib.buildtool.buildevent.BuildStartingEvent;
|
71 | 71 | import com.google.devtools.build.lib.cmdline.Label;
|
72 | 72 | import com.google.devtools.build.lib.cmdline.LabelSyntaxException;
|
| 73 | +import com.google.devtools.build.lib.cmdline.RepositoryMapping; |
| 74 | +import com.google.devtools.build.lib.cmdline.RepositoryName; |
73 | 75 | import com.google.devtools.build.lib.collect.nestedset.NestedSet;
|
74 | 76 | import com.google.devtools.build.lib.events.Event;
|
75 | 77 | import com.google.devtools.build.lib.events.EventCollector;
|
|
114 | 116 | import com.google.devtools.build.lib.skyframe.ActionExecutionValue;
|
115 | 117 | import com.google.devtools.build.lib.skyframe.BuildResultListener;
|
116 | 118 | import com.google.devtools.build.lib.skyframe.ConfiguredTargetAndData;
|
| 119 | +import com.google.devtools.build.lib.skyframe.RepositoryMappingValue; |
117 | 120 | import com.google.devtools.build.lib.skyframe.SkyframeExecutor;
|
118 | 121 | import com.google.devtools.build.lib.skyframe.SkymeldModule;
|
119 | 122 | import com.google.devtools.build.lib.skyframe.util.SkyframeExecutorTestUtils;
|
@@ -755,7 +758,7 @@ protected ConfiguredTarget getConfiguredTarget(String target)
|
755 | 758 | InterruptedException,
|
756 | 759 | TransitionException,
|
757 | 760 | InvalidConfigurationException {
|
758 |
| - getPackageManager().getTarget(events.reporter(), Label.parseCanonical(target)); |
| 761 | + getPackageManager().getTarget(events.reporter(), label(target)); |
759 | 762 | return getSkyframeExecutor()
|
760 | 763 | .getConfiguredTargetForTesting(events.reporter(), label(target), getTargetConfiguration());
|
761 | 764 | }
|
@@ -847,8 +850,15 @@ public void clean() throws Exception {
|
847 | 850 | }
|
848 | 851 |
|
849 | 852 | /** Utility function: parse a string as a label. */
|
850 |
| - protected static Label label(String labelString) throws LabelSyntaxException { |
851 |
| - return Label.parseCanonical(labelString); |
| 853 | + protected Label label(String labelString) throws LabelSyntaxException, InterruptedException { |
| 854 | + RepositoryMapping mainRepoMapping = |
| 855 | + ((RepositoryMappingValue) |
| 856 | + getSkyframeExecutor() |
| 857 | + .getEvaluator() |
| 858 | + .getExistingValue(RepositoryMappingValue.key(RepositoryName.MAIN))) |
| 859 | + .repositoryMapping(); |
| 860 | + return Label.parseWithRepoContext( |
| 861 | + labelString, Label.RepoContext.of(RepositoryName.MAIN, mainRepoMapping)); |
852 | 862 | }
|
853 | 863 |
|
854 | 864 | protected String run(Artifact executable, String... arguments) throws Exception {
|
|
0 commit comments