depot/tools/magrathea, branch refs/r/4465 monorepo for the virus lounge http://code.tvl.fyi/depot/atom?h=refs%2Fr%2F4465 2022-06-01T10:32:01+00:00 feat(tools/magrathea): add repl command 2022-06-01T10:32:01+00:00 sterni sternenseemann@systemli.org 2022-06-01T10:27:59+00:00 urn:sha1:89f3f0a5dc710c891a422d530c18a58aa2d336fb `mg repl` is essentially a shortcut for nix repl $(mg path //) which comes up often enough for me. Launching a repl only really makes sense in the repository root with how readTree works at the moment, so I think this is a convenient addition. Change-Id: I32b695885c2e6eaecdcc656c7249afa504439913 Reviewed-on: https://cl.tvl.fyi/c/depot/+/5822 Autosubmit: sterni <sternenseemann@systemli.org> Reviewed-by: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI feat(magrathea): add flag passthru for arguments to nix-build 2022-05-01T20:27:30+00:00 Vincent Ambo mail@tazj.in 2022-04-27T14:10:52+00:00 urn:sha1:dd691b1bd388a2f8923c28280f11a15293282f3b in some cases, users might want to pass through flags for nix-build (such as `-j`). magrathea now accepts these as arguments to `mg build`, as long as they are separated by `--`. the arguments passed to `mg build` are parsed into a proper record, which enables us to show users very clear error messages in case they forget to use the `--` separator and keeping us future-compatible with more potential arguments to magrathea itself. Change-Id: I81f5d9db52779a5cc3b8bbdd975316274fffe5fc Reviewed-on: https://cl.tvl.fyi/c/depot/+/5507 Tested-by: BuildkiteCI Reviewed-by: ezemtsov <eugene.zemtsov@gmail.com> Reviewed-by: asmundo <asmundo@gmail.com> feat(tools/magrathea): implement run command 2022-02-18T12:06:41+00:00 sterni sternenseemann@systemli.org 2022-02-13T18:30:29+00:00 urn:sha1:01b25ebd8e21692bddf724b5c02a9849c2a5427c This command builds the desired target and runs the executable produced by it. If a directory is produced, it looks for a single (!) executable in the bin directory. Dot files are ignored, so wrappers should generally work. In the future we could provide a flag to select one of multiple executables. All arguments following the target are passed to the executable as is. Examples: mg run ops/mq_cli ls mg run web/bubblegum:examples Change-Id: I6490668af68e028520973196d9daa5f1d58969ee Reviewed-on: https://cl.tvl.fyi/c/depot/+/5277 Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su> fix(magrathea): print [mg] messages to stderr 2022-02-13T17:06:58+00:00 sterni sternenseemann@systemli.org 2022-02-13T16:44:43+00:00 urn:sha1:b7be2660c92fe206e01c0236dc03e2dee03dfa3b I want to add a shortcut to build and run e.g. scripts that are depot targets - for which it would be useful to not have stdout polluted by magrathea itself. Change-Id: Ic58fe28eafb4d0715e53beae041bfaa5d1745812 Reviewed-on: https://cl.tvl.fyi/c/depot/+/5276 Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su> fix(tools/magrathea): prevent trailing slash for // in path 2021-12-18T20:23:35+00:00 sterni sternenseemann@systemli.org 2021-12-18T19:27:37+00:00 urn:sha1:3090f61713c7360b12d5ae710686376b0c5e6f82 All targets would have no trailing slash, so it was at least ugly that // had one as the only legal target. Change-Id: I1b60850ac86d8c550f262841694fb00c518413b8 Reviewed-on: https://cl.tvl.fyi/c/depot/+/4404 Autosubmit: sterni <sternenseemann@systemli.org> Tested-by: BuildkiteCI Reviewed-by: tazjin <mail@tazj.in> feat(tools/magrathea): let users override the repository root 2021-12-18T15:03:02+00:00 Vincent Ambo mail@tazj.in 2021-12-17T22:52:22+00:00 urn:sha1:8fb90b9e5eb58bc8e1820f4c8c8fd65bcc0031dd for global installations of magrathea, setting MG_ROOT can be a way to switch quickly between different repositories (esp. in combination with `cd (mg path)`). Change-Id: I4627fe78b7cc112b75ab57e7806ffd85c6d38aee Reviewed-on: https://cl.tvl.fyi/c/depot/+/4396 Tested-by: BuildkiteCI Reviewed-by: wpcarro <wpcarro@gmail.com> feat(tools/magrathea): add a path command 2021-12-18T15:03:02+00:00 Vincent Ambo mail@tazj.in 2021-12-17T22:42:05+00:00 urn:sha1:46a4e25550456790999c3afe4a578dedb8fe5024 this command prints the absolute directory for a given target. it can be combined with shell aliases to add quick navigation commands. unfortunately due to the nature of computers implementing something like `mg cd` directly is not possible. Change-Id: Icc88eb97384812c620c49fe2de8fa331f4d7153b Reviewed-on: https://cl.tvl.fyi/c/depot/+/4395 Tested-by: BuildkiteCI Reviewed-by: wpcarro <wpcarro@gmail.com> feat(tools/magrathea): wire up parsed targets with commands 2021-12-18T15:03:02+00:00 Vincent Ambo mail@tazj.in 2021-12-17T22:08:40+00:00 urn:sha1:589480a92552732399e8d3c318b5eb18c821677e magrathea now does what it says on the tin - build and shell commands can be used with the targets specified on the command line. implementation notes: * string representation of target has been changed to look like the target spec format, this is now used in user-facing messages * errors returned by the target parser make the program exit with status 1 * normalisation could be done better (for example, maybe it makes sense to always do it) but it's good enough for now Change-Id: Ib85f389a5cec92b3c2f3b9c0b40764435bbcc68b Reviewed-on: https://cl.tvl.fyi/c/depot/+/4394 Tested-by: BuildkiteCI Reviewed-by: wpcarro <wpcarro@gmail.com> feat(tools/magrathea): add weirdly overengineered target spec parser 2021-12-17T20:48:35+00:00 Vincent Ambo mail@tazj.in 2021-12-17T18:17:28+00:00 urn:sha1:cecc249c961735c9a9bd0c8d60e5fec7e4ac3b70 i'm not sure what happened here, but it works (yes, the fancy target printing is completely unnecessary, but oh well): #;152> (parse-target "foo") #target(foo) #;153> (parse-target "//foo") #target(//foo) #;154> (parse-target "//foo/bar") #target(//foo/bar) #;155> (parse-target "//foo/bar/") #target(//foo/bar) #;156> (parse-target "//foo/bar:baz") #target(//foo/bar:baz) #;157> (parse-target "//foo/bar/:baz") #target(//foo/bar:baz) #;158> (parse-target "//foo/bar:") (error . "unexpected end of input while parsing virtual target") #;159> (parse-target "//foo//") (error . "unexpected root-anchor while parsing normal target") the most notable thing is that trailing slashes are allowed in the physical targets, since people may be autocompleting these on the shell from folder names. Change-Id: I32975ad77fe2a327130dc9574011fe92cce49f84 Reviewed-on: https://cl.tvl.fyi/c/depot/+/4393 Tested-by: BuildkiteCI Reviewed-by: grfn <grfn@gws.fyi> Reviewed-by: wpcarro <wpcarro@gmail.com> feat(tools/magrathea): bootstrap a tool for working with depot 2021-12-17T20:48:35+00:00 Vincent Ambo mail@tazj.in 2021-12-15T16:31:47+00:00 urn:sha1:564ad52b306bc1a3abe2afa9380bb0552144b23e this is going to be a serious version of //tools/depot-build. right now it doesn't support parsing any target specs yet, so only shells and builds for the physical project of the current folder work. Change-Id: I4308e29da940571622ff9e539fbb8ededd27aca7 Reviewed-on: https://cl.tvl.fyi/c/depot/+/4335 Tested-by: BuildkiteCI Reviewed-by: tazjin <mail@tazj.in> Reviewed-by: grfn <grfn@gws.fyi>
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/tools/magrathea, branch refs/r/4465</title>
<subtitle>monorepo for the virus lounge</subtitle>
<id>http://code.tvl.fyi/depot/atom?h=refs%2Fr%2F4465</id>
<link rel="self" href="http://code.tvl.fyi/depot/atom?h=refs%2Fr%2F4465"/>
<link rel="alternate" type="text/html" href="http://code.tvl.fyi/"/>
<updated>2022-06-01T10:32:01+00:00</updated>
<entry>
<title>feat(tools/magrathea): add repl command</title>
<updated>2022-06-01T10:32:01+00:00</updated>
<author>
<name>sterni</name>
<email>sternenseemann@systemli.org</email>
</author>
<published>2022-06-01T10:27:59+00:00</published>
<link rel="alternate" type="text/html" href="http://code.tvl.fyi/commit/?id=89f3f0a5dc710c891a422d530c18a58aa2d336fb"/>
<id>urn:sha1:89f3f0a5dc710c891a422d530c18a58aa2d336fb</id>
<content type="text"> `mg repl` is essentially a shortcut for nix repl $(mg path //) which comes up often enough for me. Launching a repl only really makes sense in the repository root with how readTree works at the moment, so I think this is a convenient addition. Change-Id: I32b695885c2e6eaecdcc656c7249afa504439913 Reviewed-on: https://cl.tvl.fyi/c/depot/+/5822 Autosubmit: sterni <sternenseemann@systemli.org> Reviewed-by: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI </content>
</entry>
<entry>
<title>feat(magrathea): add flag passthru for arguments to nix-build</title>
<updated>2022-05-01T20:27:30+00:00</updated>
<author>
<name>Vincent Ambo</name>
<email>mail@tazj.in</email>
</author>
<published>2022-04-27T14:10:52+00:00</published>
<link rel="alternate" type="text/html" href="http://code.tvl.fyi/commit/?id=dd691b1bd388a2f8923c28280f11a15293282f3b"/>
<id>urn:sha1:dd691b1bd388a2f8923c28280f11a15293282f3b</id>
<content type="text"> in some cases, users might want to pass through flags for nix-build (such as `-j`). magrathea now accepts these as arguments to `mg build`, as long as they are separated by `--`. the arguments passed to `mg build` are parsed into a proper record, which enables us to show users very clear error messages in case they forget to use the `--` separator and keeping us future-compatible with more potential arguments to magrathea itself. Change-Id: I81f5d9db52779a5cc3b8bbdd975316274fffe5fc Reviewed-on: https://cl.tvl.fyi/c/depot/+/5507 Tested-by: BuildkiteCI Reviewed-by: ezemtsov <eugene.zemtsov@gmail.com> Reviewed-by: asmundo <asmundo@gmail.com> </content>
</entry>
<entry>
<title>feat(tools/magrathea): implement run command</title>
<updated>2022-02-18T12:06:41+00:00</updated>
<author>
<name>sterni</name>
<email>sternenseemann@systemli.org</email>
</author>
<published>2022-02-13T18:30:29+00:00</published>
<link rel="alternate" type="text/html" href="http://code.tvl.fyi/commit/?id=01b25ebd8e21692bddf724b5c02a9849c2a5427c"/>
<id>urn:sha1:01b25ebd8e21692bddf724b5c02a9849c2a5427c</id>
<content type="text"> This command builds the desired target and runs the executable produced by it. If a directory is produced, it looks for a single (!) executable in the bin directory. Dot files are ignored, so wrappers should generally work. In the future we could provide a flag to select one of multiple executables. All arguments following the target are passed to the executable as is. Examples: mg run ops/mq_cli ls mg run web/bubblegum:examples Change-Id: I6490668af68e028520973196d9daa5f1d58969ee Reviewed-on: https://cl.tvl.fyi/c/depot/+/5277 Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su> </content>
</entry>
<entry>
<title>fix(magrathea): print [mg] messages to stderr</title>
<updated>2022-02-13T17:06:58+00:00</updated>
<author>
<name>sterni</name>
<email>sternenseemann@systemli.org</email>
</author>
<published>2022-02-13T16:44:43+00:00</published>
<link rel="alternate" type="text/html" href="http://code.tvl.fyi/commit/?id=b7be2660c92fe206e01c0236dc03e2dee03dfa3b"/>
<id>urn:sha1:b7be2660c92fe206e01c0236dc03e2dee03dfa3b</id>
<content type="text"> I want to add a shortcut to build and run e.g. scripts that are depot targets - for which it would be useful to not have stdout polluted by magrathea itself. Change-Id: Ic58fe28eafb4d0715e53beae041bfaa5d1745812 Reviewed-on: https://cl.tvl.fyi/c/depot/+/5276 Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su> </content>
</entry>
<entry>
<title>fix(tools/magrathea): prevent trailing slash for // in path</title>
<updated>2021-12-18T20:23:35+00:00</updated>
<author>
<name>sterni</name>
<email>sternenseemann@systemli.org</email>
</author>
<published>2021-12-18T19:27:37+00:00</published>
<link rel="alternate" type="text/html" href="http://code.tvl.fyi/commit/?id=3090f61713c7360b12d5ae710686376b0c5e6f82"/>
<id>urn:sha1:3090f61713c7360b12d5ae710686376b0c5e6f82</id>
<content type="text"> All targets would have no trailing slash, so it was at least ugly that // had one as the only legal target. Change-Id: I1b60850ac86d8c550f262841694fb00c518413b8 Reviewed-on: https://cl.tvl.fyi/c/depot/+/4404 Autosubmit: sterni <sternenseemann@systemli.org> Tested-by: BuildkiteCI Reviewed-by: tazjin <mail@tazj.in> </content>
</entry>
<entry>
<title>feat(tools/magrathea): let users override the repository root</title>
<updated>2021-12-18T15:03:02+00:00</updated>
<author>
<name>Vincent Ambo</name>
<email>mail@tazj.in</email>
</author>
<published>2021-12-17T22:52:22+00:00</published>
<link rel="alternate" type="text/html" href="http://code.tvl.fyi/commit/?id=8fb90b9e5eb58bc8e1820f4c8c8fd65bcc0031dd"/>
<id>urn:sha1:8fb90b9e5eb58bc8e1820f4c8c8fd65bcc0031dd</id>
<content type="text"> for global installations of magrathea, setting MG_ROOT can be a way to switch quickly between different repositories (esp. in combination with `cd (mg path)`). Change-Id: I4627fe78b7cc112b75ab57e7806ffd85c6d38aee Reviewed-on: https://cl.tvl.fyi/c/depot/+/4396 Tested-by: BuildkiteCI Reviewed-by: wpcarro <wpcarro@gmail.com> </content>
</entry>
<entry>
<title>feat(tools/magrathea): add a path command</title>
<updated>2021-12-18T15:03:02+00:00</updated>
<author>
<name>Vincent Ambo</name>
<email>mail@tazj.in</email>
</author>
<published>2021-12-17T22:42:05+00:00</published>
<link rel="alternate" type="text/html" href="http://code.tvl.fyi/commit/?id=46a4e25550456790999c3afe4a578dedb8fe5024"/>
<id>urn:sha1:46a4e25550456790999c3afe4a578dedb8fe5024</id>
<content type="text"> this command prints the absolute directory for a given target. it can be combined with shell aliases to add quick navigation commands. unfortunately due to the nature of computers implementing something like `mg cd` directly is not possible. Change-Id: Icc88eb97384812c620c49fe2de8fa331f4d7153b Reviewed-on: https://cl.tvl.fyi/c/depot/+/4395 Tested-by: BuildkiteCI Reviewed-by: wpcarro <wpcarro@gmail.com> </content>
</entry>
<entry>
<title>feat(tools/magrathea): wire up parsed targets with commands</title>
<updated>2021-12-18T15:03:02+00:00</updated>
<author>
<name>Vincent Ambo</name>
<email>mail@tazj.in</email>
</author>
<published>2021-12-17T22:08:40+00:00</published>
<link rel="alternate" type="text/html" href="http://code.tvl.fyi/commit/?id=589480a92552732399e8d3c318b5eb18c821677e"/>
<id>urn:sha1:589480a92552732399e8d3c318b5eb18c821677e</id>
<content type="text"> magrathea now does what it says on the tin - build and shell commands can be used with the targets specified on the command line. implementation notes: * string representation of target has been changed to look like the target spec format, this is now used in user-facing messages * errors returned by the target parser make the program exit with status 1 * normalisation could be done better (for example, maybe it makes sense to always do it) but it's good enough for now Change-Id: Ib85f389a5cec92b3c2f3b9c0b40764435bbcc68b Reviewed-on: https://cl.tvl.fyi/c/depot/+/4394 Tested-by: BuildkiteCI Reviewed-by: wpcarro <wpcarro@gmail.com> </content>
</entry>
<entry>
<title>feat(tools/magrathea): add weirdly overengineered target spec parser</title>
<updated>2021-12-17T20:48:35+00:00</updated>
<author>
<name>Vincent Ambo</name>
<email>mail@tazj.in</email>
</author>
<published>2021-12-17T18:17:28+00:00</published>
<link rel="alternate" type="text/html" href="http://code.tvl.fyi/commit/?id=cecc249c961735c9a9bd0c8d60e5fec7e4ac3b70"/>
<id>urn:sha1:cecc249c961735c9a9bd0c8d60e5fec7e4ac3b70</id>
<content type="text"> i'm not sure what happened here, but it works (yes, the fancy target printing is completely unnecessary, but oh well): #;152> (parse-target "foo") #target(foo) #;153> (parse-target "//foo") #target(//foo) #;154> (parse-target "//foo/bar") #target(//foo/bar) #;155> (parse-target "//foo/bar/") #target(//foo/bar) #;156> (parse-target "//foo/bar:baz") #target(//foo/bar:baz) #;157> (parse-target "//foo/bar/:baz") #target(//foo/bar:baz) #;158> (parse-target "//foo/bar:") (error . "unexpected end of input while parsing virtual target") #;159> (parse-target "//foo//") (error . "unexpected root-anchor while parsing normal target") the most notable thing is that trailing slashes are allowed in the physical targets, since people may be autocompleting these on the shell from folder names. Change-Id: I32975ad77fe2a327130dc9574011fe92cce49f84 Reviewed-on: https://cl.tvl.fyi/c/depot/+/4393 Tested-by: BuildkiteCI Reviewed-by: grfn <grfn@gws.fyi> Reviewed-by: wpcarro <wpcarro@gmail.com> </content>
</entry>
<entry>
<title>feat(tools/magrathea): bootstrap a tool for working with depot</title>
<updated>2021-12-17T20:48:35+00:00</updated>
<author>
<name>Vincent Ambo</name>
<email>mail@tazj.in</email>
</author>
<published>2021-12-15T16:31:47+00:00</published>
<link rel="alternate" type="text/html" href="http://code.tvl.fyi/commit/?id=564ad52b306bc1a3abe2afa9380bb0552144b23e"/>
<id>urn:sha1:564ad52b306bc1a3abe2afa9380bb0552144b23e</id>
<content type="text"> this is going to be a serious version of //tools/depot-build. right now it doesn't support parsing any target specs yet, so only shells and builds for the physical project of the current folder work. Change-Id: I4308e29da940571622ff9e539fbb8ededd27aca7 Reviewed-on: https://cl.tvl.fyi/c/depot/+/4335 Tested-by: BuildkiteCI Reviewed-by: tazjin <mail@tazj.in> Reviewed-by: grfn <grfn@gws.fyi> </content>
</entry>
</feed>