-
Notifications
You must be signed in to change notification settings - Fork 153
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
Cease to modify bindgen output. #1456
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1c0f99f
to
d66b768
Compare
This is a major change to the function of autocxx. Previously, it ran bindgen, edited the output, appended cxx instructions, and packaged the results in a hierarchy of mods for the user. With this change, we NO LONGER edit the bindgen output. That's passed onto the user as-is. We simply augment it with cxx wrappers. This has pros and cons. Pros: * It makes the function of autocxx conceptually easier to understand. * We're more likely to be able to accommodate upstream bindgen changes without falling over. Similarly, as bindgen improves, we should automatically pass those improvements onto autocxx users. * With subsequent cleanups, it should reduce the complexity of autocxx. Cons: * We're more sensitive to bugs within bindgen. Four tests have been disabled because of bindgen bugs (which have been reported upstream). * We are unable to hide some of the original bindgen methods attached to types; users should not normally call them. This is a compatibility break in two known respects: * A wider selection of bindgen issues may be passed on, so this might break autocxx for some users. * For C++ functions that were Rust keywords (e.g. "async", "move") previously it was necessary to give their name with a _ in the `generate!()` directive, e.g. `generate!("async_")`. This is no longer the case (which is an improvement but nevertheless a compatibility break). This code needs quite a bit of cleanup. Fixes #1450.
This was no longer necessary or sensible.
d66b768
to
dd29343
Compare
They're useful. And put back doc_attrs.
adetaylor
added a commit
to adetaylor/rust-bindgen
that referenced
this pull request
Feb 26, 2025
Provide an option to add a line to every mod generated by bindgen. Part of google/autocxx#124, though this is only in fact necessary if we make the changes given in google/autocxx#1456.
adetaylor
added a commit
to adetaylor/rust-bindgen
that referenced
this pull request
Feb 26, 2025
This uses an existing callback to allow overriding of constructor name. Part of google/autocxx#124, though only necessary if we also do google/autocxx#1456.
This was referenced Feb 26, 2025
Open
Previously we put these in a sub-mod called 'output' but that turned out to be annoying when looking at things in rustdoc. This puts them back in the top level ffi namespace which we generate.
This helps when following our documentation's advice which is to use cargo doc --document-private-items.
adetaylor
added a commit
that referenced
this pull request
Feb 27, 2025
These tests now appear to be passing, at least on some configurations, since the major changes in #1456.
adetaylor
added a commit
that referenced
this pull request
Feb 27, 2025
These tests now appear to be passing, at least on some configurations, since the major changes in #1456.
This was referenced Feb 27, 2025
Merged
adetaylor
added a commit
that referenced
this pull request
Feb 28, 2025
Since #1456, users of autocxx have become much more sensitive to bugs upstream in bindgen. This PR introduces an emergency option that users can use to work around some of those bugs.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This is a major change to the function of autocxx. Previously, it ran bindgen, edited the output, appended cxx instructions, and packaged the results in a hierarchy of mods for the user.
With this change, we NO LONGER edit the bindgen output. That's passed onto the user as-is. We simply augment it with cxx wrappers.
This has pros and cons. Pros:
Cons:
This is a compatibility break in two known respects:
generate!()
directive, e.g.generate!("async_")
. This is no longer the case (which is an improvement but nevertheless a compatibility break).This code needs quite a bit of cleanup.
Fixes #1450.