cachix / devenv

Fast, Declarative, Reproducible, and Composable Developer Environments
https://devenv.sh
Apache License 2.0
3.47k stars 252 forks source link

bug: devenv fails with setting python.version #1151

Closed imcom closed 6 days ago

imcom commented 2 weeks ago

Describe the bug A clear and concise description of what the bug is.

To reproduce

I tried to init devenv in an existing project.

  1. devenv init
  2. config devenv.nix to include python as following

in my case, the trigger is the python.version

  languages.python.enable = true;
  languages.python.version = "3.11.8";

With this setting, devenv test fails

And then when I run devenv test I got the following output and the test fails.

• Overriding .devenv to .devenv.aUelqUX5hA0q
• Building tests ...
• Using Cachix: nixpkgs-python, devenv
warning: updating lock file '/devenv.lock':
• Added input 'nixpkgs-python':
    'github:cachix/nixpkgs-python/462946481a3f4497c90103c92b5e7408e3c59f4f' (2024-04-19)
• Added input 'nixpkgs-python/flake-compat':
    'github:edolstra/flake-compat/0f9255e01c2351cc7d116c072cb317785dd33b33' (2023-10-04)
• Added input 'nixpkgs-python/flake-utils':
    'github:numtide/flake-utils/b1d9ab70662946ef0850d488da1c9019f3a9752a' (2024-03-11)
• Added input 'nixpkgs-python/flake-utils/systems':
    'github:nix-systems/default/da67096a3b9bf56a91d16901293e51ba5b49a27e' (2023-04-09)
• Added input 'nixpkgs-python/nixpkgs':
    follows 'nixpkgs'
✔ Building tests in 7.3s.
• Running tests ...
• Building shell ...
warning: updating lock file '/devenv.lock':
• Removed input 'nixpkgs-python'
• Removed input 'nixpkgs-python/flake-compat'
• Removed input 'nixpkgs-python/flake-utils'
• Removed input 'nixpkgs-python/flake-utils/systems'
• Removed input 'nixpkgs-python/nixpkgs'
error:
       … while calling the 'derivationStrict' builtin
         at <nix/derivation-internal.nix>:9:12:
            8|
            9|   strict = derivationStrict drvAttrs;
             |            ^
           10|

       … while evaluating derivation 'devenv-shell'
         whose name attribute is located at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/pkgs/stdenv/generic/make-derivation.nix:331:7

       … while evaluating attribute 'DEVENV_PROFILE' of derivation 'devenv-shell'

       … while evaluating derivation 'devenv-profile'
         whose name attribute is located at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/pkgs/stdenv/generic/make-derivation.nix:331:7

       … while evaluating attribute 'passAsFile' of derivation 'devenv-profile'
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/pkgs/build-support/trivial-builders/default.nix:69:9:
           68|         inherit buildCommand name;
           69|         passAsFile = [ "buildCommand" ]
             |         ^
           70|           ++ (derivationArgs.passAsFile or [ ]);

       … from call site
         at «github:cachix/devenv/11e7d3ef56f542e70f138069fe9b95401c2143c8»/src/modules/top-level.nix:15:13:
           14|     name = "devenv-profile";
           15|     paths = lib.flatten (builtins.map drvOrPackageToPaths config.packages);
             |             ^
           16|     ignoreCollisions = true;

       … while calling 'flatten'
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/lib/lists.nix:383:13:
          382|   */
          383|   flatten = x:
             |             ^
          384|     if isList x

       … from call site
         at «github:cachix/devenv/11e7d3ef56f542e70f138069fe9b95401c2143c8»/src/modules/top-level.nix:15:59:
           14|     name = "devenv-profile";
           15|     paths = lib.flatten (builtins.map drvOrPackageToPaths config.packages);
             |                                                           ^
           16|     ignoreCollisions = true;

       … while calling anonymous lambda
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/lib/attrsets.nix:1171:18:
         1170|         mapAttrs
         1171|           (name: value:
             |                  ^
         1172|             if isAttrs value && cond value

       … from call site
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/lib/attrsets.nix:1174:18:
         1173|             then recurse (path ++ [ name ]) value
         1174|             else f (path ++ [ name ]) value);
             |                  ^
         1175|     in

       … while calling anonymous lambda
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/lib/modules.nix:242:72:
          241|           # For definitions that have an associated option
          242|           declaredConfig = mapAttrsRecursiveCond (v: ! isOption v) (_: v: v.value) options;
             |                                                                        ^
          243|

       … while evaluating the option `packages':

       … from call site
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/lib/modules.nix:846:59:
          845|       if isDefined then
          846|         if all (def: type.check def.value) defsFinal then type.merge loc defsFinal
             |                                                           ^
          847|         else let allInvalid = filter (def: ! type.check def.value) defsFinal;

       … while calling 'merge'
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/lib/types.nix:546:20:
          545|       check = isList;
          546|       merge = loc: defs:
             |                    ^
          547|         map (x: x.value) (filter (x: x ? value) (concatLists (imap1 (n: def:

       … while calling anonymous lambda
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/lib/types.nix:547:35:
          546|       merge = loc: defs:
          547|         map (x: x.value) (filter (x: x ? value) (concatLists (imap1 (n: def:
             |                                   ^
          548|           imap1 (m: def':

       … from call site
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/lib/types.nix:547:38:
          546|       merge = loc: defs:
          547|         map (x: x.value) (filter (x: x ? value) (concatLists (imap1 (n: def:
             |                                      ^
          548|           imap1 (m: def':

       … while calling anonymous lambda
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/lib/lists.nix:334:29:
          333|   */
          334|   imap1 = f: list: genList (n: f (n + 1) (elemAt list n)) (length list);
             |                             ^
          335|

       … from call site
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/lib/lists.nix:334:32:
          333|   */
          334|   imap1 = f: list: genList (n: f (n + 1) (elemAt list n)) (length list);
             |                                ^
          335|

       … while calling anonymous lambda
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/lib/types.nix:548:21:
          547|         map (x: x.value) (filter (x: x ? value) (concatLists (imap1 (n: def:
          548|           imap1 (m: def':
             |                     ^
          549|             (mergeDefinitions

       … while calling anonymous lambda
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/lib/modules.nix:824:28:
          823|         # Process mkMerge and mkIf properties.
          824|         defs' = concatMap (m:
             |                            ^
          825|           map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))

       … while evaluating definitions from `/nix/store/virtual000000000000000000000000a-source/src/modules/languages/python.nix':

       … from call site
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/lib/modules.nix:825:137:
          824|         defs' = concatMap (m:
          825|           map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))
             |                                                                                                                                         ^
          826|         ) defs;

       … while calling 'dischargeProperties'
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/lib/modules.nix:896:25:
          895|   */
          896|   dischargeProperties = def:
             |                         ^
          897|     if def._type or "" == "merge" then

       … from call site
         at «github:cachix/devenv/11e7d3ef56f542e70f138069fe9b95401c2143c8»/src/modules/languages/python.nix:13:13:
           12|   readlink = "${pkgs.coreutils}/bin/readlink -f ";
           13|   package = pkgs.callPackage "${pkgs.path}/pkgs/development/interpreters/python/wrapper.nix" {
             |             ^
           14|     python = cfg.package;

       … while calling 'callPackageWith'
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/lib/customisation.nix:212:35:
          211|   */
          212|   callPackageWith = autoArgs: fn: args:
             |                                   ^
          213|     let

       … from call site
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/lib/trivial.nix:895:7:
          894|     { # TODO: Should we add call-time "type" checking like built in?
          895|       __functor = self: f;
             |       ^
          896|       __functionArgs = args;

       … while calling anonymous lambda
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/lib/customisation.nix:136:17:
          135|     in
          136|     mirrorArgs (origArgs:
             |                 ^
          137|     let

       … from call site
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/lib/customisation.nix:138:16:
          137|     let
          138|       result = f origArgs;
             |                ^
          139|

       … while calling anonymous lambda
         at /nix/store/mhgnysbsr0yx44xlqvl7xymk8js22c7z-source/pkgs/development/interpreters/python/wrapper.nix:1:1:
            1| { lib, stdenv, buildEnv, makeBinaryWrapper
             | ^
            2|

       … from call site
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/lib/trivial.nix:895:7:
          894|     { # TODO: Should we add call-time "type" checking like built in?
          895|       __functor = self: f;
             |       ^
          896|       __functionArgs = args;

       … while calling anonymous lambda
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/lib/customisation.nix:136:17:
          135|     in
          136|     mirrorArgs (origArgs:
             |                 ^
          137|     let

       … from call site
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/lib/customisation.nix:138:16:
          137|     let
          138|       result = f origArgs;
             |                ^
          139|

       … while calling anonymous lambda
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/pkgs/build-support/buildenv/default.nix:14:2:
           13| lib.makeOverridable
           14| ({ name
             |  ^
           15|

       … from call site
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/pkgs/build-support/buildenv/default.nix:53:1:
           52|
           53| runCommand name
             | ^
           54|   rec {

       … while calling anonymous lambda
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/pkgs/build-support/trivial-builders/default.nix:65:8:
           64|       # TODO(@Artturin): enable strictDeps always
           65|     }: buildCommand:
             |        ^
           66|       stdenv.mkDerivation ({

       … from call site
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/pkgs/build-support/trivial-builders/default.nix:66:7:
           65|     }: buildCommand:
           66|       stdenv.mkDerivation ({
             |       ^
           67|         enableParallelBuilding = true;

       … while calling 'mkDerivation'
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/pkgs/stdenv/generic/make-derivation.nix:46:5:
           45|   mkDerivation =
           46|     fnOrAttrs:
             |     ^
           47|       if builtins.isFunction fnOrAttrs

       … from call site
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/pkgs/stdenv/generic/make-derivation.nix:49:12:
           48|       then makeDerivationExtensible fnOrAttrs
           49|       else makeDerivationExtensibleConst fnOrAttrs;
             |            ^
           50|

       … while calling 'makeDerivationExtensibleConst'
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/pkgs/stdenv/generic/make-derivation.nix:98:35:
           97|   # but pre-evaluated for a slight improvement in performance.
           98|   makeDerivationExtensibleConst = attrs:
             |                                   ^
           99|     mkDerivationSimple

       … from call site
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/pkgs/stdenv/generic/make-derivation.nix:99:5:
           98|   makeDerivationExtensibleConst = attrs:
           99|     mkDerivationSimple
             |     ^
          100|       (f0:

       … while calling 'mkDerivationSimple'
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/pkgs/stdenv/generic/make-derivation.nix:508:1:
          507| # * [package attributes]: https://nixos.org/manual/nix/stable/glossary#package-attribute-set
          508| {
             | ^
          509|

       … from call site
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/pkgs/stdenv/generic/make-derivation.nix:579:1:
          578|
          579| extendDerivation
             | ^
          580|   validity.handled

       … while calling 'extendDerivation'
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/lib/customisation.nix:339:43:
          338|   */
          339|   extendDerivation = condition: passthru: drv:
             |                                           ^
          340|     let

       … from call site
         at «github:cachix/devenv/11e7d3ef56f542e70f138069fe9b95401c2143c8»/src/modules/languages/python.nix:14:14:
           13|   package = pkgs.callPackage "${pkgs.path}/pkgs/development/interpreters/python/wrapper.nix" {
           14|     python = cfg.package;
             |              ^
           15|     requiredPythonModules = cfg.package.pkgs.requiredPythonModules;

       … while calling anonymous lambda
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/lib/attrsets.nix:1171:18:
         1170|         mapAttrs
         1171|           (name: value:
             |                  ^
         1172|             if isAttrs value && cond value

       … from call site
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/lib/attrsets.nix:1174:18:
         1173|             then recurse (path ++ [ name ]) value
         1174|             else f (path ++ [ name ]) value);
             |                  ^
         1175|     in

       … while calling anonymous lambda
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/lib/modules.nix:242:72:
          241|           # For definitions that have an associated option
          242|           declaredConfig = mapAttrsRecursiveCond (v: ! isOption v) (_: v: v.value) options;
             |                                                                        ^
          243|

       … while evaluating the option `languages.python.package':

       … while calling anonymous lambda
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/lib/modules.nix:824:28:
          823|         # Process mkMerge and mkIf properties.
          824|         defs' = concatMap (m:
             |                            ^
          825|           map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))

       … while evaluating definitions from `/nix/store/virtual000000000000000000000000a-source/src/modules/languages/python.nix':

       … from call site
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/lib/modules.nix:825:137:
          824|         defs' = concatMap (m:
          825|           map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))
             |                                                                                                                                         ^
          826|         ) defs;

       … while calling 'dischargeProperties'
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/lib/modules.nix:896:25:
          895|   */
          896|   dischargeProperties = def:
             |                         ^
          897|     if def._type or "" == "merge" then

       … from call site
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/lib/modules.nix:902:11:
          901|         if def.condition then
          902|           dischargeProperties def.content
             |           ^
          903|         else

       … while calling 'dischargeProperties'
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/lib/modules.nix:896:25:
          895|   */
          896|   dischargeProperties = def:
             |                         ^
          897|     if def._type or "" == "merge" then

       … while calling 'dischargeProperties'
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/lib/modules.nix:896:25:
          895|   */
          896|   dischargeProperties = def:
             |                         ^
          897|     if def._type or "" == "merge" then

       … from call site
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/lib/modules.nix:902:11:
          901|         if def.condition then
          902|           dischargeProperties def.content
             |           ^
          903|         else

       … while calling 'dischargeProperties'
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/lib/modules.nix:896:25:
          895|   */
          896|   dischargeProperties = def:
             |                         ^
          897|     if def._type or "" == "merge" then

       … from call site
         at «github:cachix/devenv/11e7d3ef56f542e70f138069fe9b95401c2143c8»/src/modules/languages/python.nix:35:20:
           34|
           35|   nixpkgs-python = config.lib.getInput {
             |                    ^
           36|     name = "nixpkgs-python";

       … while calling 'lambda'
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/lib/types.nix:259:33:
          258|             stringCoercibleSet = mergeOneOption;
          259|             lambda = loc: defs: arg: anything.merge
             |                                 ^
          260|               (loc ++ [ "<function body>" ])

       … from call site
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/lib/types.nix:259:38:
          258|             stringCoercibleSet = mergeOneOption;
          259|             lambda = loc: defs: arg: anything.merge
             |                                      ^
          260|               (loc ++ [ "<function body>" ])

       … while calling 'merge'
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/lib/types.nix:233:20:
          232|       check = value: true;
          233|       merge = loc: defs:
             |                    ^
          234|         let

       … from call site
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/lib/types.nix:242:24:
          241|           # don't have the same type
          242|           commonType = foldl' (type: def:
             |                        ^
          243|             if getType def.value == type

       … while calling 'foldl''
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/lib/lists.nix:264:5:
          263|     op:
          264|     acc:
             |     ^
          265|     # The builtin `foldl'` is a bit lazier than one might expect.

       … from call site
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/lib/types.nix:246:14:
          245|             else throw "The option `${showOption loc}' has conflicting option types in ${showFiles (getFiles defs)}"
          246|           ) (getType (head defs).value) defs;
             |              ^
          247|

       … while calling 'getType'
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/lib/types.nix:235:21:
          234|         let
          235|           getType = value:
             |                     ^
          236|             if isAttrs value && isStringLike value

       … from call site
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/lib/types.nix:263:25:
          262|                 file = def.file;
          263|                 value = def.value arg;
             |                         ^
          264|               }) defs);

       … while calling 'getInput'
         at «github:cachix/devenv/11e7d3ef56f542e70f138069fe9b95401c2143c8»/src/modules/lib.nix:11:16:
           10|   config.lib = {
           11|     getInput = { name, url, attribute, follows ? [ ] }:
             |                ^
           12|       let

       error:
       error: To use 'languages.python.version', run the following command:

         $ devenv inputs add nixpkgs-python github:cachix/nixpkgs-python --follows nixpkgs

✖ Command produced the following output:

✔ Building shell in 1.1s.
✔ Running tests in 1.1s.
Error:   × Command `/nix/store/as7cgg7qvnkamrcycbgcdvhs0kv7wphx-nix-2.21-devenv/bin/nix --show-trace --extra-experimental-features nix-command --extra-experimental-features flakes --option
  │ warn-dirty false --option eval-cache false --keep-going --max-jobs 5 print-dev-env --profile /Users/ij0723/workspace/tap-init-api/.devenv.aUelqUX5hA0q/gc/shell --option extra-
  │ substituters https://nixpkgs-python.cachix.org https://devenv.cachix.org --option extra-trusted-public-keys devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw= nixpkgs-
  │ python.cachix.org-1:hxjI7pFxTyuTHn2NkvWCrAUcNZLNS3ZAvfYNuYifcEU=` failed with with exit code 1
  1. run $ devenv inputs add nixpkgs-python github:cachix/nixpkgs-python --follows nixpkgs did not help but it did add the config to devenv.yaml though

My devenv.yaml

inputs:
  nixpkgs-python:
    url: github:cachix/nixpkgs-python
    inputs:
      nixpkgs:
        follows: nixpkgs
  nixpkgs:
    url: github:cachix/devenv-nixpkgs/rolling

My devnenv.nix

{ pkgs, lib, config, inputs, ... }:

{
  # https://devenv.sh/basics/
  env.GREET = "tap-init-api";

  # https://devenv.sh/packages/
  packages = [ pkgs.git pkgs.jq ];

  # https://devenv.sh/scripts/
  scripts.hello.exec = "echo hello from $GREET";

  enterShell = ''
    echo "Get ready for [$GREET]"
    jq --version
    git --version
    go version
    python -V
  '';

  # https://devenv.sh/tests/
  enterTest = ''
    echo "Running tests"
    if [[ $(git --version | head -n 1 | cut -d" " -f3) > 2.42.0 ]]; then
      echo "git version is OK"
    else
      echo "git version too low"
      exit 1
    fi
  '';

  # https://devenv.sh/services/
  # services.postgres.enable = true;

  # https://devenv.sh/languages/
  # languages.nix.enable = true;
  languages.go.enable = true;
  languages.go.package = pkgs.go_1_22;
  languages.python.enable = true;
  languages.python.version = "3.11.8";

  # https://devenv.sh/pre-commit-hooks/
  pre-commit.hooks.shellcheck.enable = true;

  # https://devenv.sh/processes/
  # processes.ping.exec = "ping example.com";

  # See full reference at https://devenv.sh/reference/options/
}

Version

Paste the output of $ devenv version here.

devenv 1.0.4 (aarch64-darwin)
nix (Nix) 2.20.5
domenkozar commented 1 week ago

I'll release 1.0.5 today/tomorrow to address this.

bobymicroby commented 1 week ago

It happened to me too today when trying to devenv test - leaving the logs bellow.

β Projects/s git:(master)  devenv test                               devenv-shell-env
• Overriding .devenv to .devenv.maQ4iGQd35CR
• Building tests ...
• Using Cachix: nixpkgs-python, devenv
error:
       … while calling the 'derivationStrict' builtin
         at <nix/derivation-internal.nix>:9:12:
            8|
            9|   strict = derivationStrict drvAttrs;
             |            ^
           10|

       … while evaluating derivation 'devenv-test'
         whose name attribute is located at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/pkgs/stdenv/generic/make-derivation.nix:331:7

       … while evaluating attribute 'text' of derivation 'devenv-test'
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/pkgs/build-support/trivial-builders/default.nix:103:16:
          102|       ({
          103|         inherit text executable checkPhase allowSubstitutes preferLocalBuild;
             |                ^
          104|         passAsFile = [ "text" ]

       … from call site
         at «github:cachix/devenv/2ee332697eb84101695b0fd950f31961ca60d7dd»/src/modules/tests.nix:15:11:
           14|         echo "• Setting up shell environment ..."
           15|         ${config.enterShell}
             |           ^
           16|

       … while calling anonymous lambda
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/lib/attrsets.nix:1171:18:
         1170|         mapAttrs
         1171|           (name: value:
             |                  ^
         1172|             if isAttrs value && cond value

       … from call site
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/lib/attrsets.nix:1174:18:
         1173|             then recurse (path ++ [ name ]) value
         1174|             else f (path ++ [ name ]) value);
             |                  ^
         1175|     in

       … while calling anonymous lambda
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/lib/modules.nix:242:72:
          241|           # For definitions that have an associated option
          242|           declaredConfig = mapAttrsRecursiveCond (v: ! isOption v) (_: v: v.value) options;
             |                                                                        ^
          243|

       … while evaluating the option `enterShell':

       … while calling anonymous lambda
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/lib/modules.nix:824:28:
          823|         # Process mkMerge and mkIf properties.
          824|         defs' = concatMap (m:
             |                            ^
          825|           map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))

       … while evaluating definitions from `/nix/store/virtual0000000000000000000000008-source/src/modules/languages/python.nix':

       … from call site
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/lib/modules.nix:825:137:
          824|         defs' = concatMap (m:
          825|           map (value: { inherit (m) file; inherit value; }) (builtins.addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))
             |                                                                                                                                         ^
          826|         ) defs;

       … while calling 'dischargeProperties'
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/lib/modules.nix:896:25:
          895|   */
          896|   dischargeProperties = def:
             |                         ^
          897|     if def._type or "" == "merge" then

       … from call site
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/lib/modules.nix:902:11:
          901|         if def.condition then
          902|           dischargeProperties def.content
             |           ^
          903|         else

       … while calling 'dischargeProperties'
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/lib/modules.nix:896:25:
          895|   */
          896|   dischargeProperties = def:
             |                         ^
          897|     if def._type or "" == "merge" then

       … from call site
         at «github:cachix/devenv/2ee332697eb84101695b0fd950f31961ca60d7dd»/src/modules/languages/python.nix:13:13:
           12|   readlink = "${pkgs.coreutils}/bin/readlink -f ";
           13|   package = pkgs.callPackage "${pkgs.path}/pkgs/development/interpreters/python/wrapper.nix" {
             |             ^
           14|     python = cfg.package;

       … while calling 'callPackageWith'
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/lib/customisation.nix:212:35:
          211|   */
          212|   callPackageWith = autoArgs: fn: args:
             |                                   ^
          213|     let

       … from call site
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/lib/trivial.nix:895:7:
          894|     { # TODO: Should we add call-time "type" checking like built in?
          895|       __functor = self: f;
             |       ^
          896|       __functionArgs = args;

       … while calling anonymous lambda
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/lib/customisation.nix:136:17:
          135|     in
          136|     mirrorArgs (origArgs:
             |                 ^
          137|     let

       … from call site
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/lib/customisation.nix:138:16:
          137|     let
          138|       result = f origArgs;
             |                ^
          139|

       … while calling anonymous lambda
         at /nix/store/mhgnysbsr0yx44xlqvl7xymk8js22c7z-source/pkgs/development/interpreters/python/wrapper.nix:1:1:
            1| { lib, stdenv, buildEnv, makeBinaryWrapper
             | ^
            2|

       … from call site
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/lib/trivial.nix:895:7:
          894|     { # TODO: Should we add call-time "type" checking like built in?
          895|       __functor = self: f;
             |       ^
          896|       __functionArgs = args;

       … while calling anonymous lambda
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/lib/customisation.nix:136:17:
          135|     in
          136|     mirrorArgs (origArgs:
             |                 ^
          137|     let

       … from call site
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/lib/customisation.nix:138:16:
          137|     let
          138|       result = f origArgs;
             |                ^
          139|

       … while calling anonymous lambda
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/pkgs/build-support/buildenv/default.nix:14:2:
           13| lib.makeOverridable
           14| ({ name
             |  ^
           15|

       … from call site
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/pkgs/build-support/buildenv/default.nix:53:1:
           52|
           53| runCommand name
             | ^
           54|   rec {

       … while calling anonymous lambda
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/pkgs/build-support/trivial-builders/default.nix:65:8:
           64|       # TODO(@Artturin): enable strictDeps always
           65|     }: buildCommand:
             |        ^
           66|       stdenv.mkDerivation ({

       … from call site
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/pkgs/build-support/trivial-builders/default.nix:66:7:
           65|     }: buildCommand:
           66|       stdenv.mkDerivation ({
             |       ^
           67|         enableParallelBuilding = true;

       … while calling 'mkDerivation'
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/pkgs/stdenv/generic/make-derivation.nix:46:5:
           45|   mkDerivation =
           46|     fnOrAttrs:
             |     ^
           47|       if builtins.isFunction fnOrAttrs

       … from call site
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/pkgs/stdenv/generic/make-derivation.nix:49:12:
           48|       then makeDerivationExtensible fnOrAttrs
           49|       else makeDerivationExtensibleConst fnOrAttrs;
             |            ^
           50|

       … while calling 'makeDerivationExtensibleConst'
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/pkgs/stdenv/generic/make-derivation.nix:98:35:
           97|   # but pre-evaluated for a slight improvement in performance.
           98|   makeDerivationExtensibleConst = attrs:
             |                                   ^
           99|     mkDerivationSimple

       … from call site
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/pkgs/stdenv/generic/make-derivation.nix:99:5:
           98|   makeDerivationExtensibleConst = attrs:
           99|     mkDerivationSimple
             |     ^
          100|       (f0:

       … while calling 'mkDerivationSimple'
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/pkgs/stdenv/generic/make-derivation.nix:508:1:
          507| # * [package attributes]: https://nixos.org/manual/nix/stable/glossary#package-attribute-set
          508| {
             | ^
          509|

       … from call site
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/pkgs/stdenv/generic/make-derivation.nix:579:1:
          578|
          579| extendDerivation
             | ^
          580|   validity.handled

       … while calling 'extendDerivation'
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/lib/customisation.nix:339:43:
          338|   */
          339|   extendDerivation = condition: passthru: drv:
             |                                           ^
          340|     let

       … from call site
         at «github:cachix/devenv/2ee332697eb84101695b0fd950f31961ca60d7dd»/src/modules/languages/python.nix:14:14:
           13|   package = pkgs.callPackage "${pkgs.path}/pkgs/development/interpreters/python/wrapper.nix" {
           14|     python = cfg.package;
             |              ^
           15|     requiredPythonModules = cfg.package.pkgs.requiredPythonModules;

       … while calling anonymous lambda
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/lib/attrsets.nix:1171:18:
         1170|         mapAttrs
         1171|           (name: value:
             |                  ^
         1172|             if isAttrs value && cond value

       … from call site
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/lib/attrsets.nix:1174:18:
         1173|             then recurse (path ++ [ name ]) value
         1174|             else f (path ++ [ name ]) value);
             |                  ^
         1175|     in

       … while calling anonymous lambda
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/lib/modules.nix:242:72:
          241|           # For definitions that have an associated option
          242|           declaredConfig = mapAttrsRecursiveCond (v: ! isOption v) (_: v: v.value) options;
             |                                                                        ^
          243|

       … while evaluating the option `languages.python.package':

       (9 duplicate frames omitted)

       … from call site
         at «github:cachix/devenv/2ee332697eb84101695b0fd950f31961ca60d7dd»/src/modules/languages/python.nix:35:20:
           34|
           35|   nixpkgs-python = config.lib.getInput {
             |                    ^
           36|     name = "nixpkgs-python";

       … while calling 'lambda'
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/lib/types.nix:259:33:
          258|             stringCoercibleSet = mergeOneOption;
          259|             lambda = loc: defs: arg: anything.merge
             |                                 ^
          260|               (loc ++ [ "<function body>" ])

       … from call site
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/lib/types.nix:259:38:
          258|             stringCoercibleSet = mergeOneOption;
          259|             lambda = loc: defs: arg: anything.merge
             |                                      ^
          260|               (loc ++ [ "<function body>" ])

       … while calling 'merge'
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/lib/types.nix:233:20:
          232|       check = value: true;
          233|       merge = loc: defs:
             |                    ^
          234|         let

       … from call site
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/lib/types.nix:242:24:
          241|           # don't have the same type
          242|           commonType = foldl' (type: def:
             |                        ^
          243|             if getType def.value == type

       … while calling 'foldl''
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/lib/lists.nix:264:5:
          263|     op:
          264|     acc:
             |     ^
          265|     # The builtin `foldl'` is a bit lazier than one might expect.

       … from call site
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/lib/types.nix:246:14:
          245|             else throw "The option `${showOption loc}' has conflicting option types in ${showFiles (getFiles defs)}"
          246|           ) (getType (head defs).value) defs;
             |              ^
          247|

       … while calling 'getType'
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/lib/types.nix:235:21:
          234|         let
          235|           getType = value:
             |                     ^
          236|             if isAttrs value && isStringLike value

       … from call site
         at «github:cachix/devenv-nixpkgs/285676e87ad9f0ca23d8714a6ab61e7e027020c6»/lib/types.nix:263:25:
          262|                 file = def.file;
          263|                 value = def.value arg;
             |                         ^
          264|               }) defs);

       … while calling 'getInput'
         at «github:cachix/devenv/2ee332697eb84101695b0fd950f31961ca60d7dd»/src/modules/lib.nix:11:16:
           10|   config.lib = {
           11|     getInput = { name, url, attribute, follows ? [ ] }:
             |                ^
           12|       let

       error:
       error: To use 'languages.python.version', run the following command:

         $ devenv inputs add nixpkgs-python github:cachix/nixpkgs-python --follows nixpkgs

✖ Command produced the following output:

✔ Building tests in 0.8s.
Error:   × Command `/nix/store/wcqjriqzl8nd82ajz2fy7vmndbx1668j-nix-2.21-devenv/bin/nix --show-
  │ trace --extra-experimental-features nix-command --extra-experimental-features flakes
  │ --option warn-dirty false --option eval-cache false --keep-going --max-jobs 10
  │ build .#devenv.test --no-link --print-out-paths --option extra-substituters https://
  │ nixpkgs-python.cachix.org https://devenv.cachix.org --option extra-trusted-public-
  │ keys devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw= nixpkgs-
  │ python.cachix.org-1:hxjI7pFxTyuTHn2NkvWCrAUcNZLNS3ZAvfYNuYifcEU=` failed with with exit
  │ code 1

direnv: loading ~/Projects/s/.envrc                                                    
direnv: loading https://raw.githubusercontent.com/cachix/devenv/d1f7b48e35e6dee421cfd0f51481d17f77586997/direnvrc (sha256-YBzqskFZxmNb3kYVoKD9ZixoPXJh1C9ZvTLGFRkauZ0=)
direnv: using devenv
direnv: .envrc changed, reloading
direnv: ([/nix/store/vgsya11phi7cs65kn4nmv7hyhjavhn1p-direnv-2.34.0/bin/direnv export zsh]) is taking a while to execute. Use CTRL-C to give up.
• Using Cachix: nixpkgs-python, devenv
direnv: updated devenv shell cache
direnv: export +AR +AS +CC +CONFIG_SHELL +CXX +DETERMINISTIC_BUILD +DEVENV_DOTFILE +DEVENV_PROFILE +DEVENV_ROOT +DEVENV_RUNTIME +DEVENV_STATE +IN_NIX_SHELL +LD +NIX_BINTOOLS +NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu +NIX_CC +NIX_CC_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu +NIX_CFLAGS_COMPILE +NIX_ENFORCE_NO_NATIVE +NIX_HARDENING_ENABLE +NIX_LDFLAGS +NIX_PKG_CONFIG_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu +NIX_STORE +NM +OBJCOPY +OBJDUMP +PKG_CONFIG +PKG_CONFIG_PATH +PYTHONHASHSEED +PYTHONNOUSERSITE +PYTHONPATH +PYTHONSTARTUP +RANLIB +READELF +SIZE +SOURCE_DATE_EPOCH +STRINGS +STRIP +VIRTUAL_ENV +VIRTUAL_ENV_PROMPT +_PYTHON_HOST_PLATFORM +_PYTHON_SYSCONFIGDATA_NAME +cmakeFlags +configureFlags +mesonFlags +name +system ~PATH ~XDG_DATA_DIRS
β Projects/s git:(master)                         
imcom commented 6 days ago

has devenv 1.0.5 out already? How should I upgrade the package via home-manager

Thanks in advance!

imcom commented 6 days ago

@bobymicroby well, it seems there no new release yet, so we have the issue with 1.0.4 at the moment

domenkozar commented 6 days ago

https://github.com/cachix/devenv/releases/tag/v1.0.5 is out, it should be available for installation tomorrow.