Examples of enhancing crane for larg and compex projects #401
dpc
started this conversation in
Show and tell
Replies: 1 comment 3 replies
-
One thing I've been thinking about is introducing something like That might be a good middle ground for introducing extra things like that! |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi @ipetkov
In flakebox I'm going to work on bringing some abstractions and functionality that would make it easier to replicate the really nice dev shell / CI setup we have in Fedimint. And I want everyone (Rust + Nix project) to learn love and use it.
One thing I had to add is "enhanced crane":
https://github.com/rustshop/flakebox/blob/233129a439d5f5eb8cb3ba4e996355d71483ac0e/lib/crane/enhance.nix#L1
As you can see I've added the the "commonArgs" support I described before
. I named it just
args
here.This allows me to build all sorts of abstractions like "map over all relevant profiles" or "map over some cross compilation targets".
With a bit of these things composed I can now easily do things like:
which is very handy e.g. for running the CI with some build-time-optimized
ci
profile while retaining the ability to generate release binaries, etc.I also added the
buildWorkspaceDepsOnly
,buildWorkspace
, andbuildCommand
. These are meant to handle workflows for larger projects, like described in #396 .I just wanted to show you what I'm aiming at. Most projects nowadays just have one derivation in release build and waste time and space, but not mind it too much. This really breaks down in a compilation-heavy language like Rust very quick as the size of the project grows.
I wish some of this was built-in into crane. I don't think it's a lot of code or even complexity, and it would really help the users if they didn't have to be aware that Flakebox's has a hacked
craneLib
version and some of this stuff will not work with plancraneLib
, or will not match the documentation. I would rather point users of fakebox to crane's documentation for details.I would rather focus in Fakebox on other stuff (loops over profiles, over toolchains, cross-compilation, etc.). Stuff that is out of scope for craneLib as it integrates it with other pieces.
I'm not planning to ask for more complexity later. I think "common args" and some some basic extra commands are all that is really needed.
Beta Was this translation helpful? Give feedback.
All reactions