Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

(Solved)Cyclic dependency issue with ahash crate - maybe worthwhile to document. #235

Closed
elbart opened this issue Oct 10, 2021 · 3 comments

Comments

@elbart
Copy link
Contributor

elbart commented Oct 10, 2021

Dear Sea ORM creators / maintainers,

first of all, thanks a lot for all the effort you seem to spend on this nice peace of software. I was just skimming around to look for a ORM to try for a new project I am trying to build. While knowing diesel (no it's not async, so it's not really interesting to me anymore) and also trying rbatis, Sea ORM looks the most promising to be honest. I have been working with sqlx before but wished for a more high level layer for regular crud operations.

I have been trying to pull in Sea ORM in an quasi active project with openidconnect / oauth dependency, however failed to pull in Sea ORM. I got a cyclic dependency error:

> cargo build
    Updating crates.io index
error: cyclic package dependency: package `ahash v0.7.4` depends on itself. Cycle:
package `ahash v0.7.4`
    ... which is depended on by `hashbrown v0.11.2`
    ... which is depended on by `indexmap v1.7.0`
    ... which is depended on by `serde_json v1.0.67`
    ... which is depended on by `wasm-bindgen v0.2.77`
    ... which is depended on by `js-sys v0.3.54`
    ... which is depended on by `getrandom v0.2.3`
    ... which is depended on by `ahash v0.7.4

I was a bit puzzled and did a cargo clean but this did not help, too. I searched for such an Issue and found an unanswered SO post: https://stackoverflow.com/questions/68399961/how-do-i-resolve-a-cyclic-dependency-in-cargo in the same question range.

I then wanted to do a minimal example for reproduction in a clean project ... I failed! I was unabled to reproduce, which left me puzzled. The only thing for me, left to do was to do rm Cargo.lock && cargo clean && cargo build and this suddenly worked (remark: i did not change any version specs in Cargo.toml, but I never pinned to patch versions, but usually minors). Seems like I was locked to an older version somewhere - the changes in Cargo.lock were too many to track down where the issue could have been, however it resolved the issue for me. Instead of deleting Cargo.toml I just learned, that i should have better used cargo update :).

Anyways, other people pulling Sea ORM in existing projects might stumble upon this issue and do not jump on the train. A simple 'cargo update' instruction for the above error somewhere in the documentation could help :)

Keep up the great work and feel free to close if too minor for you guys!

@baoyachi
Copy link
Contributor

baoyachi commented Oct 10, 2021

it's caused by this issue:tkaitchuck/aHash#95.
Using indexmap = "~1.6.2" works as a workaround.

Sea-orm can not solved this question.

@elbart
Copy link
Contributor Author

elbart commented Oct 10, 2021

@baoyachi thanks for the quick reply! I never claimed that sea orm can solve the issue, sorry if that somehow sounded like that (which is why I put solved in the ticket title). I just wanted to point out that this issue happened to me while adding sea orm to the project and never happend before with any other crate I added. Therefore I thought it might be good to document this here, too, just if someone else stumbles upon this same issue. And if you guys want, you could add a short remark to your already great documentation. No must have, it just came to my mind.

@elbart elbart closed this as completed Oct 10, 2021
@tyt2y3
Copy link
Member

tyt2y3 commented Oct 11, 2021

Thank you @baoyachi for the help.

So according to the issue it seems that the problem manifests when the serde feature on wasm-bindgen is enabled. Did you actually have wasm in your dependency tree? Or is it another dependency combo which caused this?

I have never encountered it indeed.

@SeaQL SeaQL locked and limited conversation to collaborators Oct 11, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants