depot/tvix/derivation/src/validate.rs, branch refs/r/7958 monorepo for the virus lounge http://code.tvl.fyi/depot/atom?h=refs%2Fr%2F7958 2023-01-31T15:16:39+00:00 refactor(tvix/nix-compat): absorb //tvix/derivation 2023-01-31T15:16:39+00:00 Florian Klink flokli@flokli.de 2023-01-31T13:45:42+00:00 urn:sha1:2d24c5f260945216ca01371d4120f5d53f08b2cd Put this in its src/derivation. Change-Id: Ic047ab1c2da555a833ee454e10ef60c77537b617 Reviewed-on: https://cl.tvl.fyi/c/depot/+/7967 Reviewed-by: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI Autosubmit: flokli <flokli@flokli.de> refactor(tvix): introduce nix-compat crate 2023-01-31T13:26:18+00:00 Florian Klink flokli@flokli.de 2023-01-31T11:18:03+00:00 urn:sha1:c27bacd905a14207edc56850fd4ef9383706b5c4 Move nixbase32 and store_path into this. This allows //tvix/cli to not pull in //tvix/store for now. Change-Id: Id3a32867205d95794bc0d33b21d4cb3d9bafd02a Reviewed-on: https://cl.tvl.fyi/c/depot/+/7964 Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su> refactor(tvix/derivation): remove DOT_FILE_EXT const 2023-01-23T13:53:45+00:00 Florian Klink flokli@flokli.de 2023-01-23T13:46:40+00:00 urn:sha1:b0d6e748acbdfb914bfe53c1c91345a408cc8726 This is used in few enough places to just inline it. It felt a bit alien in the ATerm construction aswell. write.rs now pleasantly only includes tokens that occur in the ATerm representation. Change-Id: I524f8d6c1ce9057ff7fd16c6c3efd98467040a44 Reviewed-on: https://cl.tvl.fyi/c/depot/+/7911 Reviewed-by: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI feat(tvix/derivation): add validate_output_paths flag for validate 2023-01-18T17:13:23+00:00 Florian Klink flokli@flokli.de 2023-01-16T14:55:16+00:00 urn:sha1:083e24bbb1a216b43bfa4fa2e509a1ee6a88ad46 This allows calling validate() on a derivation that doesn't have its output paths already calculated yet. It allows offloading some of the error checking in builtins.derivation* to be offloaded to that function. Change-Id: Ib4aeadc0eb6583ef8cd765f33e9a9ec32be62729 Reviewed-on: https://cl.tvl.fyi/c/depot/+/7848 Reviewed-by: tazjin <tazjin@tvl.su> Autosubmit: flokli <flokli@flokli.de> Tested-by: BuildkiteCI feat(tvix/derivation): check for other invalid output names 2023-01-18T17:13:23+00:00 Florian Klink flokli@flokli.de 2023-01-17T11:42:36+00:00 urn:sha1:b1e8fe7212618a61b78eeefa65075295fe2e40b2 This uses the exposed StorePath::validate_name method to check for other invalid output names (for which it would not be possible to construct a store path of). Change-Id: Ia3f65e19a07ef164f9f64013a5f37cbac99eb8e0 Reviewed-on: https://cl.tvl.fyi/c/depot/+/7855 Reviewed-by: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI refactor(tvix/derivation): use DerivationError in Output::validate 2023-01-18T17:13:23+00:00 Florian Klink flokli@flokli.de 2023-01-17T11:04:15+00:00 urn:sha1:6e7f06d942a5e54d20d4441ff196ce3ffc99855a Change-Id: I7dbd3b8ff9ef92acddde2e579fb24b8311c34d8f Reviewed-on: https://cl.tvl.fyi/c/depot/+/7852 Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su> refactor(tvix/derivation): rename {ValidateDerivation,}Error 2023-01-18T17:13:23+00:00 Florian Klink flokli@flokli.de 2023-01-17T11:00:52+00:00 urn:sha1:eebb3ce028e56872cdfee462dd6556e33d2f204e This is now used in more than just validate(). Change-Id: I69c3ad6cb5f3ad60a636fe2ea05d432aebe8e53b Reviewed-on: https://cl.tvl.fyi/c/depot/+/7851 Reviewed-by: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI feat(tvix/derivation): also fail if output name is called `drv` 2023-01-18T17:13:23+00:00 Florian Klink flokli@flokli.de 2023-01-17T10:56:23+00:00 urn:sha1:0aad4e2246971601c16a20240eebf61964f8c198 `drv` is an invalid output name too, as this would cause a `builtins.derivation` call to return an attrset with a `drvPath` key (which already exists) and has a different meaning. Also handle errors during store path construction, and return our own error type, instead of the ParseStorePathError. Change-Id: Ib7952dde1d5cf18a0e210928df7c57b5939b7678 Reviewed-on: https://cl.tvl.fyi/c/depot/+/7850 Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su> Autosubmit: flokli <flokli@flokli.de> refactor(tvix/derivation): expose proper ValidateDerivationError 2023-01-16T23:04:50+00:00 Florian Klink flokli@flokli.de 2023-01-16T14:24:02+00:00 urn:sha1:d644ed389aab967a276c39b349a8d266a1aee889 Use proper errors, instead of anyhow. Change-Id: I6db14c72a6319b389b0136aac7b84f50a30fb366 Reviewed-on: https://cl.tvl.fyi/c/depot/+/7847 Autosubmit: flokli <flokli@flokli.de> Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su> feat(tvix/derivation): make input_sources a BTreeSet 2023-01-16T16:45:56+00:00 Florian Klink flokli@flokli.de 2023-01-16T14:25:08+00:00 urn:sha1:95cad95b9333214df90d6002e51c7ae34910fa7e These need to be sorted anyways, so let's use the correct data structure for it. Change-Id: I009c9989d7647dc1df716170f3680c981db6e4b2 Reviewed-on: https://cl.tvl.fyi/c/depot/+/7846 Autosubmit: flokli <flokli@flokli.de> Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su>
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/tvix/derivation/src/validate.rs, branch refs/r/7958</title>
<subtitle>monorepo for the virus lounge</subtitle>
<id>http://code.tvl.fyi/depot/atom?h=refs%2Fr%2F7958</id>
<link rel="self" href="http://code.tvl.fyi/depot/atom?h=refs%2Fr%2F7958"/>
<link rel="alternate" type="text/html" href="http://code.tvl.fyi/"/>
<updated>2023-01-31T15:16:39+00:00</updated>
<entry>
<title>refactor(tvix/nix-compat): absorb //tvix/derivation</title>
<updated>2023-01-31T15:16:39+00:00</updated>
<author>
<name>Florian Klink</name>
<email>flokli@flokli.de</email>
</author>
<published>2023-01-31T13:45:42+00:00</published>
<link rel="alternate" type="text/html" href="http://code.tvl.fyi/commit/?id=2d24c5f260945216ca01371d4120f5d53f08b2cd"/>
<id>urn:sha1:2d24c5f260945216ca01371d4120f5d53f08b2cd</id>
<content type="text"> Put this in its src/derivation. Change-Id: Ic047ab1c2da555a833ee454e10ef60c77537b617 Reviewed-on: https://cl.tvl.fyi/c/depot/+/7967 Reviewed-by: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI Autosubmit: flokli <flokli@flokli.de> </content>
</entry>
<entry>
<title>refactor(tvix): introduce nix-compat crate</title>
<updated>2023-01-31T13:26:18+00:00</updated>
<author>
<name>Florian Klink</name>
<email>flokli@flokli.de</email>
</author>
<published>2023-01-31T11:18:03+00:00</published>
<link rel="alternate" type="text/html" href="http://code.tvl.fyi/commit/?id=c27bacd905a14207edc56850fd4ef9383706b5c4"/>
<id>urn:sha1:c27bacd905a14207edc56850fd4ef9383706b5c4</id>
<content type="text"> Move nixbase32 and store_path into this. This allows //tvix/cli to not pull in //tvix/store for now. Change-Id: Id3a32867205d95794bc0d33b21d4cb3d9bafd02a Reviewed-on: https://cl.tvl.fyi/c/depot/+/7964 Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su> </content>
</entry>
<entry>
<title>refactor(tvix/derivation): remove DOT_FILE_EXT const</title>
<updated>2023-01-23T13:53:45+00:00</updated>
<author>
<name>Florian Klink</name>
<email>flokli@flokli.de</email>
</author>
<published>2023-01-23T13:46:40+00:00</published>
<link rel="alternate" type="text/html" href="http://code.tvl.fyi/commit/?id=b0d6e748acbdfb914bfe53c1c91345a408cc8726"/>
<id>urn:sha1:b0d6e748acbdfb914bfe53c1c91345a408cc8726</id>
<content type="text"> This is used in few enough places to just inline it. It felt a bit alien in the ATerm construction aswell. write.rs now pleasantly only includes tokens that occur in the ATerm representation. Change-Id: I524f8d6c1ce9057ff7fd16c6c3efd98467040a44 Reviewed-on: https://cl.tvl.fyi/c/depot/+/7911 Reviewed-by: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI </content>
</entry>
<entry>
<title>feat(tvix/derivation): add validate_output_paths flag for validate</title>
<updated>2023-01-18T17:13:23+00:00</updated>
<author>
<name>Florian Klink</name>
<email>flokli@flokli.de</email>
</author>
<published>2023-01-16T14:55:16+00:00</published>
<link rel="alternate" type="text/html" href="http://code.tvl.fyi/commit/?id=083e24bbb1a216b43bfa4fa2e509a1ee6a88ad46"/>
<id>urn:sha1:083e24bbb1a216b43bfa4fa2e509a1ee6a88ad46</id>
<content type="text"> This allows calling validate() on a derivation that doesn't have its output paths already calculated yet. It allows offloading some of the error checking in builtins.derivation* to be offloaded to that function. Change-Id: Ib4aeadc0eb6583ef8cd765f33e9a9ec32be62729 Reviewed-on: https://cl.tvl.fyi/c/depot/+/7848 Reviewed-by: tazjin <tazjin@tvl.su> Autosubmit: flokli <flokli@flokli.de> Tested-by: BuildkiteCI </content>
</entry>
<entry>
<title>feat(tvix/derivation): check for other invalid output names</title>
<updated>2023-01-18T17:13:23+00:00</updated>
<author>
<name>Florian Klink</name>
<email>flokli@flokli.de</email>
</author>
<published>2023-01-17T11:42:36+00:00</published>
<link rel="alternate" type="text/html" href="http://code.tvl.fyi/commit/?id=b1e8fe7212618a61b78eeefa65075295fe2e40b2"/>
<id>urn:sha1:b1e8fe7212618a61b78eeefa65075295fe2e40b2</id>
<content type="text"> This uses the exposed StorePath::validate_name method to check for other invalid output names (for which it would not be possible to construct a store path of). Change-Id: Ia3f65e19a07ef164f9f64013a5f37cbac99eb8e0 Reviewed-on: https://cl.tvl.fyi/c/depot/+/7855 Reviewed-by: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI </content>
</entry>
<entry>
<title>refactor(tvix/derivation): use DerivationError in Output::validate</title>
<updated>2023-01-18T17:13:23+00:00</updated>
<author>
<name>Florian Klink</name>
<email>flokli@flokli.de</email>
</author>
<published>2023-01-17T11:04:15+00:00</published>
<link rel="alternate" type="text/html" href="http://code.tvl.fyi/commit/?id=6e7f06d942a5e54d20d4441ff196ce3ffc99855a"/>
<id>urn:sha1:6e7f06d942a5e54d20d4441ff196ce3ffc99855a</id>
<content type="text"> Change-Id: I7dbd3b8ff9ef92acddde2e579fb24b8311c34d8f Reviewed-on: https://cl.tvl.fyi/c/depot/+/7852 Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su> </content>
</entry>
<entry>
<title>refactor(tvix/derivation): rename {ValidateDerivation,}Error</title>
<updated>2023-01-18T17:13:23+00:00</updated>
<author>
<name>Florian Klink</name>
<email>flokli@flokli.de</email>
</author>
<published>2023-01-17T11:00:52+00:00</published>
<link rel="alternate" type="text/html" href="http://code.tvl.fyi/commit/?id=eebb3ce028e56872cdfee462dd6556e33d2f204e"/>
<id>urn:sha1:eebb3ce028e56872cdfee462dd6556e33d2f204e</id>
<content type="text"> This is now used in more than just validate(). Change-Id: I69c3ad6cb5f3ad60a636fe2ea05d432aebe8e53b Reviewed-on: https://cl.tvl.fyi/c/depot/+/7851 Reviewed-by: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI </content>
</entry>
<entry>
<title>feat(tvix/derivation): also fail if output name is called `drv`</title>
<updated>2023-01-18T17:13:23+00:00</updated>
<author>
<name>Florian Klink</name>
<email>flokli@flokli.de</email>
</author>
<published>2023-01-17T10:56:23+00:00</published>
<link rel="alternate" type="text/html" href="http://code.tvl.fyi/commit/?id=0aad4e2246971601c16a20240eebf61964f8c198"/>
<id>urn:sha1:0aad4e2246971601c16a20240eebf61964f8c198</id>
<content type="text"> `drv` is an invalid output name too, as this would cause a `builtins.derivation` call to return an attrset with a `drvPath` key (which already exists) and has a different meaning. Also handle errors during store path construction, and return our own error type, instead of the ParseStorePathError. Change-Id: Ib7952dde1d5cf18a0e210928df7c57b5939b7678 Reviewed-on: https://cl.tvl.fyi/c/depot/+/7850 Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su> Autosubmit: flokli <flokli@flokli.de> </content>
</entry>
<entry>
<title>refactor(tvix/derivation): expose proper ValidateDerivationError</title>
<updated>2023-01-16T23:04:50+00:00</updated>
<author>
<name>Florian Klink</name>
<email>flokli@flokli.de</email>
</author>
<published>2023-01-16T14:24:02+00:00</published>
<link rel="alternate" type="text/html" href="http://code.tvl.fyi/commit/?id=d644ed389aab967a276c39b349a8d266a1aee889"/>
<id>urn:sha1:d644ed389aab967a276c39b349a8d266a1aee889</id>
<content type="text"> Use proper errors, instead of anyhow. Change-Id: I6db14c72a6319b389b0136aac7b84f50a30fb366 Reviewed-on: https://cl.tvl.fyi/c/depot/+/7847 Autosubmit: flokli <flokli@flokli.de> Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su> </content>
</entry>
<entry>
<title>feat(tvix/derivation): make input_sources a BTreeSet</title>
<updated>2023-01-16T16:45:56+00:00</updated>
<author>
<name>Florian Klink</name>
<email>flokli@flokli.de</email>
</author>
<published>2023-01-16T14:25:08+00:00</published>
<link rel="alternate" type="text/html" href="http://code.tvl.fyi/commit/?id=95cad95b9333214df90d6002e51c7ae34910fa7e"/>
<id>urn:sha1:95cad95b9333214df90d6002e51c7ae34910fa7e</id>
<content type="text"> These need to be sorted anyways, so let's use the correct data structure for it. Change-Id: I009c9989d7647dc1df716170f3680c981db6e4b2 Reviewed-on: https://cl.tvl.fyi/c/depot/+/7846 Autosubmit: flokli <flokli@flokli.de> Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su> </content>
</entry>
</feed>