nix-community / yarn2nix

Generate nix expressions from a yarn.lock file [maintainer=???]
GNU General Public License v3.0
123 stars 61 forks source link

Cannot build project,hash mismatch #121

Open pasqui23 opened 4 years ago

pasqui23 commented 4 years ago

A project with the given package.json:

{
  "main": "index.js",
  "license": "MIT",
  "dependencies": {
    "@e-e-e/hyperchat": "^0.0.4",
    "TKEM": "https://github.com/bifurcation/treekem",
    "browserify": "^16.5.0"
  }
}

and default.nix:

with (import <nixpkgs> {});
with  pkgs.yarn2nix-moretea ;
rec {
  main = mkYarnPackage {
    name = "secureP2PSocialNet";
    src = ./.;
    packageJSON = ./package.json;
    yarnLock = ./yarn.lock;
    # NOTE: this is optional and generated dynamically if omitted
    # yarnNix = ./yarn.nix;
  };
}

Fails when build:

nix build -f .  main
hash mismatch in fixed-output derivation '/nix/store/0g7c9s9vg201pbqcwa4fs8l8w25mwcg8-https___github.com_bifurcation_treekem':
  wanted: sha1:f5cwb92i5dm0dz3iq9cd0hpm2mcgk6d7
  got:    sha1:4dh78rcb1v2qf7mfcl9zvlrgk8v7gg3r
cannot build derivation '/nix/store/h76zgak13z1x5nyvv8369nafik9558na-offline.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/1n3n7x4rqws846fa9dfavxp363b9s0rq-SecureP2PSocialNetworks-modules-1.0.0.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/gqkpqnr7ahklw65i9mgvhckl3l37qpr1-secureP2PSocialNet.drv': 1 dependencies couldn't be built
[6 built (1 failed), 2 copied (3.2 MiB), 0.4 MiB DL]
error: build of '/nix/store/gqkpqnr7ahklw65i9mgvhckl3l37qpr1-secureP2PSocialNet.drv' failed
pasqui23 commented 4 years ago

Note that it fails even after yarn upgrade

ebkalderon commented 4 years ago

Running into a similar issue with two different packages, this time with BitGo/blake2b:

hash mismatch in fixed-output derivation '/nix/store/0vww94ffar2cbnqbm3glzl96z9wknyfr-BitGo_blake2b':
  wanted: sha1:mkwfpcbyp5qr37imqjnf0qc6czfycs32
  got:    sha1:f4z1xx4ddwmgr959bsjy3pnbfjd9bhmk
hash mismatch in fixed-output derivation '/nix/store/38ablf4g3yqg595bd3ik5i404lq71zay-BitGo_blake2b_wasm':
  wanted: sha1:3c3qsxcvpckh6pdhi5znq6kccmqxng0r
  got:    sha1:1s2psljc6m4y1536j2imdrpffh6halfv
cannot build derivation '/nix/store/0dh2937ynvf1d44g6kj9s3yncmlhj6pa-offline.drv': 1 dependencies couldn't be built