-
Notifications
You must be signed in to change notification settings - Fork 92
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
Add buildWorkspace #180
Comments
Hi @sellout thanks for the report! Let me ask a bit more concretely: what potential advantages would you be interested in seeing from From the perspective of organizing derivations and their outputs I could see the advantage of being able to select a specific "output" of the workspace (I know
Where i do see a stronger motivator for I've had some ideas for implementing something like this. I think the basic approach would be using something like |
So, I could be off the mark here, but here’s what I’m thinking. First, I mostly build libraries, so the flake is largely for developer/CI consistency and efficiency. So yeah, my use case is basically what you state in the second part. I do something similar for other projects. Here is a Haskell example, with less automation than Crane provides: https://github.com/con-kitty/concat/blob/506a9461079fa407df4b81f4d1bb00f84671e7f0/flake.nix Line 30 processes the “cabal.project” file, which has a
An extension of the incremental build/caching is that the separate packages are great to have for garnix to get fine-grained CI failure reporting. About the first part – you’re right, that’s a tough and frustrating problem. Our Haskell solution is hacky, and I was thinking Crane’s could be at least less hacky (but I’m only guessing, I don’t know cargo tooling at all). It sounds like cargo-guppy could do one better than a topological sort, and give you the exact set of direct dependencies that intersect with In Haskell we just depend on the |
It might be related and/or helpful. In the project I'm using crane for heavily, we have both package-based outputs, and workspace-based outputs. Workspace ones are used for CI, where we quickly and robustly try to build/test everything in aggregate. Packages are useful for OCI containers, or when building things for architectures (like WASM) where not all the code can even compile. Notably, in package builds, we also list all the directories that are actually being used, to help the caching and avoiding rebuild (at the cost of having to manually maintain these lists). |
hi! I came here to say that I found this explanation for why the feature doesn't exist (yet) to be useful and think it should make its way into the documentation. I think that officially documenting the reasoning here would be worthwhile even if the feature is ultimately added, since it would clarify the relationship between the two functions. |
I’m not sure if this is a good idea, but if not I’d like to hear what the best alternative is (explicit separate
buildPackage
for each lib in the workspace?)In any case, I want roughly
where
buildWorkspace
produces an attrset of packages, one per package in the workspace. And the attrs passed tobuildWorkspace
are propagated to the individual packages. Although maybe it makes sense to put propagated attrs in a single attr, so otherbuildWorkspace
attrs (like, maybe anexclude
list or something) can be provided without conflicting or being propagated.I’m still on the steep part of the learning curve for both Nix and Rust, so I’m as interested in arguments against this as I am in seeing it done.
The text was updated successfully, but these errors were encountered: