1

I am seeing an error building Plutus-Apps on Mac M1.

After precisely following

https://github.com/renzwo/cardano-plutus-apps-install-m1/blob/main/README.md

UPDATE: This did resolve. These errors appears to be due to corrupted cache in nix store from download on in the cache itself.

as recommended here:

Building Plutus-apps on Mac M1

I get an Invalid File Descriptor error. Here are the logs

 copying path '/nix/store/lkbwcc0zyq9jzz8mk149rmfxw6ycl627-curl-7.81.0-dev' from  'https://hydra.iohk.io'...
 building '/nix/store/9z2bhjz6slfphlm4xbpkh9c0hzll46kh-source.drv'...

 ErrorErrorxexecuting '/nix/store/067f780bk90ghn7yhz914d5fykmll7a4-bash-5.1-p16/bin/bash': Bad file descriptor
 error: builder for '/nix/store/9z2bhjz6slfphlm4xbpkh9c0hzll46kh-source.drv' failed with exit code 1;
   last 2 log lines:
   > 
   > ErrorErrorxexecuting '/nix/store/067f780bk90ghn7yhz914d5fykmll7a4-bash-5.1-p16/bin/bash': Bad file descriptor
   For full logs, run 'nix log /nix/store/9z2bhjz6slfphlm4xbpkh9c0hzll46kh-source.drv'.
 (use '--show-trace' to show detailed location information)

here is full logs:

    nix log /nix/store/9z2bhjz6slfphlm4xbpkh9c0hzll46kh-source.drv
 ^A
 ^E^@^@^@^@^@^@^@Error^@^@^@^@^@^@^@^@^@^@^@^E^@^@^@^@^@^@^@Error^@^@^@x^@^@^@^@^@^@^@executing '/nix/store/067f780bk90ghn7yhz914d5fyk>
lines 1-2/2 (END)

Here is logs with full trace:

 deano@Ds-MacBook-Pro plutus-apps % nix-build --show-trace -A plutus- playground.server                         
 building '/nix/store/9z2bhjz6slfphlm4xbpkh9c0hzll46kh-source.drv'...

 ErrorErrorxexecuting '/nix/store/067f780bk90ghn7yhz914d5fykmll7a4-bash-5.1-p16/bin/bash': Bad file descriptor
 error: builder for '/nix/store/9z2bhjz6slfphlm4xbpkh9c0hzll46kh-source.drv' failed  with exit code 1;
   last 2 log lines:
   > 
   > ErrorErrorxexecuting '/nix/store/067f780bk90ghn7yhz914d5fykmll7a4-bash-5.1- p16/bin/bash': Bad file descriptor
   For full logs, run 'nix log /nix/store/9z2bhjz6slfphlm4xbpkh9c0hzll46kh-source.drv'.

    … while realising the context of path  '/nix/store/dv269kw7fp6y81n0k20w9s4a05s2z4f7-source'

   at /Users/deano/plutus/plutus-apps/default.nix:13:16:

       12| , sources ? import ./nix/sources.nix { inherit system; } //  sourcesOverride
       13| , haskellNix ? import sources.haskell-nix {
         |                ^
       14|     pkgs = import sources.nixpkgs { inherit system; };

   … while evaluating 'throwIfNot'

   at /nix/store/m2vv0bxfchzrjngx8wi0i7dhzb9q2g50-source/lib/trivial.nix:379:22:

      378|   */
      379|   throwIfNot = cond: msg: if cond then x: x else throw msg;
         |                      ^
      380|

   … from call site

   at /nix/store/m2vv0bxfchzrjngx8wi0i7dhzb9q2g50-source/pkgs/top-  level/default.nix:55:5:

       54|   checked =
       55|     throwIfNot (lib.isList overlays) "The overlays argument to nixpkgs   must be a list."
         |     ^
       56|     lib.foldr (x: throwIfNot (lib.isFunction x) "All overlays passed to nixpkgs must be functions.") (r: r) overlays

   … while evaluating anonymous lambda

   at /nix/store/m2vv0bxfchzrjngx8wi0i7dhzb9q2g50-source/pkgs/top-level/default.nix:19:1:

       18|
       19| { # The system packages will be built on. See the manual for the
         | ^
       20|   # subtle division of labor between these two `*System`s and the three

   … from call site

   at /nix/store/m2vv0bxfchzrjngx8wi0i7dhzb9q2g50-source/pkgs/top-   level/impure.nix:82:1:

       81|
       82| import ./. (builtins.removeAttrs args [ "system" ] // {
         | ^
       83|   inherit config overlays localSystem;

   … while evaluating anonymous lambda

   at /nix/store/m2vv0bxfchzrjngx8wi0i7dhzb9q2g50-source/pkgs/top- level/impure.nix:14:1:

       13|
       14| { # We put legacy `system` into `localSystem`, if `localSystem` was not   passed.
         | ^
       15|   # If neither is passed, assume we are building packages on the current

   … from call site

   at /Users/deano/plutus/plutus-apps/nix/default.nix:30:10:

       29|
       30|   pkgs = import sources.nixpkgs {
         |          ^
       31|     inherit crossSystem;

   … while evaluating the attribute 'pkgs'

   at /Users/deano/plutus/plutus-apps/nix/default.nix:44:10:

       43| {
       44|   inherit pkgs plutus-apps sources;
         |          ^
       45| }

And here is nix.conf

% cat /etc/nix/nix.conf

 build-users-group = nixbld
 substituters        = https://hydra.iohk.io    https://iohk.cachix.org https://cache.nixos.org/
 trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=  iohk.cachix.org-1:DpRUyj7h7V830dp/i6Nti+NEO2/nhblbov/8MW7Rqoo= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=

 system = x86_64-darwin
 extra-platforms = x86_64-darwin aarch64-darwin

 sandbox = false
 extra-sandbox-paths = /System/Library/Frameworks /System/Library/PrivateFrameworks /usr/lib /private/tmp /private/var/tmp /usr/bin/env
 experimental-features = nix-command
 extra-experimental-features = flakes

I tried increasing file limits ..

launchctl limit maxfiles
maxfiles    200000         200000   

But still get the error.

8
  • I did install GCH separately before but I don't think that should be a factor in running nix-shell or nix build
    – Deano
    Apr 26, 2022 at 13:51
  • No it does not affect at all because GHC comes with Nix. When you enter a in a shell you already have access to all plutus dependencies.
    – Igodlab
    Apr 26, 2022 at 19:22
  • [60 of 60] Compiling Blockfrost.API ( src/Blockfrost/API.hs, dist/build/Blockfrost/API.o, dist/build/Blockfrost/API.dyn_o ) error: builder for '/nix/store/zx91r06dgsdddrmd1gzpx2ckiaw9qf29-blockfrost-api-lib-blockfrost-api-0.3.1.0.drv' failed with exit code 1; last 10 log lines: > [51 of 60] Compiling Blockfrost.API.Cardano.Assets ( src/Blockfrost/API/Cardano/Assets.hs, dist/build/Blockfrost/API/Cardano/Assets.o, dist/build/Blockfrost/API/Cardano/Assets.dyn_o )
    – Deano
    Apr 26, 2022 at 20:03
  • both server and client compile ok now. I suspect that was corrupted download of cache or corrupted cache. But now I get above error during nix-shell run
    – Deano
    Apr 26, 2022 at 20:04
  • I think these errors are from corrupt download of cache but not sure.
    – Deano
    Apr 26, 2022 at 20:14

1 Answer 1

0

You may want to try to follow the guide for Mac M1 here:

https://plutus-community.readthedocs.io/en/latest/#Environment/Build/Mac_M1/

9
  • I am following that. And the errors above are not now appearing. The nix-build of server and client worked ok after rerunning a few times. However the step of running nix-shell is now giving an error.
    – Deano
    Apr 26, 2022 at 19:39
  • error is [60 of 60] Compiling Blockfrost.API ( src/Blockfrost/API.hs, dist/build/Blockfrost/API.o, dist/build/Blockfrost/API.dyn_o ) error: builder for '/nix/store/zx91r06dgsdddrmd1gzpx2ckiaw9qf29-blockfrost-api-lib-blockfrost-api-0.3.1.0.drv' failed with exit code 1; last 10 log lines: > [51 of 60] Compiling Blockfrost.API.Cardano.Assets ( src/Blockfrost/API/Cardano/Assets.hs, dist/build/Blockfrost/API/Cardano/Assets.o, dist/build/Blockfrost/API/Cardano/Assets.dyn_o )
    – Deano
    Apr 26, 2022 at 20:05
  • The previous errors with file descriptors I suspect are from corrupt download of cache or corrupt cache.
    – Deano
    Apr 26, 2022 at 20:06
  • 60 of 60] Compiling Blockfrost.API ( src/Blockfrost/API.hs, dist/build/Blockfrost/API.o, dist/build/Blockfrost/API.dyn_o ) error: builder for '/nix/store/zx91r06dgsdddrmd1gzpx2ckiaw9qf29-blockfrost-api-lib-blockfrost-api-0.3.1.0.drv' failed with exit code 1; last 10 log lines:
    – Deano
    Apr 26, 2022 at 20:08
  • > [60 of 60] Compiling Blockfrost.API ( src/Blockfrost/API.hs, dist/build/Blockfrost/API.o, dist/build/Blockfrost/API.dyn_o ) For full logs, run 'nix log /nix/store/zx91r06dgsdddrmd1gzpx2ckiaw9qf29-blockfrost-api-lib-blockfrost-api-0.3.1.0.drv'. error: 1 dependencies of derivation '/nix/store/a45kgfid8c37ika0bx6f6dy6hrlya168-blockfrost-client-core-lib-blockfrost-client-core-0.2.0.0-config.drv' failed to build error: 1 dependencies of derivation '/nix/store/j7rszs8r90643v61cv430fp21z8n9456-blockfrost-client-core-lib-blockfrost-client-core-0.2.0.0.drv' failed to build
    – Deano
    Apr 26, 2022 at 20:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.