Running nix develop now seems to fail on release-7 branch. #289

Open
opened 2024-04-23 01:04:26 +08:00 by shareef · 6 comments

I have previously managed to build artiq-zynq but having returned to it recently, I'm seeing the following errors. This is on a clean checkout of the release-7 branch and a brand new Nix installation. I thought I might have corrupted something in my nix env so tried a fresh installation.

shareefj@JALAPINO:~/git/artiq-zynq$ nix develop
error:
       … while calling the 'derivationStrict' builtin
         at <nix/derivation-internal.nix>:9:12:
            8|
            9|   strict = derivationStrict drvAttrs;
             |            ^
           10|

       … while evaluating derivation 'artiq-zynq-dev-shell'
         whose name attribute is located at /nix/store/8drxi4s8n69hdv4mp4jiqsi71yaxv8i6-source/pkgs/stdenv/generic/make-derivation.nix:278:7

       … while evaluating attribute 'buildInputs' of derivation 'artiq-zynq-dev-shell'
         at /nix/store/8drxi4s8n69hdv4mp4jiqsi71yaxv8i6-source/pkgs/stdenv/generic/make-derivation.nix:322:7:
          321|       depsHostHost                = lib.elemAt (lib.elemAt dependencies 1) 0;
          322|       buildInputs                 = lib.elemAt (lib.elemAt dependencies 1) 1;
             |       ^
          323|       depsTargetTarget            = lib.elemAt (lib.elemAt dependencies 2) 0;

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: NAR hash mismatch in input 'git+https://github.com/m-labs/misoc.git?ref=refs/heads/master&rev=6d48ce77b6746d3226a682790fbc95b90340986e&submodules=1', expected 'sha256-g4+yeSV+HtWjcllM5wk4vNBUVCXtDOzUSKhxXPT7Fyc=' but got 'sha256-NjicjkygVEciaUkxcpgAyHELiuqqSvbLH8w5sfJMpP0='

I have previously managed to build artiq-zynq but having returned to it recently, I'm seeing the following errors. This is on a clean checkout of the release-7 branch and a brand new Nix installation. I thought I might have corrupted something in my nix env so tried a fresh installation. ``` shareefj@JALAPINO:~/git/artiq-zynq$ nix develop error: … while calling the 'derivationStrict' builtin at <nix/derivation-internal.nix>:9:12: 8| 9| strict = derivationStrict drvAttrs; | ^ 10| … while evaluating derivation 'artiq-zynq-dev-shell' whose name attribute is located at /nix/store/8drxi4s8n69hdv4mp4jiqsi71yaxv8i6-source/pkgs/stdenv/generic/make-derivation.nix:278:7 … while evaluating attribute 'buildInputs' of derivation 'artiq-zynq-dev-shell' at /nix/store/8drxi4s8n69hdv4mp4jiqsi71yaxv8i6-source/pkgs/stdenv/generic/make-derivation.nix:322:7: 321| depsHostHost = lib.elemAt (lib.elemAt dependencies 1) 0; 322| buildInputs = lib.elemAt (lib.elemAt dependencies 1) 1; | ^ 323| depsTargetTarget = lib.elemAt (lib.elemAt dependencies 2) 0; (stack trace truncated; use '--show-trace' to show the full trace) error: NAR hash mismatch in input 'git+https://github.com/m-labs/misoc.git?ref=refs/heads/master&rev=6d48ce77b6746d3226a682790fbc95b90340986e&submodules=1', expected 'sha256-g4+yeSV+HtWjcllM5wk4vNBUVCXtDOzUSKhxXPT7Fyc=' but got 'sha256-NjicjkygVEciaUkxcpgAyHELiuqqSvbLH8w5sfJMpP0=' ```
Author

This seems to be due to a difference in the flake.lock file for misoc. If I update the narHash field for misoc to the expected value, then it all Just Works.

My Nix knowledge is non-existent so I have no idea how that lock file is constructed. Deleting it and rebuilding didn't help.

This seems to be due to a difference in the `flake.lock` file for `misoc`. If I update the `narHash` field for `misoc` to the expected value, then it all Just Works. My Nix knowledge is non-existent so I have no idea how that lock file is constructed. Deleting it and rebuilding didn't help.
Contributor

I tried also a clean checkout of release-7 branch, but have not encountered the issue. Can you share the the contents of your flake.lock file before you update it?

I tried also a clean checkout of `release-7` branch, but have not encountered the issue. Can you share the the contents of your `flake.lock` file before you update it?
Author

Sorry, I missed your post.

The contents of flake.lock are unmodified from the HEAD of the branch. I'm using nix 2.21.1

shareefj@JALAPINO:~$ cd git/
shareefj@JALAPINO:~/git$ git clone https://git.m-labs.hk/M-Labs/artiq-zynq.git -b release-7 artiq-zynq-release-7
Cloning into 'artiq-zynq-release-7'...
remote: Enumerating objects: 5208, done.
remote: Counting objects: 100% (2025/2025), done.
remote: Compressing objects: 100% (1136/1136), done.
remote: Total 5208 (delta 1742), reused 901 (delta 889), pack-reused 3183
Receiving objects: 100% (5208/5208), 1.46 MiB | 1.11 MiB/s, done.
Resolving deltas: 100% (3651/3651), done.
shareefj@JALAPINO:~/git$ cd !$
cd artiq-zynq-release-7
shareefj@JALAPINO:~/git/artiq-zynq-release-7$ nix develop
error:
       … while calling the 'derivationStrict' builtin
         at <nix/derivation-internal.nix>:9:12:
            8|
            9|   strict = derivationStrict drvAttrs;
             |            ^
           10|

       … while evaluating derivation 'artiq-zynq-dev-shell'
         whose name attribute is located at /nix/store/8drxi4s8n69hdv4mp4jiqsi71yaxv8i6-source/pkgs/stdenv/generic/make-derivation.nix:278:7

       … while evaluating attribute 'buildInputs' of derivation 'artiq-zynq-dev-shell'
         at /nix/store/8drxi4s8n69hdv4mp4jiqsi71yaxv8i6-source/pkgs/stdenv/generic/make-derivation.nix:322:7:
          321|       depsHostHost                = lib.elemAt (lib.elemAt dependencies 1) 0;
          322|       buildInputs                 = lib.elemAt (lib.elemAt dependencies 1) 1;
             |       ^
          323|       depsTargetTarget            = lib.elemAt (lib.elemAt dependencies 2) 0;

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: NAR hash mismatch in input 'git+https://github.com/m-labs/misoc.git?ref=refs/heads/master&rev=6d48ce77b6746d3226a682790fbc95b90340986e&submodules=1', expected 'sha256-g4+yeSV+HtWjcllM5wk4vNBUVCXtDOzUSKhxXPT7Fyc=' but got 'sha256-NjicjkygVEciaUkxcpgAyHELiuqqSvbLH8w5sfJMpP0='
Sorry, I missed your post. The contents of `flake.lock` are unmodified from the HEAD of the branch. I'm using nix 2.21.1 ``` shareefj@JALAPINO:~$ cd git/ shareefj@JALAPINO:~/git$ git clone https://git.m-labs.hk/M-Labs/artiq-zynq.git -b release-7 artiq-zynq-release-7 Cloning into 'artiq-zynq-release-7'... remote: Enumerating objects: 5208, done. remote: Counting objects: 100% (2025/2025), done. remote: Compressing objects: 100% (1136/1136), done. remote: Total 5208 (delta 1742), reused 901 (delta 889), pack-reused 3183 Receiving objects: 100% (5208/5208), 1.46 MiB | 1.11 MiB/s, done. Resolving deltas: 100% (3651/3651), done. shareefj@JALAPINO:~/git$ cd !$ cd artiq-zynq-release-7 shareefj@JALAPINO:~/git/artiq-zynq-release-7$ nix develop error: … while calling the 'derivationStrict' builtin at <nix/derivation-internal.nix>:9:12: 8| 9| strict = derivationStrict drvAttrs; | ^ 10| … while evaluating derivation 'artiq-zynq-dev-shell' whose name attribute is located at /nix/store/8drxi4s8n69hdv4mp4jiqsi71yaxv8i6-source/pkgs/stdenv/generic/make-derivation.nix:278:7 … while evaluating attribute 'buildInputs' of derivation 'artiq-zynq-dev-shell' at /nix/store/8drxi4s8n69hdv4mp4jiqsi71yaxv8i6-source/pkgs/stdenv/generic/make-derivation.nix:322:7: 321| depsHostHost = lib.elemAt (lib.elemAt dependencies 1) 0; 322| buildInputs = lib.elemAt (lib.elemAt dependencies 1) 1; | ^ 323| depsTargetTarget = lib.elemAt (lib.elemAt dependencies 2) 0; (stack trace truncated; use '--show-trace' to show the full trace) error: NAR hash mismatch in input 'git+https://github.com/m-labs/misoc.git?ref=refs/heads/master&rev=6d48ce77b6746d3226a682790fbc95b90340986e&submodules=1', expected 'sha256-g4+yeSV+HtWjcllM5wk4vNBUVCXtDOzUSKhxXPT7Fyc=' but got 'sha256-NjicjkygVEciaUkxcpgAyHELiuqqSvbLH8w5sfJMpP0=' ```
Author

A nix store gc didn't help. Are there any other useful nix commands to clean and start from a fresh build?

A `nix store gc` didn't help. Are there any other useful `nix` commands to clean and start from a fresh build?
Contributor

I managed to reproduce this using the latest nix 2.22.0. It seems this is related on the changes in supporting submodules as a nix flake input. Will check on how it is implemented now and submit a PR. In the meantime, the simplest workaround is to revert to nix 2.18.

I managed to reproduce this using the latest `nix 2.22.0`. It seems this is related on the changes in [supporting submodules as a nix flake input](https://github.com/NixOS/nix/pull/7862#issuecomment-1908577578). Will check on how it is implemented now and submit a PR. In the meantime, the simplest workaround is to revert to `nix 2.18`.
Contributor

Hi @shareef. I tested again and followed the troubleshooting steps indicated here:

I was able to avoid those NAR mismatch errors and run ARTIQ without changing anything in the source code.

You might need to reboot your machine for the configuration to take effect.

Hi @shareef. I tested again and followed the troubleshooting steps indicated here: - [Ignoring untrusted substituter, you are not a trusted user](https://m-labs.hk/artiq/manual-beta/installing.html#ignoring-untrusted-substituter-you-are-not-a-trusted-user) - [Do you want to allow configuration setting… (y/N)?](https://m-labs.hk/artiq/manual-beta/installing.html#do-you-want-to-allow-configuration-setting-y-n) I was able to avoid those NAR mismatch errors and run ARTIQ without changing anything in the source code. You might need to reboot your machine for the configuration to take effect.
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: M-Labs/artiq-zynq#289
No description provided.