mlabs-haskell / cardano.nix

Nix ❤️ Cardano
https://mlabs-haskell.github.io/cardano.nix/
1 stars 0 forks source link

`nix develop github:mlabs-haskell/cardano.nix` and `nix run github:mlabs-haskell/cardano.nix#vm-preview` fail #87

Open hhefesto opened 5 days ago

hhefesto commented 5 days ago

Both nix develop github:mlabs-haskell/cardano.nix and nix run github:mlabs-haskell/cardano.nix#vm-preview fail the same way:

❯ nix develop github:mlabs-haskell/cardano.nix       
error: builder for '/nix/store/wr0j247frcblh4v4qczw4dvfsll852dz-nix-tools-0.1.0.0.drv' failed with exit code 1;
       last 16 log lines:
       >
       > trying https://ci.zw3rk.com/build/3108674/download/1/nix-tools-0.1.0.0-x86_64-unknown-linux-musl.tar.gz
       >   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
       >                                  Dload  Upload   Total   Spent    Left  Speed
       >   0   150    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
       > curl: (22) The requested URL returned error: 502
       > Warning: Problem : HTTP error. Will retry in 1 seconds. 3 retries left.
       >   0   150    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
       > curl: (22) The requested URL returned error: 502
       > Warning: Problem : HTTP error. Will retry in 2 seconds. 2 retries left.
       >   0   150    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
       > curl: (22) The requested URL returned error: 502
       > Warning: Problem : HTTP error. Will retry in 4 seconds. 1 retries left.
       >   0   150    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
       > curl: (22) The requested URL returned error: 502
       > error: cannot download nix-tools-0.1.0.0 from any mirror
       For full logs, run 'nix log /nix/store/wr0j247frcblh4v4qczw4dvfsll852dz-nix-tools-0.1.0.0.drv'.
error:
       … while evaluating the attribute 'optionalValue.value'
         at /nix/store/vm4qsaala00i8q5js7i3am3w0m766k1d-source/modules.nix:856:5:
          855|
          856|     optionalValue =
             |     ^
          857|       if isDefined then { value = mergedValue; }

       … while evaluating a branch condition
         at /nix/store/vm4qsaala00i8q5js7i3am3w0m766k1d-source/modules.nix:857:7:
          856|     optionalValue =
          857|       if isDefined then { value = mergedValue; }
             |       ^
          858|       else {};

       … while evaluating definitions from `/nix/store/aqnklsijb47x7z816nci9zqg8rjv0wnb-source/modules/transposition.nix':

       … while evaluating the option `perSystem.x86_64-linux.packages':

       … while evaluating definitions from `/nix/store/d75ccs5q2smn9bzh6pld56pcdfip0flx-source/packages/cardano.nix, via option perSystem':

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

       error: 1 dependencies of derivation '/nix/store/y9h638nj6b5bqd7ywh88mcj2rxwhfc9a-cardano-node-plan-to-nix-pkgs.drv' failed to build

Might be related to haskellPackages.nix-tools being marked as broken, but haven't actually looked into it other than trying to build it on my machine with my nixpkgs version:

❯ nix shell nixpkgs#haskellPackages.nix-tools     
error:
       … in the condition of the assert statement
         at /nix/store/8s55w0927lh3mdbkxf434zb0c5hqsz8z-source/lib/customisation.nix:365:17:
          364|     in commonAttrs // {
          365|       drvPath = assert condition; drv.drvPath;
             |                 ^
          366|       outPath = assert condition; drv.outPath;

       … while evaluating the attribute 'handled'
         at /nix/store/8s55w0927lh3mdbkxf434zb0c5hqsz8z-source/pkgs/stdenv/generic/check-meta.nix:507:7:
          506|       # or, alternatively, just output a warning message.
          507|       handled =
             |       ^
          508|         (

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

       error: Package ‘nix-tools-0.1.0.0’ in /nix/store/8s55w0927lh3mdbkxf434zb0c5hqsz8z-source/pkgs/development/haskell-modules/hackage-packages.nix:218851 is marked as broken, refusing to evaluate.

       a) To temporarily allow broken packages, you can use an environment variable
          for a single invocation of the nix tools.

            $ export NIXPKGS_ALLOW_BROKEN=1

          Note: When using `nix shell`, `nix build`, `nix develop`, etc with a flake,
                then pass `--impure` in order to allow use of environment variables.

       b) For `nixos-rebuild` you can set
         { nixpkgs.config.allowBroken = true; }
       in configuration.nix to override this.

       c) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
         { allowBroken = true; }
       to ~/.config/nixpkgs/config.nix.
hhefesto commented 5 days ago

error: 'packages.x86_64-linux' is not an attribute set

Got this from nix flake show github:mlabs-haskell/cardano.nix:

❯ nix flake show github:mlabs-haskell/cardano.nix              
github:mlabs-haskell/cardano.nix/5c8a8bffcee77189b72fea6123b2a2845d1e731e?narHash=sha256-scs7lMJQ4kLSIh9nahzoxk9L6BRyt2hYFbr5nIaqCWY%3D
├───allSystems: unknown
├───apps
│   └───x86_64-linux
│       ├───nix-build-all: app
│       ├───run-vm-tests: app
│       ├───vm-preview: app
│       ├───vmTests-cardano-cli: app
│       ├───vmTests-cardano-node: app
│       ├───vmTests-ctl-8: app
│       ├───vmTests-db-sync: app
│       ├───vmTests-http: app
│       ├───vmTests-kupo: app
│       └───vmTests-ogmios: app
├───checks
│   └───x86_64-linux
│       ├───github-pages-effect-is-buildable: derivation 'effect-write-branch'
│       ├───pre-commit: derivation 'pre-commit-run'
│       ├───reuse: derivation 'reuse-lint'
│       ├───treefmt: derivation 'treefmt-check'
trace: warning: lib.nixos.evalModules is experimental and subject to change. See nixos/lib/default.nix
│       └───vmTests-cardano-cli: derivation 'vm-test-run-cardano-cli'
├───debug: unknown
├───devShells
│   └───x86_64-linux
│       └───default: development environment 'cardano.nix'
├───formatter
│   └───x86_64-linux: package 'treefmt'
├───herculesCI: unknown
├───nixosConfigurations
│   └───vm-preview: NixOS configuration
├───nixosModules
│   ├───cardano: NixOS module
│   ├───cli: NixOS module
│   ├───db-sync: NixOS module
│   ├───default: NixOS module
│   ├───http: NixOS module
│   ├───kupo: NixOS module
│   ├───node: NixOS module
│   └───ogmios: NixOS module
├───overlays
│   ├───"cardano-node-8.1.1": Nixpkgs overlay
│   ├───"cardano-node-8.7.3": Nixpkgs overlay
│   ├───ctl-8: Nixpkgs overlay
│   └───default: Nixpkgs overlay
├───packages
│   └───x86_64-linux
error: 'packages.x86_64-linux' is not an attribute set

and it confirms (fails equally) if you do nix build github:mlabs-haskell/cardano.nix

hhefesto commented 5 days ago

I did a nix-collect-garbage -d in hopes I had some wrong state on my nix store, but the result ended up being the same. Something else to note is that the cache didn't hit (took like 5 mins to build, not that much) even though I have:

❯ nix show-config
... [more output]...
substituters = https://telomare.cachix.org https://nixcache.reflex-frp.org https://cache.staging.mlabs.city/cardano-nix https://cache.nixos.org/
sync-before-registering = false
system = x86_64-linux
system-features = benchmark big-parallel kvm nixos-test
tarball-ttl = 3600
timeout = 0
trace-function-calls = false
trace-verbose = false
trust-tarballs-from-git-forges = true
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= telomare.cachix.org-1:H0qRjVstxtb9oyEPvDDpmPSLyJ9oViAsTgwR02ra6Dk= ryantrinkle.com-1:JJiAKaRv9mWgpVAz8dwewnZe0AzzEAzPkagE9SP5NWI= cardano-nix:BQ7QKgoQQAuL3Kh6pfIJ8oxrihUbUSxf6tN9SxyW608=
trusted-substituters = https://cache.iog.io https://nixcache.reflex-frp.org https://telomare.cachix.org
trusted-users = root hhefesto
...[more output]...

Trying to see what packages is from the repl wasn't very helpful:

~/src/cardano.nix (main) 
❯ nix repl            
Nix 2.23.0pre20240606_e1b3716
Type :? for help.
nix-repl> :lf .
Added 26 variables.

nix-repl> outputs.
outputs.allSystems           outputs.currentSystem        outputs.formatter            outputs.nixosConfigurations  outputs.packages
outputs.apps                 outputs.debug                outputs.herculesCI           outputs.nixosModules         outputs.templates
outputs.checks               outputs.devShells            outputs.legacyPackages       outputs.overlays
nix-repl> outputs.packages
{
error: builder for '/nix/store/wr0j247frcblh4v4qczw4dvfsll852dz-nix-tools-0.1.0.0.drv' failed with exit code 1;
       last 16 log lines:
       >
       > trying https://ci.zw3rk.com/build/3108674/download/1/nix-tools-0.1.0.0-x86_64-unknown-linux-musl.tar.gz
       >   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
       >                                  Dload  Upload   Total   Spent    Left  Speed
       >   0   150    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
       > curl: (22) The requested URL returned error: 502
       > Warning: Problem : HTTP error. Will retry in 1 seconds. 3 retries left.
       >   0   150    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
       > curl: (22) The requested URL returned error: 502
       > Warning: Problem : HTTP error. Will retry in 2 seconds. 2 retries left.
       >   0   150    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
       > curl: (22) The requested URL returned error: 502
       > Warning: Problem : HTTP error. Will retry in 4 seconds. 1 retries left.
       >   0   150    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
       > curl: (22) The requested URL returned error: 502
       > error: cannot download nix-tools-0.1.0.0 from any mirror
       For full logs, run 'nix log /nix/store/wr0j247frcblh4v4qczw4dvfsll852dz-nix-tools-0.1.0.0.drv'.
[0/7 built (1 failed)] building nix-tools-0.1.0.0: error: cannot download nix-tools-0.1.0.0 from any mirror«error: 1 dependencies of derivation '/nix/store/y9h638nj6b5bqd7ywh88mcj2rxwhfc9a-cardano-node-plan-to-nix-pkgs.drv' failed to build»;
}
hhefesto commented 5 days ago

The commit that introduced this error is quite old: https://github.com/mlabs-haskell/cardano.nix/commit/c53dbea09dc3dc4e140789d119d4c506ece7ed46

The previous commit had no problem doing nix develop

hhefesto commented 5 days ago

On commit 562721d packages is an attribute set as expected:

~/src/cardano.nix (562721d) 
❯ nix flake show        
git+file:///home/hhefesto/src/cardano.nix?rev=562721ddcccde14bf26a8f77df193f562b99b2f2
├───allSystems: unknown
├───apps
│   ├───aarch64-darwin
│   │   ├───nix-build-all: app
│   │   └───run-test: app
│   ├───aarch64-linux
│   │   ├───nix-build-all: app
│   │   └───run-test: app
│   ├───x86_64-darwin
│   │   ├───nix-build-all: app
│   │   └───run-test: app
│   └───x86_64-linux
│       ├───nix-build-all: app
│       └───run-test: app
├───checks
│   ├───aarch64-darwin
│   │   ├───pre-commit omitted (use '--all-systems' to show)
│   │   ├───reuse omitted (use '--all-systems' to show)
│   │   └───treefmt omitted (use '--all-systems' to show)
│   ├───aarch64-linux
│   │   ├───pre-commit omitted (use '--all-systems' to show)
│   │   ├───reuse omitted (use '--all-systems' to show)
│   │   └───treefmt omitted (use '--all-systems' to show)
│   ├───x86_64-darwin
│   │   ├───pre-commit omitted (use '--all-systems' to show)
│   │   ├───reuse omitted (use '--all-systems' to show)
│   │   └───treefmt omitted (use '--all-systems' to show)
│   └───x86_64-linux
│       ├───github-pages-effect-is-buildable: derivation 'effect-write-branch'
│       ├───pre-commit: derivation 'pre-commit-run'
│       ├───reuse: derivation 'reuse-lint'
trace: warning: lib.nixos.evalModules is experimental and subject to change. See nixos/lib/default.nix
│       ├───testing-dummy: derivation 'vm-test-run-cli-test'
│       └───treefmt: derivation 'treefmt-check'
├───debug: unknown
├───devShells
│   ├───aarch64-darwin
│   │   └───default omitted (use '--all-systems' to show)
│   ├───aarch64-linux
│   │   └───default omitted (use '--all-systems' to show)
│   ├───x86_64-darwin
│   │   └───default omitted (use '--all-systems' to show)
│   └───x86_64-linux
│       └───default: development environment 'cardano.nix'
├───formatter
│   ├───aarch64-darwin omitted (use '--all-systems' to show)
│   ├───aarch64-linux omitted (use '--all-systems' to show)
│   ├───x86_64-darwin omitted (use '--all-systems' to show)
│   └───x86_64-linux: package 'treefmt'
├───herculesCI: unknown
├───lib: unknown
├───nixosModules
│   ├───cardano-cli: NixOS module
│   ├───default: NixOS module
│   └───globals: NixOS module
└───packages
    ├───aarch64-darwin
    │   └───docs omitted (use '--all-systems' to show)
    ├───aarch64-linux
    │   └───docs omitted (use '--all-systems' to show)
    ├───x86_64-darwin
    │   └───docs omitted (use '--all-systems' to show)
    └───x86_64-linux
        └───docs: package 'cardano-nix-docs'