Conversation
Signed-off-by: r4v3n6101 <raven6107@gmail.com>
There was a problem hiding this comment.
This should be outside of the Microkit repo, just like microkit-manifest is outside of it. Maybe in microkit-manifest, maybe not, but definitely not here. You don't want to commit hashes and shas, that's unmaintainable, except if it happens automatically on release.
I think some other people already made Nix packages for seL4 and/or Microkit, but I don't know if they shared it. The problem is maintaining it, someone has to do that somewhere. Are you volunteering?
|
Yeah, I use Nix and for sDDF we have a package in the repo that downloads the SDK (building from source is too slow). Package definitions should belong with the distro or dependendants, otherwise we must maintain every distro. The intended distribution model is as an SDK (at least until we decide otherwise). #420 I sketched out a distro package for Fedora. I think it would be neat for us to maintain dnf/apt/etc repos. But I'm not sure how useful it is if you need specific versions of the SDK for different projects and being tied to system-wide updates. |
|
Thanks for the feedback. I initially put this here because the repository already has Nix flakes support, and keeping the SDK package alongside seemed convenient to me. I made the package read the seL4 revision from the XML in After considering your comments, I agree that keeping the package outside this repo makes sense. I’m willing to take this work to If you decide to revisit packaging here in the future, I’d be very happy to help and pick up the work again. For now, I’m fine with leaving this PR on hold, marking it as Draft or even closing it. |
That shouldn't be there either I think. But what's there is at least self-contained I think, and if it's actively used, then it's maintained by someone. It says it's "A flake for building microkit", that being here makes some sense, but it's unclear to me how your new thing differs exactly, as it also seems to build Microkit instead of using the SDK. And if you do use the SDK, you don't need the microkit repo and then this is the wrong place. So the thing you added seems to handle a weird corner case where you want to use a specific SDK and build it from source, but then be able to do local modifications in only Microkit?
But
I'm fine if you tweak the existing Flake to add what you want (a package instead of a development shell?), but I don't think it should have hard-coded references to microkit-manifest or dependencies. All in all it does sound that you mostly want a Nix version of microkit-manifest, that's probably best in its own repository like microkit-manifest is. @wucke13, you're the Nix expert, what would you recommend? |
|
(Yes, I actively use and maintain the Nix flake for building Microkit, and it is used in CI. Once inside that development environment it's just one command to build) You don't even need a nix version of Microkit-manifest really - nix can just shell out to repo to fetch dependencies. In a distro environment, using our flake doesn't make sense since it wants a consistent set of build dependencies. In a user environment it makes more sense to distribute the prebuilt .tar.gz files (like we do for sDDF: https://github.com/au-ts/sddf/blob/43d5574d0939418b20b74d8fdd2637b1cd4a1c5d/flake.nix#L118), and for developing Microkit itself it makes no sense to use a Nix package because it always builds clean which takes 30 minutes. Unless there's some other use case I can't think of? |
To me the obvious use case would be to rebuild it with a custom kernel configuration, either because they want different seL4 config decisions, or add a @r4v3n6101, is |
Hi 👋, https://github.com/DLR-FT/seL4-nix-utils/ is fairly comprehensive (but due to time constraints usually lagging behind one or two minor releases).
Might I ask why you have to rebuild the sdk when you change a driver? The SDK should be first, hence you build it once and be done with it. Other than that, yes, the SDK building process of microkit is rather slow, in part due to being sequential; I think this is by design: the sdk is build seldomly; and sequential builds are easier to debug.
Please keep it that way, this is by far the easiest deployment model. Download a tar file full of statically linked binaries, prebuilt object code and a demo Makefil, done. This is peak packaging 😄. Practical, simple, universal.
Hit me up if you need a review. Also, this flake uses an external Rust toolchain, if you want to learn how to do it with in-house means, checkout my packaging of microkit. You will not get something upstreamed in nixpkgs that uses oxalica's overlay.
I gently disagree. If microkit, the repo, would expose a Nix package which builds the sdk, then for example for a feature branch you could litterally tell someone to So, there definitely is some merit to having it directly in the repo. However, hop via the manifest repo is quite ugly in that sense. I would prefer (and this is also what I'm doing in my repo) hardcoding the commit hash of the seL4 kernel. That makes the package truly self contained (at the cost of duplicating what is in the manifest).
It's not an XOR. If you have a packge For this reason I would actually like to see the microkit flake to expose only a package, instead of only a devShell, because the former automatically also becomes a devShell. But I do understand that this is a touch subject, and not everyone is keen on either having a reference to the -manifest repo or duplicating the seL4 commit id and tarball hash in the nix expressions. So take my point of view purely as a hypothetical; I'm not pushing for this; I would just prefer it all things equal.
IMHO that is fundamentally impossible. The sdk package would need seL4, so it needs to know which specific version. There is no way to get that except for either one of these:
My understanding is, that all three are disliked by the seL4 community...
Technically, this could be made part of the -manifest repo itself. There everything is local, and the manifest repo anyhow needs to be tagged with a version for each release; so automatically via that tag then also a nix expression would be available for each release. Technically, I think, that would be a compromise worth considering. Whether consensus for this could be found, well, that is not for me to answer 😄
Shameless self-plug: https://github.com/DLR-FT/seL4-nix-utils/blob/main/pkgs/fetch-google-repo-tool.nix I think, in particular for microkit, there is not a very strong use-case for Nix. The SDK is not, well, elegant, but it is practical, quick, just perfectly adequate. For other things, like the kernel itself, it makes more sense IMHO. Nix excels in letting downstream consumers override aspects of the upstream dependencies. This is also where we use the seL4-nix-utils most. But, all this makes only sense if technical ownership lays with someone from the inner circle; otherwise this is a frustration potential. With the devShell, this ownership seems to lay with @midnightveil . Would she be interested in stepping up from devShell to actual package, at the cost of one of the compromises I elaborated above? I'm open for discussion and also willing to hop on a call for anything Nix + seL4, but no need to push this more than desired by the inner circle. Take care 🙂 |
|
Yeah, I'm really not interested in having an extra source of truth for the seL4 version. We only just finally got back to having only one with the repo manifest :) (unfortunately)
We don't, it's just that if the first thing one had to do to use sDDF was compile Microkit it would be extremely unpleasant. So I'm opposed to binary-cache-less builds.
Yeah. I want to speed it up. I have a PR which #479 but it didn't actually help much. I think something like the output of What would help if we didn't have to rebuild most of rust-sel4 once per platform, it's the really slow part. 6 configs for 3 architectures (or maybe a few variants) is much more manageable than 6 configs for 3 boards. I have some other local patches to hide a local of seL4 config options and make it so the only differences in libsel4 occurs due to actually important things (e.g. s2_start_l1 or debug configs etc) which would help reduce (strip plat-specifics then collate by general option sets). Butttt.... It looks like a generic AArch64 seL4 is wanted and so that will be noce too.--- (We should probably consider using the nixpkgs rust toolchain instead of oxalica.. but anyway) |
|
I’d actually forgotten about Regarding the long build times, I can’t really help with that yet, since I’m not familiar with the seL4 team’s build or dev process. One thing might be relevant to @midnightveil ’s point and it is that I made package.override { boards = [ "rpi4b_1gb" ]; }Personally, I’m using Microkit SDK for self-taught of a seL4 development process. I haven’t needed to modify Microkit itself yet, and all I used is the As I’m still fairly new to the seL4 ecosystem, I’d really appreciate your suggestions on what direction would make sense for this PR and how it could be moved forward. |
General
Build
microkit-sdkincludingmicrokit-tool, docs (actually a manual), boards/configs as a Nix package using flakes.What's done
microkitcommand in theoutoutput, withMICROKIT_SDKset in a wrapper;docoutput;The package uses
build_sdk.pyand derives the seL4 revision from https://github.com/seL4/microkit-manifest repo.Why?
Just so you could run typing only
nix run github:seL4#microkit.UX for development process.