depot/nix/yants, branch refs/r/6087 monorepo for the virus lounge http://code.tvl.fyi/depot/atom?h=refs%2Fr%2F6087 2022-02-19T11:37:00+00:00 docs(yants): Update josh cloning instructions 2022-02-19T11:37:00+00:00 Vincent Ambo mail@tazj.in 2022-02-19T11:33:07+00:00 urn:sha1:c7bc8aac4985bf5351a1e933769dd7d764e623ae Change-Id: I4e9e31488f91465df6b2c6800a3940118107524b Reviewed-on: https://cl.tvl.fyi/c/depot/+/5315 Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su> Autosubmit: tazjin <tazjin@tvl.su> style: format entire depot with nixpkgs-fmt 2022-01-31T16:11:53+00:00 Vincent Ambo mail@tazj.in 2022-01-30T16:06:58+00:00 urn:sha1:aa122cbae78ce97d60c0c98ba14df753d97e40b1 This CL can be used to compare the style of nixpkgs-fmt against other formatters (nixpkgs, alejandra). Change-Id: I87c6abff6bcb546b02ead15ad0405f81e01b6d9e Reviewed-on: https://cl.tvl.fyi/c/depot/+/4397 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org> Reviewed-by: lukegb <lukegb@tvl.fyi> Reviewed-by: wpcarro <wpcarro@gmail.com> Reviewed-by: Profpatsch <mail@profpatsch.de> Reviewed-by: kanepyork <rikingcoding@gmail.com> Reviewed-by: tazjin <tazjin@tvl.su> Reviewed-by: cynthia <cynthia@tvl.fyi> Reviewed-by: edef <edef@edef.eu> Reviewed-by: eta <tvl@eta.st> Reviewed-by: grfn <grfn@gws.fyi> feat(nix/yants): improve error message for errornous predicate 2021-12-27T08:20:58+00:00 zseri zseri.devel@ytrizja.de 2021-12-27T03:52:40+00:00 urn:sha1:00adb6e8f347ea6fee328641c4413946a41af5a2 while trying to yantsify `mkSecrets` in https://cl.tvl.fyi/c/depot/+/4688, I(zseri) needed to debug a failing evaluation which boiled down to a result.ok containing something which wasn't boolean, but the error message didn't indicate where that value came from. I debugged yants and found that the only place which didn't simply combine boolean values or use functions which always return booleans, I managed to isolate the error to the `pred v` expression. To avoid the necessity to debug yants to find this, I improve the error message for this case to mention that - a restriction predicate is invalid - what's the name of the failing restriction - the unexpected predicate return value Change-Id: I6c570a33ccc5afc445f208e2e8855c49fb37abaf Reviewed-on: https://cl.tvl.fyi/c/depot/+/4698 Tested-by: BuildkiteCI Reviewed-by: zseri <zseri.devel@ytrizja.de> Reviewed-by: tazjin <mail@tazj.in> Autosubmit: zseri <zseri.devel@ytrizja.de> fix(nix/yants): make (typedef …).checkType return a result set 2021-02-19T16:14:55+00:00 sterni sternenseemann@systemli.org 2021-02-18T00:33:27+00:00 urn:sha1:690994a28cc3045c14268996144e9302fa43bf68 Previously, for types defined using typedef (like all primitive types) type.checkType would return a boolean. This is largely fine since in most places `type.checkToBool (type.checkType x)` or similar is used. However, some functions actually take type.checkType up on the promise that it returns a set of the form: { ok = <bool>; err = <option string>; } This is the case for restrict which has checkToBool = v: v.ok; and will generate a proper set except if `t.checkToBool (t.checkType v) == false` in which case it will return t.checkType v. If t was a primitive type or defined using typedef, previously `t.checkType v` would be a boolean which meant as soon as (restrict …).checkToBool was called on a restrict checkType result in cases where the wrapped type didn't match, an unrelated error would be thrown: nix-repl> with nix.yants; restrict "foo" (_: true) int "lol" error: value is a boolean while a set was expected, at /home/lukas/src/depot/nix/yants/default.nix:38:39 This is fixed by making typedef return a proper set from checkType and adjusting its checkToBool accordingly. Unfortunately I don't think we can easily add test cases for this except by using recursive nix or VM tests as there is no way to introspect error messages. Change-Id: I96a7be065630f04ca33358f21809284911ec14fe Reviewed-on: https://cl.tvl.fyi/c/depot/+/2536 Tested-by: BuildkiteCI Reviewed-by: tazjin <mail@tazj.in> Reviewed-by: Profpatsch <mail@profpatsch.de> feat(nix/yants/tests): test drv type 2021-02-12T21:52:36+00:00 sterni sternenseemann@systemli.org 2021-02-09T22:30:42+00:00 urn:sha1:7bd43d15d90f05d752578ca14abc064e5f3db7af By using an extremely trivial derivation we can ensure that it will not throw if evaluated using deepSeq. When using stdenv.mkDerivation or similar at some point something will most likely throw or generate some kind of error which is alright in the context of nixpkgs, but makes testing yants harder than you'd think it should be. Change-Id: I61ff7dc01a00a4815ef39066e4e223123356ddd5 Reviewed-on: https://cl.tvl.fyi/c/depot/+/2507 Tested-by: BuildkiteCI Reviewed-by: tazjin <mail@tazj.in> feat(nix/yants/tests): port to runTestsuite 2021-02-09T21:57:56+00:00 sterni sternenseemann@systemli.org 2021-02-01T09:14:48+00:00 urn:sha1:58020730cd4b52df1583197b0cc70b6d964f628e Port existing tests to runTestsuite and add some obvious additional tests that wouldn't be possible before (using assertThrows and assertEq). Change-Id: Ibe950a7a0cda3e23ebb226bdff35f52cdfec5ddf Reviewed-on: https://cl.tvl.fyi/c/depot/+/2479 Tested-by: BuildkiteCI Reviewed-by: Profpatsch <mail@profpatsch.de> Reviewed-by: tazjin <mail@tazj.in> feat(nix/yants): add restrict 2021-01-03T15:53:18+00:00 Profpatsch mail@profpatsch.de 2021-01-01T20:36:42+00:00 urn:sha1:4af195c5f294699340e349e936f994813a7112e4 `restrict` uses a predicate function to restrict a type, giving the restricting a descriptive name in the process. First, the wrapped type definition is checked (e.g. int) and then the value is checked with the predicate, so the predicate can already depend on the value being of the wrapped type. Change-Id: Ic3edde45a8f34c31bc164414580d0a1aa5a821d5 Reviewed-on: https://cl.tvl.fyi/c/depot/+/2312 Tested-by: BuildkiteCI Reviewed-by: Profpatsch <mail@profpatsch.de> Reviewed-by: tazjin <mail@tazj.in> feat(nix/yants): add unit type 2020-06-27T20:48:15+00:00 Profpatsch mail@profpatsch.de 2020-06-27T19:45:20+00:00 urn:sha1:e2c7e38934772744883494a01a784acc15ad2ff7 Has one less value than bool. Change-Id: I2f2db07b1eb1f49172942bc1d8c6ceb30d987d84 Reviewed-on: https://cl.tvl.fyi/c/depot/+/661 Reviewed-by: tazjin <mail@tazj.in> docs(nix/yants): Mention Yants subtree split in README 2020-05-16T11:37:12+00:00 Vincent Ambo tazjin@google.com 2020-05-16T11:24:39+00:00 urn:sha1:6e7006c061da1ccbacf6f92f2a6464f63c4ded44 This subtree split makes it possible for people to clone only yants (similar to the kontemplate and journaldriver branches). The subtree continues the history of the old git repository. chore: Rename pkgs->depot in all Nix file headers 2020-02-21T13:54:53+00:00 Vincent Ambo tazjin@google.com 2020-02-21T12:47:29+00:00 urn:sha1:4bbbb58cb537014dd8b0b3c3c560c039ac57ad89
This XML file does not appear to have any style information associated with it. The document tree is shown below.
<feed xmlns="http://www.w3.org/2005/Atom">
<title>depot/nix/yants, branch refs/r/6087</title>
<subtitle>monorepo for the virus lounge</subtitle>
<id>http://code.tvl.fyi/depot/atom?h=refs%2Fr%2F6087</id>
<link rel="self" href="http://code.tvl.fyi/depot/atom?h=refs%2Fr%2F6087"/>
<link rel="alternate" type="text/html" href="http://code.tvl.fyi/"/>
<updated>2022-02-19T11:37:00+00:00</updated>
<entry>
<title>docs(yants): Update josh cloning instructions</title>
<updated>2022-02-19T11:37:00+00:00</updated>
<author>
<name>Vincent Ambo</name>
<email>mail@tazj.in</email>
</author>
<published>2022-02-19T11:33:07+00:00</published>
<link rel="alternate" type="text/html" href="http://code.tvl.fyi/commit/?id=c7bc8aac4985bf5351a1e933769dd7d764e623ae"/>
<id>urn:sha1:c7bc8aac4985bf5351a1e933769dd7d764e623ae</id>
<content type="text"> Change-Id: I4e9e31488f91465df6b2c6800a3940118107524b Reviewed-on: https://cl.tvl.fyi/c/depot/+/5315 Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su> Autosubmit: tazjin <tazjin@tvl.su> </content>
</entry>
<entry>
<title>style: format entire depot with nixpkgs-fmt</title>
<updated>2022-01-31T16:11:53+00:00</updated>
<author>
<name>Vincent Ambo</name>
<email>mail@tazj.in</email>
</author>
<published>2022-01-30T16:06:58+00:00</published>
<link rel="alternate" type="text/html" href="http://code.tvl.fyi/commit/?id=aa122cbae78ce97d60c0c98ba14df753d97e40b1"/>
<id>urn:sha1:aa122cbae78ce97d60c0c98ba14df753d97e40b1</id>
<content type="text"> This CL can be used to compare the style of nixpkgs-fmt against other formatters (nixpkgs, alejandra). Change-Id: I87c6abff6bcb546b02ead15ad0405f81e01b6d9e Reviewed-on: https://cl.tvl.fyi/c/depot/+/4397 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org> Reviewed-by: lukegb <lukegb@tvl.fyi> Reviewed-by: wpcarro <wpcarro@gmail.com> Reviewed-by: Profpatsch <mail@profpatsch.de> Reviewed-by: kanepyork <rikingcoding@gmail.com> Reviewed-by: tazjin <tazjin@tvl.su> Reviewed-by: cynthia <cynthia@tvl.fyi> Reviewed-by: edef <edef@edef.eu> Reviewed-by: eta <tvl@eta.st> Reviewed-by: grfn <grfn@gws.fyi> </content>
</entry>
<entry>
<title>feat(nix/yants): improve error message for errornous predicate</title>
<updated>2021-12-27T08:20:58+00:00</updated>
<author>
<name>zseri</name>
<email>zseri.devel@ytrizja.de</email>
</author>
<published>2021-12-27T03:52:40+00:00</published>
<link rel="alternate" type="text/html" href="http://code.tvl.fyi/commit/?id=00adb6e8f347ea6fee328641c4413946a41af5a2"/>
<id>urn:sha1:00adb6e8f347ea6fee328641c4413946a41af5a2</id>
<content type="text"> while trying to yantsify `mkSecrets` in https://cl.tvl.fyi/c/depot/+/4688, I(zseri) needed to debug a failing evaluation which boiled down to a result.ok containing something which wasn't boolean, but the error message didn't indicate where that value came from. I debugged yants and found that the only place which didn't simply combine boolean values or use functions which always return booleans, I managed to isolate the error to the `pred v` expression. To avoid the necessity to debug yants to find this, I improve the error message for this case to mention that - a restriction predicate is invalid - what's the name of the failing restriction - the unexpected predicate return value Change-Id: I6c570a33ccc5afc445f208e2e8855c49fb37abaf Reviewed-on: https://cl.tvl.fyi/c/depot/+/4698 Tested-by: BuildkiteCI Reviewed-by: zseri <zseri.devel@ytrizja.de> Reviewed-by: tazjin <mail@tazj.in> Autosubmit: zseri <zseri.devel@ytrizja.de> </content>
</entry>
<entry>
<title>fix(nix/yants): make (typedef …).checkType return a result set</title>
<updated>2021-02-19T16:14:55+00:00</updated>
<author>
<name>sterni</name>
<email>sternenseemann@systemli.org</email>
</author>
<published>2021-02-18T00:33:27+00:00</published>
<link rel="alternate" type="text/html" href="http://code.tvl.fyi/commit/?id=690994a28cc3045c14268996144e9302fa43bf68"/>
<id>urn:sha1:690994a28cc3045c14268996144e9302fa43bf68</id>
<content type="text"> Previously, for types defined using typedef (like all primitive types) type.checkType would return a boolean. This is largely fine since in most places `type.checkToBool (type.checkType x)` or similar is used. However, some functions actually take type.checkType up on the promise that it returns a set of the form: { ok = <bool>; err = <option string>; } This is the case for restrict which has checkToBool = v: v.ok; and will generate a proper set except if `t.checkToBool (t.checkType v) == false` in which case it will return t.checkType v. If t was a primitive type or defined using typedef, previously `t.checkType v` would be a boolean which meant as soon as (restrict …).checkToBool was called on a restrict checkType result in cases where the wrapped type didn't match, an unrelated error would be thrown: nix-repl> with nix.yants; restrict "foo" (_: true) int "lol" error: value is a boolean while a set was expected, at /home/lukas/src/depot/nix/yants/default.nix:38:39 This is fixed by making typedef return a proper set from checkType and adjusting its checkToBool accordingly. Unfortunately I don't think we can easily add test cases for this except by using recursive nix or VM tests as there is no way to introspect error messages. Change-Id: I96a7be065630f04ca33358f21809284911ec14fe Reviewed-on: https://cl.tvl.fyi/c/depot/+/2536 Tested-by: BuildkiteCI Reviewed-by: tazjin <mail@tazj.in> Reviewed-by: Profpatsch <mail@profpatsch.de> </content>
</entry>
<entry>
<title>feat(nix/yants/tests): test drv type</title>
<updated>2021-02-12T21:52:36+00:00</updated>
<author>
<name>sterni</name>
<email>sternenseemann@systemli.org</email>
</author>
<published>2021-02-09T22:30:42+00:00</published>
<link rel="alternate" type="text/html" href="http://code.tvl.fyi/commit/?id=7bd43d15d90f05d752578ca14abc064e5f3db7af"/>
<id>urn:sha1:7bd43d15d90f05d752578ca14abc064e5f3db7af</id>
<content type="text"> By using an extremely trivial derivation we can ensure that it will not throw if evaluated using deepSeq. When using stdenv.mkDerivation or similar at some point something will most likely throw or generate some kind of error which is alright in the context of nixpkgs, but makes testing yants harder than you'd think it should be. Change-Id: I61ff7dc01a00a4815ef39066e4e223123356ddd5 Reviewed-on: https://cl.tvl.fyi/c/depot/+/2507 Tested-by: BuildkiteCI Reviewed-by: tazjin <mail@tazj.in> </content>
</entry>
<entry>
<title>feat(nix/yants/tests): port to runTestsuite</title>
<updated>2021-02-09T21:57:56+00:00</updated>
<author>
<name>sterni</name>
<email>sternenseemann@systemli.org</email>
</author>
<published>2021-02-01T09:14:48+00:00</published>
<link rel="alternate" type="text/html" href="http://code.tvl.fyi/commit/?id=58020730cd4b52df1583197b0cc70b6d964f628e"/>
<id>urn:sha1:58020730cd4b52df1583197b0cc70b6d964f628e</id>
<content type="text"> Port existing tests to runTestsuite and add some obvious additional tests that wouldn't be possible before (using assertThrows and assertEq). Change-Id: Ibe950a7a0cda3e23ebb226bdff35f52cdfec5ddf Reviewed-on: https://cl.tvl.fyi/c/depot/+/2479 Tested-by: BuildkiteCI Reviewed-by: Profpatsch <mail@profpatsch.de> Reviewed-by: tazjin <mail@tazj.in> </content>
</entry>
<entry>
<title>feat(nix/yants): add restrict</title>
<updated>2021-01-03T15:53:18+00:00</updated>
<author>
<name>Profpatsch</name>
<email>mail@profpatsch.de</email>
</author>
<published>2021-01-01T20:36:42+00:00</published>
<link rel="alternate" type="text/html" href="http://code.tvl.fyi/commit/?id=4af195c5f294699340e349e936f994813a7112e4"/>
<id>urn:sha1:4af195c5f294699340e349e936f994813a7112e4</id>
<content type="text"> `restrict` uses a predicate function to restrict a type, giving the restricting a descriptive name in the process. First, the wrapped type definition is checked (e.g. int) and then the value is checked with the predicate, so the predicate can already depend on the value being of the wrapped type. Change-Id: Ic3edde45a8f34c31bc164414580d0a1aa5a821d5 Reviewed-on: https://cl.tvl.fyi/c/depot/+/2312 Tested-by: BuildkiteCI Reviewed-by: Profpatsch <mail@profpatsch.de> Reviewed-by: tazjin <mail@tazj.in> </content>
</entry>
<entry>
<title>feat(nix/yants): add unit type</title>
<updated>2020-06-27T20:48:15+00:00</updated>
<author>
<name>Profpatsch</name>
<email>mail@profpatsch.de</email>
</author>
<published>2020-06-27T19:45:20+00:00</published>
<link rel="alternate" type="text/html" href="http://code.tvl.fyi/commit/?id=e2c7e38934772744883494a01a784acc15ad2ff7"/>
<id>urn:sha1:e2c7e38934772744883494a01a784acc15ad2ff7</id>
<content type="text"> Has one less value than bool. Change-Id: I2f2db07b1eb1f49172942bc1d8c6ceb30d987d84 Reviewed-on: https://cl.tvl.fyi/c/depot/+/661 Reviewed-by: tazjin <mail@tazj.in> </content>
</entry>
<entry>
<title>docs(nix/yants): Mention Yants subtree split in README</title>
<updated>2020-05-16T11:37:12+00:00</updated>
<author>
<name>Vincent Ambo</name>
<email>tazjin@google.com</email>
</author>
<published>2020-05-16T11:24:39+00:00</published>
<link rel="alternate" type="text/html" href="http://code.tvl.fyi/commit/?id=6e7006c061da1ccbacf6f92f2a6464f63c4ded44"/>
<id>urn:sha1:6e7006c061da1ccbacf6f92f2a6464f63c4ded44</id>
<content type="text"> This subtree split makes it possible for people to clone only yants (similar to the kontemplate and journaldriver branches). The subtree continues the history of the old git repository. </content>
</entry>
<entry>
<title>chore: Rename pkgs->depot in all Nix file headers</title>
<updated>2020-02-21T13:54:53+00:00</updated>
<author>
<name>Vincent Ambo</name>
<email>tazjin@google.com</email>
</author>
<published>2020-02-21T12:47:29+00:00</published>
<link rel="alternate" type="text/html" href="http://code.tvl.fyi/commit/?id=4bbbb58cb537014dd8b0b3c3c560c039ac57ad89"/>
<id>urn:sha1:4bbbb58cb537014dd8b0b3c3c560c039ac57ad89</id>
<content type="text"> </content>
</entry>
</feed>