News for hackers. Stuff that matters.
Re:Strengths, weaknesses, opportunities, and threats facing ... by downut on Sunday May 01, 2022 @10:27PM (#31230797)
I build a lot of cmake and meson projects. I was an expert at cmake for quite some time (bleh), but now I use meson for everything I can.

The end user experience is in every aspect superior to autotools. There is a small downside for cmake compared to autotools: while you have to install the bits for autotools it runs on a shell. There is a bigger downside for meson: you need a minimal python infrastructure up and working. Over time you need that python infrastructure to keep working. Sometimes it doesn't.

I still vastly prefer meson over cmake and much more so autotools. If I have to fix cmake or meson builds, well, really, if you know their languages, it's just no comparison to debugging the 1000s of lines of shell code autotools generates.

Re:Strengths, weaknesses, opportunities, and threats facing ... by saurik on Sunday May 01, 2022 @11:46PM (#31231240)
And yet, meson just routinely doesn't work. Sure: if you are just trying to do some trivial local compile job it seems fine, but it keeps having issues with even trivial cross compilation cases (which are used even on Linux as you generally want to do a Linux-to-Linux cross compile to control your glibc target) and linker detection (as it is assuming way too much direct control over the linker that it should frankly be delegating to the compiler) that make you have to jump through ridiculous hurdles to make things compile (and that's assuming you aren't on one of the commonly-deployed semi-recent versions of meson where it is a truly lost cause). In contrast, autotools always works: I have never had a blocking or serious issue compiling something that uses autotools, no matter how complex the scenario.

Here are a couple issues I have run into (one being fixed, though too late for some key versions of Ubuntu; and the other just languishing, as I guess "working" is asking for too much).

https://github.com/mesonbuild/meson/issues/6057

https://github.com/mesonbuild/meson/issues/6662

Re:Strengths, weaknesses, opportunities, and threats facing ... by bonzini on Monday May 02, 2022 @02:12AM (#31231926)
For the second, https://github.com/mesonbuild/meson/issues/6662#issuecomment... is the right solution and I will try to have it documented. Unfortunately, clang disagrees that it's the right solution and meson might have to hack something around that disagreement.

Thanks for the report!

Re:Strengths, weaknesses, opportunities, and threats facing ... by marcosdumay on Monday May 02, 2022 @10:24AM (#31235494)
Hum... Configure routinely doesn't work for me either, on even more trivial scenarios than cross-compilation.

When I care to look how to fix it, it's almost always some error on the autotools configuration and I can edit the Makefile to run things correctly. Also, when it breaks, there are normally more broken things on the project. But autotools are always among the first things to break.

Re:Strengths, weaknesses, opportunities, and threats facing ... by teknopaul on Monday May 02, 2022 @11:12AM (#31236166)
Is autotools the first to break or the first that you notice and fix ;)
Re:Strengths, weaknesses, opportunities, and threats facing ... by marcosdumay on Monday May 02, 2022 @12:19PM (#31237164)
It is a very good predictor of breakage anywhere. Code where the autotools are perfectly configured normally is very close to correct.

It's usually not broken on my own code because I will write a DAG builder in bare C before I use them personally, so I don't know the breakage timing.

Re:Strengths, weaknesses, opportunities, and threats facing ... by downut on Sunday May 01, 2022 @11:57PM (#31231299)
Could be; I'm not an evangelist for meson and if it doesn't work for cross compilation I'd use something else, likely cmake. I don't cross compile very often, so for me it works great. I have run into sadness with meson subprojects, but I'm unconvinced they are a big win.
Re:Strengths, weaknesses, opportunities, and threats facing ... by saurik on Monday May 02, 2022 @12:03AM (#31231328)
The problem is that I don't get to make the decision to use meson or cmake: you make that decision when you develop your project around meson; which ties back to the point of this thread: as a user attempting to compile something (which FWIW should essentially always be a cross compile... a native compile is essentially never what you want as it bleeds way too much random machine state into your build), autotools is still king (and certainly much better than the haphazard piles of programmable cmake that people tend to throw together when they use cmake; at least with cmake,npeople tend to develop stuff where I just give up on their compilation scripts and compile all their code with my own replacement scripts... sadly, I haven't managed to do that reasonably for glib yet so I could avoid their meson hell).
Re:Strengths, weaknesses, opportunities, and threats facing ... by jameshilliard on Monday May 02, 2022 @01:20AM (#31231700)
For us(https://buildroot.org/) cross compiling with meson tends to be significantly more reliable than autotools already as it tends to be much better at separating host/target artifact builds within a project and setting up the toolchain correctly, autotools tends to need lots of package specific hacks in my experience.

We have a fairly customized integration(https://github.com/buildroot/buildroot/blob/master/package/p...) which we've iterated on for a while that works quite well these days. The cross compilation support with upstream meson has improved a lot over the years and while it's quite mature now IMO it still takes a bit of env setup to work correctly(but once it works it tends to not break much).

Re:Strengths, weaknesses, opportunities, and threats facing ... by rascul on Sunday May 01, 2022 @10:56PM (#31230963)
I'm not very familiar with meson. I can use cmake to build a project but I don't know how to find various build options without searching through that project's documentation. I probably haven't explored cmake enough.
Re:Strengths, weaknesses, opportunities, and threats facing ... by downut on Sunday May 01, 2022 @11:51PM (#31231269)
In the build directory, "ccmake ." Note the "." I need to do this in almost every cmake project I don't know well. Also toggle on the advanced options listing. Occasionally you'll see stuff in the CMakeLists.txt files that don't show up in that menu. This is usually variables you can set on the command line to influence configuration. People are nowadays calming down their desire to program up their own flavor of a gigantic build system, and sticking to simpler idioms. That's a big improvement. However there's a lot of legacy nightmare cmake out there. Meson is much harder to build different dialects. Some people don't like this. After 35 years of build systems, I say yes please!

I forget what I do in meson. Which means I just read the meson.build and meson_options.txt. They are quite straightforward, and very concise, if you're not Doing It Wrong.

Re:Strengths, weaknesses, opportunities, and threats facing ... by throwaway82652 on Sunday May 01, 2022 @11:43PM (#31231227)
Use cmake-gui and it lists all the options for you. Or for the manual method, search in the project's cmake sources for lines starting with "option(".
Re:Strengths, weaknesses, opportunities, and threats facing ... by cycomanic on Monday May 02, 2022 @01:43AM (#31231792)
I would argue this confirms what the OP said cmake is really not very friendly to the user (not developer). Reading through the cmake sources for options is equivalent to "read the source".
Re:Strengths, weaknesses, opportunities, and threats facing ... by jcelerier on Monday May 02, 2022 @02:54AM (#31232115)
But you only have to do this if you don't want to run an actual GUI or ncurses UI which does this for you for some reason ? What would you suggest instead ?
Re:Strengths, weaknesses, opportunities, and threats facing ... by cycomanic on Monday May 02, 2022 @03:37PM (#31239803)
Why do I need to run a gui or ncurses UI if I just want to do the equivalent of configure && make && make install?
Re:Strengths, weaknesses, opportunities, and threats facing ... by jcelerier on Tuesday May 03, 2022 @01:34AM (#31245007)
The equivalent of this is

    cmake -S source_folder -B build_folder 
    cmake --build build_folder
    cmake --install build_folder

You don't need to run a GUI at all for this, I don't see how you could infer this from the previous messages
Re:Strengths, weaknesses, opportunities, and threats facing ... by tpush on Monday May 02, 2022 @05:15AM (#31232801)
Something like 'cmake --list-options CMakeLists.txt' seems the most obvious.
Re:Strengths, weaknesses, opportunities, and threats facing ... by jcelerier on Monday May 02, 2022 @08:50AM (#31234466)
I don't think it would be meaningfully different from what you would get by doing

    less CMakeCache.txt
Listing the options cannot be done by just introspecting a CMakeLists: what would it show for:

    if(FOO)
      option(ENABLE_BAMBOOZLE_${FOO} "Enable Bamboozle - ${FOO}-specific version" OFF)
    else()
      option(ENABLE_BAMBOOZLE "Enable Bamboozle" ON)
    endif()
(and if your meta-build system does not allow to do that, I'm sorry but I'll have to build a meta-meta-build-system on top of it which implements it and no one will like it)
Re:Strengths, weaknesses, opportunities, and threats facing ... by pif on Monday May 02, 2022 @05:41AM (#31232965)
> it's just no comparison to debugging the 1000s of lines of shell code autotools generates

If you find yourself debugging generated scripts, you have done something wrong.

Re:Strengths, weaknesses, opportunities, and threats facing ... by trasz on Monday May 02, 2022 @08:57AM (#31234545)
Not really - from my experience autotools can’t really be expected to work properly on any system it wasn’t tested on. And it’s way easier to hack the generated script - usually just commenting out the problematic part, as almost none of those scripts generated by autoconf serve any purpose.
Re:Strengths, weaknesses, opportunities, and threats facing ... by CJefferson on Monday May 02, 2022 @07:58AM (#31233954)
I agree, but I have done things wrong with autotools, then spent hours debugging the generated scripts to figure out what I did wrong.
Re:Strengths, weaknesses, opportunities, and threats facing ... by imron on Sunday May 01, 2022 @11:18PM (#31231078)
meson is so nice to use.