-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Stop using Rule+Package for repos
#26493
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fmeum
reviewed
Jul 8, 2025
src/main/java/com/google/devtools/build/lib/bazel/bzlmod/modcommand/ModExecutor.java
Show resolved
Hide resolved
src/main/java/com/google/devtools/build/lib/bazel/repository/AttributeUtils.java
Outdated
Show resolved
Hide resolved
src/main/java/com/google/devtools/build/lib/bazel/repository/DigestWriter.java
Show resolved
Hide resolved
src/main/java/com/google/devtools/build/lib/bazel/repository/RepoDefinition.java
Outdated
Show resolved
Hide resolved
src/main/java/com/google/devtools/build/lib/bazel/repository/RepoDefinitionValue.java
Show resolved
Hide resolved
src/main/java/com/google/devtools/build/lib/bazel/repository/RepositoryFetchFunction.java
Show resolved
Hide resolved
src/main/java/com/google/devtools/build/lib/bazel/repository/RepositoryResolvedEvent.java
Show resolved
Hide resolved
src/main/java/com/google/devtools/build/lib/skyframe/serialization/autocodec/Initializers.java
Outdated
Show resolved
Hide resolved
Apologies for the size of this CL, but I couldn't really see a way to do this in incremental steps while actually exercising the new logic. - When in the context of repos, `Rule` is replaced with `RepoDefinition` and `RuleClass` is replaced with `RepoRule`. - In a follow-up, we can remove all repo-related logic from `Rule` and `Package`. - `BzlmodRepoRuleFunction`/`Value` are moved into the `lib/bazel/repository` package and renamed to `RepoDefinitionFunction`/`Value`. - The logic to type-check attribute values is now shared between `TypeCheckedTag` and `RepoRule`, and extracted into an `AttributeUtils` class. - The label-validation logic that used to live in `AttributeValues` is also moved into `AttributeUtils`. - `AttributeValues` now explicitly requires all attribute values to be valid Starlark values, instead of performing another transformation on construction. IMO this improves clarity. - `bazel mod show_repo` now uses its own "repo definition printer", which also does away with a lot of useless information (like the call stack of repo rules -- the location suffices). Work towards #26131. Closes #26493. PiperOrigin-RevId: 778681107 Change-Id: I7b66720e8bbe5a756bc216fd07fd1b7e6c21ab3c
fmeum
approved these changes
Jul 9, 2025
This was referenced Oct 12, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
team-ExternalDeps
External dependency handling, remote repositiories, WORKSPACE file.
team-Performance
Issues for Performance teams
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Apologies for the size of this PR, but I couldn't really see a way to do this in incremental steps while actually exercising the new logic.
Ruleis replaced withRepoDefinitionandRuleClassis replaced withRepoRule.RuleandPackage.BzlmodRepoRuleFunction/Valueare moved into thelib/bazel/repositorypackage and renamed toRepoDefinitionFunction/Value.TypeCheckedTagandRepoRule, and extracted into anAttributeUtilsclass.AttributeValuesis also moved intoAttributeUtils.AttributeValuesnow explicitly requires all attribute values to be valid Starlark values, instead of performing another transformation on construction. IMO this improves clarity.bazel mod show_reponow uses its own "repo definition printer", which also does away with a lot of useless information (like the call stack of repo rules -- the location suffices).Work towards #26131.