nix-overlays
nix-overlays copied to clipboard
Upstream cross-compilation support
It would be really great if Nixpkgs could cross-compile OCaml out of the box. What would need to happen to get the cross-compilation support from this overlay upstream? I would be willing to put work into this, but if you already have thought about what would need to happen it would be great to hear from you.
I agree this would be desirable to upstream. I haven't made many strides towards that however. Here's the current state of cross compilation support in this repo:
- changes live in the
cross/folder - the OCaml compiler needs a small patch + a custom build process which you can find here
- then we need to make the OCaml package set (esp. findlib) aware of the 2 toolchains (
buildPackagesand the cross-compilation environment). This is all done incross/ocaml.nix- IMO this is where most of the complexity lies: nixpkgs uses
OCAMLPATHto tell findlib about OCaml packages, but we need to actually write downfindlib.conffiles for both the build and cross toolchains.
- IMO this is where most of the complexity lies: nixpkgs uses
I hope the above information gives you something to start with. Feel free to reach out for more questions otherwise.