@@ -69,11 +69,11 @@ public SkyValue compute(SkyKey skyKey, Environment env)
69
69
PackageIdentifier .create (module .getCanonicalRepoName (), PathFragment .EMPTY_FRAGMENT ),
70
70
module .getRepoMappingWithBazelDepsOnly ());
71
71
for (ModuleExtensionUsage usage : module .getExtensionUsages ()) {
72
+ ModuleExtensionId moduleExtensionId ;
72
73
try {
73
- ModuleExtensionId moduleExtensionId =
74
+ moduleExtensionId =
74
75
ModuleExtensionId .create (
75
76
labelConverter .convert (usage .getExtensionBzlFile ()), usage .getExtensionName ());
76
- extensionUsagesTableBuilder .put (moduleExtensionId , module .getKey (), usage );
77
77
} catch (LabelSyntaxException e ) {
78
78
throw new BazelModuleResolutionFunctionException (
79
79
ExternalDepsException .withCauseAndMessage (
@@ -83,6 +83,16 @@ public SkyValue compute(SkyKey skyKey, Environment env)
83
83
usage .getLocation ()),
84
84
Transience .PERSISTENT );
85
85
}
86
+ if (!moduleExtensionId .getBzlFileLabel ().getRepository ().isVisible ()) {
87
+ throw new BazelModuleResolutionFunctionException (
88
+ ExternalDepsException .withMessage (
89
+ Code .BAD_MODULE ,
90
+ "invalid label for module extension found at %s: no repo visible as '@%s' here" ,
91
+ usage .getLocation (),
92
+ moduleExtensionId .getBzlFileLabel ().getRepository ().getName ()),
93
+ Transience .PERSISTENT );
94
+ }
95
+ extensionUsagesTableBuilder .put (moduleExtensionId , module .getKey (), usage );
86
96
}
87
97
}
88
98
ImmutableTable <ModuleExtensionId , ModuleKey , ModuleExtensionUsage > extensionUsagesById =
0 commit comments