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

Sort dependency manifest #10414

Merged

Conversation

TrentHouliston
Copy link
Contributor

Currently the ordering of the files in the dependency manifest file are undefined as the directories are stored in an unordered list.

This has resulted in a bug specifically for me with the combination of CMake/ninja/depfiles as if the first file listed as an output by CMake is not the first file in the list for the dependency manifest file, ninja complains about a missing "primary output" and treats the entire list of dependencies as dirty and rebuilds them.

The outputs for protoc don't really have a "primary" output as outputs of python/cpp etc would all be equal.

This PR sorts the dependency output files before writing them to resolve this.
At least this way so long as both of the CMake list and depfile are sorted it will work as expected.

@mkruskal-google mkruskal-google merged commit 735221f into protocolbuffers:main Aug 17, 2022
@TrentHouliston TrentHouliston deleted the sort_dependency_manifest branch August 17, 2022 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants