-
Notifications
You must be signed in to change notification settings - Fork 144
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
Canonicalize include path in Windows to not contain UNC prefix #33
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here with What to do if you already signed the CLAIndividual signers
Corporate signers
ℹ️ Googlers: Go here for more info. |
@googlebot I signed it! |
Thanks a lot for this! I'll take a look at the And I am indeed shocked that you've got as far as you have. I have personally not yet been brave enough to even try to use autocxx in a real build system (I'm just on the cusp though.) Meanwhile though - I think your problem might be as simple as this. Your project needs to depend on both |
Thank you! 🙂 I tried to use both
I assume linking needs to be done on my side (but didn't see it in the Demo example)? How would I know the name and location of the library? Also, there seems to be no .cpp file, just a header |
Great. To confirm, you're now trying to use this outside of Cargo, right? Yes, you will need:
Then you should indeed get as far as the Rust side of the bindings building correctly, and you have! That's good news. But.... Unfortunately the idea of And... that's not possible yet for autocxx in a non-Cargo environment. I've filed #35 for this. The good news is that I happened to start on this yesterday. My day is crammed with meetings today, so I doubt I'll get this pushed within the next 24 hours, but it should be within the next 48. In case you feel like you're on a treadmill of discovering unimplemented features: you're right :) But here is a list of other things I expect you to come across.
After that, there will be some light at the end of the tunnel. |
No, I still used it with Cargo, but a separate project that adds Thanks for the write-up, and definitely don't feel pressured! |
Ah I see, in which case you should be able to use the stuff from |
Thanks for the fast fix of #27!
I have shocking news for you. After some tweaking, I ran the Demo example:
But from the beginning. The compilation step failed, and unfortunately the
cc
output is not that great -- it outputs the return code of MSVC compilercl
, however not the error message. I had to figure out which command failed, and reproduce it in the command line (which is not exactly the same setup, becausecc
loads the environment, e.g. to find standard headers).Anyway, I found out that the include directory created by
std::fs::canonicalize()
on Windows is a UNC path, with a prefix\\?\
that is not understood by many Microsoft tools, among otherscl
. There is an existing issue rust-lang/rust#42869 on the Rust repo about this.So I need to strip that prefix, and came across the dunce crate which did exactly that. It is of course also possible to write some inline code to not impose an extra dependency.
So far, so good, however I wasn't able to use autocxx from outside.
When I try to reproduce the Demo setup in a separate project, I get:
I saw the
NoAutoCxxInc
enumerator and was wondering, if theAUTOCXX_INC
env var might be missing. I set it asAUTOCXX_INC=src
(the relative path toinput.h
from the project root) but then got another error:Is there something obvious I'm doing wrong, or what setup would autocxx require? Is this the extra bindgen configuration you talked about?