-
Notifications
You must be signed in to change notification settings - Fork 120
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
Add a note about ordering of Tree protos #223
Conversation
LGTM. I considered whether the API should take a stronger stance on what the ordering should be, but
With all that in mind, what you have here seems like the right balance for the present API. |
Pieces of code that create Tree objects need to hash individual Directory objects anyway, so they can be referenced by their parent(s). It's trivial for an implementation to also use these hashes for sorting/deduplication purposes. This is exactly what Buildbarn does, by the way. Child directories are sorted in increasing order by hash, and identical subtrees are merged together. |
Yep, agreed, that was the first thing that sprung to my mind too :) Although I could also imagine an implementation that always generates them in a deterministic order and so felt that sorting it was unnecessary. Anyway, I agree with Eric that it's not really necessary for REAPI to specify how the ordering should be done here; the ordering only matters in terms of determinism of outputs, and as long as an implementation does it the same way each time that should be sufficient (I'm sure nobody has a need for determinism between different implementations...). |
This commit updates .pb.go using hooks/pre-commit as it was forgotten in the following commits: 2af1c43 Use fully-qualified import paths in `go_package` options. (bazelbuild#219) 5971c1e Add a note about ordering of Tree protos (bazelbuild#223)
This commit updates .pb.go using hooks/pre-commit as it was forgotten in the following commits: 2af1c43 Use fully-qualified import paths in `go_package` options. (bazelbuild#219) 5971c1e Add a note about ordering of Tree protos (bazelbuild#223)
We recently discovered some nondeterminism in outputs because the Tree children were coming out in different orders. It looks like that specific case got fixed by bazelbuild/remote-apis-sdks#411, but it seems worth noting for any future implementations.