Commit graph

10 commits

Author SHA1 Message Date
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
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
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
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
1261616bff feat(Profpatsch/writers): add rustSimple writers
A bunch of writer functions wrapping the `buildRustCrate`
functionality of nixpkgs. Can be used to write inline rust code, or
rust code read from files with `builtins.readFile`.

Change-Id: I9d74e9381b858b485925e4dc3fbb7fc392877c0a
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2318
Reviewed-by: tazjin <mail@tazj.in>
Reviewed-by: Profpatsch <mail@profpatsch.de>
Tested-by: BuildkiteCI
2021-01-03 16:29:57 +00:00
Profpatsch
baab2ce359 fix(Profpatsch/writers): ignore the most annoying flake errors
Change-Id: I3b8f51ff0dcdd842811e2fd9876cd4925c64f135
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2314
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-01-03 16:12:33 +00:00
Profpatsch
b046c77493 feat(Profpatsch/writers): add yants types to python3 writer
Uses the new restrict type to make sure flake errors start with an E.

Change-Id: I30369ade28e1ef612c91a368de2d5b128e6cf2a9
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2313
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-01-03 16:12:33 +00:00
Profpatsch
6b21b108ba feat(users/Profpatsch): add writers.python3
This is a reexport of nixpkgs.writers.writePython3, but the libraries
are passed the package set, like with other writers.

Change-Id: Ia5a2ed1b6b329700836a8575d2bde768bf64fb31
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2311
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
2021-01-03 16:12:33 +00:00
Profpatsch
533e365c12 feat(users/Profpatsch): add python3Lib writer
Smol writer to create a python lib directly from a nix string.
The resulting library can be consumed by the writePython3 writer.

Change-Id: Id3d793564d230b38a08f65140bda4287285e1a72
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2310
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
2021-01-03 16:12:33 +00:00