-
Notifications
You must be signed in to change notification settings - Fork 150
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
Fix and test constructor wrappers in multiple include_cpps #1099
Conversation
The naming convention that just used the C++ function name directly doesn't work with multiple include_cpps in the same binary. The test case has them in the same rust file, which could be solved other ways, but ultimately we may link the generated C++ code from multiple Rust files which means the names need to be globally unique.
Thanks for this! I'm aware that this is a problem with multiple mods in the same linked binary. I'm not yet sure that this is how I want to solve it. Thoughts:
|
Yea, managing the names in all these different namespaces is tricky...
Good point, I had it in my head that the namespace was included, but looking again it isn't.
Could you include the filename and line number of the
Are there any un-mangled names right now? I might be not using some features, but I've got some fairly complex classes being wrapped and the only functions using this codepath that I see are special member functions which need wrappers anyways. |
Unfortunately, getting such information out of a
Hmm, there should be. For simple functions. But, fair comment, maybe we've added so many cases requiring wrappers that nearly all names get mangled one way or another already. I will do some experiments and report back! |
I gathered some figures || Example || Total names || Of which mangled with autocxx_wrapper || No conclusions yet! I think my next step might be to attempt to put together a PR which does indeed mangle all names, and see how much code we can discard. I did already try this in #785; see also #486 (comment), but I think I should revisit it. |
Looks like my current use cases don't need this any more, so I'll close this. I'm not sure what combination of my code changing vs fixes in autocxx fixed it, but current autocxx builds my code without needing this. |
The naming convention that just used the C++ function name directly
doesn't work with multiple include_cpps in the same binary. The test
case has them in the same rust file, which could be solved other ways,
but ultimately we may link the generated C++ code from multiple Rust
files which means the names need to be globally unique.