-
Notifications
You must be signed in to change notification settings - Fork 86
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
cli/printlog: improve compact exec log #6350
Conversation
cli/printlog/compact/compact.go
Outdated
} | ||
spawnInputs = append(spawnInputs, file) | ||
} | ||
if slr.sort { |
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.
The old exec format didn't sort the individual fields of the spawn proto as those are already deterministically ordered (based on depset
order). Instead, to make the log more comparable overall, we would need to sort the protos with respect to each other.
Bazel topologically sorts by consumer-producer relationship and then by output path, see https://github.com/bazelbuild/bazel/blob/5d4feefed7e39b20a6c5deb5f74394abbf622a52/src/main/java/com/google/devtools/build/lib/exec/StableSort.java#L55. I think that this is what we should do if -sort
is specified.
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.
Im a bit afraid of implementing this.
Currently, we are converting from the new compact format to the old format, which is big and could take a long time to sort.
But perhaps it's fine because we are not processing the log inside the invocation. 🤔
Let me give it a try.
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 don't think it's possible to sort the new compact format directly as consumer/producer relationships can only be discovered after you have "flattened" the input/output file sets. If you want, we could take a look at this together at some point and see whether we can do better.
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 have removed the --sort for now.
This PR is now a lot smaller to fix obvious bugs and add some minor doc improvements.
PTAL.
73ac678
to
360bf29
Compare
Fixed an issue in `reconstructDir()` where the filesInDir slice was initiated with nil entries. Rename the compact log file to have the right extension.
360bf29
to
bbc85ca
Compare
Fixed an issue in
reconstructDir()
where the filesInDir slice wasinitiated with nil entries.
Rename the compact log file to have the right extension.