by misnome · 5y ago · 0 comments
Am I thinking of it wrong, and using it as a "layer" above CMake to do the heavy dependency lifting is an intended part of Meson? Cmake has _huge_ support and mindshare in terms of third party packages and dependencies, even if it is somewhat difficult to learn "good" methods of writing CMakeLists.
I feel like spending the effort to learn a complete new build configuration metalanguage - and having to rewrite dependency discovery/builds, would be better spent on something like Bazel and it's mass-distributed compile capabilities, rather than something that looks just like cmake but with a new and unique language that to general approximation nobody else uses.
This is admittedly a rather uncharitable and possibly unfair way of looking at it - and I don't begrudge anyone trying to find a way of writing builds that fits better with them. Perhaps It's just a personal bias and I'm just getting to the age where learning a tool thoroughly and writing stuff that other people have a higher chance of experience in becomes more important than chasing... whatever it is that people value in this. (Or perhaps I have been too burnt by insanely complex badly implemented fragile SCons systems and not enough bad CMake systems).
If you are in a larger company, or something like an OS distribution, you can even further benefit from RBE. Imagine a Linux distro just being built like this:
cc_binary(name = "package_manager", ...)
os_pkg(name = "distro", srcs = [":package_manager", "//:userspace"])
Or something like that which would produce an iso and cpio (for PXE) automatically for you. You could then very quickly compile and test all of this on every arch you have access to using RBE.Such packages and exports are really just simple config files that I think can be safely treated as declarative — they become a perhaps uglier, but portable alternative to pkg-config. As such, having meson read them would be a smart move, and would be quite simple.
Unfortunately, CMake doesn’t have a culture of creating/installing/using exports IME, and so you end up with enormous, complicated Find packages that do fancy bespoke dynamic search logic. THAT isn’t something I’d like a project like meson to lean on, but only because the goal should be to remove the need for such things, not depend on them further. CMake doesn’t help matters by making exports fiddly.
On a cursory check, the conda environment that we build off has 250 packages in, and only 60 .pc files.
And to be fair, only 50 entries in lib/cmake, but a lot of the CMake dependency resolution is built into CMake (and does pkg-config support separated components as part of a package, like e.g. Boost which apparently has a 14-year-old unresolved ticket to add pkg-config support). All our "build from source" HDF5 installs don't have this either. Nor does debian have .pc files for their distribution of one of our key libraries (which we don't use via debian, but still....).
This seems a very, very long way from "literally every library comes with pkg-config".
> For dependencies without specific detection logic, the dependency method order for auto is: pkg-config cmake
In my experience, it's that pkg-config assumes that everything needed to consume a library can be communicated via flags spelled as GCC spells them. There are many compilers which don't speak GCC on the command line. Some are popular (Intel and MSVC come to mind).