Skip to content

Commit

Permalink
Mark use_repo_rule extension as reproducible
Browse files Browse the repository at this point in the history
Also fix two typos.
  • Loading branch information
fmeum committed Feb 12, 2024
1 parent fb25158 commit a517b46
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public void afterCommand() throws AbruptExitException {
// Add the new resolved extensions
for (var event : extensionResolutionEventsMap.values()) {
LockFileModuleExtension extension = event.getModuleExtension();
if (!extension.shouldLockExtesnsion()) {
if (!extension.shouldLockExtension()) {
continue;
}

Expand Down Expand Up @@ -169,7 +169,7 @@ private boolean shouldKeepExtension(
// If there is a new event for this extension, compare it with the existing ones
ModuleExtensionResolutionEvent extEvent = extensionResolutionEventsMap.get(extensionId);
if (extEvent != null) {
boolean doNotLockExtension = !extEvent.getModuleExtension().shouldLockExtesnsion();
boolean doNotLockExtension = !extEvent.getModuleExtension().shouldLockExtension();
boolean dependencyOnOsChanged =
lockedExtensionKey.getOs().isEmpty() != extEvent.getExtensionFactors().getOs().isEmpty();
boolean dependencyOnArchChanged =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public static Builder builder() {

public abstract Builder toBuilder();

public boolean shouldLockExtesnsion() {
public boolean shouldLockExtension() {
return getModuleExtensionMetadata().isEmpty()
|| !getModuleExtensionMetadata().get().getReproducible();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@
@AutoValue
@GenerateTypeAdapter
public abstract class ModuleExtensionMetadata implements StarlarkValue {

static final ModuleExtensionMetadata REPRODUCIBLE =
create(
/* explicitRootModuleDirectDeps= */ null,
/* explicitRootModuleDirectDevDeps= */ null,
UseAllRepos.NO,
/* reproducible= */ true);

@Nullable
abstract ImmutableSet<String> getExplicitRootModuleDirectDeps();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ public RunModuleExtensionResult run(
ModuleExtensionId extensionId)
throws InterruptedException, SingleExtensionEvalFunctionException {
var generatedRepoSpecs = ImmutableMap.<String, RepoSpec>builderWithExpectedSize(repos.size());
// Instiantiate the repos one by one.
// Instantiate the repos one by one.
for (InnateExtensionRepo repo : repos) {
Object exported = repo.loadedBzl().getModule().getGlobal(repo.ruleName());
if (exported == null) {
Expand Down Expand Up @@ -790,7 +790,7 @@ public RunModuleExtensionResult run(
return RunModuleExtensionResult.create(
ImmutableMap.of(),
generatedRepoSpecs.buildOrThrow(),
Optional.empty(),
Optional.of(ModuleExtensionMetadata.REPRODUCIBLE),
ImmutableTable.of());
}
}
Expand Down

0 comments on commit a517b46

Please sign in to comment.