-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Add support for overlays in source.json #22349
Closed
Closed
Changes from 4 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
7fa7d37
Add support for remote_files to bzlmod
fzakaria 3288fc8
Addressed feedback fmeum@
fzakaria 858b911
add static import for collectors
fzakaria ece6861
Fix mod_command_test.py
fzakaria 25a4869
Stylistic changes and GSON update
fmeum 8a4930f
Merge pull request #1 from fmeum/review
fzakaria 4946611
Merge branch 'master' into bcr-overlay
fzakaria 2afc01a
Update lock file
fzakaria fa81a39
Merge branch 'master' into bcr-overlay
fzakaria e7f58e3
Changed overlay setup
fzakaria a1e6791
Refactor creation of mirror urls into helper method
fzakaria 1a2d3ca
Remove mirror from overlay
fzakaria 3e27cce
Feedback from Wyverald addressed
fzakaria File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
12 changes: 12 additions & 0 deletions
12
src/main/java/com/google/devtools/build/lib/bazel/bzlmod/RemoteFile.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.google.devtools.build.lib.bazel.bzlmod; | ||
import java.net.URL; | ||
import java.util.List; | ||
|
||
/** | ||
* For use with IndexRegistry and associated files. A simple pojo to track remote files that are | ||
* offered at multiple urls (mirrors) with a single integrity. | ||
* We split up the file here to simplify the dependency. | ||
*/ | ||
record RemoteFile(String integrity, List<URL> urls) { | ||
} | ||
|
This file contains 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
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Wyverald One thing I'm wondering about right now: There is no such thing for remote patches, but should we use the mirrors in
bazel_registry.json
to populate these URLs?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could see from the test is that mirrors is only used for the main URL of the module.
I also had the same thought that it was a bit confusing --
Since this is a distinct URL it actually doesn't even need to reside within BCR server so it probably needs it's own URLS.
in the simple/common case, it could be a relative file path and just use a single URL.
Maybe a follow up: if the URL is a
file://
use the bazel_registry.json mirrors?I say let's finish the complete end-to-end with BCR first and then do a UX fixup once we test it out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
taking a more serious look now -- shouldn't the overlay files be served from the registry itself? Just like how today patch files are served from the registry, instead of some random other URL. The only thing we're fetching from arbitrary URLs is the source archive itself.
I'm thinking that the
overlay
property can just be a JSON object (i.e. a dict) that maps from overlay file path to integrity (just like howpatches
is a map from patch file name to integrity). The overlay files will reside in theoverlay
directory next to thepatches
directory. So if you have the source.json:then your module version directory tree in the registry should look like:
WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I see this and construct the URL similar to how it's done for patches?