-
Notifications
You must be signed in to change notification settings - Fork 337
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
Allow DSO export for C Rust bindings. #231
Conversation
I don't consider this complete yet. I'm struggling to get the cxx test suite to run properly on my machine, then I want to figure out how to add a test for this. |
Sorry about the CI failure -- it looks like the compiler error tests in compiletest.rs were failing due to nightly having adjusted some of the diagnostics. I pushed a fix to master so hopefully the CI will pass after a rebase. Locally, |
a94f12b
to
447c808
Compare
Hi @dtolnay, a few questions about your preferences for the test code I've just added.
|
Incidentally, my thinking regarding adding new tests here is that it would be practically impossible to make compile tests which can also adequately test for different permutations of linking. That assumption may be wrong - let me know if you think that's the best direction to explore and I'll give it a try. As to the CI errors, some versions of
It looks like some of the CI nightly builders do and some don't, so there is no permutation of code which will pass on all builders. Presumably this may fix itself within a week or so as they all roll to a more recent version of nightly. |
This option to the 'cxxbridge' command line tool allows users to specify (for example) __attribute__((visibility("default"))) or __declspec(dllexport) on C functions which may be exported from a shared object as they may be required by Rust code in different binaries.
Actually it looks like the reverse -- all the nightly builders used the most recently nightly: I'll push another rebase and keep alert for this happening again. According to https://www.githubstatus.com/ GitHub Actions had some degradation only a few hours later so it could have been some precursor of that... Sorry about the confusing failures on this PR. :( |
To answer your questions on testing: I'll land this with the tests as currently implemented, but I filed #241 to try something more like what the Rust compiler repo does for its MIR tests. |
This option to the 'cxxbridge' command line tool allows
users to specify (for example)
__attribute__((visibility("default")))
or
__declspec(dllexport)
on C functions which may be exported from a shared object
as they may be required by Rust code in different binaries.
Fixes #219.