meson: doesn't always run apache and other conditional tests
I have spent some time debugging why apache tests don't run in Debian if building with meson and found some problems. I've tried to fix them myself but my python foo is not great, so here's what I found so far.
- It doesn't find the Apache binary. The problem here is that in Debian it's installed outside the $PATH, so you need to search as well in /usr/sbin. Meson makes it a bit cumbersome to do this, but it's a known issue that perhaps will be fixed soon, but probably not: https://github.com/mesonbuild/meson/issues/1576
A temporary fix is to just manually add all the potential locations, so I'm doing that in a commit soon.
-
get_apache_module_dirs.py
returns early if the apache call has a non-zero return code. This is problematic because, in Debian, there is actually a warning when calling apache2 directly and an error code, but this doesn't prevent Apache from spitting out the desired info to stdout. So the early return should not check for the return code, but rather for stdout not being empty, for example. -
The code parsing the MPM output doesn't take into account that MPM could be empty, and in my Debian machine it is. Either the regexp or the code that parses the result need to be fixed.
This is what I have found so far. I'll push now a fix for 1. but the other two I leave to other people to check. I think @tpopela was in charge of the Meson files, so have a look at this please :)