Just noticed this comment... is this something we want to update across the whole compiler? basically have one reference in the workspace and then all the crates use that?
Screenshot 2024-11-29 at 09.44.07.png
I'm contemplating doing a pass through the crates and making a PR to do this, it would make life easier in the long run when we refactor things.
I didn't know you could use workspace paths for our own crates... I thought it was only possible for external packages.
Hmm... I guess we could do it for local imports
Sounds nice to not need to get paths right....though seeing paths may minorly help key people that they are importing things they shouldn't.
There's still a path, just in the one Cargo.toml in the root of the workspace instead of repeated throughout all of the crates
Like of you have to use a ton of ../
, you may be important in something form far away and making the time to compile the roc compiler worse due to bad cargo dependency tree
At the same time, our dependency tree is already screwed up really bad (from a compile time perspective), so maybe that doesn't matter
I think making it easier to refactor and reorganise the crates will help us improve the situation
Maybe though realistically, it needs a very target project mostly related to compiling the roc builtins to get fixed up.
If it's not really helpful I might just leave it for now. We can revisit later. Thanks :smiley:
I mean sounds reasonable to do
Like doesn't hurt anything, but I don't think it is much of a gain either
Yeah, it was just something I stumbled into while looking at the llvm-upgrade PR and thought it would be better to fix in main and then merge. But I might leave it for a later time and not get too distracted.
i think for local crates it doesn’t matter. there aren’t going to be two local crates of the same name. I think this is very useful for 3p dependencies though so you have one version across the board.
Luke Boswell said:
I didn't know you could use workspace paths for our own crates... I thought it was only possible for external packages.
yeah I found about this at Zed. I really like it!
I'd like to have it for all our local crates, so we don't have to get all the ..
s right and so forth
I don't think it's urgent or anything, which was why I figured I'd just introduce it with the soa
crate and start doing it, then figured eventually we'd convert over the existing crates
but if you'd like to do a pass to make everything consistent, that seems fine to me!
Done https://github.com/roc-lang/roc/pull/7265
Last updated: Jul 06 2025 at 12:14 UTC