about summary refs log tree commit diff
path: root/users/Profpatsch/execline (follow)
AgeCommit message (Collapse)AuthorFilesLines
2021-11-23 r/3088 refactor(readTree): Move 'drvTargets' into readTreeVincent Ambo1-1/+1
This function is also generally useful for readTree consumers that have the concept of subtargets. Change-Id: Ic7fc03380dec6953fb288763a28e50ab3624d233
2021-04-24 r/2547 chore(nix): move rustSimple from users.Profpatsch.writersProfpatsch1-1/+1
I think it’s solid enough to use in a wider context. Change-Id: If53e8bbb6b90fa88d73fb42730db470e822ea182 Reviewed-on: https://cl.tvl.fyi/c/depot/+/3055 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org> Reviewed-by: lukegb <lukegb@tvl.fyi>
2021-03-15 r/2282 feat(users/Profpatsch): build attrset members on CIsterni1-1/+1
Setting meta.targets to include all derivations in the different package sets in Profpatsch's user folder makes them checked by CI until they do the readTree refactor as promised. To reduce code duplication we handle this in a simple function which is exposed from nix.utils which may be a good place for depot specific bits and bops we accumulate over time. To get around the issue of too nested sets we perform the following renames: * users.Profpatsch.tests gets moved into its own directory * users.Profpatsch.arglib.netencode now lives in its own file instead of the default.nix * users.Profpatsch.netstring.tests gets moved into its own directory Change-Id: Icd039c29d7760a711c1c53554504d6b0cd19e120 Reviewed-on: https://cl.tvl.fyi/c/depot/+/2603 Tested-by: BuildkiteCI Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-02-13 r/2207 feat(users/Profpatsch/execline/exec_helpers): add args()Profpatsch1-0/+10
Some programs need an exact amount of arguments, and we want to fail if they get too many or not enough. Change-Id: Ic703949f38780718f26118b896e7c7d7aa5553d9 Reviewed-on: https://cl.tvl.fyi/c/depot/+/2504 Tested-by: BuildkiteCI Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-02-13 r/2206 feat(users/Profpatsch/execline/exec_helpers): add no_args()Profpatsch1-0/+9
Some programs don’t need any arguments, so fail if they do get them, because that’s usually a bug. Change-Id: I28639056d3d9cea0cc0e7fcbfa42120c4f129c8c Reviewed-on: https://cl.tvl.fyi/c/depot/+/2503 Tested-by: BuildkiteCI Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-02-13 r/2203 fix(users/Profpatsch/execline/exec_helpers): fix arg loop off-by-1Profpatsch1-1/+1
Change-Id: If20a91eaa6693ba35ce645b104c625dbd0c71726 Reviewed-on: https://cl.tvl.fyi/c/depot/+/2500 Tested-by: BuildkiteCI Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-02-06 r/2185 fix(users/Profpatsch/execline): fix exec_into_args off-by-1Profpatsch1-2/+2
We expect the users to pass an actual prog, not an argv, so 0 is the program to exec into. Also improve the exec error, by including the program we tried to exec into (the rust IO error doesn’t contain the name). Change-Id: I664f9f717e4f82bfc1b1da3bd7114124b7582d5f Reviewed-on: https://cl.tvl.fyi/c/depot/+/2489 Reviewed-by: Profpatsch <mail@profpatsch.de> Tested-by: BuildkiteCI
2021-01-31 r/2176 feat(users/Profpatsch): add die_* helpers for semantic exit errorsProfpatsch1-1/+54
There is this semantic exit code schema championed by execline and skaware tooling, and we refined and documented it a bit in lorri https://github.com/nix-community/lorri/blob/d1d673d42090f0cfe8ab9b92b465315a9e7d30a3/src/ops/mod.rs#L24-L35 in the past. This just transcribes the error messages into simple helper functions. Applies the functions to the places where we would panic or die `sys::exit()` instead. Change-Id: I15ca05cd6f99a25a3378518be94110eab416354e Reviewed-on: https://cl.tvl.fyi/c/depot/+/2475 Tested-by: BuildkiteCI Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-01-31 r/2175 feat(users/Profpatsch/execline): add args_for_execProfpatsch2-16/+42
`exec_into_args` would just read argv and exec into it, but we want to be able to write commands which take some positional arguments first. Thus we split the invocation into `args_for_exec`, which returns the positional arguments and prog, and then pass prog to `exec_into_args` when we want to exec eventually (prog is still an iterator at this point). Change-Id: I0b180c1a100b96363fe33ba2c42034ed41716b7a Reviewed-on: https://cl.tvl.fyi/c/depot/+/2474 Tested-by: BuildkiteCI Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-01-31 r/2171 feat(users/Profpatsch/execline): add exec helpersProfpatsch1-0/+27
Most tools end by execing into their argv, so here’s a small rust function which does the boilerplate. Change-Id: I9748955cf53828e02f04d7e8d74fbaf10c1158b5 Reviewed-on: https://cl.tvl.fyi/c/depot/+/2453 Tested-by: BuildkiteCI Reviewed-by: Profpatsch <mail@profpatsch.de>