-
Notifications
You must be signed in to change notification settings - Fork 154
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
We do not uniqueify cxx::bridge names except for functions #486
Comments
Minimized test case: namespace a {
namespace spanner {
class Key;
}
} // namespace a
namespace spanner {
class Key {
public:
bool b(a::spanner::Key &);
};
} // namespace spanner |
This problem is understood. It's because, for functions, we're using a |
Syn(Error("the name
Key is defined multiple times"))
I'm now thinking that we should "simply" mangle all names in the It would be ideal if we could come up with a name mangling scheme which, for simple names, happens to match user expectations. This would significantly help with debugging when people were looking through complex call stacks across languages. e.g.
but then we would need something different for a type literally called So the alternative is indeed to have a |
Previously we generated slightly simpler output by using `#[rust_name]` attributes on the cxx::bridge mod. With this change, we never do that and instead always perform any such renames with a `use` statement in the output set of mods. This simplifies our code, while making output more verbose; it is a prerequisite for a subsequent step towards solving #486.
This is part one of multiple commits which will solve #486 by mangling all names in the cxx::bridge in a predictable way.
Previously we sometimes panicked if we found APIs with identical names. We know we have issues like #486 where we don't always eliminate identically named items, and we know bindgen also has similar bugs. With this change we do not panic but instead ignore such items.
Just wanted to say that I'm encountering this issue with multiple definitions of Is it possible for the names to be mangled based on the gen # in the file name? When I |
That feels to me like a slightly different problem than the one here - the current issue is about multiple conflicting names within a single |
Sure haha |
This error encountered on an internal codebase:
"thread '<unnamed>' panicked at 'Unable to generate header and C++ code: Syn(Error("the name
Keyis defined multiple times"))', /src/main.rs:189:18"
Working on reducing now.
The text was updated successfully, but these errors were encountered: