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

upgrade ci #234

Merged
merged 16 commits into from Jan 19, 2022
Merged

upgrade ci #234

merged 16 commits into from Jan 19, 2022

Conversation

geohardtke
Copy link
Contributor

CI should now build and test against gdal 3.0, 3.1, 3.2, 3.3 and 3.4

Unfortunately some tests are now failing. Any idea?

@geohardtke geohardtke mentioned this pull request Nov 22, 2021
1 task
@geohardtke
Copy link
Contributor Author

Some more work is needed here, but I don't have time right now. Will come back here later

@geohardtke
Copy link
Contributor Author

geohardtke commented Nov 22, 2021

Test pass in gdal 3.0; then in gdal 3.2 and gdal 3.3; test_sql_with_dialect is broken.

test vector::vector_tests::tests::test_features_aliasing_compile_fail ... ok

failures:

---- vector::vector_tests::sql::test_sql_with_dialect stdout ----
thread 'vector::vector_tests::sql::test_sql_with_dialect' panicked at 'called `Result::unwrap()` on an `Err` value: CplError { class: 3, number: 1, msg: "In ExecuteSQL(): sqlite3_prepare_v2(SELECT * FROM roads WHERE highway = 'pedestrian' and NumPoints(GEOMETRY) = 3):\n  no such function: NumPoints" }', src/vector/vector_tests/sql.rs:82:10
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


failures:
    vector::vector_tests::sql::test_sql_with_dialect

and in gdal 3.4 a second test breaks; auto_identify :

---- spatial_ref::tests::auto_identify stdout ----
thread 'spatial_ref::tests::auto_identify' panicked at 'called `Result::unwrap()` on an `Err` value: OgrError { err: 7, method_name: "OSRAutoIdentifyEPSG" }', src/spatial_ref/tests.rs:207:38

Which shows why it is a good idea to test against as many versions as possible. :)

@geohardtke
Copy link
Contributor Author

Ok. so the problem with one of the function was probably a driver not available on the minimal ubuntu base, swapping to the full image solved the problem.

@jdroenner
Copy link
Member

great work!
i guess the failure in 3.4 is caused by Proj not accepting the SRS identification we have in that test.

@geohardtke
Copy link
Contributor Author

Proj not accepting the SRS

Any idea how to fix it? I'm not very familiar with that side of the API.

@michaelkirk
Copy link
Member

I was able to get the test to pass with these changes:
https://github.com/geohardtke/gdal/compare/upgrade_ci...michaelkirk:mkirk/upgrade-ci?expand=1

I've never used the WKT SRS format before. Is it possible that it changed with the more recent versions?

update WKT representation to fix test on gdal 3.4
@michaelkirk
Copy link
Member

bors try

bors bot added a commit that referenced this pull request Dec 1, 2021
@geohardtke
Copy link
Contributor Author

I was able to get the test to pass with these changes: https://github.com/geohardtke/gdal/compare/upgrade_ci...michaelkirk:mkirk/upgrade-ci?expand=1

Excellent, thanks! We do have all green lights now.

Maybe it would be nice to add a note about this in the release notes when gdal 3.4 bindings are added? Unfortunately I can't find anything in the release notes upstream to explain the change in behaviour. I'm not even sure if it is a change in gdal or proj?

@michaelkirk
Copy link
Member

I don't know either. One data point I have is that I was actually seeing this same error locally with gdal 3.3 and proj 8.2 (on apple aarch64).

So that might point to it being related to the underlying proj instance... maybe 🤷

@geohardtke
Copy link
Contributor Author

yes, I'm inclined to think that is a change in proj. I just checked and the docker image for gdal 3.4 uses proj 8.2 while the 3.3 version uses 8.0.1.
So the actual behaviour will depend on the proj version available in the system and not the gdal version. So probably we don't need to add anything to the release notes.

Thanks again!

@jdroenner
Copy link
Member

thanks! this a huge improvement. I also think think it depends on the proj version.

@jdroenner
Copy link
Member

bors r+

bors bot added a commit that referenced this pull request Dec 2, 2021
234: upgrade ci r=jdroenner a=geohardtke

CI should now build and test against gdal 3.0, 3.1, 3.2, 3.3 and 3.4

Unfortunately some tests are now failing. Any idea?

 

Co-authored-by: Leonardo Hardtke <leonardo.hardtke@des.qld.gov.au>
Co-authored-by: Michael Kirk <michael.code@endoftheworl.de>
Co-authored-by: geohardtke <48337686+geohardtke@users.noreply.github.com>
@bors
Copy link
Contributor

bors bot commented Dec 2, 2021

Timed out.

@bors
Copy link
Contributor

bors bot commented Dec 2, 2021

try

Timed out.

1 similar comment
@bors
Copy link
Contributor

bors bot commented Dec 2, 2021

try

Timed out.

@jdroenner
Copy link
Member

bors try

bors bot added a commit that referenced this pull request Dec 2, 2021
@jdroenner
Copy link
Member

the ci is not happy with some of the tests :(

@jdroenner
Copy link
Member

bors retry

bors bot added a commit that referenced this pull request Jan 12, 2022
234: upgrade ci r=lnicola a=geohardtke

CI should now build and test against gdal 3.0, 3.1, 3.2, 3.3 and 3.4

Unfortunately some tests are now failing. Any idea?

 

Co-authored-by: Leonardo Hardtke <leonardo.hardtke@des.qld.gov.au>
Co-authored-by: Michael Kirk <michael.code@endoftheworl.de>
Co-authored-by: geohardtke <48337686+geohardtke@users.noreply.github.com>
@lnicola
Copy link
Member

lnicola commented Jan 12, 2022

We might have to merge this manually, but I'd rebase it first.

@jdroenner
Copy link
Member

yes. just thought it should try again 😆

@bors
Copy link
Contributor

bors bot commented Jan 12, 2022

Timed out.

@jdroenner
Copy link
Member

i will rebase and merge it later

@jdroenner
Copy link
Member

jdroenner commented Jan 17, 2022

ok now we have a new issue. Thanks clippy -_-

What about adding a ::zero() method to GdalType or use num_traits ::zero() to initialize generic vectors?

@rmanoka
Copy link
Contributor

rmanoka commented Jan 18, 2022

@jdroenner The set_len is exactly as suggested in the std::Vec docs, but unfortunately the example link keeps changing. See https://doc.rust-lang.org/std/vec/struct.Vec.html#examples-22 . May be clippy will accept it if we do the set_len after the FFI call? I believe it is still sound even if the FFI errors out as the capacity is already known to Vec and it should drop it correctly.

@jdroenner
Copy link
Member

jdroenner commented Jan 18, 2022

i think we would have to make the FFI call in the same method. we can not use a &mut ref and pass it to the other method.

@jdroenner
Copy link
Member

@rmanoka this way it works. Don't know what i like better.

@jdroenner
Copy link
Member

bors try

bors bot added a commit that referenced this pull request Jan 18, 2022
@rmanoka
Copy link
Contributor

rmanoka commented Jan 18, 2022

@jdroenner I like your approach; it's a bit of copied code, but safer. We used set_len earlier because this could be part of a hot-loop in many raster reading paradigms. That said, safety and easier maintenance is more important, so I don't mind either the copied code or the T::zero() approach. There may be a way using MaybeUninit as clippy suggests, but it's beyond my understanding.

@rmanoka
Copy link
Contributor

rmanoka commented Jan 18, 2022

Another option, if you would like to not have copied code: move the common GDALRasterIOEx code into a private fn that takes *mut instead of &mut. Then both the method returning Buffer and the read_into_slice can call that. Since it is *mut we can now do the set_len after the call. At this point, it's more for clarity, so pls. feel free to ignore this.

@jdroenner
Copy link
Member

lets use it like this then

@jdroenner
Copy link
Member

bors merge

bors bot added a commit that referenced this pull request Jan 18, 2022
234: upgrade ci r=jdroenner a=geohardtke

CI should now build and test against gdal 3.0, 3.1, 3.2, 3.3 and 3.4

Unfortunately some tests are now failing. Any idea?

 

Co-authored-by: Leonardo Hardtke <leonardo.hardtke@des.qld.gov.au>
Co-authored-by: Michael Kirk <michael.code@endoftheworl.de>
Co-authored-by: geohardtke <48337686+geohardtke@users.noreply.github.com>
Co-authored-by: Johannes Drönner <droenner@mathematik.uni-marburg.de>
@bors
Copy link
Contributor

bors bot commented Jan 18, 2022

try

Timed out.

@bors
Copy link
Contributor

bors bot commented Jan 18, 2022

Timed out.

@jdroenner
Copy link
Member

i guess the CI is just to much for bors

@jdroenner jdroenner merged commit 9249bf7 into georust:master Jan 19, 2022
@lnicola lnicola mentioned this pull request Oct 31, 2022
2 tasks
bors bot added a commit that referenced this pull request Oct 31, 2022
329: Drop `trybuild` test r=jdroenner a=lnicola

- [x] I agree to follow the project's [code of conduct](https://github.com/georust/gdal/blob/master/CODE_OF_CONDUCT.md).
- [ ] I added an entry to `CHANGES.md` if knowledge of this change could be valuable to users.
---

Follow-up to #236
Closes #312

`trybuild` sounds nice, however:

 - it doesn't work (out of the box) with multiple compiler versions, so it breaks when upgrading compilers: #234
 - when testing with `--all-features`, it causes the code to be rebuilt twice
 - I've seen it give some weird errors in unusual circumstances (under `gdb`, maybe?)
 - it's completely broken for `@metasim` (#312), but not on CI, see also #312 (comment)
 - 1.5 years later, we still only have one test

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
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 this pull request may close these issues.

None yet

5 participants