Skip to content
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

Error building on mac #387

Closed
milosimr opened this issue Apr 13, 2023 · 16 comments
Closed

Error building on mac #387

milosimr opened this issue Apr 13, 2023 · 16 comments

Comments

@milosimr
Copy link

Since a couple of days ago, homebrew updated gdal and this package no longer compiles:

thread 'main' panicked at '"OGRField_struct_(unnamed_at_/Users/home/vcpkg/installed/arm64-osx/include/ogr_core_h_873_5)" is not a valid Ident', /Users/home/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro2-1.0.49/src/fallback.rs:756:9

This error in particular happens with vcpkg, but same thing happens with brew version.

@lnicola
Copy link
Member

lnicola commented Apr 13, 2023

That's strange, cargo check --features bindgen works for me with GDAL 3.6.3.

What do you have at /Users/home/vcpkg/installed/arm64-osx/include/ogr_core_h:873:5?

@milosimr
Copy link
Author

Homebrew updated gdal to 3.6.3.1

@milosimr
Copy link
Author

I cloned gdal repo and ran cargo check --features bindgen and it works for me too.

@milosimr
Copy link
Author

milosimr commented Apr 13, 2023

Screenshot 2023-04-13 at 13 51 28

Sorry @lnicola this is what I have on that line

@milosimr
Copy link
Author

Commenting out all those lines, app compiles

@lnicola
Copy link
Member

lnicola commented Apr 13, 2023

Yeah, I have those, too:

image

@lnicola
Copy link
Member

lnicola commented Apr 13, 2023

This looks like rust-lang/rust-bindgen#2312.

Are you building the current version of the code or the latest release? Which bindgen version do you have in your Cargo.lock?

@lnicola
Copy link
Member

lnicola commented Apr 13, 2023

I cloned gdal repo and ran cargo check --features bindgen and it works for me too.

Ah, so it's only in the released version?

@milosimr
Copy link
Author

Screenshot 2023-04-13 at 14 39 30

This is what I have in my dependencies. I think I tried with git link to pull the latest code and had the same results, but can't say for sure.

@lnicola
Copy link
Member

lnicola commented Apr 13, 2023

Try cargo tree | grep bindgen.

@milosimr
Copy link
Author

Bindgen is 0.61.0

@lnicola
Copy link
Member

lnicola commented Apr 13, 2023

Okay, I can reproduce this with 0.14. Looks like we need to cut a new release. In the meanwhile, you can use a git dependency, like:

[dependencies]
gdal = { git = "https://github.com/georust/gdal/", features = ["bindgen"] }
gdal-sys = { git = "https://github.com/georust/gdal/", features = ["bindgen"] }

@milosimr
Copy link
Author

Yeah, I tried that and it works, but a lot of things changed in the meantime so I get other compile errors.

@milosimr
Copy link
Author

Thanks a lot for your help and responsiveness.

@lnicola
Copy link
Member

lnicola commented Apr 13, 2023

When we put out a new release and you upgrade, you'll have to fix the same set of errors.

You can see the pending changes at https://github.com/georust/gdal/blob/master/CHANGES.md#unreleased. Feel free to ask here or on Discord if you need help upgrading! I'll try to find the time for another Lynch fan :-).

@alex-translation
Copy link

I had the same issue as @milosimr and this solution worked for me as well. Thank you @lnicola and I'm looking forward to future releases. Really enjoying the whole georust suite.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants