Remix.run Logo
x3n0ph3n3 10 hours ago

I don't understand why people like make so much. Interacting with CLI tools using only env vars as arguments is cartoonishly bad dev experience.

zelphirkalt 10 hours ago | parent | next [-]

Make allows you to specify dependencies for you targets, which are also targets. As such you do not need to rely on brittle string concatenation approaches. It is a tool build for this.

I personally like going to a project folder and run "make run", no matter what language or setup I have, to run the project. It enables me to unify access to projects.

I also take great care to make these runs reproducible, using lock files and other things of the ecosystems I am using, whenever possible. I work on another machine? git clone, make run. Or perhaps git clone, make init, make run.

georgyo 10 hours ago | parent | prev | next [-]

I'm not so sure most people would agree with you. Though I think plenty would.

I dare say that developers like environment variables more than before. Consider that Docker images, and hence Helm charts, are entirely controlled via environment variables. These very popular dev tools suffer from the same problem of having near-zero easy discoverability of what those environment variables might be. Yet they are very popular.

But I don't think Make usually uses all that many environment variables. You're usually specifying build targets as the command line arguments. Automake and autogen usually generate these makefiles with everything hard-coded.

Also, it makes it very easy to get started with, and it is universally available. Makes it very easy to like.

danlitt 9 hours ago | parent | prev | next [-]

Make is in POSIX, so it's generally available. Same reason people write shell scripts (even if the scripts are not generally POSIX-only).

bshacklett 6 hours ago | parent [-]

Unless your company forces you to use Windows, which is still much more common than many would like to admit. And yes, WSL exists, but in my experience, if a company is unwilling to allow macOS, there’s a good chance they either don’t allow enabling HyperV, or the security software they use is such garbage that it results in a HyperV enabled system being effectively unusable.

pjmlp 3 hours ago | parent [-]

Windows 11 requires Hyper-V turned on, virtualization based security is one of the reasons of the forced hardware upgrades.

cerved 9 hours ago | parent | prev | next [-]

I like it because it's language and tooling agnostic, declarative, fast and ubiquitous.

Where it's less great is complicated recipes and debugging

xigoi 5 hours ago | parent [-]

Make is not language agnostic; it has implicit rules for compiling C.

pheggs 5 hours ago | parent [-]

it also has implicit rules for other languages, why would that make it non-agnostic?

zabzonk 10 hours ago | parent | prev | next [-]

You can pass arguments via the command line (it is, after all, a CLI tool): https://stackoverflow.com/questions/2826029/passing-addition...

lmz 10 hours ago | parent [-]

I mean there's really not much difference between "VAR=val make x" and "make x VAR=val" now is there?

marginalia_nu 10 hours ago | parent [-]

Syntactically? No. Semantically? Yes.

lmz 7 hours ago | parent [-]

I'm guessing the syntax was the part the poster was complaining about when they complained about the "dev experience".

marginalia_nu 5 hours ago | parent [-]

Dunno, there are other aspects of environment variables that deteriorate the dev experience. They're very conducive to spooky action at a distance, since they're silently being passed along from parent-process to child-process (except when they aren't).

They can cause a lot of annoying bugs, and sometimes it's hard to track down where they are coming from (especially when dealing with stuff running in containers).

77pt77 an hour ago | parent [-]

> except when they aren't

Like sudo for example.

So many problems related to that.

motorest 7 hours ago | parent | prev | next [-]

> Interacting with CLI tools using only env vars as arguments is cartoonishly bad dev experience.

Make excels at what it's design to do: specify a configurable DAG of tasks that generate artifacts, execute them, and automatically determine which subgraph requires updates and which can be skipped by reusing their artifacts.

I wonder: which tool do you believe does this better than Make?

system33- 7 hours ago | parent [-]

Tup. https://gittup.org/tup/ https://gittup.org/tup/make_vs_tup.html

But the Internet’s make mind-share means you still have to know make.

Edit: and make lets you use make to essentially run scripts/utils. People love to abuse make for that. Can’t do that with tup.

motorest 4 hours ago | parent | next [-]

> Tup.

I don't think Tup managed to present any case. Glancing at the page, the only conceivable synthetic scenarios where they can present Tup in a positive light is built times of > 10k files, and only in a synthetic scenario involving recompiling partially built projects. And what's the upside of those synthetic scenarios? Shaving w couple of seconds in rebuilds? That's hardly a compelling scenario.

3 hours ago | parent | prev | next [-]
[deleted]
aDyslecticCrow 6 hours ago | parent | prev | next [-]

Abuse? Runnig linters, code analysers, configuration tools, template engines, spellcheckers, pulling dependencies, building dependencies with different build systems.

Sufficiently complex project need to invole alot of wierd extra scripts, and if a build system cannot fulfil it... the n it needs to be wrapped in a complex bash script anyway.

kiitos 2 hours ago | parent | prev [-]

> Tup

`tup` relies on a stateful database, which makes it incomparable to `make`.

PhilipRoman 9 hours ago | parent | prev | next [-]

You don't have to write Make invocations by hand... It's just a tool that can be called from any editor or IDE (or by automatic file watchers). Environment variables aren't really relevant to Make either, unless you really want to misuse it as a command runner.

aboardRat4 8 hours ago | parent | prev | next [-]

Because make is a prolog in disguise.

hiAndrewQuinn 10 hours ago | parent | prev | next [-]

I often prefer to work in in extremis environments where there is no internet access, and hence, no easy way to get ahold of make; it's given me a bad habit of just waiting a build.bash script to do what make does most of the time. I haven't really found myself missing it that much.

0points 10 hours ago | parent | next [-]

If you can install bash on your airgapped dev box, why wouldn't you install make on it? Make is part of the core dev environment on just about every disto under the sun.

77pt77 an hour ago | parent [-]

most minimal setups nowadays have bash, make and even perl.

M0r13n 10 hours ago | parent | prev [-]

I am confused, because this means that you won't be able to install anything. No compiler, no 3rd party libraries and no text editor that isn't preinstalled

globular-toast 10 hours ago | parent | prev | next [-]

It's 80% of what you want and it's installed everywhere.

You could go for something closer to exactly what you want, but now you've got an extra set up step for devs and something else for people to learn if they want to change it.

I would say if you're looking for cli args then you shouldn't be using any wrapper like make at all. Just call the underlying tool directly. Make is for doing big high level things in the standard way, nowadays quite often in CI pipelines.

zelphirkalt 9 hours ago | parent [-]

Yep, that's how I used it on the job before. "make test" would run tests locally and in CI pipeline, keeping the CI file refreshingly short at that point.

10 hours ago | parent | prev | next [-]
[deleted]
gjvc 7 hours ago | parent | prev [-]

you don't do it naked, you write and use wrapper scripts to make it ergonomic