Taskfile: A Modern Alternative to Makefile
91–100 of 223 posts
Re: Taskfile: A Modern Alternative to Makefile
#92Earlier quoted context omitted.
Because Make is too stable and well documented, because it's just one tool and not 3, because it isn't written in Go and because you don't have to scratch you head at another YAML hell. Because 47 years of proven track record is nothing compared to "modern". Need I go on?
If you think there’s nothing to fix with make, you’re severely mistaken. The differences between GNU Make and BSD Make are for me a big reason to be extra careful when using it. Make also relies a lot on cleverness so it comes with lots of idiosyncrasies (like having to add .PHONY to all the targets not representing files, which in itself proves Make was not thought to be used like we use it). Some basic conventions…
Re: Taskfile: A Modern Alternative to Makefile
#93Earlier quoted context omitted.
No need to apologise, I don't like YAML, I like Python, and I agree: I'd rather have a domain specific library than a DSL anyday. The best of both worlds is a good programming language that allows expressing domain specific libraries almost as if they were domain specific languages, without going so declarative that people don't know how to script anything anymore. I don't know if Python/doit really achieved that, bu…
Yes. I said it in another comment as well, but I'm rooting for a solid non turing complete conf language like CUElang ( https://cuelang.org ) to become popular. For now we can already use it to check and generate regular JSON or YAML, which is a good compat story. But imagine having this in CI instead of YAML files.
Re: Taskfile: A Modern Alternative to Makefile
#94Just add a makefile to your repo and anybody is able it get started. I would have no clue what todo with a project in the structure proposed.
Note: I just makefiles as an entry point to the underlying build tool such as gradle or npm or go build
Re: Taskfile: A Modern Alternative to Makefile
#95I wanted to see what was wrong with Makefile and how Taskfile solved the issue, but the post doesn't explain; it's more a tutorial on how to use Taskfile. If the author reads this, I think we'd love to know what's wrong with make. Also, a lot of those look like artificial complexity over a shell script sourcing another one containing only variables export, and running the required scripts.
If your Makefiles look like this:
build:
go build -o dist/app
You might as well just use make, it's fine. It's less fine when you want to avoid rebuilding if sources didn't change, or if you want to use environment variables, maybe from a dotenv file, or if you want to do conditions (like adding a debug flag to a build command if a make variable is set), or if you need to use make incantations (hoping they'll work with both BSD Make and GNU Make), then a Taskfile might help solving some issues, including legibility.Re: Taskfile: A Modern Alternative to Makefile
#96Re: Taskfile: A Modern Alternative to Makefile
#97I wanted to see what was wrong with Makefile and how Taskfile solved the issue, but the post doesn't explain; it's more a tutorial on how to use Taskfile. If the author reads this, I think we'd love to know what's wrong with make. Also, a lot of those look like artificial complexity over a shell script sourcing another one containing only variables export, and running the required scripts.
If you don't know what's wrong with make, just use make. But it probably means you probably don't USE make. If your Makefiles look like this: build: go build -o dist/app You might as well just use make, it's fine. It's less fine when you want to avoid rebuilding if sources didn't change, or if you want to use environment variables, maybe from a dotenv file, or if you want to do conditions (like adding a debug flag to…
Your description starts to be more interesting, and I feel like mk (the successor of make from the Plan 9 people: https://plan9.io/sys/doc/mk.html) might address those, but again, I don't have a need for it.
Re: Taskfile: A Modern Alternative to Makefile
#98Earlier quoted context omitted.
Yes. I said it in another comment as well, but I'm rooting for a solid non turing complete conf language like CUElang ( https://cuelang.org ) to become popular. For now we can already use it to check and generate regular JSON or YAML, which is a good compat story. But imagine having this in CI instead of YAML files.
I prefer Jsonnet for JSON and YAML
I've tried the 3 of them, eventually I found CUElang was the best balance between expressiveness, ability to enforce and check for constraints, and easy of use.
But I would welcome any of them replacing the YAML mess we currently have in sysadmin.
Re: Taskfile: A Modern Alternative to Makefile
#99I wanted it easy to read, write, parse and use, so I'd use YAML. You guys all shit on YAML because it's extremely badly used by, say, Helm charts, but it's a good markup language in itself. StrictYAML is anyway.
So I started writing a toy Makefile in YAML with these requirements: I need to run a command, with variables, it needs to depend on another command, and shouldn't run if the "output" file is already present and newer than the "source" files. So something like this:
env:
APPNAME: app
clean:
run: rm -rf ./dist
build:
depends:
- clean
input:
- **/*.go
run:
- go build -o dist/$APPNAME
output:
- dist/$APPNAME
At this point I realized I had written exactly the same things proposed by Taskfile (which I heard of but thought "meh it sucks, Makefiles are great).So yeah, Taskfiles are just Makefiles with a sane syntax and better tooling (JSON schema, auto generated doc, real default target...). I have no idea why the comments are so hostile towards it, because clearly Makefiles are not perfect (it's even a pretty bad format)
Re: Taskfile: A Modern Alternative to Makefile
#100One day after writing a complex Makefile and getting frustrated because 1) it was hard to read and reason about because of make weird syntax, 2) it didn't run on CI because it uses GNU Make instead of BSD Make on my MacBook, I thought of writing a "modern" alternative: I wanted it easy to read, write, parse and use, so I'd use YAML. You guys all shit on YAML because it's extremely badly used by, say, Helm charts, but…
it didn't run on CI because it uses GNU Make instead of BSD Make on my MacBook
What? $ /usr/bin/make --version
GNU Make 3.81
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
This program built for i386-apple-darwin11.3.0