Public
Authored by FAURE Adrien

NUR update script

When calling the update script from NUR bin/nur update which shoud contruct the json.lock files. The script fails:

INFO:nur.update:Evaluate repository kapack
error: while evaluating 'callPackage' at /nix/store/2dr0ri39sq8nzpyiax1q2i7hj4rydr7g-source/default.nix:24:24, called from /nix/store/2dr0ri39sq8nzpyiax1q2i7hj4rydr7g-source/default.nix:192:19:
while evaluating 'check' at /nix/store/2dr0ri39sq8nzpyiax1q2i7hj4rydr7g-source/default.nix:27:11, called from /nix/store/2dr0ri39sq8nzpyiax1q2i7hj4rydr7g-source/default.nix:24:34:
while evaluating 'test' at /nix/store/2dr0ri39sq8nzpyiax1q2i7hj4rydr7g-source/default.nix:30:12, called from /nix/store/2dr0ri39sq8nzpyiax1q2i7hj4rydr7g-source/default.nix:37:12:
while evaluating 'makeC' at /nix/store/2dr0ri39sq8nzpyiax1q2i7hj4rydr7g-source/default.nix:29:17, called from /nix/store/2dr0ri39sq8nzpyiax1q2i7hj4rydr7g-source/default.nix:31:8:
attribute 'meta' missing, at /nix/store/2dr0ri39sq8nzpyiax1q2i7hj4rydr7g-source/default.nix:37:17
Traceback (most recent call last):
  File "bin/nur", line 12, in <module>
    main()
  File "/home/adfaure/Projects/NUR/nur/__init__.py", line 58, in main
    args.func(args)
  File "/home/adfaure/Projects/NUR/nur/update.py", line 81, in update_command
    update(repo)
  File "/home/adfaure/Projects/NUR/nur/update.py", line 68, in update
    eval_repo(repo, repo_path)
  File "/home/adfaure/Projects/NUR/nur/update.py", line 60, in eval_repo
    raise EvalError(f"{repo.name} does not evaluate:\n$ {' '.join(cmd)}")
nur.error.EvalError: kapack does not evaluate:
$ nix-env -f /run/user/1000/tmp9ae0kd9f/default.nix -qa * --meta --xml --allowed-uris https://static.rust-lang.org --option restrict-eval true --option allow-import-from-derivation true --drv-path --show-trace -I nixpkgs=/nix/store/rz1iy6crxc0z9pr0jr1zp238l3r2lkb5-nixpkgs-19.03pre166449.be445a9074f/nixpkgs -I /nix/store/2dr0ri39sq8nzpyiax1q2i7hj4rydr7g-source -I /run/user/1000/tmp9ae0kd9f/default.nix -I /home/adfaure/Projects/NUR/lib/evalRepo.nix

The script, during it execution, generates a default file looking like the default.nix above and applies the command:

nix-env -f /tmp/nurtest/default.nix -qa * --meta --xml --allowed-uris https://static.rust-lang.org --option restrict-eval true --option allow-import-from-derivation true --drv-path --show-trace -I nixpkgs=/nix/store/rz1iy6crxc0z9pr0jr1zp238l3r2lkb5-nixpkgs-19.03pre166449.be445a9074f/nixpkgs -I /nix/store/nkflq2ansfjg2bl5dbr2sm2yqyblclrz-source -I /tmp/nurtest/default.nix -I /home/adfaure/Projects/NUR/lib/evalRepo.nix

If I isolate this out from the update script I have the following error:

 error: while evaluating 'callPackage' at /nix/store/nkflq2ansfjg2bl5dbr2sm2yqyblclrz-source/default.nix:24:24, called from /nix/store/nkflq2ansfjg2bl5dbr2sm2yqyblclrz-source/default.nix:192:19:
while evaluating 'check' at /nix/store/nkflq2ansfjg2bl5dbr2sm2yqyblclrz-source/default.nix:27:11, called from /nix/store/nkflq2ansfjg2bl5dbr2sm2yqyblclrz-source/default.nix:24:34:
while evaluating 'test' at /nix/store/nkflq2ansfjg2bl5dbr2sm2yqyblclrz-source/default.nix:30:12, called from /nix/store/nkflq2ansfjg2bl5dbr2sm2yqyblclrz-source/default.nix:37:12:
while evaluating 'makeC' at /nix/store/nkflq2ansfjg2bl5dbr2sm2yqyblclrz-source/default.nix:29:17, called from /nix/store/nkflq2ansfjg2bl5dbr2sm2yqyblclrz-source/default.nix:31:8:
attribute 'meta' missing, at /nix/store/nkflq2ansfjg2bl5dbr2sm2yqyblclrz-source/default.nix:37:17

The command assumes that the default.nix provided is situated into /tmp/nurtest/default.nix. And one needs to adapt the pass to its own NUR repository.

Edited
default.nix 318 Bytes
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment