2

I've been trying to get the latest version of plutus on my project but I get the following error message when I run nix-shell:

error: attribute '8a20664f00d8f396920385947903761a9a897fe0' missing, at /nix/store/przi4l85b1yd1irwss0qnhg1lsw2925k-haskell.nix-src/modules/cabal-project.nix:118:37

In the cabal.project file, I made the change of the tag from:

-- Plutus revision from 2021/06/11
source-repository-package
  type: git
  location: https://github.com/input-output-hk/plutus.git
  subdir:
    freer-extras
    playground-common
    plutus-core
    plutus-contract
    plutus-ledger
    plutus-ledger-api
    plutus-tx
    plutus-tx-plugin
    plutus-pab
    plutus-use-cases
    prettyprinter-configurable
    quickcheck-dynamic
    word-array
  tag: plutus-starter-devcontainer/v1.0.6

to the latest plutus tag, which is currently 8a20664f00d8f396920385947903761a9a897fe0

The line (118) the error refers to in cabal.project.nix is as follows:

then { location, tag, ...}: config.sha256map.${location}.${tag}

OR

    lookupSha256 = mkOption {
      type = nullOr unspecified;
      default = if config.sha256map != null
        then { location, tag, ...}: config.sha256map.${location}.${tag} -- <- Error here
        else _: null;
    };

Could someone kindly point me in the right direction on how to fetch the latest version from the plutus repo?

1 Answer 1

0

I was able to fix the problem by copying the content of cabal.project from one of the latest examples in the plutus pioneer program to the cabal.project file of my own project - while ensuring that the index-state is left out.

Copying the content of the file also requires that I update nix/pkgs/haskell/haskell.nix with the latest tags of the source-repository-packages in the cabal.project file and their corresponding sha256 hashes (this is gotten from running nix-shell --show-trace repeatedly and observing the error messages for wrong expected sha256 hash)

    sha256map = {
      ...
      "https://github.com/Quid2/flat.git"."95e5d7488451e43062ca84d5376b3adcc465f1cd" = "06l31x3y93rjpryvlxnpsyq2zyxvb0z6lik6yq2fvh36i5zwvwa3";
      "https://github.com/input-output-hk/plutus.git"."2f11c28bd8f6d630daab582255e16d8408075bd7" = "0sh4mfsanvdg43qhq321v24vamrw7nzc6gpjb0d34nyrq2lw55wj";
      "https://github.com/shmish111/purescript-bridge.git"."6a92d7853ea514be8b70bab5e72077bf5a510596" = "13j64vv116in3c204qsl1v0ajphac9fqvsjp7x3zzfr7n7g61drb";
      ...
    }

Afterwards, I ran cabal update and replaced the new index state on the cabal.project file with the new index state generated by cabal and running nix-shell works, finally!

1
  • 1
    Hopefully someone finds or makes a better way...
    – ZachSweet
    Sep 10, 2021 at 23:51

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.