@@ -1041,7 +1041,7 @@ public void generatedReposHaveCorrectMappings_strictDepsViolation() throws Excep
10411041 assertThat (result .hasError ()).isTrue ();
10421042 assertThat (result .getError ().getException ())
10431043 .hasMessageThat ()
1044- .contains ("No repository visible as '@foo' from repository '@~ext~ext'" );
1044+ .contains ("No repository visible as '@foo' from repository '@_main ~ext~ext'" );
10451045 }
10461046
10471047 @ Test
@@ -1082,7 +1082,7 @@ public void importNonExistentRepo() throws Exception {
10821082 scratch .file (workspaceRoot .getRelative ("BUILD" ).getPathString ());
10831083 scratch .file (
10841084 workspaceRoot .getRelative ("data.bzl" ).getPathString (),
1085- "load('@@~ext~ext//:data.bzl', ext_data='data')" ,
1085+ "load('@@_main ~ext~ext//:data.bzl', ext_data='data')" ,
10861086 "data=ext_data" );
10871087
10881088 SkyKey skyKey = BzlLoadValue .keyForBuild (Label .parseCanonical ("//:data.bzl" ));
@@ -1216,7 +1216,7 @@ public void extensionRepoCtxReadsFromAnotherExtensionRepo() throws Exception {
12161216 workspaceRoot .getRelative ("defs.bzl" ).getPathString (),
12171217 "load('@data_repo//:defs.bzl','data_repo')" ,
12181218 "def _ext_impl(ctx):" ,
1219- " data_file = ctx.read(Label('@@~my_ext2~candy2//:data.bzl'))" ,
1219+ " data_file = ctx.read(Label('@@_main ~my_ext2~candy2//:data.bzl'))" ,
12201220 " data_repo(name='candy1',data=data_file)" ,
12211221 "my_ext=module_extension(implementation=_ext_impl)" ,
12221222 "def _ext_impl2(ctx):" ,
@@ -1264,7 +1264,8 @@ public void testReportRepoAndBzlCycles_circularExtReposCtxRead() throws Exceptio
12641264 SkyKey skyKey =
12651265 PackageValue .key (
12661266 PackageIdentifier .create (
1267- RepositoryName .createUnvalidated ("~my_ext~candy1" ), PathFragment .EMPTY_FRAGMENT ));
1267+ RepositoryName .createUnvalidated ("_main~my_ext~candy1" ),
1268+ PathFragment .EMPTY_FRAGMENT ));
12681269 EvaluationResult <PackageValue > result =
12691270 evaluator .evaluate (ImmutableList .of (skyKey ), evaluationContext );
12701271 assertThat (result .hasError ()).isTrue ();
@@ -1275,11 +1276,11 @@ public void testReportRepoAndBzlCycles_circularExtReposCtxRead() throws Exceptio
12751276 assertContainsEvent (
12761277 "ERROR <no location>: Circular definition of repositories generated by module extensions"
12771278 + " and/or .bzl files:\n "
1278- + ".-> @~my_ext~candy1\n "
1279+ + ".-> @_main ~my_ext~candy1\n "
12791280 + "| extension 'my_ext' defined in //:defs.bzl\n "
1280- + "| @~my_ext2~candy2\n "
1281+ + "| @_main ~my_ext2~candy2\n "
12811282 + "| extension 'my_ext2' defined in //:defs.bzl\n "
1282- + "`-- @~my_ext~candy1" );
1283+ + "`-- @_main ~my_ext~candy1" );
12831284 }
12841285
12851286 @ Test
@@ -1310,7 +1311,7 @@ public void testReportRepoAndBzlCycles_circularExtReposLoadInDefFile() throws Ex
13101311 SkyKey skyKey =
13111312 PackageValue .key (
13121313 PackageIdentifier .create (
1313- RepositoryName .createUnvalidated ("~my_ext~candy1" ),
1314+ RepositoryName .createUnvalidated ("_main ~my_ext~candy1" ),
13141315 PathFragment .create ("data.bzl" )));
13151316 EvaluationResult <PackageValue > result =
13161317 evaluator .evaluate (ImmutableList .of (skyKey ), evaluationContext );
@@ -1322,13 +1323,13 @@ public void testReportRepoAndBzlCycles_circularExtReposLoadInDefFile() throws Ex
13221323 assertContainsEvent (
13231324 "ERROR <no location>: Circular definition of repositories generated by module extensions"
13241325 + " and/or .bzl files:\n "
1325- + ".-> @~my_ext~candy1\n "
1326+ + ".-> @_main ~my_ext~candy1\n "
13261327 + "| extension 'my_ext' defined in //:defs.bzl\n "
1327- + "| @~my_ext2~candy2\n "
1328+ + "| @_main ~my_ext2~candy2\n "
13281329 + "| extension 'my_ext2' defined in //:defs2.bzl\n "
13291330 + "| //:defs2.bzl\n "
1330- + "| @~my_ext~candy1//:data.bzl\n "
1331- + "`-- @~my_ext~candy1" );
1331+ + "| @_main ~my_ext~candy1//:data.bzl\n "
1332+ + "`-- @_main ~my_ext~candy1" );
13321333 }
13331334
13341335 @ Test
@@ -1350,7 +1351,7 @@ public void testReportRepoAndBzlCycles_extRepoLoadSelfCycle() throws Exception {
13501351 SkyKey skyKey =
13511352 PackageValue .key (
13521353 PackageIdentifier .create (
1353- RepositoryName .createUnvalidated ("~my_ext~candy1" ),
1354+ RepositoryName .createUnvalidated ("_main ~my_ext~candy1" ),
13541355 PathFragment .create ("data.bzl" )));
13551356 EvaluationResult <PackageValue > result =
13561357 evaluator .evaluate (ImmutableList .of (skyKey ), evaluationContext );
@@ -1362,10 +1363,10 @@ public void testReportRepoAndBzlCycles_extRepoLoadSelfCycle() throws Exception {
13621363 assertContainsEvent (
13631364 "ERROR <no location>: Circular definition of repositories generated by module extensions"
13641365 + " and/or .bzl files:\n "
1365- + ".-> @~my_ext~candy1\n "
1366+ + ".-> @_main ~my_ext~candy1\n "
13661367 + "| extension 'my_ext' defined in //:defs.bzl\n "
13671368 + "| //:defs.bzl\n "
1368- + "| @~my_ext~candy1//:data.bzl\n "
1369- + "`-- @~my_ext~candy1" );
1369+ + "| @_main ~my_ext~candy1//:data.bzl\n "
1370+ + "`-- @_main ~my_ext~candy1" );
13701371 }
13711372}
0 commit comments