dependency loop with borsh and bson #860

Open
opened 2026-02-15 13:02:31 -06:00 by alexanderkjall · 4 comments
alexanderkjall commented 2026-02-15 13:02:31 -06:00 (Migrated from github.com)

Not really sure that this is the right place to post this, but here goes:

The following dependencies leads to a loop:

uuid = { version = "1.21.0", features = ["borsh"] }
borsh = { version = "1.6.0", features = ["bson"] }

full reproduction example here: https://github.com/alexanderkjall/rkyv-loop-demo/

Not really sure that this is the right place to post this, but here goes: The following dependencies leads to a loop: ``` uuid = { version = "1.21.0", features = ["borsh"] } borsh = { version = "1.6.0", features = ["bson"] } ``` full reproduction example here: https://github.com/alexanderkjall/rkyv-loop-demo/
KodrAus commented 2026-02-15 15:57:28 -06:00 (Migrated from github.com)

Hmm, that's pretty unfortunate. We need some way to break the cycle. If there was a smaller core API of borsh we could depend on that was just enough to implement BorshSerialize and BorshDeserialize traits that itself was a dependency of the complete borsh library that would do it.

Hmm, that's pretty unfortunate. We need some way to break the cycle. If there was a smaller core API of `borsh` we could depend on that was just enough to implement `BorshSerialize` and `BorshDeserialize` traits that itself was a dependency of the complete `borsh` library that would do it.
alexanderkjall commented 2026-02-16 11:02:09 -06:00 (Migrated from github.com)

I agree, and I guess would be best to try to solve this in collaboration with the other two crates in question. But I have never talked with any of those authors, should I try to ping them here maybe?

I agree, and I guess would be best to try to solve this in collaboration with the other two crates in question. But I have never talked with any of those authors, should I try to ping them here maybe?
KodrAus commented 2026-03-03 16:30:22 -06:00 (Migrated from github.com)

I've opened https://github.com/near/borsh-rs/issues/363 over in borsh to get some input from the maintainers there. Since this is an issue across multiple crates, I think it'll take some effort on all of our parts to work around it.

I've opened https://github.com/near/borsh-rs/issues/363 over in `borsh` to get some input from the maintainers there. Since this is an issue across multiple crates, I think it'll take some effort on all of our parts to work around it.
KodrAus commented 2026-03-26 16:24:32 -05:00 (Migrated from github.com)

We decided to deprecate the borsh feature of uuid in favour of a uuid feature in borsh. I don't think there's much we can do here without breakage, except to encourage users to use the borsh feature of uuid instead. At some future point we'll then change our borsh feature into a no-op that produces a compile error.

We decided to deprecate the `borsh` feature of `uuid` in favour of a `uuid` feature in `borsh`. I don't think there's much we can do here without breakage, except to encourage users to use the `borsh` feature of `uuid` instead. At some future point we'll then change our `borsh` feature into a no-op that produces a compile error.
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-uuid-rs/uuid#860
No description provided.