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

Could not convert gdal version string into number with GDAL 3.7.2 Linux 64 #438

Closed
latot opened this issue Sep 22, 2023 · 1 comment · Fixed by #439
Closed

Could not convert gdal version string into number with GDAL 3.7.2 Linux 64 #438

latot opened this issue Sep 22, 2023 · 1 comment · Fixed by #439

Comments

@latot
Copy link

latot commented Sep 22, 2023

Hi all, I'm trying to use the crate, sadly does not works.

gdal = {features = ["bindgen"], version = "0.16.0"}
gdal-sys = { version = "0.9.1", features = ["bindgen"] }
  --- stderr
  thread 'main' panicked at 'The GDAL-SYS crate must emit the version of libgdal via cargo:version_number: NotPresent', /home/pipe/.cargo/registry/src/index.crates.io-6f17d22bba15001f/gdal-0.16.0/build.rs:5:10
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

There is at least two issues here, one is related to the git version.

pkg-config --modversion gdal
3.7.2dev

Talking with @lnicola seems "3.7.2dev" can't be parsed.

The next and unknown one is that, using GDAL 3.7.2, not the dev version, the error persist... no idea why:

pkg-config --modversion gdal
3.7.2

I'm using gentoo 64.

Edited:

Running cargo clean after downgrade from gdal-git to 3.7.2 fixes the issue.
Probs this happens because of the 3.7.2dev

Thx!

@lnicola
Copy link
Member

lnicola commented Sep 23, 2023

Running cargo clean after downgrade from gdal-git to 3.7.2 fixes the issue.

For future reference, this is because build scripts don't run again unless something changed. Cargo can't tell when you've upgraded or downgraded GDAL, so you need to at least do cargo clean -p gdal-sys (but cargo clean is probably a better idea).

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

Successfully merging a pull request may close this issue.

2 participants