[draft] fix: allow use as library dependency without git submodules#242
[draft] fix: allow use as library dependency without git submodules#242zyrakq wants to merge 2 commits into
Conversation
Replaced ignatz/serde_rusqlite git dependency with crates.io v0.43.0 Reverted sqlite-vec and pgrow2serde to branch refs instead of pinned commits Allow consuming trailbase as a path dep from external workspaces without workspace context The ignatz fork uses workspace = true for rusqlite which makes it unusable as a standalone dependency; crates.io 0.43.0 provides explicit rusqlite ^0.40 and works standalone
ba288ae to
ce84cee
Compare
| serde_qs = { version = "1.0.0", default-features = false, features = [] } | ||
| serde_rusqlite = { path = "vendor/serde_rusqlite" } | ||
| sqlite-vec = { path = "vendor/sqlite-vec/bindings/rust", default-features = false } | ||
| serde_rusqlite = "0.43.0" |
There was a problem hiding this comment.
(No action required)
serde_rusqlite is a well-maintained crate. I merely vendored it in the past since sometimes it would take a few weeks before rusqlite updates propagate. On the flip-side my vendored version has become stale, so thank you for pointing it back at upstream.
|
This looks great, thanks! Will squash as soon as the workflows pass. Out of curiosity, I suspect you're using TB as a library - is that right? For context, with APIs internally changing quite a bit (e.g. lately DB init sync -> async to accommodate for PG) this is something I haven't payed too much attention to. Appreciate you not being discouraged by these obstacles. Please keep it coming 🙏 |
|
I was a bit hasty in opening the PR and specified some inappropriate versions of the packages. The test will likely fail, but even if it does, something might break. Unfortunately, I'm having some issues with the network and development environment, so I won't be able to fix it until tomorrow. |
I suspect it's only an issue for you (i.e. I expect tests and workspace builds to pass), specifically |
|
Just pushed it to the dev branch: e91c17e 🙏 Will rebase a few more minor changes and release a new version to get the OTP fix out ASAP. Thanks again |
|
Yes, I'm using TB as a library 👍 I actually got started with Trailbase as a BaaS, so I'm not very up to speed on the internal challenges you're dealing with (like the recent DB init sync → async changes). Thanks for the context. I skimmed through some of the open issues — a few of the features discussed there are things I’d also like to see. Might try to propose something in the future around making the admin panel more extensible (for example, via web components and micro-frontends). |
Problem
When TrailBase is consumed as a library from an external workspace (e.g. via
git subtree), the build fails because:sqlite-vecandpgrow2serdeare path dependencies pointing to unpopulated git submodules.serde_rusqliteusesrusqlite = { workspace = true }, which requires TrailBase to be the active workspace root — this breaks when resolved from outside.Solution
Replace the three sub-dependencies with sources that work standalone, while keeping
[patch]entries so local submodule paths are still used when building TrailBase directly.Since
[patch]is only applied from the root workspace, contributors with submodules populated see no change in behavior.