Skip to content

Commit

Permalink
Remove erroneous check about a repo mapping entry with an empty appar…
Browse files Browse the repository at this point in the history
…ent name

It turns out that not only the main repo can have such an entry; any repo generated by a module extension hosted in the main repo can (and will) also have such an entry, because they can see all repos that the main repo can see, which includes the main repo itself.

PiperOrigin-RevId: 483938753
Change-Id: I6192496f2edf08c9b1723c5b041c0ac44f928b3e
  • Loading branch information
Wyverald committed Oct 26, 2022
1 parent cc5de1b commit 31faec1
Showing 1 changed file with 0 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import static java.util.Comparator.comparing;

import com.google.auto.value.AutoValue;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;
import com.google.devtools.build.lib.actions.ActionExecutionContext;
import com.google.devtools.build.lib.actions.ActionKeyContext;
Expand Down Expand Up @@ -106,9 +105,6 @@ public DeterministicWriter newDeterministicWriter(ActionExecutionContext ctx)
if (entry.targetRepoApparentName().isEmpty()) {
// The apparent repo name can only be empty for the main repo. We skip this line as
// Rlocation paths can't reference an empty apparent name anyway.
Preconditions.checkArgument(
entry.sourceRepo().isMain(),
"only the main repo mapping can contain an entry with an empty apparent name");
continue;
}
// The canonical name of the main repo is the empty string, which is not a valid name for a
Expand Down

0 comments on commit 31faec1

Please sign in to comment.