Live data from Hacker News

Cmkr – a modern build system based on CMake and TOML

github.com

11–20 of 30 posts

Re: Cmkr – a modern build system based on CMake and TOML

#11
post #10

I think Cmkr fails to state its value proposition by focusing on how it works. Any system like CMake that wraps boatloads of complexity is going to have unexpected interactions and inscrutable failures. The question for any developer who doesn't want to become a build system guru is whether they can take a happy path far from any gotcha's. That's when people start defining conventions to solve classes of problems: fo…

What "boatloads of complexity" does CMake wrap and save me from handling myself?

Turn on all warnings? Yeah, just check if your CC is MSVC or else and set the flag!

Turn on sanitizers? Yeah, just include this 2000 line piece of CMake macro that checks your CC and turns on flags!

Find a package? Yeah, just write a FindFooCMake macro file that spells out the exact files to find in the filesystem and parses a header with more macro magic to determine the version. Maybe we decide to ship this shitty macro file with the default distribution later on and cause more conflicts and distress. By the way, we now have a superior C++ namespace inspired way of defining packages that we mix and match with the old stuff in our default distribution.

Can't you just use pkg-config files like everyone else? Yeah, just make sure to include another 3000 line CMake macro if you specifically want us to use pkg-config.

Cross compile my program for a different architecture? Of course CMake supports that, as long as you write a toolchain file that spells out the exact CC, CXX, sysroot, ... and all other things that could even get a maximally minimal Makefile to trivially cross compile. Make sure to force-overwrite some of the useless autoconfig inspired tests CMake will perform on your toolchain because they are broken with whatever cross compiler you are trying to use.

So while CMake does nothing to help with common things, their "CMakeCache" is the most powerful proof for "nothing is more complicated in programming than caching" the world has ever seen.

Re: Cmkr – a modern build system based on CMake and TOML

#13
post #4

Looks like it's a declarative CMake so you don't have to interact with the CMake DSL yourself. Which is nice, but I've rarely had a non-sample/toy CMake project where I didn't have to hack something outside of the straightforward steps the docs make it look like you need to do, so my number concern with this is that it's going to end up being a (very) leaky abstraction. How much will cmkr get in the way and make it h…

I share your concerns. I mean, I could use a build system that is as powerful and versatile as CMake, but much more declarative and not a horrible inscrutable mess of procedural manipulation of mutable state like CMake is. But that would probably mean replicating, in some way, all the years of work that went into CMake proper and its 3rd-party extensions. Not an easy task. I want something that is declarative and ext…

Bazel?

Re: Cmkr – a modern build system based on CMake and TOML

#14
I think this is being misunderstood, partially because of the self-claim that this is a build system.

The CMake DSL is utter garbage. From my understanding, this converts TOML that follows the same/similar naming as CMake commands/options to CMake DSL. Allowing for total compatibility with CMake while avoiding the pain of actually interacting directly with a CMakeLists.txt.

Most people agree that CMake is not a good option but the only real option. I'd happily put lipstick on this pig.

Re: Cmkr – a modern build system based on CMake and TOML

#15
After working as a C++ developer almost all my career I am moving away from it, so I do not follow it as much. I heard that C++ modules are a step forward and a step back. Don't remember the exact criticism.

Is there a build system where one would point to a one source file and it would find its way around the whole thing? Things it wouldn't be able to deduce would be given as a comment or some preprocessor fluff. Basically implementing module system. Or maybe I did not think it through too much.

Re: Cmkr – a modern build system based on CMake and TOML

#16
post #4

Looks like it's a declarative CMake so you don't have to interact with the CMake DSL yourself. Which is nice, but I've rarely had a non-sample/toy CMake project where I didn't have to hack something outside of the straightforward steps the docs make it look like you need to do, so my number concern with this is that it's going to end up being a (very) leaky abstraction. How much will cmkr get in the way and make it h…

I share your concerns. I mean, I could use a build system that is as powerful and versatile as CMake, but much more declarative and not a horrible inscrutable mess of procedural manipulation of mutable state like CMake is. But that would probably mean replicating, in some way, all the years of work that went into CMake proper and its 3rd-party extensions. Not an easy task. I want something that is declarative and ext…

So far, the closest buildsystem I've seen to that model is Mozilla's build system (https://firefox-source-docs.mozilla.org/build/buildsystem/bu...), the core of which is a set of python files that basically describe the build graph given the feature context. A simple file might be:

  SOURCES += ['a.cpp', 'b.cpp']
  if CONFIG['OS'] == 'WINNT':
    SOURCES += ['win.cpp']
  elif CONFIG['OS'] == 'OSX':
    SOURCES += ['osx.cpp']
  else:
    SOURCES += ['unix.cpp']
I like that it uses the Python language rather than coming up with its own DSL for handling conditionality or things where you need to do loops, and by splitting up the steps in the way that it does, it keeps the build system fairly declarative. But don't look under the hood, because the things under the hood are fiendishly complex and it's way too complicated to be usable for a simple project.

Re: Cmkr – a modern build system based on CMake and TOML

#17

I think this is being misunderstood, partially because of the self-claim that this is a build system. The CMake DSL is utter garbage. From my understanding, this converts TOML that follows the same/similar naming as CMake commands/options to CMake DSL. Allowing for total compatibility with CMake while avoiding the pain of actually interacting directly with a CMakeLists.txt. Most people agree that CMake is not a good…

There are plenty of options other than cmake. Ideally:

1. read the GNU Make manual 2. Write a tiny build system with Make or use any of the precanned ones. I use this: https://github.com/dkogan/mrbuild/ but there are many others

In any case, learning how to actually use Make is a prerequisite to having an opinion here.

Re: Cmkr – a modern build system based on CMake and TOML

#18
post #4

Earlier quoted context omitted.

I share your concerns. I mean, I could use a build system that is as powerful and versatile as CMake, but much more declarative and not a horrible inscrutable mess of procedural manipulation of mutable state like CMake is. But that would probably mean replicating, in some way, all the years of work that went into CMake proper and its 3rd-party extensions. Not an easy task. I want something that is declarative and ext…

So far, the closest buildsystem I've seen to that model is Mozilla's build system ( https://firefox-source-docs.mozilla.org/build/buildsystem/bu... ), the core of which is a set of python files that basically describe the build graph given the feature context. A simple file might be: SOURCES += ['a.cpp', 'b.cpp'] if CONFIG['OS'] == 'WINNT': SOURCES += ['win.cpp'] elif CONFIG['OS'] == 'OSX': SOURCES += ['osx.cpp'] els…

Interesting - a current (or maybe former) Firefox dev does Half-Life 2 plugin stuff in his spare time and created something similar called ambuild which his projects use.

Re: Cmkr – a modern build system based on CMake and TOML

#19
post #11
post #10

I think Cmkr fails to state its value proposition by focusing on how it works. Any system like CMake that wraps boatloads of complexity is going to have unexpected interactions and inscrutable failures. The question for any developer who doesn't want to become a build system guru is whether they can take a happy path far from any gotcha's. That's when people start defining conventions to solve classes of problems: fo…

What "boatloads of complexity" does CMake wrap and save me from handling myself? Turn on all warnings? Yeah, just check if your CC is MSVC or else and set the flag! Turn on sanitizers? Yeah, just include this 2000 line piece of CMake macro that checks your CC and turns on flags! Find a package? Yeah, just write a FindFooCMake macro file that spells out the exact files to find in the filesystem and parses a header wit…

I think the point is that every decade or so someone comes out with a new wrapper for the build systems that are wrapping the build systems that are wrapping make. And the developer inevitably makes something that works great for their specific usage of Make/CMake etc in the specific programming niche they occupy. Gradually over the coming decade the build system they created becomes more and more complex as it addresses more and more use cases until it begins to resemble autotools. At that point, someone comes out with a new wrapper and the whole process repeats itself.

Re: Cmkr – a modern build system based on CMake and TOML

#20

I think this is being misunderstood, partially because of the self-claim that this is a build system. The CMake DSL is utter garbage. From my understanding, this converts TOML that follows the same/similar naming as CMake commands/options to CMake DSL. Allowing for total compatibility with CMake while avoiding the pain of actually interacting directly with a CMakeLists.txt. Most people agree that CMake is not a good…

The Make DSL is also utter garbage. As is Autotools. I'm not convinced that wrapping a garbage DSL with another DSL is a value-add when you're building applications.
Post reply on HN