-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Fix and optimize Runfiles#fingerprint
#18384
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
Conversation
dfcf2eb to
6103e8a
Compare
The fingerprint did not include the conflict policy and some of the collection's sizes. It also didn't use the cache for fingerprints of `NestedSet`s and instead always flattened the sets. The new `fingerprint` method on `EmptyFilesSupplier` makes it possible to drop the call to `Runfiles#getEmptyFilenames`, which would still end up flattening the sets.
6103e8a to
78a896e
Compare
lberki
left a comment
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.
Thanks! The only real issue I have is with InterruptedException handling; it's easy to get that wrong.
src/main/java/com/google/devtools/build/lib/analysis/Runfiles.java
Outdated
Show resolved
Hide resolved
src/main/java/com/google/devtools/build/lib/collect/nestedset/NestedSetFingerprintCache.java
Outdated
Show resolved
Hide resolved
| */ | ||
| public static class GetInitPyFiles implements Runfiles.EmptyFilesSupplier { | ||
| private final Predicate<PathFragment> isPackageInit; | ||
| private final UUID guid; |
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.
nit: mind adding a comment as to why the UUID is necessary here? It's a little surprising if one doesn't intimately know how Runfiles works.
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 added a comment to the constructor argument. Should I also add it to the field?
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.
Meh, I won't make you jump through that particular hoop; it's not that big a deal.
src/main/java/com/google/devtools/build/lib/actions/ActionKeyContext.java
Outdated
Show resolved
Hide resolved
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.
Can you please include a link to your bazel-discuss@ thread in the commit message?
lberki
left a comment
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.
Thanks for this change! Let's merge it.
The fingerprint did not include the conflict policy and some of the collections' sizes. It also didn't use the cache for fingerprints of `NestedSet`s and instead always flattened the sets. The new `fingerprint` method on `EmptyFilesSupplier` makes it possible to drop the call to `Runfiles#getEmptyFilenames`, which would still end up flattening the sets. See https://groups.google.com/g/bazel-discuss/c/KrUg6ZPky80 Closes bazelbuild#18384. PiperOrigin-RevId: 534724771 Change-Id: I7b39a1fa2c7c5904b186cc2d343b2b6432b05ad4
The fingerprint did not include the conflict policy and some of the collections' sizes. It also didn't use the cache for fingerprints of `NestedSet`s and instead always flattened the sets. The new `fingerprint` method on `EmptyFilesSupplier` makes it possible to drop the call to `Runfiles#getEmptyFilenames`, which would still end up flattening the sets. See https://groups.google.com/g/bazel-discuss/c/KrUg6ZPky80 Closes bazelbuild#18384. PiperOrigin-RevId: 534724771 Change-Id: I7b39a1fa2c7c5904b186cc2d343b2b6432b05ad4
The fingerprint did not include the conflict policy and some of the collections' sizes. It also didn't use the cache for fingerprints of `NestedSet`s and instead always flattened the sets. The new `fingerprint` method on `EmptyFilesSupplier` makes it possible to drop the call to `Runfiles#getEmptyFilenames`, which would still end up flattening the sets. See https://groups.google.com/g/bazel-discuss/c/KrUg6ZPky80 Closes bazelbuild#18384. PiperOrigin-RevId: 534724771 Change-Id: I7b39a1fa2c7c5904b186cc2d343b2b6432b05ad4
The fingerprint did not include the conflict policy and some of the collections' sizes. It also didn't use the cache for fingerprints of `NestedSet`s and instead always flattened the sets. The new `fingerprint` method on `EmptyFilesSupplier` makes it possible to drop the call to `Runfiles#getEmptyFilenames`, which would still end up flattening the sets. See https://groups.google.com/g/bazel-discuss/c/KrUg6ZPky80 Closes bazelbuild#18384. PiperOrigin-RevId: 534724771 Change-Id: I7b39a1fa2c7c5904b186cc2d343b2b6432b05ad4
The fingerprint did not include the conflict policy and some of the collections' sizes. It also didn't use the cache for fingerprints of `NestedSet`s and instead always flattened the sets. The new `fingerprint` method on `EmptyFilesSupplier` makes it possible to drop the call to `Runfiles#getEmptyFilenames`, which would still end up flattening the sets. See https://groups.google.com/g/bazel-discuss/c/KrUg6ZPky80 Closes bazelbuild#18384. PiperOrigin-RevId: 534724771 Change-Id: I7b39a1fa2c7c5904b186cc2d343b2b6432b05ad4
|
@bazel-io fork 6.3.0 |
|
@lberki @fmeum |
|
@keertk Since the other cherry-picks have been reverted/dropped, I don't think it makes sense to include this one. |
The fingerprint did not include the conflict policy and some of the collections' sizes. It also didn't use the cache for fingerprints of
NestedSets and instead always flattened the sets.The new
fingerprintmethod onEmptyFilesSuppliermakes it possible to drop the call toRunfiles#getEmptyFilenames, which would still end up flattening the sets.See https://groups.google.com/g/bazel-discuss/c/KrUg6ZPky80