tvl-depot/nix
Profpatsch 83e81def23 feat(nix/readTree): give better error message when not a function
When a file is added to the depot tree that is picked up by read-tree,
but it’s not a function like ({...}: {}), `readTree` will fail on the
function application, leading to a bad error message.

We can do slightly better, by checking the type and throwing a nicer
trace message.

`assertMsg` is copied from `nixpkgs/lib/assert.nix`, since at this
point we don’t have a reference to the lib.

There is another evaluation failure that can happen, which is when the
function we try to call does not have dots; however, nix does not
provide any inflection capabilies for checking whether a function
attrset is open (`builtins.functionArgs` only tells us the attrs it
mentions explicitly). Maybe the locality of the error could be
improved somehow.

Change-Id: Ibe38ce78bb56902075f7c31f2eeeb93485b34be3
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2469
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
2021-02-19 23:04:04 +00:00
..
binify refactor(nix): use our own writeScript(Bin) 2020-06-30 00:19:27 +00:00
bufCheck feat(ci): run buf check lint in CI 2020-07-17 22:55:13 +00:00
buildGo feat(tools/depot-scanner): init project 2020-08-20 03:05:40 +00:00
buildLisp fix(buildLisp): Override LANG in sbclWith for misconfigured machines 2020-11-08 18:35:28 +00:00
drvSeqL feat(nix/drvSeqL): make build of a drv depend on unrelated drvs 2021-02-14 12:40:06 +00:00
emptyDerivation feat(nix/emptyDerivation) add emptyDerivation 2020-06-28 17:59:46 +00:00
escapeExecline chore(OWNERS): move Profpatsch up to nix/ 2021-01-01 19:03:15 +00:00
getBins chore(OWNERS): move Profpatsch up to nix/ 2021-01-01 19:03:15 +00:00
mergePatch feat(nix): add mergePatch 2021-01-01 19:03:02 +00:00
readTree feat(nix/readTree): give better error message when not a function 2021-02-19 23:04:04 +00:00
runExecline feat(nix): add runExecline.local 2021-01-02 14:24:35 +00:00
runTestsuite feat(nix/runTestsuite): add assertDoesNotThrow 2021-02-09 21:57:56 +00:00
tag feat(nix): add nix.tag, a way of discriminating via tagged unions 2021-01-30 15:41:08 +00:00
tailscale chore: Rename pkgs->depot in all Nix file headers 2020-02-21 13:54:53 +00:00
writeElispBin chore(writeElispBin): Move from //overrides to //nix 2020-12-01 12:55:59 +00:00
writeExecline chore(OWNERS): move Profpatsch up to nix/ 2021-01-01 19:03:15 +00:00
writeScript refactor(nix): use our own writeScript(Bin) 2020-06-30 00:19:27 +00:00
writeScriptBin refactor(nix): use our own writeScript(Bin) 2020-06-30 00:19:27 +00:00
yants fix(nix/yants): make (typedef …).checkType return a result set 2021-02-19 16:14:55 +00:00
OWNERS chore(OWNERS): move Profpatsch up to nix/ 2021-01-01 19:03:15 +00:00