-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
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
very WIP solo5: 0.6.9 -> 0.7.0 #153204
base: master
Are you sure you want to change the base?
very WIP solo5: 0.6.9 -> 0.7.0 #153204
Conversation
This can be useful for "toolchain-style" packages which don't let us set a custom prefix.
Actually, it would be nice to provide a basic libc for linking with Solo5 unikernels. |
Upstream was adamant that there is no such thing, but I believe there is a subset of one bundled with |
FWIW I can build Nim programs for Solo5 (without a libc). It's not upstream but obviously I'd like to build services that I can use with NixOS. |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
I want to keep this around since it implements a solo5 cross infra which we still don't have. |
Motivation for this change
Mainly opening this, so we don't duplicate the effort accidentally. My goal is to have
pkgsCross.{aarch64,x86_64}-solo5
in the end which just work™ for packages that support it. Specifically, the ocaml compiler in these sets could then automatically switch toocaml-freestanding
and we may even be able to have a proper package sets for MirageOS unikernels…However, there are currently a few problems:
solo5
has chosen{aarch64,x86_64}-solo5-none-static
as its configuration which we would translate to{aarch64,x86_64}-solo5-none
since the link type is stored independently from the platform string for us (Alternatively{aarch64,x86_64}-solo5-none-elf
would be more in line with our other "embedded" platforms, however autotools does not like this string at all and I am relatively sure that the embeddedconfig
s we pass currently work more by accident). The vendor is enough to throw binutils off and stop it from compiling (I have no clue about gcc as it's not possible to compile without a target libc atm). LLVM swallows the target, but behaves weirdly, insisting on usinggcc
for linking despite-fuse-ld
being passed. Since solo5's toolchain is intended as a bunch of wrapper scripts around a normal linux toolchain you already have, there seems little interest from their side to upstream this into autotools, binutils, LLVM, ... which is annoying, because it means, in order to build the toolchain, we have to configure parts of it with different triples thantargetPlatform.config
.A related problem is that the config string is not configurable in solo5's configure script, so we'll have to patch that in eventually.
build == host == target
, but supportsbuild == host != target
theoretically. The later case is more or less broken withclang
however which is the only real option for us atm (it basically ignores that clang is multi target and will never pass-target
to it).cc-wrapper
) or the unwrapped compiler. The latter is the better choice in general (I think at least), but unfortunately quite tricky to implement, because everything mashed together into a single build: solo5 specific bintools, solo5 toolchain wrappers, solo5 runtime libs etc. Untangling this will probably require quite a bit of patching.These are just a few notes and may be out of date quite quickly when I continue working on this. The current state is quite hacky, but sort of works: the "native" toolchain
pkgs.solo5-toolchain
works from what I can tell, the cross onepkgsCross.aarch64-solo5
works but chokes on linking which I currently would attribute to some flags getting passed tolld
which shouldn't, but I still need to confirm this theory.Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)nixos/doc/manual/md-to-db.sh
to update generated release notes