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

Can't build local-cluster on Apple M1 / aarch64-darwin #167

Open
aljosa opened this issue Dec 16, 2022 · 2 comments
Open

Can't build local-cluster on Apple M1 / aarch64-darwin #167

aljosa opened this issue Dec 16, 2022 · 2 comments

Comments

@aljosa
Copy link

aljosa commented Dec 16, 2022

When I clone the repo (commit 7f2d59) and I try to build on macbook pro (Apple M1 Max) I get this error:

$ nix build .#plutip:exe:local-cluster
error: flake 'git+file:///Users/aljosa/plutip' does not provide attribute 'packages.aarch64-darwin.plutip:exe:local-cluster', 'legacyPackages.aarch64-darwin.plutip:exe:local-cluster' or 'plutip:exe:local-cluster'
@aljosa
Copy link
Author

aljosa commented Dec 17, 2022

I've tried just adding the system:

$ git diff
diff --git a/flake.nix b/flake.nix
index c117ade..899cfae 100644
--- a/flake.nix
+++ b/flake.nix
@@ -17,7 +17,7 @@
   outputs =
     { self, bot-plutus-interface, nixpkgs, haskell-nix, iohk-nix, ... }@inputs:
     let
-      defaultSystems = [ "x86_64-linux" "x86_64-darwin" ];
+      defaultSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-darwin" ];

       perSystem = nixpkgs.lib.genAttrs defaultSystems;

but the build still failed:

nix build .#plutip:exe:local-cluster
warning: Git tree '/Users/aljosa/plutip' is dirty
[35.1 MiB DL]

trace: To make project.plan-nix for plutip a fixed-output derivation but not materialized, set `plan-sha256` to the output of the 'calculateMaterializedSha' script in 'passthru'.
trace: To materialize project.plan-nix for plutip entirely, pass a writable path as the `materialized` argument and run the 'updateMaterialized' script in 'passthru'.
[1/142/731 built, 418 copied (1729.1 MiB), 596.4 MiB DL] building ghc-8.10.7 (buildPhase): "inplace/bin/ghc-stage1" -hisuf hi

[1/142/731 built, 418 copied (1729.1 MiB), 596.4 MiB DL] building ghc-8.10.7 (buildPhase):      - Module.holeUnitId

error: builder for '/nix/store/11w2dbc4smn5wk8m1cwmqhwij56vbi36-scrypt-lib-scrypt-0.5.0.drv' failed with exit code 1;
       last 10 log lines:
       > /nix/store/qc4fzcja2bs760vsqcsc6v28imjwy0wi-clang-wrapper-11.1.0/resource-root/include/mmintrin.h:525:12: error:
       >      error: invalid conversion between vector type '__m64' (vector of 1 'long long' value) and integer type 'int' of different size
       >         return (__m64)__builtin_ia32_psubw((__v4hi)__m1, (__v4hi)__m2);
       >                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       >     |
       > 525 |     return (__m64)__builtin_ia32_psubw((__v4hi)__m1, (__v4hi)__m2);
       >     |            ^
       > fatal error: too many errors emitted, stopping now [-ferror-limit=]
       > 20 errors generated.
       > `clang' failed in phase `C Compiler'. (Exit code: 1)
       For full logs, run 'nix log /nix/store/11w2dbc4smn5wk8m1cwmqhwij56vbi36-scrypt-lib-scrypt-0.5.0.drv'.
error: 1 dependencies of derivation '/nix/store/g3qa4xpwa7yy4frl9badw4q9v9bgd59n-cardano-wallet-core-lib-cardano-wallet-core-2022.7.1-config.drv' failed to build
error: 1 dependencies of derivation '/nix/store/122w813h0w6ax6vv5yp2gmc1gl6j75in-cardano-wallet-core-lib-cardano-wallet-core-2022.7.1.drv' failed to build
error: 1 dependencies of derivation '/nix/store/fww6kpyzb55aj06zwz7wjxp5hzdy6v4i-plutip-lib-plutip-0.2-config.drv' failed to build
error: 1 dependencies of derivation '/nix/store/dlzl67xscd8qcf2dkwbmy69rj9c26sma-plutip-lib-plutip-0.2.drv' failed to build
error (ignored): error: cannot unlink '/private/tmp/nix-build-prettyprinter-lib-prettyprinter-1.7.1.drv-0/prettyprinter-1.7.1': Directory not empty
error: 1 dependencies of derivation '/nix/store/w36k7jbigxm1ir162ml76wrk4ink0v2v-plutip-exe-local-cluster-0.2.drv' failed to build

@szg251
Copy link
Collaborator

szg251 commented Dec 21, 2022

building ghc-8.10.7 is suspicious to me, maybe we can circumvent the problem by using the nix binary caches.
Unfortunately the branch is still using our own fork of haskell.nix, making the iohk caches useless.
We already have an upgrade in progress, using the upstream haskell.nix, but it's still unfinished... (it is working with CTL, but tests are failing, and with the lack of funding, no one has started working on a fix yet)
#164

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