dabreegster / odjitter

Disaggregate zone-based origin/destination data to specific points
Apache License 2.0
12 stars 6 forks source link

Latest version does not compile #52

Open Robinlovelace opened 11 months ago

Robinlovelace commented 11 months ago

On at least a couple of machines.

Example below:

cargo install --git https://github.com/dabreegster/odjitter      
# error[E0277]: the trait bound `geozero::geojson::GeoJson<'_>: flatgeobuf::geozero::GeozeroDatasource` is not satisfied
``` cargo install --git https://github.com/dabreegster/odjitter 10/17/2023 10:57:41 am Updating git repository `https://github.com/dabreegster/odjitter` Installing odjitter v0.1.0 (https://github.com/dabreegster/odjitter#da8cfd4f) Updating crates.io index Downloaded fastrand v2.0.1 Downloaded errno v0.3.5 Downloaded clap_derive v3.2.25 Downloaded os_str_bytes v6.6.1 Downloaded byteorder v1.5.0 Downloaded termcolor v1.3.0 Downloaded ordered-float v3.9.2 Downloaded csv-core v0.1.11 Downloaded thiserror-impl v1.0.49 Downloaded thiserror v1.0.49 Downloaded smallvec v1.11.1 Downloaded semver v1.0.20 Downloaded tempfile v3.8.0 Downloaded flatbuffers v23.5.26 Downloaded unicode-ident v1.0.12 Downloaded proc-macro2 v1.0.69 Downloaded bitflags v2.4.1 Downloaded num-traits v0.2.17 Downloaded serde_derive v1.0.189 Downloaded serde v1.0.189 Downloaded libm v0.2.8 Downloaded memchr v2.6.4 Downloaded flatgeobuf v3.27.0 Downloaded serde_json v1.0.107 Downloaded syn v2.0.38 Downloaded rustix v0.38.19 Downloaded geozero v0.10.0 Downloaded geozero v0.11.0 Downloaded earcutr v0.4.3 Downloaded libc v0.2.149 Downloaded csv v1.3.0 Downloaded linux-raw-sys v0.4.10 Downloaded 32 crates (6.2 MB) in 4.51s (largest was `linux-raw-sys` at 1.4 MB) Compiling proc-macro2 v1.0.69 Compiling autocfg v1.1.0 Compiling unicode-ident v1.0.12 Compiling semver v1.0.20 Compiling libm v0.2.8 Compiling serde v1.0.189 Compiling libc v0.2.149 Compiling scopeguard v1.2.0 Compiling byteorder v1.5.0 Compiling version_check v0.9.4 Compiling itoa v1.0.9 Compiling ryu v1.0.15 Compiling cfg-if v1.0.0 Compiling serde_json v1.0.107 Compiling thiserror v1.0.49 Compiling stable_deref_trait v1.2.0 Compiling smallvec v1.11.1 Compiling syn v1.0.109 Compiling log v0.4.20 Compiling rustix v0.38.19 Compiling bitflags v2.4.1 Compiling hash32 v0.2.1 Compiling linux-raw-sys v0.4.10 Compiling bitflags v1.3.2 Compiling proc-macro-error-attr v1.0.4 Compiling proc-macro-error v1.0.4 Compiling either v1.9.0 Compiling geozero v0.11.0 Compiling hashbrown v0.12.3 Compiling memchr v2.6.4 Compiling anyhow v1.0.75 Compiling os_str_bytes v6.6.1 Compiling num-traits v0.2.17 Compiling lock_api v0.4.10 Compiling indexmap v1.9.3 Compiling itertools v0.11.0 Compiling heck v0.4.1 Compiling fastrand v2.0.1 Compiling geozero v0.10.0 Compiling rustc_version v0.4.0 Compiling ppv-lite86 v0.2.17 Compiling lazy_static v1.4.0 Compiling clap_lex v0.2.4 Compiling geographiclib-rs v0.2.3 Compiling quote v1.0.33 Compiling termcolor v1.3.0 Compiling heapless v0.7.16 Compiling spin v0.9.8 Compiling flatbuffers v23.5.26 Compiling syn v2.0.38 Compiling getrandom v0.2.10 Compiling csv-core v0.1.11 Compiling rand_core v0.6.4 Compiling atty v0.2.14 Compiling approx v0.5.1 Compiling strsim v0.10.0 Compiling rand_chacha v0.3.1 Compiling textwrap v0.16.0 Compiling robust v1.1.0 Compiling once_cell v1.18.0 Compiling float_next_after v1.0.0 Compiling fallible-streaming-iterator v0.1.9 Compiling rand v0.8.5 Compiling rstar v0.11.0 Compiling ordered-float v3.9.2 Compiling fs-err v2.9.0 Compiling earcutr v0.4.3 Compiling tempfile v3.8.0 Compiling serde_derive v1.0.189 Compiling thiserror-impl v1.0.49 Compiling clap_derive v3.2.25 Compiling clap v3.2.25 Compiling geo-types v0.7.11 Compiling csv v1.3.0 Compiling geo v0.26.0 Compiling geojson v0.24.1 Compiling flatgeobuf v3.27.0 Compiling odjitter v0.1.0 (/home/robin/.cargo/git/checkouts/odjitter-2ee039e64a6d7c8d/da8cfd4) error[E0277]: the trait bound `geozero::geojson::GeoJson<'_>: flatgeobuf::geozero::GeozeroDatasource` is not satisfied --> src/main.rs:126:29 | 126 | fgb.add_feature(geozero::geojson::GeoJson(&serde_json::to_string(&feature)?))?; | ----------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `flatgeobuf::geozero::GeozeroDatasource` is not implemented for `geozero::geojson::GeoJson<'_>` | | | required by a bound introduced by this call | = help: the following other types implement trait `flatgeobuf::geozero::GeozeroDatasource`: FgbReader FgbReader note: required by a bound in `FgbWriter::<'a>::add_feature` --> /home/robin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/flatgeobuf-3.27.0/src/file_writer.rs:254:53 | 254 | pub fn add_feature(&mut self, mut feature: impl GeozeroDatasource) -> Result<()> { | ^^^^^^^^^^^^^^^^^ required by this bound in `FgbWriter::<'a>::add_feature` For more information about this error, try `rustc --explain E0277`. error: could not compile `odjitter` (bin "odjitter") due to previous error error: failed to compile `odjitter v0.1.0 (https://github.com/dabreegster/odjitter#da8cfd4f)`, intermediate artifacts can be found at `/tmp/cargo-installlcpkzP`. To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.
Robinlovelace commented 11 months ago

Context: https://github.com/nptscot/npt/issues/276#issuecomment-1766041541

Robinlovelace commented 11 months ago

Latest version that does compile for me:

cargo install --git https://github.com/dabreegster/odjitter --rev 32fb58bf7f0d68afd3b76b88cf6b1272c5c66828
dabreegster commented 11 months ago

Something super odd is happening here. If I clone the repo and do cargo check or cargo build --release, everything's fine. But indeed cargo install --git breaks with that error.

I'll look into it whenever I have time. For now, workaround is git clone https://github.com/dabreegster/odjitter && cd odjitter && cargo build --release && cp ./target/realese/odjitter /usr/local/bin/

e-kotov commented 9 months ago

@dabreegster thank you for this temporary solution! just fixing the typo in the path ~./target/realese/odjitter~ so that the code is ready for anyone who might be using this solution too:

git clone https://github.com/dabreegster/odjitter && cd odjitter && cargo build --release && cp ./target/release/odjitter /usr/local/bin/