Live data from Hacker News

Makefiles for web work

rosszurowski.com

11–20 of 58 posts

Re: Makefiles for web work

#11
It's interesting, but I can't help but think that by the time you're adding `.PHONY` after most rules, you're not using the right tool for the job.

(I generally find a small set of shell scripts work, or just three or four rules in the package.json file I can access with `npm run`).

Re: Makefiles for web work

#12
post #8

Make becomes a pretty terrible tool at a fairly low level of complexity. I would never choose it voluntarily to build things.

I agree. It has its merits, but it's hard for me to get around my visceral reaction to the fact it just bombs on filenames with spaces in them.

Re: Makefiles for web work

#14
I tried this for a bit until I found out make couldn't deal with spaces in the file name. switched to rake (ruby), which had the advantage of not needing to write separate shell scripts.

Re: Makefiles for web work

#15

It's interesting, but I can't help but think that by the time you're adding `.PHONY` after most rules, you're not using the right tool for the job. (I generally find a small set of shell scripts work, or just three or four rules in the package.json file I can access with `npm run`).

I generally find shell/npm scripts work until you get to the few cases that actually benefit from the dependency management and then you wish you'd just given in to .PHONY, no matter how inelegant it may be.

Re: Makefiles for web work

#16
post #3

My main problem with make: When you want to write sophisticated build processes, the syntax is bizarre and difficult to work with.

True, but having "sophisticated" build processes are a problem in their own right. I understand that there may be special cases, but generally, if you have troubles making a build process work with Make, then using a "better" tool is just paving over the underlying problem.

Just today I was trying to help a friend build some tool with Bazel. While I'm sure there's a reason for Bazels existence, but it's just way to complex. The build failed and debugging the Bazel config was just a major hassle compared to had we just looked at the Java commands in a Makefile.

Similar with Pythons setuptools, even though that is significantly easier with the new pyproject.toml. It's really powerful, but what all I wanted is basically to copy a bunch of files and add a bit of metadata.

Re: Makefiles for web work

#17
I tried repeatedly to just stick with Makefiles but I kept having to add workaround and hack to do basic stuff. They got uglier and uglier. I checked out go task and cargo make, but eventually gave in to `just`. It has worked just fine and the files are infinitely more readable than the comparable ones w/ make.

Re: Makefiles for web work

#18
post #13

I’m unconvinced. I don’t see a reasonable benefit for learning yet another config syntax just to run some scripts.

That's specifically the gain here, you don't need to keep learning new build tools or language-specific tools. Make works for all languages, all kinds of projects, has been around since forever and is not going away. It's the only build tool you need to learn.

Re: Makefiles for web work

#19

It's interesting, but I can't help but think that by the time you're adding `.PHONY` after most rules, you're not using the right tool for the job. (I generally find a small set of shell scripts work, or just three or four rules in the package.json file I can access with `npm run`).

I generally find shell/npm scripts work until you get to the few cases that actually benefit from the dependency management and then you wish you'd just given in to .PHONY, no matter how inelegant it may be.

All of my dependency management issues are handled by npm.

The main problem `make` solved was not wasting work rebuilding dependencies that hadn't changed, but in 2023 on modern computers I don't notice the CPU cycles burned on that kind of thing.

(... if I do start to notice them, I reach for a tool like bazel, because it can handle spaces in filenames).

Re: Makefiles for web work

#20
This is sweet but `just` is even sweeter - can use multistage build files to elegantly add it to any Containerfile, no?

Edit: I don't see a publicized image - added an issue: https://github.com/casey/just/issues/1497

However, anyone could add a docker just for just for their own project and use it to pull in just for all their projects, avoiding a download command to get just in other Containerfiles.

Post reply on HN