youki icon indicating copy to clipboard operation
youki copied to clipboard

[RFC] hierarchy of just commands

Open utam0k opened this issue 2 years ago • 2 comments

I would like to have a certain regularity in just commands because they are too irregular. How about doing it like this? level1-level2(-level3) e.g. test-unit

Candidate for level1

  • test
  • dev(e.g. dev-prepare, dev-format)
  • build
  • clean
  • bin

utam0k avatar Jun 09 '23 12:06 utam0k

@containers/youki-maintainers I'd like to know your opiniton

utam0k avatar Jun 09 '23 12:06 utam0k

Agreed. I think these are good categories. Not sure what bin means, but the other 4 category looks good. How does bin differ from build.

I would start with these 4 category (or 5 with bin) and not introduce too many too soon. I would also allow recipes to fall out of these 4 category if it is not immediately clear where things should fit, so we have some flexibility. I think we will have some trial and error before we can get this part right, so I would not stress too much about making everything consistent. It can be improved one category by one category :)

Also note that justfile can have recursion. With a justfile at the root and in each crates/*, we can potentially do:

build +crate:
    just -f crates/{{ crate }} {{ build }}

or

dev *cmd:
    just -f dev.justfile {{ cmd }}

I am not proposing we do these, but it is another way to simplify the hierarchy we can consider. I was looking into breaking the build.sh into something simple and I was trying to understand if breaking by crate is a good idea or not. I think cargo build --all is much better supported now compared to a few years ago when we wrote the build.sh.

yihuaf avatar Jun 09 '23 19:06 yihuaf