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

Error while building Plutus Core with Nix - "cannot coerce null to a string" #3675

Closed
2 of 4 tasks
hexrcs opened this issue Aug 3, 2021 · 5 comments
Closed
2 of 4 tasks
Labels

Comments

@hexrcs
Copy link

hexrcs commented Aug 3, 2021

Area

  • Plutus Foundation Related to the GHC plugin, Haskell-to-Plutus compiler, on-chain code
  • Plutus Application Framework Related to the Plutus application backend (PAB), emulator, Plutus libraries
  • Marlowe Related to Marlowe
  • Other Any other topic (Playgrounds, etc.)

Summary

I'm trying to build Plutus on an M1 mac, but encountered the following error.

error: cannot coerce null to a string, at /nix/store/sdjxjsd5phr225rs2qzklj2xci0c9gr0-source/pkgs/stdenv/generic/make-derivation.nix:192:19

This is my first time using Nix. It seems that there's a bug in the make-derivation.nix. That line specifically is name = "${attrs.pname}-${attrs.version}";. Maybe attrs was null?

Steps to reproduce

Steps to reproduce the behavior:

  1. Install nix with this command sh <(curl -L https://nixos.org/nix/install) --darwin-use-unencrypted-nix-store-volume
  2. Make a new file at /etc/nix/nix.conf, and add the following to use the cache to save time
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=

sandbox = true
extra-sandbox-paths = /System/Library/Frameworks /System/Library/PrivateFrameworks /usr/lib /private/tmp /private/var/tmp /usr/bin/env
  1. Restart the computer
  2. Clone the Plutus repo git clone https://github.com/input-output-hk/plutus.git
  3. Navigate into the root of ./plutus
  4. Run nix build -f default.nix plutus.haskell.packages.plutus-core.components.library

Expected behavior

Build should go through successfully.

System info (please complete the following information):

  • OS: MacOS (M1 Apple Silicon)
  • OS Version: Big Sur 11.5.1
  • nix --version: nix (Nix) 2.3.15
  • Plutus version or commit hash: a2ce648

Screenshots and attachments

Running the nix build command again with --show-trace:

image

The line where the error got thrown:

image

Additional context

When running the nix build command on Plutus for the first time, Nix downloaded 20.7MiB of data.

@hexrcs hexrcs added the bug label Aug 3, 2021
@ak3n
Copy link
Contributor

ak3n commented Aug 3, 2021

Thanks for the issue!

Unfortunately, the nix support for m1 macs is new at the moment and is available only in newer nixpkgs. Plutus uses the older and more stable version.

I don't think it will be fixed in the near future. Such things take time to update and upgrade. Even if you will make it work somehow, you will lack a lot of cached packages (because of different nixpkgs versions).

@hexrcs
Copy link
Author

hexrcs commented Aug 3, 2021

Thanks for the issue!

Unfortunately, the nix support for m1 macs is new at the moment and is available only in newer nixpkgs. Plutus uses the older and more stable version.

I don't think it will be fixed in the near future. Such things take time to update and upgrade. Even if you will make it work somehow, you will lack a lot of cached packages (because of different nixpkgs versions).

I see, thank you for the reply! I will leave this issue open in case someone has a comprehensive solution in the future.

@ak3n
Copy link
Contributor

ak3n commented Aug 3, 2021

You may try to disable the sandbox: sandbox = false or other notes from https://docs.plutus-community.com/docs/setup/MacOS.html

@hexrcs
Copy link
Author

hexrcs commented Aug 3, 2021

@ak3n Thanks, I'll try again, but I remember I used unstable + didn't disable sandbox, which was also not working, so I enabled it. Hope it works.

@michaelpj
Copy link
Contributor

Closing as stale.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants