From Makefile to Justfile (or Taskfile): Recipe Runner Replacement

Поделиться
HTML-код
  • Опубликовано: 8 сен 2024

Комментарии • 24

  • @DevOpsToolkit
    @DevOpsToolkit  3 месяца назад +1

    What do you think of just and Justfile?

    • @MarcusXPX
      @MarcusXPX 3 месяца назад +1

      I'd rather use Taskfile, for yaml format and additional features.

  • @mihaigalos279
    @mihaigalos279 3 месяца назад +6

    Hi Viktor, awesome video! Thanks for taking the time to review this awesome Just project!
    I've been using just for >2y and believe some of the features which are relevant here and already in just could get more love in the content:
    * recipes with optional or variadic parameters.
    * pre and post dependencies.
    * inline bash variable expansion coupled with templating.
    * runtime global variables via subshells.
    * other justfile inclusion.
    * I personally prefer vim to code and am using syntax highlighting there working just fine. Also there is bat syntax coloring for justfiles.
    All of the above are there out-of-the-box and one can use them with minimal syntax and effort. Which is a far cry from shell.

  • @Jarek.
    @Jarek. 3 месяца назад +6

    Awesome! I like the simplicity, very much indeed. BTW: On just page, there is a lot of competitors:
    *There is no shortage of command runners! Some more or less similar alternatives to just include:*
    make: The Unix build tool that inspired just. There are a few different modern day descendents of the original make, including FreeBSD Make and GNU Make.
    task: A YAML-based command runner written in Go.
    maid: A Markdown-based command runner written in JavaScript.
    microsoft/just: A JavaScript-based command runner written in JavaScript.
    cargo-make: A command runner for Rust projects.
    mmake: A wrapper around make with a number of improvements, including remote includes.
    robo: A YAML-based command runner written in Go.
    mask: A Markdown-based command runner written in Rust.
    makesure: A simple and portable command runner written in AWK and shell.
    haku: A make-like command runner written in Rust.

  • @Jarek.
    @Jarek. 3 месяца назад +3

    I'm really impressed by Just. As for now only reason *not to switch* from Taskfile is that Just is missing feature called in Task "Prevent unnecessary work (...) - When given, Task will compare the checksum of the source files to determine if it's necessary to run the task". I couldn't find this feature in Just ... "just is a command runner, not a build system"

  • @IvanRizzante
    @IvanRizzante 2 месяца назад +1

    Thanks for another great video🎉 I agree with those saying that there's no need to replace or reinvent bash, I just want to add that maybe some people may feel more comfortable with writing Just code than start straightaway the bash journey

  • @AndreaGhensi
    @AndreaGhensi 3 месяца назад +2

    Taskfile has an (incomplete, alas) shell interpreter and platform conditionals that help you write cross platform tasks; it also can check for conditions to skip unneeded tasks (for example I used to bootstrap my dev environments with task, before I learned about devbox from you!)

  • @MichaelBushey
    @MichaelBushey 3 месяца назад +2

    There's not enough Yaml in my life. The Serde Rust crate makes reading and writing Yaml files insanely easy. I simply do not grok how anyone can have issues with a config format that's designed to be easy to read. Yaml removes headaches and stress.

    • @DevOpsToolkit
      @DevOpsToolkit  3 месяца назад +3

      I have no doubt that YAML is the best format to define state that is passed to an API. When tasks are concerned I am not 100% sure.
      Also, YAML being a great format to define something does not necessarily mean that we have to write it directly. I, for example, tend to use KCL that outputs YAML I need.

  • @dariusjuodokas9458
    @dariusjuodokas9458 3 месяца назад +3

    IMO it's yet another way to reinvent bash.
    Bash has all the pros and none of the cons (except for dry-run, which could also be achieved if you mock everything in $PATH)
    And the bash's syntax flexibility does not mean you MUST use it as an advanced user. You CAN, but you don't HAVE to. And it's perfectly possible to create maintainable bash applications and "makefile" alternatives.
    IDK, I personally don't see a point in using just/task/makefile. I fail to see what they can offer that bash can't. I mean, you're writing mostly bash in them anyways...
    So "just" "make" a bash script, write all the "task"s as functions, and call it a day. --list -- `declare -F`. run -- `eval ${1:?Task missing}`. And so on.
    Why reinvent what's already there...? Why....

  • @rodarmor
    @rodarmor 2 месяца назад +1

    Great video! ❤

  • @danko95bgd
    @danko95bgd 3 месяца назад +1

    There is an evaluate command to see what variables will output i guess.
    Also i prefer passing arguments in justfile compared to taskfile where you do -- thingy.

  • @MarcusXPX
    @MarcusXPX 3 месяца назад +1

    I actually like Yaml.
    There's nothing wrong with it - on the opposite: it's user friendly, it's expressive, maybe 'just' maybe a bit too verbose.
    So I will stick with Taskfile 😊

  • @ryanseipp6944
    @ryanseipp6944 3 месяца назад +5

    I'd love to use either of these, but they both have one major downside. Neither are installed by default, or can be assumed to be present on Linux machines, meaning it's yet another thing devs need to install before they can get the project running.

    • @Jarek.
      @Jarek. 3 месяца назад +3

      Fair point! Same is applicable to _make_. Having said that - task and just are statically compiled binaries. At worst they can be part of the repo.

    • @DevOpsToolkit
      @DevOpsToolkit  3 месяца назад +2

      There are always things that need to be installed. I tend to use devbox for that.

    • @Jarek.
      @Jarek. 3 месяца назад +1

      @@DevOpsToolkit Indeed; thank's for sharing GitHub repo - it's all there

    • @ryanseipp6944
      @ryanseipp6944 3 месяца назад +1

      @Jarek. oh, does make only get installed with the base-devel packages on Ubuntu? If that's the case maybe my point has no merit

    • @MarcusXPX
      @MarcusXPX 3 месяца назад +2

      @@DevOpsToolkit I'm a bit old fashioned guy.
      I prefer building a Docker image with all the tools needed. The advantage is that image can be used in CI/CD as well.
      Reproducible environment for everyone, including automation.

  • @milosbuncic9560
    @milosbuncic9560 3 месяца назад +1

    Taskfile rules.

  • @julianomoraisbarbosa
    @julianomoraisbarbosa 3 месяца назад +1

    # til