Commit graph

112 commits

Author SHA1 Message Date
Vincent Ambo
562236085b style: format all Go code
The code in //users/wpcarro/tools/monzo_ynab/ynab/client.go was not
valid Go and has been commented out.

Change-Id: Icb4003607f30294dcbf60132eb7722702c7f0d84
Reviewed-on: https://cl.tvl.fyi/c/depot/+/4400
Tested-by: BuildkiteCI
Reviewed-by: wpcarro <wpcarro@gmail.com>
Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-12-19 18:05:04 +00:00
Vincent Ambo
4f1249e46f refactor(readTree): Move 'drvTargets' into readTree
This function is also generally useful for readTree consumers that
have the concept of subtargets.

Change-Id: Ic7fc03380dec6953fb288763a28e50ab3624d233
2021-11-23 14:42:08 +00:00
Profpatsch
70d01b201f docs(users/profpatsch/blog): rust string conversions: &str -> &OsStr
Change-Id: I215cd311551d54ce42c71d4e80ea18f9a17d4cf8
Reviewed-on: https://cl.tvl.fyi/c/depot/+/3879
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-11-15 00:31:11 +00:00
Profpatsch
e2fbc10ebd feat(users/Profpatsch/lens): add _ as reverse function application
Change-Id: I0bcd997ea469ff55d2170027184fc5bd10b44e00
Reviewed-on: https://cl.tvl.fyi/c/depot/+/3847
Reviewed-by: Profpatsch <mail@profpatsch.de>
Tested-by: BuildkiteCI
2021-11-13 01:22:58 +00:00
Profpatsch
d08fbd79c7 docs(users/Profpatsch/lens): setter inline arrows
Change-Id: I22bed7bc16b69f94556142cad1079e23f3550bb1
Reviewed-on: https://cl.tvl.fyi/c/depot/+/3846
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-11-13 00:57:28 +00:00
Profpatsch
539884f7ad docs(users/Profpatsch/netencode): fix typo
Change-Id: I7edb9027c0a9eb014931033760be5f3d6e734b8a
Reviewed-on: https://cl.tvl.fyi/c/depot/+/3845
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-11-13 00:57:28 +00:00
Profpatsch
8c6bf623b6 feat(users/Profpatsch/blog: inject css into markdown files
Change-Id: I72bba4bd8aa9a9fccab1fd3d618cfcfa7e0507c5
Reviewed-on: https://cl.tvl.fyi/c/depot/+/3844
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-11-13 00:57:28 +00:00
Profpatsch
850dcf615b feat(users/Profpatsch/lens): lens library for nix
Profunctor lenses for nix.

Implemented Profunctor and Strong instances for `(->)`,
and some simple setters.
Next step would be getters, which will need the `Forget` profunctor.

Fairly straightforward implementation of
https://github.com/purescript-contrib/purescript-profunctor-lenses
(with all the types erased and instance dicts passed manually).

```
> :p set (optic [_2 (field "foo") _1]) 42 (tuple 1 { foo = (tuple 1 2); })
{ fst = 1; snd = { foo = { fst = 42; snd = 2; }; }; }
```

Change-Id: Iad145523d1c035187b8b2db9302b840c282d427a
Reviewed-on: https://cl.tvl.fyi/c/depot/+/3295
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-11-13 00:57:28 +00:00
Profpatsch
b48c5c4976 feat(users/Profpatsch/blog): Add posts section
A new section for my awesome website.

Migrates an old blogpost from the github repository.

Change-Id: I5fd0c2b2679a1367015fa098e3e787bbc0cdd973
Reviewed-on: https://cl.tvl.fyi/c/depot/+/3293
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-11-13 00:57:28 +00:00
Profpatsch
81e39b51cd feat(users/Profpatsch/blog): Add projects section
A new section for my awesome website.

Change-Id: I6c624aa0bfaf82aff943431da7499bec1d842c67
Reviewed-on: https://cl.tvl.fyi/c/depot/+/3291
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-11-13 00:57:28 +00:00
Profpatsch
d4f4b0f6d4 docs(users/Profpatsch/blog): document symbols
… and clean up the import list a little.

Change-Id: I7a116e9bbf01731267795b5327fecf98f0c7c3e4
Reviewed-on: https://cl.tvl.fyi/c/depot/+/3286
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-11-13 00:57:28 +00:00
Profpatsch
2835e5ec7e docs(users/Profpatsch/lib): move split-stdin to lib & document
Change-Id: I39e81ed766cb209ded5309ea962a59a6f1c811c9
Reviewed-on: https://cl.tvl.fyi/c/depot/+/3285
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-11-13 00:57:28 +00:00
Profpatsch
4e2879282d chore(users/Profpatsch/blog): me -> depot.users.Profpatsch
Change-Id: I72e38ce4cef109df197eccedac8e67ec423d4996
Reviewed-on: https://cl.tvl.fyi/c/depot/+/3284
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-11-13 00:57:28 +00:00
Profpatsch
dfdb6d8e15 chore(users/Profpatsch): move cdbListToNetencode out of the blog
It’s a small tool that I’ve used before but not anymore, but since it
has a few helpers for dealing with cdb stuff, I’m gonna keep it around
for now I guess.

Change-Id: I83c62fa2194113d021414708b0906350b3f2a222
Reviewed-on: https://cl.tvl.fyi/c/depot/+/3283
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-11-13 00:57:28 +00:00
Profpatsch
33e56abcf2 fix(users/Profpatsch/blog): notes toplevel rendering
The rendering of the notes/ template was done in a very roundabout way
through the routing table before. Now it’s constructed directly.

Change-Id: Iaa6157cc3f9a7e5e0ad81ab843efa988995666b2
Reviewed-on: https://cl.tvl.fyi/c/depot/+/3282
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-11-13 00:57:28 +00:00
Profpatsch
1c8e55b60c docs(users/Profpatsch/netencode): some docstrings
Change-Id: I447113d408cf51f1ed9f9d7571b2229e166e7680
Reviewed-on: https://cl.tvl.fyi/c/depot/+/3281
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-11-13 00:57:28 +00:00
Profpatsch
d41caf2dd6 feat(users/Profpatsch/netstring): add nix toNetstring* functions
We can easily construct netstrings from nix strings, which is super
helpful to inject proper structured data into execline scripts.

Change-Id: Ie8bffed285896223db83652eaea868ece43592b9
Reviewed-on: https://cl.tvl.fyi/c/depot/+/3265
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-11-13 00:57:28 +00:00
Profpatsch
28bed07694 feat(users/Profpatsch): add atomically-write
A little shell script to atomically write stdout to a file.

Change-Id: Icca58909c9ad3f92d69af2f5e20c08d69878a77c
Reviewed-on: https://cl.tvl.fyi/c/depot/+/3264
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-11-13 00:57:28 +00:00
Profpatsch
f25e930ec7 feat(users/Profpatsch): add reverse-haskell-deps
Dis is dumb

Change-Id: If09300eedff7227ed452dcec7a8e80c7ffb24757
Reviewed-on: https://cl.tvl.fyi/c/depot/+/3231
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-08-01 16:40:35 +00:00
Profpatsch
952afb7da9 feat(tools): add rust-crates-advisory
We have a bunch of crates in `third_party/rust-crates`; it would be
great if we could check them for existing CVEs.

This tool does that, it takes the rust security advisory database,
parses the applicable CVEs, and cross-checks them against the actual
crate versions we list in our package database.

The dumb parser we wrote is tested against all entries in the
database, so we will notice when upstream breaks their shit.
Checking the semver stuff is easy enough with the semver crate.

If an advisory matches, it prints the whole thing and fails the build.

Change-Id: I9e912c43d37a685d9d7a4424defc467a171ea3c4
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2818
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
Reviewed-by: sterni <sternenseemann@systemli.org>
2021-05-17 23:00:57 +00:00
Profpatsch
72924facae fix(nix/writers/rust): remove args override
We can be closed world, so let’s restrict the arguments to the subset
we need for now.

The existing override was wrong, in that `// args` would use the
arguments we already added, again. So instead of deliberating about
how to make this work right in all cases, we don’t need it, we trim
it.

Change-Id: I6443a0808b8bfd5e4db939b669c6afc741954db8
Reviewed-on: https://cl.tvl.fyi/c/depot/+/3057
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
2021-05-17 23:00:57 +00:00
Profpatsch
35aa79d14b feat(users/Profpatsch/blog): add rust-string-conversions note
Change-Id: I7bee585935e65660f6b25b88ed33f09775eb01a0
Reviewed-on: https://cl.tvl.fyi/c/depot/+/3088
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-05-03 22:22:33 +00:00
Profpatsch
713f066297 feat(users/Profpatsch/blog): implement blog engine lol
My horrible blog engine v0.0.0.0.1. Don’t judge.

Change-Id: I427b4e84d67aa49793cb7625e4d8ca2824f00943
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2456
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-04-30 21:47:42 +00:00
Profpatsch
3ef9b8fbd7 fix(users/Profpatsch/netencode): use write_all in encoder
`write` returns the written usize; now I wonder why rustc didn’t at
least produce a warning because the result was unused. Do we need to
add any flags to `rustSimple`?

Change-Id: If8d51d95c993dec6c92e46dbc82cd8cdd398f441
Reviewed-on: https://cl.tvl.fyi/c/depot/+/3056
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
2021-04-30 21:47:42 +00:00
Profpatsch
eb41eef612 chore(nix): move rustSimple from users.Profpatsch.writers
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-04-24 10:23:55 +00:00
Profpatsch
7e888c3c7b feat(nix): add basic netstring nix generation functions
Moving to toplevel so I can use them with `runExecline`. They should
be pretty atomic, and are proven to work (tests are still in my user
dir, since they test the producers indirectly via the python parser
and I don’t want to pull it out right now).

Change-Id: Id0baa3adcb2ec646458a104c7868c2889b8c64f5
Reviewed-on: https://cl.tvl.fyi/c/depot/+/3054
Reviewed-by: Profpatsch <mail@profpatsch.de>
Tested-by: BuildkiteCI
2021-04-24 09:54:34 +00:00
Profpatsch
c98dd8b352 feat(users/Profpatsch/lib): add eprint-stdin-netencode
Like `eprint-stdin`, but reads stdin as netencode and pretty-prints it
to stderr.

Change-Id: I430c010b0cac45f077cde9dadfd79adfa7a53eca
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2533
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-04-23 20:45:28 +00:00
Profpatsch
5ca71308a8 feat(users/Profpatsch/netencode): add pretty printer
Simple pretty printer for netencode values, as a rust library and an
accompanying command line tool which takes netencode on stdin and
prints the pretty version to stdout.

Change-Id: I0a57c644985162bc08a9bf1ee78f7be278400199
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2532
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-04-23 20:45:28 +00:00
Profpatsch
9d7c3ee877 feat(users/Profpatsch/netencode): add env-splice-record
It’s the inverse of record-splice-env! It sucks up the environment and
prints it as a netencode dict! Only the utf-8 clean parts at least.

Change-Id: I96c19fc5ea3a67a23e238f15f4d0fa783081859c
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2527
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-04-23 20:45:28 +00:00
Profpatsch
5156da542b feat(users/Profpatsch/struct-edit): per-level position
The user expects the editor to remember the positions of fields they
navigated from to a new level, so when they return they get put in the
same spot.

We push the index from one field into every level of the value.

Unfortunately this introduces pointers and all the woes they bring.

Change-Id: I889c28b71fd7082b765e1d6874faeb1b36dade60
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2866
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-04-23 18:30:06 +00:00
Profpatsch
50cf1e1a88 chore(users/Profpatsch/struct-edit): factor out non-val enumeration
This will be needed to factor the current cursor position into vals.

Change-Id: I73635b13c29b6b8925c68005c8db1c4dda93f15d
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2865
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-04-23 18:30:06 +00:00
Profpatsch
77840fba2c fix(users/Profpatsch/struct-edit): change arrow keys
Since items are aligned per-line, it makes more intuitive sense to use
up/down for previous/next item, and left to go up and right to go
down.

Change-Id: I6bc33bd4e6e8f9fb245d252ca063dfabf972147d
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2864
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-04-23 18:30:06 +00:00
Profpatsch
f57f1e4489 feat(users/Profpatsch/struct-edit): add support for maps
This makes it possible to pipe json dicts to the program and fully
navigate them.

Change-Id: I18dd8683d6f00c8ea967eb0c8dc89d1e0735fbcb
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2863
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-04-23 18:30:06 +00:00
Profpatsch
22a8bf93f7 feat(users/Profpatsch/struct-edit): initial version
A take at a TUI-based structural editor, which should eventually read
a type definition of a structure and some values, and build a GUI to
edit it.

So far you can only pipe it some restricted json (lists, strings and
floats) and “navigate” through the structure with the arrow keys.

Change-Id: I7c8546459ff86c766fc03723f732c7d9f863ceaa
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2862
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-04-23 18:30:06 +00:00
Vincent Ambo
473604f567 refactor: Move nixpkgs attribute to third_party.nixpkgs
Please read b/108 to make sense of this.

This gets rid of the explicit list of exposed packages from nixpkgs,
and instead makes the entire package set available at
`third_party.nixpkgs`.

To accommodate this, a LOT of things have to be very slightly shuffled
around. Some of this was done in already submitted CLs, but this
change is unfortunately still quite noisy.

Pay extra attention to:

* overlay-like functionality that was partially moved to actual
  overlays (partially as in, the minimum required to get a green
  build)

* modified uses of the package set path, esp. in NixOS systems

Special notes:

* xanthous has been disabled in CI because of issues with the Haskell
  overlay
* //third_party/nix has been disabled because of other unclear
  dependency issues

Both of these will be tackled in a followup CL.

Change-Id: I2f9c60a4d275fdb5209264be0addfd7e06c53118
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2910
Reviewed-by: glittershark <grfn@gws.fyi>
Reviewed-by: sterni <sternenseemann@systemli.org>
Tested-by: BuildkiteCI
2021-04-10 21:18:55 +00:00
Profpatsch
e7c78570ed feat(users/Profpatsch/writers): make testing default for rustSimple
This way we don’t have to explicitely wrap the rust crate with a
`testRustSimple`, but it will be done automatically, unless `doCheck`
is set to `false`.

Change-Id: I32a81821eeff620e7da57332b0873495bb85a843
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2841
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
Reviewed-by: sterni <sternenseemann@systemli.org>
2021-04-04 15:16:23 +00:00
sterni
0133fdc737 chore: move all 3p buildRustCrate derivations to //third_party
Profpatsch and me are basically the only users of
depot.users.Profpatsch.writers.rustSimple*. To pull in the odd
dependency we usually use buildRustCrate which is rather convenient.
However we've picked up the bad habit of inlining these in a let
somewhere instead of managing them in a more central location although
there has been an (unsuccesful) attempt at this in
//users/Profpatsch/rust-crates.nix.

This CL moves all buildRustCrate based derivations into
third_party.rust-crates and deletes any duplicate derivations we have
accumulated in the tree.

Change-Id: I8f68b95ebd546708e9af07dca36d72dba9ca8c77
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2769
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-04-03 22:16:35 +00:00
Profpatsch
59a9955d75 feat(users/Profpatsch/netencode): fully streaming parser
In order to arbitrarily split netencode over multiple reads, we need
to make the parser completely streaming, so that it recognizes all
cases where it needs more input.

Luckily, this is fairly trivial, after working around a bunch of
overeager parsing.

The tricky part was the giant `alt`, where inner parsers would start
consuming input and thus become incomplete when they fail afterwards.
Sinc the format *always* starts the different types with one
discriminator char, we can use that to instantly return the parser and
try the next one instead.

The other tricky part was that lists and records would parse all inner
elements and then choke on the empty string after the last element,
because the inner parser would consume at least the descriminator, and
an empty string is always `Incomplete`. We wrap these into a small
combinator which plays nice with `many0` in that regard.

Change-Id: Ib8d15d9a7cab19d432c6b24a35fcad6a5a72b246
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2704
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
Reviewed-by: sterni <sternenseemann@systemli.org>
2021-04-01 07:28:07 +00:00
Profpatsch
4a33ce1dc1 fix(users/Profpatsch/writers): use s6-portable-utils
We had a bunch of instances of
https://github.com/NixOS/nix/issues/2176,
where nix would exit with a “killed by signal 9” error.

According to Eelco in that issue, this is perfectly normal behaviour
of course, and appears if the last command in a loop closes `stdout`
or `stdin`, then the builder will SIGKILL it immediately. This is of
course also a perfectly fine error message for that case.

It turns out that mainly GNU coreutils exhibit this behaviour …

Let’s see if using a more sane tool suite fixes that.

Change-Id: If34ab692120e5e299575bf8044aa5802145ab494
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2658
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-03-26 11:01:20 +00:00
Profpatsch
45f5eb97a6 fix(users/Profpatsch/writers): fail on rust test failure
`forstdin` iterates over the tests in the test directory, and by
default it does *not* fail if an inner loop returns an error, unless
`-o okcodes` is given, a list of exit codes that indicate success.

Now it fails if a loop returns ≠ 0.

Change-Id: I0b1b2a06cd0a894e5ac4e77ec25019629ce2c077
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2657
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
2021-03-26 10:59:23 +00:00
Profpatsch
d053abfd2a feat(users/Profpatsch): add imap-idle
A small UCSPI client which connects to an IMAP server, authenticates
with username and password (for Christ’s sake, put it in
`s6-tlsclient`), selects the `INBOX` and proceeds to listen for new
mails.

Later it will generate an event on stdout and to be used for push
messaging and triggering a full `mbsync` run on new message.

Currently I’m testing it via

```
env CAFILE=/run/current-system/etc/ssl/certs/ca-bundle.crt \
  IMAP_USERNAME=<username> \
  backtick -i IMAP_PASSWORD ' pass' ' <password-entry>' '' \
  s6-tlsclient -v <imap-server> 993 ./result
```

Change-Id: I221717d374c0efc8d9e05fe0dfccba31798b3c5c
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2636
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-03-22 22:52:11 +00:00
sterni
5d8490d2fc feat(users/Profpatsch): build attrset members on CI
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-03-15 22:16:19 +00:00
Profpatsch
851e32cfe7 feat(users/Profpatsch/advent-of-code): 2020 day 04
Change-Id: I422e43f33737ef4d8e250634fa68926ae340206a
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2580
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-03-01 23:26:25 +00:00
Profpatsch
ace8c656be feat(users/Profpatsch): add advent of code 2020 day 1 2 3
Change-Id: I99d2882ac9ef5ede85032132f6727e7bad8f24eb
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2564
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-02-27 20:48:53 +00:00
sterni
ee9da33576 chore(users/Profpatsch/netencode): update serde
Was messing around with serde and trying to build serde_json something,
might as well commit this.

Change-Id: I60f87aa3180f750fa171eca7f9c375ed053f8456
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2537
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-02-18 19:42:21 +00:00
sterni
fa99c128f8 test(users/Profpatsch/writers): use testRustSimple on transitive lib
This adds a trivial test case on the transitive lib in tests and builds
it by wrapping in with testRustSimple. This should check:

* testRustSimple doesn't change the output and other packages can just
  use it as a normal dependency
* tests are built and executed

Change-Id: Ia4ea7425432b8b0da09f63054f51f0c480300aa4
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2531
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-02-14 12:40:06 +00:00
sterni
f8c92f4118 feat(users/Profpatsch/netencode-rs): run tests with testRustSimple
The rust tests are now automatically built and run if
users.Profpatsch.netencode-rs is built without changing the content of
its output. users.Profpatsch.netencode-rs-tests has been removed in
favor of this, but can still be accessed as

    builtins.head users.Profpatsch.netencode.netencode-rs.drvDeps

Change-Id: I25e8191f5b9efa08ace4a584a75978565c79d8d0
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2530
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-02-14 12:40:06 +00:00
sterni
beed354904 feat(users/Profpatsch/writers): testRustSimple to test rust crates
testRustSimple is intended to wrap rustSimpleLib and rustSimpleBin and
theoretically pkgs.buildRustCrate with { buildTests = false; } while
building and running their tests, making them fail if the tests don't
succeed.

This is implemented using nix.drvSeqL which is a perfect fit here:

* { buildTests = true; } only returns an output with the test binaries
  and does not actually run the tests. With drvSeqL we can easily wrap
  this derivation.
* { buildTests = true } doesn't contain anything other derivations want
  to depend on, so it is an derivation output we don't want to have.
  drvSeqL hides the tests derivation away and only requires us to build
  it once.
* Usually drvSeqL has the issue that tests (or advantage) are not rebuilt
  if the test derivation changes. This is no question in this case as
  due to the embedded nature of Rust's test, both the derivation with
  and without tests change anyways regardless of which part was changed.

Future work: Allow injecting other tests?

Change-Id: If6ecfb3a360ce059320dbb05642b391b617aede7
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2529
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-02-14 12:40:06 +00:00
Profpatsch
5a08316a3c fix(users/Profpatsch/netencode/gen/dwim): support derivations
We forgot the special casing of derivations; if we recurse into a
derivation like we’d recurse into an attrset, it always ends in tears,
so dwim will just print the derivation path instead, which is usually
what you want anyway.

Change-Id: Ieed1b68dfcf8f2925ee3a75ae4f460fa5081da28
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2526
Reviewed-by: Profpatsch <mail@profpatsch.de>
Tested-by: BuildkiteCI
2021-02-13 20:00:23 +00:00
Profpatsch
18e6db0f21 fix(users/Profpatsch/lib/eprintenv): don’t crash when env is missing
eprintenv is a debugging tool, as such the code should probably not
crash when the environment variable we want to look at is missing.
But we can print a warning instead.

Change-Id: I41a24dc0c1cc488587563b85c1adbd089dd364f2
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2525
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-02-13 20:00:23 +00:00