Skip to content
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

Fix file counting in merkletree.DirectoryTreeBuilder #14299

Closed
wants to merge 2 commits into from

Conversation

moroten
Copy link
Contributor

@moroten moroten commented Nov 19, 2021

The DirectoryTreeBuilder did not check if files already existed in the resulting map, so the file counter got wrong and an assertion failed.

The error was visible when adding a file and the directory containing that file as inputs for an action.

Fixes #14286.

The DirectoryTreeBuilder did not check if files already existed in the
resulting map, so the file counter got wrong and an assertion failed.

The error was visible when adding a file and the directory containing
that file as inputs for an action.

Fixes bazelbuild#14286.
@moroten moroten requested a review from a team as a code owner November 19, 2021 12:09
@google-cla google-cla bot added the cla: yes label Nov 19, 2021
@moroten
Copy link
Contributor Author

moroten commented Nov 19, 2021

@brentleyjones Are you able to try this patch on your internal test case?

It fixes my minimal case of the empty file mydir/bar.txt and target

genrule(
  name = 'foo',
  srcs = ["mydir", "mydir/bar.txt"],
  outs = ["foo.txt"],
  cmd = "echo \"foo bar\" > $@",
)

@brentleyjones
Copy link
Contributor

@moroten This fixes our internal test case.

@brentleyjones
Copy link
Contributor

cc @coeuvre

@meteorcloudy meteorcloudy requested a review from coeuvre November 22, 2021 16:24
@meteorcloudy
Copy link
Member

ping @coeuvre

Copy link
Member

@coeuvre coeuvre 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 the fix! LGTM.

@bazel-io bazel-io closed this in c05c626 Nov 24, 2021
@moroten moroten deleted the cache-merkle-trees-fix branch November 24, 2021 22:20
meteorcloudy pushed a commit to meteorcloudy/bazel that referenced this pull request Nov 25, 2021
The DirectoryTreeBuilder did not check if files already existed in the resulting map, so the file counter got wrong and an assertion failed.

The error was visible when adding a file and the directory containing that file as inputs for an action.

Fixes bazelbuild#14286.

Closes bazelbuild#14299.

PiperOrigin-RevId: 412051374
coeuvre pushed a commit to coeuvre/bazel that referenced this pull request Nov 25, 2021
The DirectoryTreeBuilder did not check if files already existed in the resulting map, so the file counter got wrong and an assertion failed.

The error was visible when adding a file and the directory containing that file as inputs for an action.

Fixes bazelbuild#14286.

Closes bazelbuild#14299.

PiperOrigin-RevId: 412051374
meteorcloudy pushed a commit that referenced this pull request Nov 25, 2021
The DirectoryTreeBuilder did not check if files already existed in the resulting map, so the file counter got wrong and an assertion failed.

The error was visible when adding a file and the directory containing that file as inputs for an action.

Fixes #14286.

Closes #14299.

PiperOrigin-RevId: 412051374

Co-authored-by: Fredrik Medley <[email protected]>
Bencodes pushed a commit to Bencodes/bazel that referenced this pull request Jan 10, 2022
The DirectoryTreeBuilder did not check if files already existed in the resulting map, so the file counter got wrong and an assertion failed.

The error was visible when adding a file and the directory containing that file as inputs for an action.

Fixes bazelbuild#14286.

Closes bazelbuild#14299.

PiperOrigin-RevId: 412051374
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5.0rc2: java.lang.RuntimeException: Unrecoverable error while evaluating node 'UnshareableActionLookupData
4 participants