Earlier quoted context omitted.
It may not be obvious why it failed, but it should be obvious that it did fail.
If, for example, make fails to update a target that should have been updated, that kind of problem will frequently not be obvious.
An opinionated approach to GNU Make
161–170 of 195 posts
Re: An opinionated approach to GNU Make
#162Earlier quoted context omitted.
Just run make -B test to force a rerun?
First, the engineer needs to understand how the makefile is written and that it doesn't rerun without changes. Is it not rerunning because of npm? because of jest? If the engineer isn't the one that wrote the makefile: they won't. Next, you're assuming a JS engineer would know what the flag is (or even that such a flag exists) to force reruns. I've literally never used this flag in my (JS) career so I wouldn't expect…
The engineer will know because it is their job to know.
(Yes I'm a huge fan of deterministic tests and running only what's necessary).
Re: An opinionated approach to GNU Make
#163This seems like a lot of work to not just consider ninja, meson, CMake, etc. I fully understand that the simplicity and portability of Make is alluring, but if you are actually using it to build C software it is a catastrophically poor choice and you can spend a ton of time and effort trying to come close to what you can get out of the box on a modern build system. If the tradeoff was that Make was easier to use and…
Re: An opinionated approach to GNU Make
#164Earlier quoted context omitted.
Since we’re doing this… ;) I’m actually coming around on really narrow conventions since tiny laptops started getting really good. I used to think 80-wide columns and 1-2 space indent was silly retro stuff in an era of modern displays. But on an M2 Air you can just barely get 80 + 80 side by side if you full screen SFMono at like 12-14pt. I’ll never sell my colleagues on it, but I’ve been playing around with setting…
The cool thing about tabs is that you can do that 1-space indent without spreading your madness (but yeah, I think I got a preference for 3 spaces -- actually tabs with tabwidth set to 3 -- while using a little, now old, netbook). One nice advantage of 3 space tabs is that if somebody mixes tabs and spaces in Python, leading to mysterious IDE-dependent bugs, it immediately sticks out (my example is from helping stude…
Re: An opinionated approach to GNU Make
#165This seems like a lot of work to not just consider ninja, meson, CMake, etc. I fully understand that the simplicity and portability of Make is alluring, but if you are actually using it to build C software it is a catastrophically poor choice and you can spend a ton of time and effort trying to come close to what you can get out of the box on a modern build system. If the tradeoff was that Make was easier to use and…
Make can do more than compile a bunch of C files. If you can express your goals and dependencies as files with meaningful creation timestamps, it can be a potent task executor that can also skip over steps if they are already done. Also, your CMake generates Makefiles, so... CMake and meson/ninja, though, seem to be pretty much tuned to compiling C-shaped things, although I’d like to see them (ab)used for other thing…
Of course Make + ssh and a distributed FS gets you there, but you don't always have a distributed FS especially across continents.
Re: An opinionated approach to GNU Make
#166the most common problem in pretty much every Makefile I've ever seen is not specifying the dependencies correctly like nested header files, or forgetting to update them when the code is changed (so everyone runs make clean all instead every time...)
Makedep creates additinal dependency targets, so that source files depend upon the header files they include.
Re: An opinionated approach to GNU Make
#167Earlier quoted context omitted.
Also, the justification seems to be > And you will never again pull your hair out because some editor swapped a tab for four spaces and made Make do insane things. Which... I guess that would be annoying, but maybe fix your horribly broken editor rather than mutilating the Makefile?
Are you going to fix everyone else’s editor too? Software is a multiplayer game and eliminating a whole class of error that hinges on someone not noticing the difference between invisible characters in a diff is a huge win.
Re: An opinionated approach to GNU Make
#168Earlier quoted context omitted.
The purpose of a title is both to summarize content and grab the readers attention. It's up the author which one they put for emphasis on. You clicked so it worked, even if you don't like it.
The user only saw the headline and closed, isn't the author aiming visitors to read the content or clicks? The same analogy could be made to a baker luring customers in their bakery with an attractive facade but the very same "customers" just give a quick glimpse and leave. What is the win?
Re: An opinionated approach to GNU Make
#169Earlier quoted context omitted.
Since we’re doing this… ;) I’m actually coming around on really narrow conventions since tiny laptops started getting really good. I used to think 80-wide columns and 1-2 space indent was silly retro stuff in an era of modern displays. But on an M2 Air you can just barely get 80 + 80 side by side if you full screen SFMono at like 12-14pt. I’ll never sell my colleagues on it, but I’ve been playing around with setting…
The cool thing about tabs is that you can do that 1-space indent without spreading your madness (but yeah, I think I got a preference for 3 spaces -- actually tabs with tabwidth set to 3 -- while using a little, now old, netbook). One nice advantage of 3 space tabs is that if somebody mixes tabs and spaces in Python, leading to mysterious IDE-dependent bugs, it immediately sticks out (my example is from helping stude…
- C/C++: `clang-format` is great - Rust: `rustfmt` is very good - Python: `yapf` is very good - Java: `google-java-formatter` is pretty good - Haskell: `fourmolu` is OK, and if you apply it first and then `stylish-haskell` it's good enough - Starlark - `buildifier` is great - Shell: `shfmt` is pretty good - Nix: `nixfmt` is pretty good
I haven't done any JS or TypeScript or golang in awhile, but I'm sure there are great options there too.
By having all the auto-formatters, we can have one golden config that's fully deterministic for upstream, but everyone can have their own if they want and it just gets blasted into the "golden" format before code review.
Finally, a world without brace wars! Everyone tabs and spaces and whatever to their hear's content. Everyone's happy!
* you do eat the blame getting fucked up the one time. it's worth it.
Re: An opinionated approach to GNU Make
#170Earlier quoted context omitted.
This is a sadly common corrolarry to "those who do not understand make are destined to reimplement it poorly". I strongly suggest spending an afternoon with "recursive make considered harmful" and the gnu make manual. I've never encountered a cmake proponent that can add trivial functionality to a cmake build in less time than it took me to learn make. I can usually port cmake builds to make in less time than such pe…
I have one question to ask you. How do I do this in Make: find_package(OpenGL) target_link_library(app OpenGL::OpenGL) Goals: - Support Windows, macOS, *NIX like - Compile with either MinGW or MSVC on Windows - Decent error output if GL headers are not found This SHOULD be possible. All we are doing here is calling the compiler with a fairly easy to derive set of options. Yet, in Make, there is no ideal way to abstra…
If you trust your build environment, then -lGL is the right answer. If you do not, then vendoring libGL is the right answer. Both approaches are easy to achieve with make.
find_package semantics are frankly weird: "maybe use the OS version, or override in nonstandard ways, or maybe download some version from somewhere and build it using some compiler flags that came from somewhere mysterious. If you succeed, have package-dependent side effects on the set of global variables in my cmake script".
Does it have a higher chance of producing a binary in dodgy environments? Sure. Are those binaries actually reproducible or what the developer / distribution tested with? Absolutely not.
As for windows with visual studio: Either point make at the visual studio compiler, or hand maintain a separate .SLN file. The impedance mismatch between Unix and Windows builds is too great, and the auto-generated .SLN files that tools like cmake produce are low quality.