Skip to content
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

Upstream cross-compilation support #698

Open
alyssais opened this issue Mar 16, 2023 · 1 comment
Open

Upstream cross-compilation support #698

alyssais opened this issue Mar 16, 2023 · 1 comment

Comments

@alyssais
Copy link

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.

@anmonteiro
Copy link
Collaborator

anmonteiro commented Mar 19, 2023

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 (buildPackages and the cross-compilation environment). This is all done in cross/ocaml.nix
    • IMO this is where most of the complexity lies: nixpkgs uses OCAMLPATH to tell findlib about OCaml packages, but we need to actually write down findlib.conf files for both the build and cross toolchains.

I hope the above information gives you something to start with. Feel free to reach out for more questions otherwise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants