-
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
Output directories are sometimes out of order when using remote execution #5109
Comments
…red directory structures. When building a parent node from action inputs, the paths to the files are sorted. These paths are then broken down into segments and a tree structure is created from the segments. Problem is, the segments at each level of the tree structure are not sorted before they are added to the parent node. This can result in an unordered directory tree. For example, the sort order of this list of files /foo/bar-client/bar-client_ijar.jar /foo/bar/bar_ijar.jar is maintained when it becomes a tree structure foo -> bar-client -> bar-client_ijar.jar bar bar_ijar.jar which is out of order. Resolves: bazelbuild#5109
Here is a PR that fixes this issue: #5110 |
Thanks for the PR! I assigned you since you sent a fix. |
…red directory structures. When building a parent node from action inputs, the paths to the files are sorted. These paths are then broken down into segments and a tree structure is created from the segments. Problem is, the segments at each level of the tree structure are not sorted before they are added to the parent node. This can result in an unordered directory tree. For example, the sort order of this list of files ``` /foo/bar-client/bar-client_ijar.jar /foo/bar/bar_ijar.jar ``` is maintained when it becomes a tree structure ``` foo -> bar-client -> bar-client_ijar.jar bar bar_ijar.jar ``` which is out of order. Resolves: #5109 Closes #5110. PiperOrigin-RevId: 195649710
Is this fixed? I still see the issue on Bazel 0.13.0 with bazel buildfarm rev |
The fix for this was merged a few hours ago. It hasn't been released as far as I know. If you're running off of HEAD, then it should be fixed. |
Sorry, I was confused about the reference to the 0.13.0 release above.. :) |
…red directory structures. When building a parent node from action inputs, the paths to the files are sorted. These paths are then broken down into segments and a tree structure is created from the segments. Problem is, the segments at each level of the tree structure are not sorted before they are added to the parent node. This can result in an unordered directory tree. For example, the sort order of this list of files /foo/bar-client/bar-client_ijar.jar /foo/bar/bar_ijar.jar is maintained when it becomes a tree structure foo -> bar-client -> bar-client_ijar.jar bar bar_ijar.jar which is out of order. Resolves: bazelbuild#5109
Seems released in https://github.com/bazelbuild/bazel/releases/tag/0.13.1 right? "Important changes: Remote Execution: Fixes a regression that produces directories with unsorted file/directory lists" |
@driveraid yes! |
Description of the problem:
When using remote execution (buildfarm) output directories are sometimes out of order. The spec requires them to be lexicographically sorted.
I have a PR that fixes this issue and will link it after creating this issue.
When using remote executing, a parent node is built from action inputs in
TreeNodeRepository
. The files are sorted by path inRemoteSpawnRunner
. These paths are then broken down into segments and a tree structure is created from the segments.Problem is, the segments at each level of the tree structure are not sorted before they are added to the parent node. This can result in an unordered directory tree.
For example, the sort order of this list of files
is maintained when it becomes a tree structure
which is out of order.
Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Create a Bazel project with two packages
that produce outputs named in a similar fashion. For example, two Java targets that create:
Then build those targets using buildfarm or another remote executor. You will receive an error like the following:
What operating system are you running Bazel on?
Ubuntu 16.04 x86_64
What's the output of
bazel info release
?What's the output of
git remote get-url origin ; git rev-parse master ; git rev-parse HEAD
?The text was updated successfully, but these errors were encountered: