Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
fmeum committed Dec 5, 2022
1 parent 263aec4 commit 79648ee
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/main/java/com/google/devtools/build/skydoc/SkydocMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import com.google.devtools.build.lib.cmdline.Label;
import com.google.devtools.build.lib.cmdline.Label.PackageContext;
import com.google.devtools.build.lib.cmdline.LabelSyntaxException;
import com.google.devtools.build.lib.cmdline.RepositoryMapping;
import com.google.devtools.build.lib.cmdline.RepositoryName;
import com.google.devtools.build.lib.collect.nestedset.Depset;
import com.google.devtools.build.lib.collect.nestedset.NestedSetBuilder;
import com.google.devtools.build.lib.collect.nestedset.Order;
Expand Down Expand Up @@ -282,7 +285,10 @@ public Module eval(

List<AspectInfoWrapper> aspectInfoList = new ArrayList<>();

Module module = recursiveEval(semantics, label, label.getRepository().getName(), ruleInfoList,
// Resolve the label provided on the command line with the main repository's repository mapping.
// The stardoc rules always pass in a canonical label, so in this case the repository mapping
// is not used.
Module module = recursiveEval(semantics, label, RepositoryName.MAIN.getName(), ruleInfoList,
providerInfoList, aspectInfoList);

Map<StarlarkCallable, RuleInfoWrapper> ruleFunctions =
Expand Down Expand Up @@ -433,7 +439,8 @@ private Module recursiveEval(
// process loads
Map<String, Module> imports = new HashMap<>();
for (String load : prog.getLoads()) {
Label apparentLabel = label.getRelativeWithRemapping(load, ImmutableMap.of());
Label apparentLabel = Label.parseWithPackageContext(load,
PackageContext.of(label.getPackageIdentifier(), RepositoryMapping.ALWAYS_FALLBACK));
try {
Module loadedModule =
recursiveEval(semantics, apparentLabel, sourceRepository, ruleInfoList,
Expand Down

0 comments on commit 79648ee

Please sign in to comment.