magrathea: add syntax for the empty target
#438
Opened by sterni at
//tools/magrathea has the concept of (empty-target)
which resolves to the target in the current directory. This target can be specified only implicitly by omitting the target.
I think it would be good to be able to specify this explicitly:
- For symmetry: Every implicit command can also be written out.
- Allow running the empty target with arguments: Currently,
mg run
only supports specifying arguments if a target and--
have been given first. We can't really allow omitting the target in this situation since--
would be a valid (relative) target. As a consequence, you have to specify the full absolute target when working in the same directory as the target you want to turn at the moment.
I'm not sure if there's prior art for this, does Bazel have something we can copy? The way I see it, the most obvious candidate would be a single :
. It is already possible to specify a relative subtarget :foo
(which builds the subtarget foo
of the empty target), so we could allow writing the empty target as an empty sub target so to speak. This is nicer than having the user write an actual empty target, e.g. mg run ""
and wouldn't require adding any new syntax.
- sterni updated the body of this issue at 2025-02-04T12·46+00