[pacman-dev] interest in using meson over autotools?
Hi, I'm probably not the first to suggest that Autotools is slow and terrible, but here it is: Autotools is slow and terrible. Concretely, a few things I find highly annoying about our current use of Autotools: * We have to carry hacks to the build system itself just to ensure that our binaries aren't overlinked. * Data is duplicated across Makefiles -- derived path configurations such as LOCALEDIR or CONFFILE. * Code is duplicated across directories (symlinked to src/common). As a result, we have poor isolation and rebuild the code multiple times. * './configure && make -C src/pacman pacman' fails. It seems absurd that the user at the command line should have to know to build libalpm first. Isn't that the whole point of a dependency-tracking build system? Subjectively, the configuration itself is archaic and verbose. Does anyone *really* want to spend time understanding the quoting semantics of m4, or figure out where things like $ac_cv_sys_file_offset_bits come from? Yes, some of this could be resolved by fixing/rewriting the autotools madness to not use recursive make, but I'd suggest we just drop autotools and adopt meson. Meson can easily fix all of the above. Why meson? * It's fast. I wrote the initial meson.build files to compile libalpm.so and pacman (this took me under an hour). The resulting build takes 1/3 of the time of the equivalent autotools build. The ./configure equivalent in meson will be faster too, but I can't compare that yet because my meson-equivalent is incomplete. Trust me, it'll be faster. * It's modular. You can still constrain lots of subdirectory specifics in subdirectory meson.build files. * It's easy to read. The config is python-ish, and it's very concise. The documentation is comprehensive and has plenty of examples. * There's lots of upstream support, and the community is growing. In Arch Linux, 175 packages are built using meson (largely because gnome has decided to adopt meson). We would not be an early adopter of meson. * It's portable. meson supports all the targets where we currently have actual users. Would there be interest in accepting patches to make these changes? I propose we would carry both build systems in parallel for a major release before eventually dropping autotools. Feedback wanted, dR
On 07/07/18 at 07:13pm, Dave Reisner wrote:
... Would there be interest in accepting patches to make these changes? I propose we would carry both build systems in parallel for a major release before eventually dropping autotools.
Feedback wanted, dR
I've hated the experience every single time I've had to deal with our autotools setup, so I'm definitely open to change. Our test suite is currently integrated with it, though. What changes would we have to make to our tests for meson? apg
On Sat, Jul 07, 2018 at 07:58:36PM -0400, Andrew Gregory wrote:
On 07/07/18 at 07:13pm, Dave Reisner wrote:
... Would there be interest in accepting patches to make these changes? I propose we would carry both build systems in parallel for a major release before eventually dropping autotools.
Feedback wanted, dR
I've hated the experience every single time I've had to deal with our autotools setup, so I'm definitely open to change. Our test suite is currently integrated with it, though. What changes would we have to make to our tests for meson?
apg
This is one area where Meson could use some improvement. There's generic support for tests, but no specific support for tests using TAP. There's an open issue where someone explicitly has requested this: https://github.com/mesonbuild/meson/issues/2923 Towards the end, there's some suggested workarounds for the current limitations. I think the answer is ideally that we have no make no changes at all to our tests. We could do all of the work in the build system alone -- use a harness to wrap each test and parse the TAP output.
On 08.07.2018 02:07, Dave Reisner wrote:
I think the answer is ideally that we have no make no changes at all to our tests. We could do all of the work in the build system alone -- use a harness to wrap each test and parse the TAP output.
You could also use perl's `prove` to run the tests. You'd probably need to create a wrapper script that handles running pacman tests though since those can't be executed directly like the shell tests. Basically you'd need to combine these two into one. Note that they are run from the respective test directories so the paths are all weird. prove -e 'python2 ./pactest.py --pacman ../../src/pacman/pacman' tests/sync*.py PMTEST_SCRIPTLIB_DIR=~/git/arch/pacman/scripts/library/ PMTEST_LIBMAKEPKG_DIR=~/git/arch/pacman/scripts/libmakepkg/ prove scripts/*.sh util/vercmptest.sh FWIW running the tests via those commands seems to work for me, but I don't know if this can be integrated into meson or if you want to use prove. Florian
On 08/07/18 09:13, Dave Reisner wrote:
Yes, some of this could be resolved by fixing/rewriting the autotools madness to not use recursive make, but I'd suggest we just drop autotools and adopt meson. Meson can easily fix all of the above.
I had a branch on a old dead laptop that rewrote autotools stuff and fixed most of those issues. Also required some rearrangement of our code rather than symlinking shared stuff. Was still crap... Anyway, I have not had time to deal with meson, so I'll take your endorsement at face value. Happy to change, particularly if we plan for a release containing both as a transition. But I will likely need help reviewing meson related stuff until I get up to speed. A
On 07/07/2018 07:13 PM, Dave Reisner wrote:
Would there be interest in accepting patches to make these changes? I propose we would carry both build systems in parallel for a major release before eventually dropping autotools.
I want this and have suggested it recently on IRC. I think Allan may have suggested there were some gotchas for building statically? That's something I'd like to keep, mainly so https://aur.archlinux.org/packages/pacman-static continues to be a valid recovery option for people with borked systems. -- Eli Schwartz Bug Wrangler and Trusted User
participants (5)
-
Allan McRae
-
Andrew Gregory
-
Dave Reisner
-
Eli Schwartz
-
Florian Pritz