Resolve the order of dependencies in the clike language backend. #1050
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
It can reorder dependencies and add forward declarations.
Warns if there is stuff that it cannot resolve.
Includes inner-working traces that can be seen with
cbindgen -vv
(should be left there to facilitate future changes).Includes tests for assumptions that
ResolveOrder
is making.Includes a clippy MSVR change to 1.74 (same as
Cargo.toml
) to fix a warning.Fixes #43
Maybe replaces #1028 ?
Before this I had to add extra stuff in
after_includes
for about 10% of symbols that ended up initems
. All those are handled, leaving only the cases where reordering items and adding forward declarations cannot fix the problem (like constants used in structs appearing after the items are written).I'm sure there are C/C++ cases that are not being handled, but the documentation and tests should facilitate implementing whatever is left.
I reeeally wanted to do some refactoring to facilitate changes and add documentation before attempting this, but the "single person reviewing and approving" bottleneck prevents that solution. I reached a point where it's impossible to continue developing without adding a hack or implementing something like this.
@emilio if there is a proper way for PRs to signal they are "ready to review" after your initial review is done and more changes are applied, please document it somewhere. =~~