Skip to content

"cabal-plan" is missing when using latest hackage.nix #2519

Description

@m4dc4p

Somewhere between February & June, hackage.nix changed and for some reason I can't build my shell anymore. It fails with:

       error: attribute 'cabal-plan' missing
       at /nix/store/imvcsn32zp098brrgxkzh9hn580a0b4p-source/overlays/haskell.nix:761:34:
          760|                             then components.library
          761|                             else components.${haskellLib.prefixComponent.${builtins.elemAt m 0}}.${builtins.elemAt m 1};
             |                                  ^
          762|

I'm using the latest haskell.nix (125a3d1); with hackage.nix at revision 0a903b36 (from about Feb 23rd), I can build. When I try to update to a newer hackage.nix (7b8331e1), my build fails. The failure is coming from somewhere in the haskell.nix code.

Any hints on debugging? I haven't had time to bisect the commit where this started.

Here is the full trace (the /nix/store derivation imvcsn32zp098brrgxkzh9hn580a0b4p-source is the haskell.nix sources at 125a3d1):

error:
       … while calling the 'derivationStrict' builtin
         at «nix-internal»/derivation-internal.nix:37:12:
           36|
           37|   strict = derivationStrict drvAttrs;
             |            ^
           38|

       … while evaluating derivation 'ghc-shell-for-packages'
         whose name attribute is located at /nix/store/42k3knjp8qlqaa2mxaqhsh6mv421v32n-source/pkgs/stdenv/generic/make-derivation.nix:336:7

       … while evaluating attribute '__impureHostDeps' of derivation 'ghc-shell-for-packages'
         at /nix/store/42k3knjp8qlqaa2mxaqhsh6mv421v32n-source/pkgs/stdenv/generic/make-derivation.nix:451:7:
          450|       __propagatedSandboxProfile = unique (computedPropagatedSandboxProfile ++ [ propagatedSandboxProfile ]);
          451|       __impureHostDeps = computedImpureHostDeps ++ computedPropagatedImpureHostDeps ++ __propagatedImpureHostDeps ++ __impureHostDeps ++ stdenv.__extraImpureHostDeps ++ [
             |       ^
          452|         "/dev/zero"

       … while calling the 'foldl'' builtin
         at /nix/store/42k3knjp8qlqaa2mxaqhsh6mv421v32n-source/pkgs/stdenv/generic/make-derivation.nix:435:11:
          434|         computedImpureHostDeps =
          435|           unique (concatMap (input: input.__propagatedImpureHostDeps or [])
             |           ^
          436|             (stdenv.extraNativeBuildInputs

       … while calling the 'concatMap' builtin
         at /nix/store/42k3knjp8qlqaa2mxaqhsh6mv421v32n-source/pkgs/stdenv/generic/make-derivation.nix:435:19:
          434|         computedImpureHostDeps =
          435|           unique (concatMap (input: input.__propagatedImpureHostDeps or [])
             |                   ^
          436|             (stdenv.extraNativeBuildInputs

       … while calling anonymous lambda
         at /nix/store/42k3knjp8qlqaa2mxaqhsh6mv421v32n-source/pkgs/stdenv/generic/make-derivation.nix:435:30:
          434|         computedImpureHostDeps =
          435|           unique (concatMap (input: input.__propagatedImpureHostDeps or [])
             |                              ^
          436|             (stdenv.extraNativeBuildInputs

       … from call site
         at /nix/store/42k3knjp8qlqaa2mxaqhsh6mv421v32n-source/pkgs/stdenv/generic/make-derivation.nix:435:37:
          434|         computedImpureHostDeps =
          435|           unique (concatMap (input: input.__propagatedImpureHostDeps or [])
             |                                     ^
          436|             (stdenv.extraNativeBuildInputs

       … while calling anonymous lambda
         at /nix/store/42k3knjp8qlqaa2mxaqhsh6mv421v32n-source/pkgs/stdenv/generic/make-derivation.nix:307:13:
          306|       (map (drv: getDev drv.__spliced.buildBuild or drv) (checkDependencyList "depsBuildBuild" depsBuildBuild))
          307|       (map (drv: getDev drv.__spliced.buildHost or drv) (checkDependencyList "nativeBuildInputs" nativeBuildInputs'))
             |             ^
          308|       (map (drv: getDev drv.__spliced.buildTarget or drv) (checkDependencyList "depsBuildTarget" depsBuildTarget))

       … from call site
         at /nix/store/42k3knjp8qlqaa2mxaqhsh6mv421v32n-source/pkgs/stdenv/generic/make-derivation.nix:307:18:
          306|       (map (drv: getDev drv.__spliced.buildBuild or drv) (checkDependencyList "depsBuildBuild" depsBuildBuild))
          307|       (map (drv: getDev drv.__spliced.buildHost or drv) (checkDependencyList "nativeBuildInputs" nativeBuildInputs'))
             |                  ^
          308|       (map (drv: getDev drv.__spliced.buildTarget or drv) (checkDependencyList "depsBuildTarget" depsBuildTarget))

       … while calling 'getOutput'
         at /nix/store/42k3knjp8qlqaa2mxaqhsh6mv421v32n-source/lib/attrsets.nix:1796:23:
         1795|   */
         1796|   getOutput = output: pkg:
             |                       ^
         1797|     if ! pkg ? outputSpecified || ! pkg.outputSpecified

       … while evaluating a branch condition
         at /nix/store/42k3knjp8qlqaa2mxaqhsh6mv421v32n-source/lib/attrsets.nix:1797:5:
         1796|   getOutput = output: pkg:
         1797|     if ! pkg ? outputSpecified || ! pkg.outputSpecified
             |     ^
         1798|       then pkg.${output} or pkg.out or pkg

       … in the left operand of the OR (||) operator
         at /nix/store/42k3knjp8qlqaa2mxaqhsh6mv421v32n-source/lib/attrsets.nix:1797:32:
         1796|   getOutput = output: pkg:
         1797|     if ! pkg ? outputSpecified || ! pkg.outputSpecified
             |                                ^
         1798|       then pkg.${output} or pkg.out or pkg

       … in the argument of the not operator
         at /nix/store/42k3knjp8qlqaa2mxaqhsh6mv421v32n-source/lib/attrsets.nix:1797:10:
         1796|   getOutput = output: pkg:
         1797|     if ! pkg ? outputSpecified || ! pkg.outputSpecified
             |          ^
         1798|       then pkg.${output} or pkg.out or pkg

       … from call site
         at /nix/store/42k3knjp8qlqaa2mxaqhsh6mv421v32n-source/pkgs/stdenv/generic/make-derivation.nix:307:25:
          306|       (map (drv: getDev drv.__spliced.buildBuild or drv) (checkDependencyList "depsBuildBuild" depsBuildBuild))
          307|       (map (drv: getDev drv.__spliced.buildHost or drv) (checkDependencyList "nativeBuildInputs" nativeBuildInputs'))
             |                         ^
          308|       (map (drv: getDev drv.__spliced.buildTarget or drv) (checkDependencyList "depsBuildTarget" depsBuildTarget))

       … while calling anonymous lambda
         at /nix/store/42k3knjp8qlqaa2mxaqhsh6mv421v32n-source/lib/lists.nix:335:29:
          334|   */
          335|   imap1 = f: list: genList (n: f (n + 1) (elemAt list n)) (length list);
             |                             ^
          336|

       … from call site
         at /nix/store/42k3knjp8qlqaa2mxaqhsh6mv421v32n-source/lib/lists.nix:335:32:
          334|   */
          335|   imap1 = f: list: genList (n: f (n + 1) (elemAt list n)) (length list);
             |                                ^
          336|

       … while calling anonymous lambda
         at /nix/store/42k3knjp8qlqaa2mxaqhsh6mv421v32n-source/pkgs/stdenv/generic/make-derivation.nix:281:15:
          280|     imap1
          281|       (index: dep:
             |               ^
          282|         if isDerivation dep || dep == null || builtins.isString dep || builtins.isPath dep then dep

       … while evaluating a branch condition
         at /nix/store/42k3knjp8qlqaa2mxaqhsh6mv421v32n-source/pkgs/stdenv/generic/make-derivation.nix:282:9:
          281|       (index: dep:
          282|         if isDerivation dep || dep == null || builtins.isString dep || builtins.isPath dep then dep
             |         ^
          283|         else if isList dep then checkDependencyList' ([index] ++ positions) name dep

       … in the left operand of the OR (||) operator
         at /nix/store/42k3knjp8qlqaa2mxaqhsh6mv421v32n-source/pkgs/stdenv/generic/make-derivation.nix:282:69:
          281|       (index: dep:
          282|         if isDerivation dep || dep == null || builtins.isString dep || builtins.isPath dep then dep
             |                                                                     ^
          283|         else if isList dep then checkDependencyList' ([index] ++ positions) name dep

       … in the left operand of the OR (||) operator
         at /nix/store/42k3knjp8qlqaa2mxaqhsh6mv421v32n-source/pkgs/stdenv/generic/make-derivation.nix:282:44:
          281|       (index: dep:
          282|         if isDerivation dep || dep == null || builtins.isString dep || builtins.isPath dep then dep
             |                                            ^
          283|         else if isList dep then checkDependencyList' ([index] ++ positions) name dep

       … in the left operand of the OR (||) operator
         at /nix/store/42k3knjp8qlqaa2mxaqhsh6mv421v32n-source/pkgs/stdenv/generic/make-derivation.nix:282:29:
          281|       (index: dep:
          282|         if isDerivation dep || dep == null || builtins.isString dep || builtins.isPath dep then dep
             |                             ^
          283|         else if isList dep then checkDependencyList' ([index] ++ positions) name dep

       … from call site
         at /nix/store/42k3knjp8qlqaa2mxaqhsh6mv421v32n-source/pkgs/stdenv/generic/make-derivation.nix:282:12:
          281|       (index: dep:
          282|         if isDerivation dep || dep == null || builtins.isString dep || builtins.isPath dep then dep
             |            ^
          283|         else if isList dep then checkDependencyList' ([index] ++ positions) name dep

       … while calling 'isDerivation'
         at /nix/store/42k3knjp8qlqaa2mxaqhsh6mv421v32n-source/lib/attrsets.nix:1282:5:
         1281|   isDerivation =
         1282|     value: value.type or null == "derivation";
             |     ^
         1283|

       … while calling the 'elemAt' builtin
         at /nix/store/42k3knjp8qlqaa2mxaqhsh6mv421v32n-source/lib/lists.nix:335:43:
          334|   */
          335|   imap1 = f: list: genList (n: f (n + 1) (elemAt list n)) (length list);
             |                                           ^
          336|

       … while calling 'tool''
         at /nix/store/imvcsn32zp098brrgxkzh9hn580a0b4p-source/overlays/tools.nix:95:50:
           94|   # tool with a default evalPackages to use.
           95|   tool' = evalPackages: compiler-nix-name: name: versionOrMod:
             |                                                  ^
           96|       final.haskell-nix.hackage-tool (

       … from call site
         at /nix/store/imvcsn32zp098brrgxkzh9hn580a0b4p-source/overlays/tools.nix:96:7:
           95|   tool' = evalPackages: compiler-nix-name: name: versionOrMod:
           96|       final.haskell-nix.hackage-tool (
             |       ^
           97|            final.haskell-nix.haskellLib.versionOrModToMods versionOrMod

       … while calling 'hackage-tool'
         at /nix/store/imvcsn32zp098brrgxkzh9hn580a0b4p-source/overlays/tools.nix:66:18:
           65|
           66|   hackage-tool = projectModules:
             |                  ^
           67|     let

       … from call site
         at /nix/store/imvcsn32zp098brrgxkzh9hn580a0b4p-source/overlays/tools.nix:86:8:
           85|       exeName = final.haskell-nix.packageToolName.${name} or name;
           86|     in package.getComponent "exe:${exeName}";
             |        ^
           87|

       … while calling 'getComponent'
         at /nix/store/imvcsn32zp098brrgxkzh9hn580a0b4p-source/overlays/haskell.nix:754:38:
          753|                       # Look up a component in the package based on ctype:name
          754|                       getComponent = componentName:
             |                                      ^
          755|                         let m = builtins.match "(lib|flib|exe|test|bench):([^:]*)" componentName;

       error: attribute 'cabal-plan' missing
       at /nix/store/imvcsn32zp098brrgxkzh9hn580a0b4p-source/overlays/haskell.nix:761:34:
          760|                             then components.library
          761|                             else components.${haskellLib.prefixComponent.${builtins.elemAt m 0}}.${builtins.elemAt m 1};
             |                                  ^
          762|

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions