Hey there, I have a question about cross-compilation with flakebox. It seems to work perfectly as long as you don't have any external pkgs dependencies.
If you do, you want to be using pkgsCross.<target> instead of pkgs for the buildInputs and nativeBuildInputs, but there are no easy way to specify that with flakebox's craneMultiBuild.
A hacky way to manually make it work for a target is to specify the target's pkgs in your flake with:
pkgs = import nixpkgs {
localSystem = "x86_64-linux";
crossSystem.config = "aarch64-unknown-linux-gnu";
};
To make the cross-compilation work, but of course this is now imposing the aarch64 pkgs on all targets, which is not the point.
Am I missing something or is that a limitation of flakebox?
I did take a look at flakebox's source to make it work, but it doesn't seem like a trivial change. My idea would be to accept a pkgsCross function for craneMultiBuild that would look like this:
nativeBuildInputs = pkgsCross: [
pkgsCross.openssl
pkgsCross.sqlite
];
This would somehow be forwarded to mkStdTargets where the correct pkgs would be resolved and later passed to mkTarget.
Thoughts about it?
Hey there, I have a question about cross-compilation with flakebox. It seems to work perfectly as long as you don't have any external pkgs dependencies.
If you do, you want to be using
pkgsCross.<target>instead ofpkgsfor thebuildInputsandnativeBuildInputs, but there are no easy way to specify that with flakebox'scraneMultiBuild.A hacky way to manually make it work for a target is to specify the target's pkgs in your flake with:
To make the cross-compilation work, but of course this is now imposing the
aarch64pkgs on all targets, which is not the point.Am I missing something or is that a limitation of flakebox?
I did take a look at flakebox's source to make it work, but it doesn't seem like a trivial change. My idea would be to accept a
pkgsCrossfunction forcraneMultiBuildthat would look like this:This would somehow be forwarded to
mkStdTargetswhere the correct pkgs would be resolved and later passed tomkTarget.Thoughts about it?