Commit graph

22 commits

Author SHA1 Message Date
Jörg Thalheim 093b8ce5cc apply treefmt 2023-12-16 11:44:08 +01:00
Jörg Thalheim b4f7eb3c77 fix ci for infinite recursion case 2023-12-16 11:40:34 +01:00
Jörg Thalheim 4d97e5a386 improve infinite recursion errors 2023-12-16 10:52:23 +01:00
Jörg Thalheim b267eb917d apply treefmt 2023-12-10 17:00:31 +01:00
Jörg Thalheim f970ec3524 add test for evaluation errors 2023-12-10 16:59:14 +01:00
adisbladis fcaf7773e3 Apply ruff 2023-07-21 01:41:41 +00:00
Jörg Thalheim cb8126538f fix recurseIntoAttrs handling 2022-09-15 11:04:12 +02:00
Jörg Thalheim f6890b93e8 add check-cache-status option to query wether a binary cache has the build 2022-09-15 11:04:12 +02:00
Zhaofeng Li 23f4dfdc24 Add support for passing a Nix expression on the command line
Fixes #38.
2022-08-17 10:59:44 -06:00
adisbladis 83773704be Add Python Black formatter 2022-04-26 21:40:31 +12:00
adisbladis 61c9f4cfcc Replace internal attr string representation with an array
This ensures correct handling of attrnames with a dot in them and will
not throw errors about illegal attrnames.

Additionally this escapes any attributes containing dots in the JSON
output and adds another field called `attrPath` which contains the
attribute path as a list.

Example output:
```
{
  "attr": "hello",
  "attrPath": [
    "hello"
  ],
  "drvPath": "/nix/store/n204jib73z55cp9s0rmw1c5v5q528j7v-hello-2.12.drv",
  "name": "hello-2.12",
  "outputs": {
    "out": "/nix/store/h59dfk7dwrn7d2csykh9z9xm2miqmrnz-hello-2.12"
  },
  "system": "x86_64-linux"
}
```
2022-04-26 19:43:56 +12:00
adisbladis c1bbb11c5d Add support for recurseForDerivations
This will respect `recurseForDerivations` when iterating over attrsets.

Example expression:
``` nix
{ system ? builtins.currentSystem }:
{
  recurseForDerivations = true;

  # This should build as it's in the top-level attrset
  drvA = derivation {
    inherit system;
    name = "drvA";
    builder = ":";
  };

  dontRecurse = {
    # This shouldn't build as `recurseForDerivations = true;` is not set
    # recurseForDerivations = true;

    # This should not build
    drvB = derivation {
      inherit system;
      name = "drvA";
      builder = ":";
    };
  };

  recurse = {
    # This should build
    recurseForDerivations = true;

    # This should not build
    drvC = derivation {
      inherit system;
      name = "drvC";
      builder = ":";
    };
  };

}
```
2022-04-25 22:11:53 +12:00
adisbladis 813c5d7aae Add test for a job with a nested attrset 2022-04-22 20:36:52 +12:00
adisbladis 3268f3a6af Add flag to enable meta
I removed meta from the output in 434376f8e1 with the intention of adding it back gated by a flag, but that never happened.

Adding meta is quite a substantial increase in output size and has some non-trivial performance impact at scale, so it's best to leave it as opt-in.
2022-01-06 13:40:21 +13:00
Tom Bereknyei d36d77c873 use outPath 2022-01-04 14:16:36 -05:00
Jörg Thalheim 26948992b3 also expose store path in json 2021-12-31 12:00:04 +01:00
adisbladis 0648bc0cb8
Select flake output by the flake fragment 2021-08-26 18:48:56 -05:00
adisbladis 434376f8e1
Remove outputs from JSON output
The output of the evaluator should only include either the full
derivation (not yet implemented) or fields not directly accessible
from the drv such as meta.

Right now the output is a fairly arbitrary selection of fields.
2021-08-26 18:48:56 -05:00
adisbladis a6171c9a62
Switch to streaming output (using line delimited JSON) 2021-08-25 13:58:42 -05:00
adisbladis 0c93e00635
Fix pytest tests 2021-08-25 03:36:32 -05:00
adisbladis 174e735183
Rename project to nix-eval-jobs
We are getting rid of Hydra specific hacks and making this a more
generically useful component for any projects that need to run
large evaluations.
2021-08-24 14:06:27 -05:00
Jörg Thalheim 71cbe4eab4
output missing/substitutable derivations in eval output 2021-03-21 19:05:11 +01:00