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

feat: adding pkgs support for cross-compilation #161

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

SilentVoid13
Copy link
Contributor

@SilentVoid13 SilentVoid13 commented Jun 30, 2024

closes #160.

This should not introduce any breaking changes, we can now pass a buildInputs and nativeBuildInputs lambda to craneMultiBuild that we get resolved in mkStdToolchains and ultimately passed to craneLib in mkFenixToolchain.

EDIT: I just realized my new commits were also forwarded to this PR, they basically add new targets (linux musl variants + windows64 with mingw).

lib/mkStdTargets.nix Outdated Show resolved Hide resolved
lib/craneMultiBuild.nix Outdated Show resolved Hide resolved
@@ -30,6 +30,7 @@ in
, clang-unwrapped ? defaultClangUnwrapped
, stdenv ? defaultStdenv
, isLintShell ? false
, craneArgs ? { }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this really needed? I thought we'd just modify mergeArgs to scan through buildInputs and buildNativeInputs and apply pkgs over functions there.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did try the mergeArgs route but it was a pain passing the buildInputs and nativeBuildInputs across different targets.
Resolving the packages as early as possible to pass it directly to mkFenixToolchain ended up working smoothly

@dpc
Copy link
Contributor

dpc commented Jul 1, 2024

We'll need tests in ./checks that make sure it works. But right now that craneArgs looks off to me.

@SilentVoid13
Copy link
Contributor Author

Got it, thanks for the review. I did not manage to get mergeArgs to work but I'm fairly new to writing nix

@SilentVoid13
Copy link
Contributor Author

Hey @dpc, coming back to this PR

  • just pushed some tests for cross-compilation on new targets
  • suppressed cross pkgs for android targets since most packages look broken (e.g. openssl)
  • updated clang to version 17 since it looks like this is the version that is picked up now with clang-unwrapped

Tell me if there are still blockers to merge this

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

Successfully merging this pull request may close these issues.

true cross-compilation?
2 participants