|
158 | 158 | ./package-lock.json |
159 | 159 | ]; |
160 | 160 | }); |
161 | | - # If you see 'ERROR: npmDepsHash is out of date' in ci |
162 | | - # set this to blank run ``nix build o1js#o1js-bindings` |
163 | | - # If you don't want to install nix you can also set it to "" and run ci to get the new hash |
164 | | - # You should get an output like this: |
165 | | - |
166 | | - # error: hash mismatch in fixed-output derivation '/nix/store/a03cg2az0b2cvjsp1wnr89clf31i79c1-o1js-npm-deps.drv': |
167 | | - # specified: sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= |
168 | | - # got: sha256-8EPvXpOgn0nvm/pFKN3h6EMjabOeBqfy5optIfe8E8Q= |
169 | | - # replace npmDepsHash bellow with the new hash |
170 | | - |
171 | | - npmDepsHash = "sha256-hFxCHth04vW95DJCTLHKV2N0v9NNQG57DpucsAq3yvs="; |
| 161 | + # If you get ERROR: npmDepsHash is out of date |
| 162 | + # you can update the hash with `nix run o1js#update-npm-deps`. |
| 163 | + # Failing that you can remove the hash from ./npmDepsHash and try again |
| 164 | + # which should get an error message with the correct hash |
| 165 | + # You can also just push and CI should suggest a fix which updates the hash |
| 166 | + npmDepsHash = builtins.readFile ./npmDepsHash; |
172 | 167 | # The prepack script runs the build script, which we'd rather do in the build phase. |
173 | 168 | npmPackFlags = [ "--ignore-scripts" ]; |
174 | 169 | dontNpmBuild = true; |
|
218 | 213 | # TODO build from ./ocaml root, not ./. (after fixing a bug in dune-nix) |
219 | 214 | packages = { |
220 | 215 | inherit dune-description; |
| 216 | + npm-deps = o1js-npm-deps; |
221 | 217 | o1js-bindings = pkgs.stdenv.mkDerivation { |
222 | 218 | name = "o1js_bindings"; |
223 | 219 | src = with pkgs.lib.fileset; |
|
286 | 282 | ocaml-js = prj.pkgs.__ocaml-js__; |
287 | 283 | }; |
288 | 284 | apps = { |
| 285 | + update-npm-deps = { |
| 286 | + type = "app"; |
| 287 | + program = "${pkgs.writeShellApplication |
| 288 | + { name = "update-npm-deps"; |
| 289 | + text = |
| 290 | + '' |
| 291 | + ${pkgs.prefetch-npm-deps}/bin/prefetch-npm-deps ./package-lock.json > npmDepsHash |
| 292 | + ''; |
| 293 | + }}/bin/update-npm-deps"; |
| 294 | + }; |
289 | 295 | update-bindings = { |
290 | 296 | type = "app"; |
291 | 297 | program = "${pkgs.writeShellApplication |
|
0 commit comments