bitte icon indicating copy to clipboard operation
bitte copied to clipboard

Vulnix craps out when bitte inputs is overridden to a local path

Open kaii-zen opened this issue 3 years ago • 0 comments
trafficstars

Often during development, it is a useful pattern to add something like nix flake lock --override-input bitte path:../bitte to the consumer's .envrc.local. Unfortunately, this results in the following when systemd tries to start vulnix on the monitoring machine:

Apr 13 15:53:37 monitoring vulnix-start[7315]: error: cannot fetch input 'path:../bitte?narHash=sha256-dy0UrDisVuUuKYhcfBB%2f6vBqpZM2OjFRm3YHj3r1Cko=' because it uses a relative path
Apr 13 15:53:37 monitoring vulnix-start[7315]:        … while fetching the input 'path:../bitte?narHash=sha256-dy0UrDisVuUuKYhcfBB%2f6vBqpZM2OjFRm3YHj3r1Cko='
Apr 13 15:53:37 monitoring vulnix-start[7315]:        … while realising the context of a path
Apr 13 15:53:37 monitoring vulnix-start[7315]:        at «string»:20:19:
Apr 13 15:53:37 monitoring vulnix-start[7315]:            19|
Apr 13 15:53:37 monitoring vulnix-start[7315]:            20|           flake = import (sourceInfo + (if subdir != "" then "/" else "") + subdir + "/flake.nix");
Apr 13 15:53:37 monitoring vulnix-start[7315]:              |                   ^
Apr 13 15:53:37 monitoring vulnix-start[7315]:            21|
Apr 13 15:53:37 monitoring vulnix-start[7315]:        … while evaluating anonymous lambda
Apr 13 15:53:37 monitoring vulnix-start[7315]:        at «string»:10:13:
Apr 13 15:53:37 monitoring vulnix-start[7315]:             9|     builtins.mapAttrs
Apr 13 15:53:37 monitoring vulnix-start[7315]:            10|       (key: node:
Apr 13 15:53:37 monitoring vulnix-start[7315]:              |             ^
Apr 13 15:53:37 monitoring vulnix-start[7315]:            11|         let
Apr 13 15:53:37 monitoring vulnix-start[7315]:        … from call site
Apr 13 15:53:37 monitoring vulnix-start[7315]:        … while evaluating anonymous lambda
Apr 13 15:53:37 monitoring vulnix-start[7315]:        at «string»:23:25:
Apr 13 15:53:37 monitoring vulnix-start[7315]:            22|           inputs = builtins.mapAttrs
Apr 13 15:53:37 monitoring vulnix-start[7315]:            23|             (inputName: inputSpec: allNodes.${resolveInput inputSpec})
Apr 13 15:53:37 monitoring vulnix-start[7315]:              |                         ^
Apr 13 15:53:37 monitoring vulnix-start[7315]:            24|             (node.inputs or {});
Apr 13 15:53:37 monitoring vulnix-start[7315]:        … from call site
Apr 13 15:53:37 monitoring vulnix-start[7315]:        … while evaluating 'recursiveUpdateUntil'
Apr 13 15:53:37 monitoring vulnix-start[7315]:        at /nix/store/m2vv0bxfchzrjngx8wi0i7dhzb9q2g50-source/lib/attrsets.nix:516:37:
Apr 13 15:53:37 monitoring vulnix-start[7315]:           515|      */
Apr 13 15:53:37 monitoring vulnix-start[7315]:           516|   recursiveUpdateUntil = pred: lhs: rhs:
Apr 13 15:53:37 monitoring vulnix-start[7315]:              |                                     ^
Apr 13 15:53:37 monitoring vulnix-start[7315]:           517|     let f = attrPath:
Apr 13 15:53:37 monitoring vulnix-start[7315]:        … from call site
Apr 13 15:53:37 monitoring vulnix-start[7315]:        at /nix/store/qk2d661knlfkhzl49krsf0vb14ns51jj-source/flake.nix:222:7:
Apr 13 15:53:37 monitoring vulnix-start[7315]:           221|     growOn = args: soil:
Apr 13 15:53:37 monitoring vulnix-start[7315]:           222|       nixpkgs.lib.attrsets.recursiveUpdate (
Apr 13 15:53:37 monitoring vulnix-start[7315]:              |       ^
Apr 13 15:53:37 monitoring vulnix-start[7315]:           223|         soil
Apr 13 15:53:37 monitoring vulnix-start[7315]:        … while evaluating 'growOn'
Apr 13 15:53:37 monitoring vulnix-start[7315]:        at /nix/store/qk2d661knlfkhzl49krsf0vb14ns51jj-source/flake.nix:221:20:
Apr 13 15:53:37 monitoring vulnix-start[7315]:           220|       stdOutput;
Apr 13 15:53:37 monitoring vulnix-start[7315]:           221|     growOn = args: soil:
Apr 13 15:53:37 monitoring vulnix-start[7315]:              |                    ^
Apr 13 15:53:37 monitoring vulnix-start[7315]:           222|       nixpkgs.lib.attrsets.recursiveUpdate (
Apr 13 15:53:37 monitoring vulnix-start[7315]:        … from call site
Apr 13 15:53:37 monitoring vulnix-start[7315]:        at /nix/store/im4vkfvk3dkilrdmmxi9nb7vdslrkgw9-source/flake.nix:25:5:
Apr 13 15:53:37 monitoring vulnix-start[7315]:            24|   in
Apr 13 15:53:37 monitoring vulnix-start[7315]:            25|     inputs.std.growOn
Apr 13 15:53:37 monitoring vulnix-start[7315]:              |     ^
Apr 13 15:53:37 monitoring vulnix-start[7315]:            26|     {
Apr 13 15:53:37 monitoring vulnix-start[7315]:        … while evaluating 'outputs'
Apr 13 15:53:37 monitoring vulnix-start[7315]:        at /nix/store/im4vkfvk3dkilrdmmxi9nb7vdslrkgw9-source/flake.nix:21:13:
Apr 13 15:53:37 monitoring vulnix-start[7315]:            20|   };
Apr 13 15:53:37 monitoring vulnix-start[7315]:            21|   outputs = inputs: let
Apr 13 15:53:37 monitoring vulnix-start[7315]:              |             ^
Apr 13 15:53:37 monitoring vulnix-start[7315]:            22|     inherit (inputs) bitte;
Apr 13 15:53:37 monitoring vulnix-start[7315]:        … from call site
Apr 13 15:53:37 monitoring vulnix-start[7315]:        at «string»:45:21:
Apr 13 15:53:37 monitoring vulnix-start[7315]:            44|
Apr 13 15:53:37 monitoring vulnix-start[7315]:            45|           outputs = flake.outputs (inputs // { self = result; });
Apr 13 15:53:37 monitoring vulnix-start[7315]:              |                     ^
Apr 13 15:53:37 monitoring vulnix-start[7315]:            46|
Apr 13 15:53:37 monitoring vulnix-start[7315]:        … while evaluating anonymous lambda
Apr 13 15:53:37 monitoring vulnix-start[7315]:        at «string»:10:13:
Apr 13 15:53:37 monitoring vulnix-start[7315]:             9|     builtins.mapAttrs
Apr 13 15:53:37 monitoring vulnix-start[7315]:            10|       (key: node:
Apr 13 15:53:37 monitoring vulnix-start[7315]:              |             ^
Apr 13 15:53:37 monitoring vulnix-start[7315]:            11|         let
Apr 13 15:53:37 monitoring vulnix-start[7315]:        … from call site
Apr 13 15:53:37 monitoring vulnix-start[7315]:        … while evaluating anonymous lambda
Apr 13 15:53:37 monitoring vulnix-start[7315]:        at «string»:2:23:
Apr 13 15:53:37 monitoring vulnix-start[7315]:             1|
Apr 13 15:53:37 monitoring vulnix-start[7315]:             2| lockFileStr: rootSrc: rootSubdir:
Apr 13 15:53:37 monitoring vulnix-start[7315]:              |                       ^
Apr 13 15:53:37 monitoring vulnix-start[7315]:             3|
Apr 13 15:53:37 monitoring vulnix-start[7315]:        … from call site

IMHO overriding an input is a valid use case when developing and should Just Work. Development friction is the root of all evil.

Clearly this takes the input verbatim rather than its corresponding store path, which is probably not exactly what we want.

kaii-zen avatar Apr 13 '22 16:04 kaii-zen