Skip to content

Conversation

@fmeum
Copy link
Collaborator

@fmeum fmeum commented May 12, 2023

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 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

@fmeum fmeum force-pushed the runfiles-fingerprint branch 2 times, most recently from dfcf2eb to 6103e8a Compare May 13, 2023 09:29
@fmeum fmeum changed the title Runfiles fingerprint Fix and optimize Runfiles#fingerprint May 13, 2023
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.
@fmeum fmeum force-pushed the runfiles-fingerprint branch from 6103e8a to 78a896e Compare May 13, 2023 09:34
@fmeum fmeum requested review from haxorz and lberki May 13, 2023 09:34
@fmeum fmeum marked this pull request as ready for review May 13, 2023 09:36
@fmeum fmeum requested review from a team, comius and rickeylev as code owners May 13, 2023 09:36
@fmeum fmeum requested review from sdtwigg and removed request for a team, comius, rickeylev and sdtwigg May 13, 2023 09:36
@github-actions github-actions bot added awaiting-review PR is awaiting review from an assigned reviewer team-Configurability platforms, toolchains, cquery, select(), config transitions team-Performance Issues for Performance teams team-Rules-Python Native rules for Python labels May 13, 2023
Copy link
Contributor

@lberki lberki left a 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.

*/
public static class GetInitPyFiles implements Runfiles.EmptyFilesSupplier {
private final Predicate<PathFragment> isPackageInit;
private final UUID guid;
Copy link
Contributor

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.

Copy link
Collaborator Author

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?

Copy link
Contributor

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.

Copy link
Contributor

@haxorz haxorz left a 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?

@fmeum fmeum requested review from haxorz and lberki May 16, 2023 10:08
Copy link
Contributor

@lberki lberki left a 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.

@lberki lberki added awaiting-PR-merge PR has been approved by a reviewer and is ready to be merge internally and removed awaiting-review PR is awaiting review from an assigned reviewer labels May 16, 2023
@sgowroji sgowroji removed the awaiting-PR-merge PR has been approved by a reviewer and is ready to be merge internally label May 24, 2023
@fmeum fmeum deleted the runfiles-fingerprint branch May 24, 2023 09:55
fweikert pushed a commit to fweikert/bazel that referenced this pull request May 25, 2023
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
iancha1992 pushed a commit to iancha1992/bazel that referenced this pull request Jun 16, 2023
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
iancha1992 pushed a commit to iancha1992/bazel that referenced this pull request Jun 16, 2023
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
iancha1992 pushed a commit to iancha1992/bazel that referenced this pull request Jun 22, 2023
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
iancha1992 pushed a commit to iancha1992/bazel that referenced this pull request Jun 22, 2023
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
@iancha1992
Copy link
Member

@bazel-io fork 6.3.0

@iancha1992
Copy link
Member

iancha1992 commented Jun 23, 2023

@lberki @fmeum
We're currently trying to cherry-pick this to release-6.3.0. However, looks like the change for "src/main/java/com/google/devtools/build/lib/exec/BUILD" is missing in the master branch (See https://github.com/bazelbuild/bazel/pull/18384/files#diff-53d9849f4a8d299e6b809d62ff433b94e34acc1292e38306bbf0cc97f029b808) I'd expect it to be there since this was merged to the master branch. Please advise on how to proceed to cherry-pick this. Thanks.

@keertk
Copy link
Member

keertk commented Jul 10, 2023

@fmeum could you submit a PR to cherry-pick this into 6.3 please? (if needed as part of #18678)

@fmeum
Copy link
Collaborator Author

fmeum commented Jul 11, 2023

@keertk Since the other cherry-picks have been reverted/dropped, I don't think it makes sense to include this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

team-Configurability platforms, toolchains, cquery, select(), config transitions team-Performance Issues for Performance teams team-Rules-Python Native rules for Python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants