I would strongly prefer to never use cmake again in any context (even though it would mean I don't get to charge people quite nice consulting fees to unfuck their CMake situation), but unfortunately people keep making build systems that are inexplicably somehow worse, like Bazel
(Bazel makes a lot of sense if you are Google, and is excruciatingly painful to use if you aren't Google. it's also almost completely undocumented; if you thought it was hard to figure out how to make CMake does something, allocate like 20× as much time for Bazel)
@whitequark Back in Ye Olden Days, I had to use Scons for a medium-scale research project in C++ and all I remember is a good deal of cursing 🤷
And Android development works just fine as long as you complete the project before the next Gradle release and never touch it again 🙄
@whitequark @floe Oh, you can always fix problems in Gradle! You just write a bunch of arbitrary Kotlin (and thank god for that, it used to be *Groovy*, which was much, much worse) to do absolutely anything you want in the middle of the build. (Finding the runes to run your arbitrary code *at the correct point* in the middle of the build is an eldritch task to which you should plan to sacrifice an intern a quarter, more or less.)
This causes no problems whatsoever and results in builds which are fast, stable, and easy to understand.
@floe @whitequark And the scars of building the boost libraries with bjam ran so deep that I’ve refused to use boost on any of my own projects for years.
I can also complain about the package managers for C/C++. Conan drove me nuts trying to get things building to WASM, I discovered Cmake Package Manager which works very nicely with ccache, and I haven’t used conan since.
The one thing that could turn me into a Rust bore is cargo.
Does Makefile plus a bunch of hand-coded scripts count as a build system?
@andrewrk we shipped zig cc (via pypi) in production at chipflow and i continue to maintain the pypi bridge... unfortunately it did bump into the PyPI size limit and i couldn't get it lifted so far
btw just noticed this:
Speaking of ziglang/zig-pypi#40, pypi/support#8180 would really valuable to have, zig is an important part of the toolchain of building manylinux-compliant python packages using rust.
you're doing a great job, I think :D
@whitequark My commiserations.
Having to decide between autotools and cmake is a Scylla and Charybdis situation.
@whitequark and then theres meson, meson is nice but then meson has an annoying thing where it wants you to do things in exactly the way they expect and if you don't do that it doesn't work; you will have all your subprojects in a folder named "subprojects" and you will like it! your projects will not interact with eachother in any way and be completley isolated and YOU WILL LIKE IT
.. :/
maybe tsoding was right with that whole nob.h thing
.. fun thing .. we hacked around meson not having a way to call a fucking shell command by instead saying that theres a subproject thats "autotools" an then had a hand written shell script called "configure" that just ran whatever the heck we actually were trying to do from there
@whitequark well you see it does eventually run a ./configure script but it needs to run it with different arguments than the default and it needs to set environment variables and .. a bunch of other shit; and then the configure script in the thing its building actually fails, however it fails in some extra components it tries to build that are not actually needed, it fails because it tries to use itself to build itself; but the version included in the system repos is way too new for that, i _would_ fix it to only build what i need, but that would mean dealing with autotools,
.. so it just runs it, lets it fail then copies out the things it did actually build successfully to the location meson is expecting the build folder to be, then gives a success error code
build systems are great
@dascandy @whitequark @Li I can't speak for this particular issue, as Meson has been able to execute shell scripts since ages.
Forcing some things is a tradeoff. While it does make some strange setups more difficult (maybe even impossible, though that is rare) it makes more important and common things vastly simpler. In Meson you can take two independent projects, use one as a subproject of the other transparently and have it mostly work. In CMake cross-using projects is unreliable at best.
@jpakkane @dascandy @whitequark
none of us could figure out how to do it ..
https://github.com/OpenPSS/SnowPME/blob/main/subprojects/LibPssMono/meson.build
the "env": "CFLAGS" is undocumented feature from what i can tell, found it by reading the source .. (and also didnt even work iirc, we just set cflags in the fake configure script"
i need an extremely specific fork of a very old version of mono-runtime ..
The `env` kwarg is documented: https://mesonbuild.com/External-Project-module.html#add_project
If the env var is not set then that seems like a bug. Though CFLAGS might be special because people might expect them to "pass through" to the underlying build system. It's all terribly complicated and different people expect the exact opposite thing to happen.
@whitequark we discovered today that the link command for an executable or lib ends up in a link.txt file called from a submakefile via a cmake_link tool or something, and that RM is actually cmake --rm
Also, they recently changed (deb12->deb13) the CMAKE_C_CREATE_STATIC_LIBRARY command from ar rc to ar qc and that it broke our build of a native ios library, the latest xcode choked on the generated .a files. Fuck that shit.
@f4grx the link.txt thing is to avoid length limits on command line arguments (present in both Windows and Linux, though Linux has a much bigger limit)
the cmake --rm is so you can use it on Windows transparently (there's also cmake -E copy and friends, very useful)
@whitequark @f4grx ... TIL that this trick still existed in the "modern" era
we mostly knew it as a borland / msdos-ish-era trick