Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when toolchain override: "Dependency is not of a valid type: element 2 of nativeBuildInputs for cargo-package-deps" #700

Closed
zmrocze opened this issue Sep 13, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@zmrocze
Copy link

zmrocze commented Sep 13, 2024

Describe the bug

I cannot override the toolchain, packages build without trying to override. Not sure which component is resposnbe for the error - whether its crane, rust-overlays or sth I defined.

Reproduction

nix run github:zmrocze/midi-mapper/bug-repro#midi_printer --show-trace

results in

warning: Git tree '/home/zmrocze/code/rust/midi-mapper' is dirty
trace: warning: crane will use a placeholder value since `version` cannot be found in /nix/store/f2mx03pgad3f1vbiwizdipnb287cvcds-source/Cargo.toml
to silence this warning consider one of the following:
- setting `version = "...";` in the derivation arguments explicitly
- setting `package.version = "..."` or `workspace.package.version` = "..." in the root Cargo.toml
- explicitly looking up the values from a different Cargo.toml via 
  `craneLib.crateNameFromCargoToml { cargoToml = ./path/to/Cargo.toml; }`

To find the source of this warning, rerun nix with:
`NIX_ABORT_ON_WARN=1 nix --option pure-eval false --show-trace ...`


trace: warning: crane will use a placeholder value since `version` cannot be found in /nix/store/f2mx03pgad3f1vbiwizdipnb287cvcds-source/Cargo.toml
to silence this warning consider one of the following:
- setting `version = "...";` in the derivation arguments explicitly
- setting `package.version = "..."` or `workspace.package.version` = "..." in the root Cargo.toml
- explicitly looking up the values from a different Cargo.toml via 
  `craneLib.crateNameFromCargoToml { cargoToml = ./path/to/Cargo.toml; }`

To find the source of this warning, rerun nix with:
`NIX_ABORT_ON_WARN=1 nix --option pure-eval false --show-trace ...`


trace: warning: crane will use a placeholder value since `name` cannot be found in /nix/store/f2mx03pgad3f1vbiwizdipnb287cvcds-source/Cargo.toml
to silence this warning consider one of the following:
- setting `pname = "...";` in the derivation arguments explicitly
- setting `package.name = "..."` or `package.metadata.crane.name` = "..." or `workspace.metadata.crane.name` = "..." in the root Cargo.toml
- explicitly looking up the values from a different Cargo.toml via 
  `craneLib.crateNameFromCargoToml { cargoToml = ./path/to/Cargo.toml; }`

To find the source of this warning, rerun nix with:
`NIX_ABORT_ON_WARN=1 nix --option pure-eval false --show-trace ...`


error:
       … while calling anonymous lambda

         at /nix/store/wxjsfgkkd93fwqn1g49srpj9gms656wn-source/attrsets.nix:1205:18:

         1204|         mapAttrs
         1205|           (name: value:
             |                  ^
         1206|             if isAttrs value && cond value

       … from call site

         at /nix/store/wxjsfgkkd93fwqn1g49srpj9gms656wn-source/attrsets.nix:1208:18:

         1207|             then recurse (path ++ [ name ]) value
         1208|             else f (path ++ [ name ]) value);
             |                  ^
         1209|     in

       … while calling anonymous lambda

         at /nix/store/wxjsfgkkd93fwqn1g49srpj9gms656wn-source/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 `flake.apps.x86_64-linux.midi_printer.program':

       … while calling anonymous lambda

         at /nix/store/wxjsfgkkd93fwqn1g49srpj9gms656wn-source/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/n9czz5ak3nnkgjvlywhaccjisjyaxhjy-source/modules/transposition.nix':

       … from call site

         at /nix/store/wxjsfgkkd93fwqn1g49srpj9gms656wn-source/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 /nix/store/wxjsfgkkd93fwqn1g49srpj9gms656wn-source/modules.nix:896:25:

          895|   */
          896|   dischargeProperties = def:
             |                         ^
          897|     if def._type or "" == "merge" then

       … while calling anonymous lambda

         at /nix/store/wxjsfgkkd93fwqn1g49srpj9gms656wn-source/attrsets.nix:1205:18:

         1204|         mapAttrs
         1205|           (name: value:
             |                  ^
         1206|             if isAttrs value && cond value

       … from call site

         at /nix/store/wxjsfgkkd93fwqn1g49srpj9gms656wn-source/attrsets.nix:1208:18:

         1207|             then recurse (path ++ [ name ]) value
         1208|             else f (path ++ [ name ]) value);
             |                  ^
         1209|     in

       … while calling anonymous lambda

         at /nix/store/wxjsfgkkd93fwqn1g49srpj9gms656wn-source/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 `perSystem.x86_64-linux.apps.midi_printer.program':

       … while calling anonymous lambda

         at /nix/store/wxjsfgkkd93fwqn1g49srpj9gms656wn-source/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/8jm9cbf66jkq7cnbw43pv324ikf6cg00-source/flake.nix, via option perSystem':

       … from call site

         at /nix/store/wxjsfgkkd93fwqn1g49srpj9gms656wn-source/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 /nix/store/wxjsfgkkd93fwqn1g49srpj9gms656wn-source/modules.nix:896:25:

          895|   */
          896|   dischargeProperties = def:
             |                         ^
          897|     if def._type or "" == "merge" then

       … while evaluating derivation 'midi_printer-0.0.1'
         whose name attribute is located at /nix/store/cy8fiajvwb80m83zxz300hwfjl0g8rna-source/pkgs/stdenv/generic/make-derivation.nix:331:7

       … while evaluating attribute 'cargoArtifacts' of derivation 'midi_printer-0.0.1'

         at /nix/store/xgf59l2rwryvybjawzwvm0i6khd9c7q1-source/lib/mkCargoDerivation.nix:59:10:

           58| } // {
           59|   inherit cargoArtifacts;
             |          ^
           60|

       … while evaluating derivation 'cargo-package-deps-0.0.1'
         whose name attribute is located at /nix/store/cy8fiajvwb80m83zxz300hwfjl0g8rna-source/pkgs/stdenv/generic/make-derivation.nix:331:7

       … while evaluating attribute 'nativeBuildInputs' of derivation 'cargo-package-deps-0.0.1'

         at /nix/store/cy8fiajvwb80m83zxz300hwfjl0g8rna-source/pkgs/stdenv/generic/make-derivation.nix:375:7:

          374|       depsBuildBuild              = elemAt (elemAt dependencies 0) 0;
          375|       nativeBuildInputs           = elemAt (elemAt dependencies 0) 1;
             |       ^
          376|       depsBuildTarget             = elemAt (elemAt dependencies 0) 2;

       … while calling anonymous lambda

         at /nix/store/cy8fiajvwb80m83zxz300hwfjl0g8rna-source/pkgs/stdenv/generic/make-derivation.nix:302:13:

          301|       (map (drv: getDev drv.__spliced.buildBuild or drv) (checkDependencyList "depsBuildBuild" depsBuildBuild))
          302|       (map (drv: getDev drv.__spliced.buildHost or drv) (checkDependencyList "nativeBuildInputs" nativeBuildInputs'))
             |             ^
          303|       (map (drv: getDev drv.__spliced.buildTarget or drv) (checkDependencyList "depsBuildTarget" depsBuildTarget))

       … from call site

         at /nix/store/cy8fiajvwb80m83zxz300hwfjl0g8rna-source/pkgs/stdenv/generic/make-derivation.nix:302:18:

          301|       (map (drv: getDev drv.__spliced.buildBuild or drv) (checkDependencyList "depsBuildBuild" depsBuildBuild))
          302|       (map (drv: getDev drv.__spliced.buildHost or drv) (checkDependencyList "nativeBuildInputs" nativeBuildInputs'))
             |                  ^
          303|       (map (drv: getDev drv.__spliced.buildTarget or drv) (checkDependencyList "depsBuildTarget" depsBuildTarget))

       … while calling 'getOutput'

         at /nix/store/cy8fiajvwb80m83zxz300hwfjl0g8rna-source/lib/attrsets.nix:1796:23:

         1795|   */
         1796|   getOutput = output: pkg:
             |                       ^
         1797|     if ! pkg ? outputSpecified || ! pkg.outputSpecified

       … while calling anonymous lambda

         at /nix/store/cy8fiajvwb80m83zxz300hwfjl0g8rna-source/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 /nix/store/cy8fiajvwb80m83zxz300hwfjl0g8rna-source/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 /nix/store/cy8fiajvwb80m83zxz300hwfjl0g8rna-source/pkgs/stdenv/generic/make-derivation.nix:276:15:

          275|     imap1
          276|       (index: dep:
             |               ^
          277|         if isDerivation dep || dep == null || builtins.isString dep || builtins.isPath dep then dep

       error: Dependency is not of a valid type: element 2 of nativeBuildInputs for cargo-package-deps
@zmrocze zmrocze added the bug Something isn't working label Sep 13, 2024
Repository owner locked and limited conversation to collaborators Sep 22, 2024
@ipetkov ipetkov converted this issue into discussion #706 Sep 22, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant