Odonno / surrealdb-migrations

An awesome SurrealDB migration tool, with a user-friendly CLI and a versatile Rust library that enables seamless integration into any project.
https://crates.io/crates/surrealdb-migrations
MIT License
210 stars 16 forks source link

cargo install surrealdb-migrations fail stack overflow in geo #42

Closed dave42w closed 11 months ago

dave42w commented 1 year ago

I've just tried the cargo install (cargo add worked fine) of v0.9.11 on Rust 1.171.0

Got this compile error.

Regards

Dave

error[E0275]: overflow evaluating the requirement `[closure@/home/dave/.cargo/registry/src/index.crates.io-6f17d22bba15001f/geo-0.24.1/src/algorithm/map_coords.rs:855:69: 855:72]: Fn<(geo_types::Coord<T>,)>`
  |
  = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`geo`)
  = note: required for `&[closure@/home/dave/.cargo/registry/src/index.crates.io-6f17d22bba15001f/geo-0.24.1/src/algorithm/map_coords.rs:855:69: 855:72]` to implement `Fn<(geo_types::Coord<T>,)>`
  = note: 128 redundant requirements hidden
  = note: required for `&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&...` to implement `Fn<(geo_types::Coord<T>,)>`
  = note: the full type name has been written to '/tmp/cargo-installBhDx5o/release/deps/geo-1ba9ff62a3464a0b.long-type-12786843144496384107.txt'

For more information about this error, try `rustc --explain E0275`.
error: could not compile `geo` (lib) due to previous error
warning: build failed, waiting for other jobs to finish...
error: failed to compile `surrealdb-migrations v0.9.11`, intermediate artifacts can be found at `/tmp/cargo-installBhDx5o`
dave42w commented 1 year ago

I have tried cargo add geo as there is a fairly new 0.26 release. It didn't make any difference.

As cargo add surrealdb-migrations installed without an error it leaves me wondering if it is possible to create schemas and migrations without the CLI cargo install surrealdb-migrations?

Thanks

Odonno commented 1 year ago

Hi Dave,

Indeed, it works on cargo 1.70.0 but I can reproduce the error you showed on cargo 1.71.0.

It is indeed related to the geo crate (0.24.1) used by the surrealdb crate (1.0.0-beta.9). However, I do not see any viable solution at the moment. I could use a patch but that would be a really bad idea.

The best option would be:

dave42w commented 1 year ago

Thanks for following up on this. A bit frustrating when these dependencies bite us.

happysalada commented 1 year ago

beta 10 was just released hours ago.

Odonno commented 11 months ago

With the release of 1.0.0, this issue should no longer occurs.

You can download the latest release of surrealdb-migrations:

cargo install surrealdb-migrations@1.0.0-preview.1