-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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
Cross-compiling Nix to aarch64-darwin fails with infinite recursion #126829
Comments
Seems to be related to |
Minimal reproducer for this seems to be |
My current theory is that |
I wonder if it's somehow related to #49526 (although I imagine python3 uses callPackage). |
It does seem like the usage of pkgsCross.aarch64-darwin.buildPackages.callPackage ({ openssl }: openssl) { } |
cc @thefloweringash as this once must have worked due to how bootstrap files were generated. |
My current theory as to why this happens is the following (read
If you set Note that if this is indeed how this happens, we have to rethink stuff like dynamically deciding |
stdenv depends on openssl, and isGNU depends on stdenv. Thanks-to: sternenseemann <[email protected]> Fixes: NixOS#126829
stdenv depends on openssl, and isGNU depends on stdenv. Thanks-to: sternenseemann <[email protected]> Fixes: #126829 (cherry picked from commit 502de3c)
When evaluating $ nix-instantiate -A pkgsCross.aarch64-darwin.hello --show-trace
error: while evaluating the attribute 'stdenv' of the derivation 'hello-aarch64-apple-darwin-2.10' at /home/lukas/src/nix/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:201:11:
while evaluating the attribute 'defaultBuildInputs' of the derivation 'stdenv-linux' at /home/lukas/src/nix/nixpkgs/pkgs/stdenv/generic/default.nix:93:14:
while evaluating the attribute 'disallowedRequisites' of the derivation 'apple-framework-CoreFoundation-11.0.0' at /home/lukas/src/nix/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:201:11:
while evaluating the attribute 'nativeBuildInputs' of the derivation 'MacOSX-SDK-11.0.0' at /home/lukas/src/nix/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:201:11:
while evaluating the attribute 'buildInputs' of the derivation 'pbzx-1.0.2' at /home/lukas/src/nix/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:201:11:
while evaluating the attribute 'buildInputs' of the derivation 'xar-1.6.1' at /home/lukas/src/nix/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:201:11:
while evaluating the attribute 'buildInputs' of the derivation 'libxml2-2.9.12' at /home/lukas/src/nix/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:201:11:
while evaluating the attribute 'postPatch' of the derivation 'python3-3.8.9' at /home/lukas/src/nix/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:201:11:
while evaluating 'spliceReal' at /home/lukas/src/nix/nixpkgs/pkgs/top-level/splice.nix:28:16, called from /home/lukas/src/nix/nixpkgs/pkgs/top-level/splice.nix:72:65:
while evaluating 'tryGetOutputs' at /home/lukas/src/nix/nixpkgs/pkgs/top-level/splice.nix:63:25, called from /home/lukas/src/nix/nixpkgs/pkgs/top-level/splice.nix:78:30:
while evaluating 'getOutputs' at /home/lukas/src/nix/nixpkgs/pkgs/top-level/splice.nix:66:22, called from /home/lukas/src/nix/nixpkgs/pkgs/top-level/splice.nix:65:12:
while evaluating 'genAttrs' at /home/lukas/src/nix/nixpkgs/lib/attrsets.nix:313:21, called from /home/lukas/src/nix/nixpkgs/pkgs/top-level/splice.nix:66:29:
while evaluating 'optionalAttrs' at /home/lukas/src/nix/nixpkgs/lib/attrsets.nix:353:25, called from /home/lukas/src/nix/nixpkgs/pkgs/top-level/splice.nix:65:24:
while evaluating the attribute 'bash' at /home/lukas/src/nix/nixpkgs/pkgs/top-level/all-packages.nix:10248:3:
while evaluating 'addMetaAttrs' at /home/lukas/src/nix/nixpkgs/lib/meta.nix:15:28, called from /home/lukas/src/nix/nixpkgs/pkgs/top-level/all-packages.nix:10248:10:
while evaluating 'callPackageWith' at /home/lukas/src/nix/nixpkgs/lib/customisation.nix:117:35, called from /home/lukas/src/nix/nixpkgs/pkgs/top-level/all-packages.nix:10248:19:
while evaluating 'makeOverridable' at /home/lukas/src/nix/nixpkgs/lib/customisation.nix:67:24, called from /home/lukas/src/nix/nixpkgs/lib/customisation.nix:121:8:
while evaluating anonymous function at /home/lukas/src/nix/nixpkgs/pkgs/shells/bash/4.4.nix:1:1, called from /home/lukas/src/nix/nixpkgs/lib/customisation.nix:69:16:
while evaluating the attribute 'cc.bintools' at /home/lukas/src/nix/nixpkgs/pkgs/stdenv/generic/default.nix:166:14:
while evaluating the attribute 'llvmPackages.clang' at /home/lukas/src/nix/nixpkgs/pkgs/development/compilers/llvm/11/default.nix:107:5:
while evaluating the attribute 'libstdcxxClang' at /home/lukas/src/nix/nixpkgs/pkgs/development/compilers/llvm/11/default.nix:109:5:
while evaluating 'wrapCCWith' at /home/lukas/src/nix/nixpkgs/pkgs/top-level/all-packages.nix:12091:5, called from /home/lukas/src/nix/nixpkgs/pkgs/development/compilers/llvm/11/default.nix:109:22:
while evaluating 'callPackageWith' at /home/lukas/src/nix/nixpkgs/lib/customisation.nix:117:35, called from /home/lukas/src/nix/nixpkgs/pkgs/top-level/all-packages.nix:12105:7:
while evaluating 'makeOverridable' at /home/lukas/src/nix/nixpkgs/lib/customisation.nix:67:24, called from /home/lukas/src/nix/nixpkgs/lib/customisation.nix:121:8:
while evaluating anonymous function at /home/lukas/src/nix/nixpkgs/pkgs/build-support/cc-wrapper/default.nix:8:1, called from /home/lukas/src/nix/nixpkgs/lib/customisation.nix:69:16:
while evaluating the attribute 'installPhase' of the derivation 'libSystem-11.0.0' at /home/lukas/src/nix/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:201:11:
infinite recursion encountered, at undefined position Not sure how big the impact of this is in practice, but I fear this points at a fundamental risk to evaluation of cross package sets posed by the openssl derivation in its current form. |
Refs #66851 |
I marked this as stale due to inactivity. → More info |
Ping @Ericson2314,
|
@pwaller There is no real solution afaik, since cross wouldn't work from This issue is mostly about a nice to have cleanup of the darwin stdenv bootstrapping. |
#346043 only fixes the infinite recursion aspect, there are still many packages which cannot compile, which means this issue isn't really fully resolved as proper cross-compiling support from While I agree it's a tough problem to solve, projects like https://github.com/tpoechtrager/osxcross prove that it is possible, and I think it'd be awesome for Nixpkgs to have support too. It'd be pretty much all wins and no losses, of course with the exception of the initial hurdle to overcome. EDITAn example to see what I mean (pinned to current staging-next): $ nix build --impure --expr '(import (builtins.getFlake "github:NixOS/nixpkgs?rev=6968567d601da88ff67834173c9384f7a7be3d3d") { localSystem = "x86_64-linux"; crossSystem = "x86_64-darwin"; }).hello'
|
Using Nix from master for better traceback:
The text was updated successfully, but these errors were encountered: