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

Update to use proj 0.23.1, using libproj 8.1.0 #661

Merged
merged 1 commit into from
Nov 2, 2021
Merged

Conversation

urschrei
Copy link
Member

  • I agree to follow the project's code of conduct.
  • I added an entry to CHANGES.md if knowledge of this change could be valuable to users.

@urschrei
Copy link
Member Author

bors try

bors bot added a commit that referenced this pull request Aug 18, 2021
@urschrei urschrei changed the title Update to use proj 0.23.0, using libproj 8.1.0 Update to use proj 0.23.1, using libproj 8.1.0 Aug 18, 2021
@bors
Copy link
Contributor

bors bot commented Aug 18, 2021

try

Build failed:

@urschrei
Copy link
Member Author

Hmmmm missing cmake in the base images?

@michaelkirk
Copy link
Member

Hmmmm missing cmake in the base images?

The geo-ci dockerfile copies the proj installation from libproj-builder:

https://github.com/georust/docker-images/blob/master/rust-1.53/geo-ci.Dockerfile#L29

So if it's trying to build proj, something has gone wrong.

@michaelkirk
Copy link
Member

michaelkirk commented Aug 19, 2021

One thought: are you sure that you'd built and tagged the latest libproj-builder:rust-1.53 (with proj 8) before rebuilding and tagging the geo-ci:rust-1.53 container?

...I have no idea how to audit this =(

I'll try to reproduce it locally.

@urschrei
Copy link
Member Author

I thought I had…

@michaelkirk
Copy link
Member

michaelkirk commented Aug 19, 2021

--- stderr
  feature flags specified source build  👀 👀 👀 👀 
  building libproj from source
  thread 'main' panicked at '
  failed to execute command: No such file or directory (os error 2)
  is `cmake` not installed?

That stderr line is from:

16 #[cfg(not(feature = "nobuild"))]
 17 fn main() -> Result<(), Box<dyn std::error::Error>> {
 18     let include_path = if cfg!(feature = "bundled_proj") {
 19         eprintln!("feature flags specified source build");
 20         build_from_source()?                                   
 21     } else {   

I wonder why we're triggering that?

@michaelkirk
Copy link
Member

michaelkirk commented Aug 19, 2021

Oh, I guess I didn't realize (or maybe forgot) that using geo --features=proj-network will build the bundled_proj:

geo/Cargo.toml

proj-network = ["use-proj", "proj/network"]

proj/Cargo.toml

network = ["bundled_proj_tiff", "reqwest"]

and

bundled_proj_tiff = [ "proj-sys/bundled_proj_tiff" ]

proj-sys/Cargo.toml

bundled_proj_tiff = ["bundled_proj"]

So I guess this is intended. I'm not sure why this was added - I guess maybe it's hard to probe whether the existing proj installation has the tiff feature?

Maybe in the immediate, the thing to do is simply to install cmake on geo-ci, as @urschrei suggested long ago. 😬

@urschrei
Copy link
Member Author

It's the easier option for now, for sure.

@michaelkirk
Copy link
Member

Sorry that this has sat here so long @urschrei!

I confess, I'm still kind of confused as to why we now need to build proj from source when we (apparently?) didn't previously need to.

One thing that might help me trace this back - can you push up a proj-0.20.3 tag?

@michaelkirk
Copy link
Member

michaelkirk commented Oct 19, 2021

BTW, I did go to add cmake to the geo-ci base docker image, but then the build failed because it needed sqlite... and presumably all the other proj deps.

Ultimately I'd be OK with having just one heavy base docker image for ci, it's no big deal.

But the primary reason it gives me pause was because now I'm wondering if we'd be newly requiring geo users to have to build proj from source even if they already have a compatible version installed.

For example, a (very) cursory look shows that debian (sid) and macos homebrew include libtiff. It seems likes those users shouldn't need to build libproj from source if we get things set up nicely.

@michaelkirk
Copy link
Member

michaelkirk commented Oct 19, 2021

Hm... maybe this is the history: georust/proj#58

Seems like we first added a way to disable the building of tiff in hopes of getting proj building on M1, but we've since tracked down a different root cause and everything is now peachy w/ aarch64 and libproj.

Since tiff is enabled by default by libproj... would it be too bold to deprecate that feature and assume all people are either:

  1. using a reasonably default proj install that includes libtiff
  2. or if they're doing something fancy, they're on their own and will have to decipher the trail of error messages.

I guess weighing the downsides of that vs. requiring everyone who uses geo w/ proj to compile libproj from source...

@urschrei
Copy link
Member Author

I think it's reasonable to assume that most people with an existing libproj also have libtiff, and anyone else is comfortable hacking.

@urschrei
Copy link
Member Author

(I also pushed a tag for 0.20.3)

bors bot added a commit to georust/proj that referenced this pull request Oct 20, 2021
92: Assume `tiff` to avoid unnecessary libproj builds. r=urschrei a=michaelkirk

This is a preface to unblocking georust/geo#661 (I've integrated these changes with the geo crate here: https://github.com/georust/geo/tree/mkirk/bump_proj_810)

--- 

This removes the bundled_proj_tiff feature (added in
https://github.com/georust/proj/pull/58/files), and we now, once again, assume all
proj installations support tiff. Meaning the user either:
1. If the user has a recent system installation of libproj, it supports
   libtiff.
2. Else if the user has no recent system installation of libproj,
   build.rs will compile it from source, which requires linking in
   libtiff

The previous "bundled_proj_tiff" unfortunately conflated needing tiff
with needing to build from source, even though most system proj installs
will already support tiff.

## Longer explanation

proj-sys requires a compatible libproj installation. build.rs will
either use a pre-existing system installation of libproj or build
libproj from source. Building from source takes a while, so it's
preferable to use the system installation if it's compatible.

tiff support is used by libproj's network grid.  tiff support is
required by libproj by default, though it's possible to opt out.

When Apple first released aarch64 (M1), libtiff was failing to build,
so as a stop gap we added a "bundled_proj_tiff" feature which:
1. forced a from-source build
2. explicitly enabled tiff support, else tiff support would be disabled,
   allowing us to build the proj crate on aarch64

The underlying build failures in libtiff have now been fixed, so the
original motivation for this feature no longer exists.

There was a cost associated with keeping it - unnecessarily triggering
source builds from, e.g. georust/geo crate, whose `proj/network` feature
wants to ensure tiff is enabled. Given that most installations will have
this feature, I think it will give most of our users a better experience
if we can avoid the compile.

To be clear, there is potential downside with this approach. It's still
conceivable that environments exists where tiff is not, or can not be
installed, but weighing that against the more common case of having
libproj installed with the default configuration, and I think this
approach wins.

If this poops on too many parties, we can revisit something like the
former behavior in a way that's less deleterious to the default use
case - e.g. have a `tiff` feature that will still use the local install
if it supports tiff.

Co-authored-by: Michael Kirk <michael.code@endoftheworl.de>
@michaelkirk
Copy link
Member

ping @urschrei - I'm happy to take this one over if you're busy.

@urschrei urschrei force-pushed the bump_proj_810 branch 2 times, most recently from 6e2077c to 7beced3 Compare November 2, 2021 14:12
@urschrei
Copy link
Member Author

urschrei commented Nov 2, 2021

Let's see if this will merge even though cargo-tarpaulin is failing with an error

@urschrei
Copy link
Member Author

urschrei commented Nov 2, 2021

bors r+

bors bot added a commit that referenced this pull request Nov 2, 2021
661: Update to use proj 0.23.1, using libproj 8.1.0 r=urschrei a=urschrei

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



Co-authored-by: Stephan Hügel <shugel@tcd.ie>
@bors
Copy link
Contributor

bors bot commented Nov 2, 2021

Build failed:

@urschrei
Copy link
Member Author

urschrei commented Nov 2, 2021

bors try

bors bot added a commit that referenced this pull request Nov 2, 2021
@urschrei
Copy link
Member Author

urschrei commented Nov 2, 2021

OK! But will the merge commit skip the coverage check 🧐?

@urschrei
Copy link
Member Author

urschrei commented Nov 2, 2021

bors r+

bors bot added a commit that referenced this pull request Nov 2, 2021
661: Update to use proj 0.23.1, using libproj 8.1.0 r=urschrei a=urschrei

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



Co-authored-by: Stephan Hügel <shugel@tcd.ie>
@urschrei
Copy link
Member Author

urschrei commented Nov 2, 2021

OK, now what? Manual merge?

@bors
Copy link
Contributor

bors bot commented Nov 2, 2021

Build failed:

@michaelkirk
Copy link
Member

michaelkirk commented Nov 2, 2021

In the immediate, I'm totally fine with a manual merge. I'm going to open a separate issue about tarpaulin (here: #676)

@urschrei urschrei merged commit 61ad69f into master Nov 2, 2021
@bors
Copy link
Contributor

bors bot commented Nov 5, 2021

try

Timed out.

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.

2 participants