Skip to content
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

Breaking change in crane fails Hydra CI #1928

Closed
2 tasks done
jpraynaud opened this issue Sep 10, 2024 · 0 comments · Fixed by #1959
Closed
2 tasks done

Breaking change in crane fails Hydra CI #1928

jpraynaud opened this issue Sep 10, 2024 · 0 comments · Fixed by #1959
Assignees
Labels
dependencies Updates a dependency file

Comments

@jpraynaud
Copy link
Member

jpraynaud commented Sep 10, 2024

Why

We have noticed that the Hydra CI fails when we update nix flake with the command nix flake update.

It raises this error: (https://github.com/input-output-hk/mithril/runs/29720308582)

hydra-eval-jobs returned exit code 1:
warning: ignoring --gc-roots-dir (just supported for compatibility)
info: waiting for evaluation...
info: evaluation failed
error:
       … while calling anonymous lambda

         at «string»:68:1:

           67| };
           68| flake: let
             | ^
           69|   job = let

       … from call site

         at «string»:128:20:

          127|
          128|     jobAttrPaths = lib.collectAttrPaths lib.isDerivation jobAttrs;
             |                    ^
          129|   inwhile calling 'collectAttrPaths'

         at «string»:20:33:

           19|
           20|   collectAttrPaths = predicate: attrs: let
             |                                 ^
           21|     internal = path: attrs: let

       … from call site

         at «string»:53:5:

           52|   in
           53|     internal [] attrs;
             |     ^
           54|while calling 'internal'

         at «string»:21:22:

           20|   collectAttrPaths = predicate: attrs: let
           21|     internal = path: attrs: let
             |                      ^
           22|       inherit

       … from call site

         at «string»:36:11:

           35|         then
           36|           flattenDepth 1 (
             |           ^
           37|             map

       … while calling 'flattenDepth'

         at «string»:6:25:

            5|
            6|   flattenDepth = depth: x:
             |                         ^
            7|     if builtins.isList x && (depth == null || depth >= 0)

       … while calling 'flattenDepth'

         at «string»:6:25:

            5|
            6|   flattenDepth = depth: x:
             |                         ^
            7|     if builtins.isList x && (depth == null || depth >= 0)

       … while calling anonymous lambda

         at «string»:39:15:

           38|             (
           39|               attrName:
             |               ^
           40|                 internal

       … from call site

         at «string»:40:17:

           39|               attrName:
           40|                 internal
             |                 ^
           41|                 (path ++ [attrName])

       … while calling 'internal'

         at «string»:21:22:

           20|   collectAttrPaths = predicate: attrs: let
           21|     internal = path: attrs: let
             |                      ^
           22|       inherit

       … while calling anonymous lambda

         at «string»:25:12:

           24|           builtins.partition
           25|           (attrName: predicate attrs.${attrName})
             |            ^
           26|           (builtins.attrNames attrs)

       … from call site

         at «string»:25:22:

           24|           builtins.partition
           25|           (attrName: predicate attrs.${attrName})
             |                      ^
           26|           (builtins.attrNames attrs)

       … while calling 'isDerivation'

         at «string»:4:18:

            3|   # copied from nixpkgs
            4|   isDerivation = value: value.type or null == "derivation";
             |                  ^
            5|while calling anonymous lambda

         at /nix/store/fkjds639pw6ykj3zib7cp4y9i9h6ka9w-source/types.nix:607:29:

          606|       merge = loc: defs:
          607|         zipAttrsWith (name: defs:
             |                             ^
          608|           let merged = mergeDefinitions (loc ++ [name]) elemType defs;while calling anonymous lambda

         at /nix/store/fkjds639pw6ykj3zib7cp4y9i9h6ka9w-source/modules.nix:836:28:

          835|         # Process mkMerge and mkIf properties.
          836|         defs' = concatMap (m:
             |                            ^
          837|           map (value: { inherit (m) file; inherit value; }) (addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))

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

       … from call site

         at /nix/store/fkjds639pw6ykj3zib7cp4y9i9h6ka9w-source/modules.nix:837:128:

          836|         defs' = concatMap (m:
          837|           map (value: { inherit (m) file; inherit value; }) (addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))
             |                                                                                                                                ^
          838|         ) defs;

       … while calling 'dischargeProperties'

         at /nix/store/fkjds639pw6ykj3zib7cp4y9i9h6ka9w-source/modules.nix:908:25:

          907|   */
          908|   dischargeProperties = def:
             |                         ^
          909|     if def._type or "" == "merge" then

       … while calling anonymous lambda

         at /nix/store/fkjds639pw6ykj3zib7cp4y9i9h6ka9w-source/types.nix:607:29:

          606|       merge = loc: defs:
          607|         zipAttrsWith (name: defs:
             |                             ^
          608|           let merged = mergeDefinitions (loc ++ [name]) elemType defs;

       … while calling anonymous lambda

         at /nix/store/fkjds639pw6ykj3zib7cp4y9i9h6ka9w-source/modules.nix:836:28:

          835|         # Process mkMerge and mkIf properties.
          836|         defs' = concatMap (m:
             |                            ^
          837|           map (value: { inherit (m) file; inherit value; }) (addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))

       … while evaluating definitions from `/nix/store/2nixq6l4bpcx48xl99ixdfxk7fjyd6m6-source/flake.nix, via option perSystem':

       … from call site

         at /nix/store/fkjds639pw6ykj3zib7cp4y9i9h6ka9w-source/modules.nix:837:128:

          836|         defs' = concatMap (m:
          837|           map (value: { inherit (m) file; inherit value; }) (addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))
             |                                                                                                                                ^
          838|         ) defs;

       … while calling 'dischargeProperties'

         at /nix/store/fkjds639pw6ykj3zib7cp4y9i9h6ka9w-source/modules.nix:908:25:

          907|   */
          908|   dischargeProperties = def:
             |                         ^
          909|     if def._type or "" == "merge" then

       … from call site

         at /nix/store/2nixq6l4bpcx48xl99ixdfxk7fjyd6m6-source/flake.nix:101:19:

          100|         mithril-common = buildPackage ./mithril-common/Cargo.toml mithril-stm.cargoArtifacts { cargoExtraArgs = "-p mithril-common --features full"; };
          101|         mithril = buildPackage null mithril-common.cargoArtifacts {
             |                   ^
          102|           doCheck = false;

       … while calling 'buildPackage'

         at /nix/store/2nixq6l4bpcx48xl99ixdfxk7fjyd6m6-source/flake.nix:88:55:

           87|
           88|         buildPackage = cargoToml: baseCargoArtifacts: args:
             |                                                       ^
           89|           craneLib.buildPackage (commonsArgs

       error: attribute 'lib' missing

       at /nix/store/2nixq6l4bpcx48xl99ixdfxk7fjyd6m6-source/flake.nix:26:20:

           25|         inherit (inputs.nixpkgs) lib;
           26|         craneLib = inputs.crane.lib.${system};
             |                    ^
           27|

What

Fix the issue with a quick fix and a long term fix by adapting the implementation to the breaking changes of crane.

How

  • Quick fix the nix configuration to target the latest version we support (0.18)
  • Long term fix by adapting the nix configuration to the latest version of crane
@jpraynaud jpraynaud added the dependencies Updates a dependency file label Sep 10, 2024
@jpraynaud jpraynaud mentioned this issue Sep 26, 2024
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Updates a dependency file
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants