-
Notifications
You must be signed in to change notification settings - Fork 155
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
autocxx can give silent failures #1269
Comments
I've just noticed that this behavior is in fact documented here:
And So maybe it would be more ergonomic to fail the build if a Or maybe you could have a parameter for each Cheers. |
And just found this sentence elsewhere in the docs:
That appears to not be true? Thanks |
Thanks for the report. The behavior you're seeing is a little surprising. If a give function is explicitly requested by |
Fixes #1269. generate! directives produce a hard error if code could not be generated. However, previously we were checking for this only just after the bindgen stage, instead of after all our analysis stages completed. Errors during those later analysis stages did not result in a hard error.
I've been poking at this but it isn't a very easy fix. We were (correctly) failing the build if a I think we should do, but this is complicated by the fact that we do all sorts of name mangling, and by the end of the analysis, we no longer know the original API name, so we can't compare the successfully-generated APIs against the original allowlist from |
Fixes #1269. generate! directives produce a hard error if code could not be generated. However, previously we were checking for this only just after the bindgen stage, instead of after all our analysis stages completed. Errors during those later analysis stages did not result in a hard error.
Thanks for looking into this. If you ping me when your PR is ready, I'd be happy to test it. |
Hi,
I'm very new to autocxx. Apologies if my expectations are naive.
We are investigating whether it would be possible to use autocxx on an existing codebase that already uses the
cc
crate to build some C++ code that interfaces with LLVM. Currently we use the regular Rust C FFI and linkage magic.I spent hours today figuring out what the following error means when I try to call the function I've generated bindings for:
Our codebase is a workspace. The crate
ykllvmwrap
is where I'm trying to replace C FFI functions with C++ ones.yktrace
is the consuming crate in this instance.At first I thought it was because I was doing a cross-crate call to a C++ function. Modified your demo code to have a workspace and do a cross-crate C++ call... It worked.
It was only when I read our code's generated docs that I stumbled on:
yet the build of
ykllvmwrap
was successful.Wouldn't it have been better if the build of the
ykllvmwrap
crate had failed at generation time, displaying that message? I did explicitly ask for that function to be generated:Perhaps it would make sense to silently fail in scenarios where you are blanket generating bindings for an API...
(I'm going to bet there's a good technical reason that things are like this 😄 )
Thanks!
The text was updated successfully, but these errors were encountered: