-
Notifications
You must be signed in to change notification settings - Fork 96
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
Use bindgen for gdal-sys #55
Conversation
This is really great work :) It was not easy to get the crate building on Windows with mingw as well as the MS tool-chain. So please make sure that it still builds on Windows. If you don't have a Windows system around, just tell me and i will test it. |
Thanks, but I'm pretty sure it's no longer working. Unfortunately, I don't have a way to test it, neither on MSVC, nor in MinGW. So it would be good if you could look into it. One weird thing is that I no longer need a |
No problem. I will test it later today :) |
Building works but the tests won't run. Will try to fix it tomorrow.... |
It appears to be a problem with my machine or windows in general. The test are not running on master, too :( |
Are you getting any error, either as a message box or in Event Viewer? Maybe it can't find the GDAL DLL? In the meanwhile, do you have any thoughts about the remaining TODO items? |
I don't know if it makes sense to split the bindings. What modules would that be? Since GDAL 2.x OGR and GDAL are merging...
This is a bit more complicated. I guess we can do a new release for new GDAL releases and running bindgen is not really required for each build...
This would be the way to go. I think we already use all other enums.
we will never be able to cover all of GDAL if we create the bindings by hand |
I didn't realize this.
Or we can do both with a feature. But I'm worried abut compatibility. Will old binding work with a newer GDAL? Will new bindings work with an older GDAL as long as the application isn't calling any missing method? In the latter case, won't the OS loader complain, at least on Windows? I looked at |
Maybe we should go with the features approach. PyGDAL has a binding for every release but i'm not yet convinced that this is required. GDAL releases are very conservative in my experience. |
surprisingly it works with the gnu toolchain on windows on a different machine. The MSVC toolchain does not work but i think i can figure it out with a bit more time. |
Maybe we could bundle at least some bindings, so people don't have to deal with that?
Ouch. So |
I just reinstalled the VS build tools and now it also works with the MSVC tool chain 😄
Which version of GDAL did you use to generate the bindings? |
Uuh this was really obvious... You have to run the |
I've been trying to make this work for multiple versions of GDAL, but I ran into rust-lang/rust-bindgen#1267. |
great! could you add the configurable include paths? I guess this will also allow to build on windows. |
Yes, I'll try to look into it tomorrow. |
@jdroenner, @weiznich, can you take a look at 9bde2eb? |
i will try it later today when i have access to a windows pc. |
all i get is "error: could not find native static library |
Can you add a print or |
Ah, I think it uses |
Its working now 👍 Great work! |
Okay, so I've gone through my TODO list. |
This is really great 👍 Thanks a lot! |
As a test, I tried to port https://github.com/t-rex-tileserver/t-rex to the new version. It was trivial, but I had to add a reference to Should we re-export these? It might be nicer for the users. |
Oh, it actually is. Please ignore my last comment. |
The pre-built files can be obtained with:
For some reason, that won't generate the docstrings. In practice, I used something like:
|
Closes #50
Closes #56
TODO:
bindgen
configlibc
andstd::os::raw
1
andTRUE
bindgen
or commit the generated file*mut c_void
WkbType
withOGRwkbGeometryType
OGRErr
i32
vs.u32
for enumsgdal-sys
build instructions