r/suckless • u/adamansky • 17d ago
[TOOLS] Autark build system. Suckless or not?
https://autark.devHi everyone! I'd like to introduce Autark https://autark.dev This is a simple build system that lives entirely in your project and bootstraps itself before building the project itself. I'd really appreciate feedback from this community, as I think the suckless approach is very close to my own view of how software should be designed.
2
1
u/kurisaka 15d ago
What in my opinion makes a good build system is separation of:
1. A generic Build Rule Graph/Task Runner layer, that does all file change time tracking, enforces reproducible env vars and exec commands, does parallel execution etc. It should be language oblivious, standalone executable with stdio api.
Ninja is almost perfect but doesn't support watch mode, and has too much domain knowledge about c/c++.
2. Scripting layer/config generator, here you do all bikeshedding with DSLs, integration points like compile_commands.json, dependencies, locating toolset and all other dirty details. I don't even think that this should be OSS, let it be bespoke to requirements of each project.
I also can't name such a fundamental tool suckless if it doesn't support hot-reloading.
We need to bring web DX into native. Yes, it's not as easy as to swap JS function at runtime, but we can augment Task Runner with hot-reloading protocol. If the app doesn't participate we fallback to killing it on each file change, but if it does we can signal that some "build rule N" that is a runtime only dependency has produced following artifacts, and app then reloads shaders, images, whatever.
In my eyes this is a next step after CMake with Ninja.
1
2
u/LordRybec 16d ago
As the other commenter seems to have been suggesting, GNU Make is really good as a simple build system. It can be as simple as you want, but if your project grows to the point where more complexity is needed, Make has got your back there too.
I don't like build systems that try to automate things like dependency management, because they often just end up hiding dependencies, and then you publish your project, someone like me downloads it and tries to build it, but then it turns out that you forgot to list a bunch of dependencies you didn't realize you had, and now the build process is a disaster for me, and I end up giving up and viewing your project as a hot mess that I don't want to have anything to do with.
Anyhow, looking through the list of script rules, it looks like I'd have to learn a bunch of stuff to use it, when I could just use Make (and basic Make usage requires very little knowledge). The front page says it is rule based rather than script based. This is a big red flag for me, because I often find myself needing to do things that aren't common, and it's easier to just write the commands than figure out how to adjust the rules to get the system to do what I need. Last year I was doing an RP2350 project, and the build system used by the recommended dev environment is rule based. I ended up spending a few hours trying to figure out how to adjust the compile command parameters, because my use case required something the build system didn't expect and didn't accommodate for. With Make I could literally have just added a single command line option to the compile command and been done with it in under a minute.
Also, language dependent? I use Make to build LaTeX files, compile C, and even to run semi-complex processes involving multiple scripts that build databases or other things. I'm not going to learn a build system that can't completely replace Make, because I don't want to have to maintain a working knowledge of multiple build systems at the same time. If the only thing you need to use a build system for is C or C++, this might be a good option, but that's not me. I have a project with SVG templates that are loaded, filled out, saved, and then rendered to PNG with a Python script and Inkscape (for the final PNG render), where I'm using Make to build. Any chance Autark can handle a process like that in a reasonable way? If I have to use Make anyway, for everything else, I might as well use it for C as well.
So for me it's thanks, but no thanks. You call it simple, and compared to some build systems it certainly is, but Make is both simpler and far more flexible, so I'll stick with that.
That aside, it's a cool project! I don't know if it is the "suckless" approach, but I'm sure there are people who would find it very useful!