GNOME Bugzilla – Bug 623675
libsoup configure needs to skip apache2 tests if mods are not present
Last modified: 2018-08-31 10:40:48 UTC
This comes from downstream report: http://bugs.gentoo.org/show_bug.cgi?id=326957 Tests can fail with the following if mod_proxy.so is not present: PASS: streaming-test timeout-test: OK PASS: timeout-test uri-parsing: OK PASS: uri-parsing apache2: Syntax error on line 26 of /var/tmp/portage/net-libs/libsoup-2.30.2-r1/work/libsoup-2.30.2/tests/httpd.conf: Cannot load /usr/lib/apache2/modules/mod_proxy.so into server: /usr/lib/apache2/modules/mod_proxy.so: cannot open shared object file: No such file or directory Could not start apache FAIL: auth-test apache2: Syntax error on line 26 of /var/tmp/portage/net-libs/libsoup-2.30.2-r1/work/libsoup-2.30.2/tests/httpd.conf: Cannot load /usr/lib/apache2/modules/mod_proxy.so into server: /usr/lib/apache2/modules/mod_proxy.so: cannot open shared object file: No such file or directory Could not start apache FAIL: proxy-test apache2: Syntax error on line 26 of /var/tmp/portage/net-libs/libsoup-2.30.2-r1/work/libsoup-2.30.2/tests/httpd.conf: Cannot load /usr/lib/apache2/modules/mod_proxy.so into server: /usr/lib/apache2/modules/mod_proxy.so: cannot open shared object file: No such file or directory Could not start apache FAIL: pull-api apache2: Syntax error on line 26 of /var/tmp/portage/net-libs/libsoup-2.30.2-r1/work/libsoup-2.30.2/tests/httpd.conf: Cannot load /usr/lib/apache2/modules/mod_proxy.so into server: /usr/lib/apache2/modules/mod_proxy.so: cannot open shared object file: No such file or directory Could not start apache FAIL: range-test forms-test: OK PASS: forms-test server-auth-test: OK PASS: server-auth-test SYNCHRONOUS SSL TEST PASSED ASYNCHRONOUS SSL TEST PASSED PASS: ssl-test ======================================================================== 4 of 21 tests failed Please report to http://bugzilla.gnome.org/enter_bug.cgi?product=libsoup ======================================================================== make[2]: *** [check-TESTS] Error 1 make[2]: Leaving directory `/var/tmp/portage/net-libs/libsoup-2.30.2-r1/work/libsoup-2.30.2/tests' make[1]: *** [check-am] Error 2 make[1]: Leaving directory `/var/tmp/portage/net-libs/libsoup-2.30.2-r1/work/libsoup-2.30.2/tests' make: *** [check-recursive] Error 1 From my point of view, these tests should be skipped if mod_proxy.so is not found at configure time Thanks
It should probably also check for rest of required modules: http://git.gnome.org/browse/libsoup/tree/tests/httpd.conf.in?h=gnome-2-30
Created attachment 165951 [details] [review] libsoup-2.30.2-configure-test.patch Suggested patch to fix this
Comment on attachment 165951 [details] [review] libsoup-2.30.2-configure-test.patch >+ if test -f $dir/mod_auth_digest.so; then >+ APACHE_MODULE_DIR="$dir" >+ fi >+ if test -n APACHE_MODULE_DIR; then >+ APACHE_MODS="mod_alias.so mod_auth_basic.so mod_auth_digest.so mod_authn_file.so mod_authz_host.so >+ mod_authz_user.so mod_dir.so mod_mime.so mod_proxy.so mod_proxy_http.so mod_proxy_connect.so" So this is sort of weird: we require mod_auth_digest.so to be there in the first check, but then test it again in the second check... I think we want to remove the first check, and just do the loop, and only set APACHE_MODULE_DIR if they're all found. Also, please indent the second line of the APACHE_MODS declaration so that "mod_authz_user.so" lines up with "mod_alias.so". >+ for mods in ${APACHE_MODS}; do >+ test -f ${APACHE_MODULE_DIR}/${mods} || unset APACHE_MODULE_DIR >+ done Likewise, the second line here should be indented beyond the other two. Finally, it would be nice to solve both this problem and bug 623674 at the same time; while looping through APACHE_MODS, if you find at least one, but not all, of them, then record the missing ones so you can include in the warning message.
(In reply to comment #3) > So this is sort of weird: we require mod_auth_digest.so to be there in the > first check, but then test it again in the second check... > > I think we want to remove the first check, and just do the loop, and only set > APACHE_MODULE_DIR if they're all found. I tried to do that at first but, then, I noticed that it wouldn't work since $apache_module_dirs contains a lot of possible paths defined in: apache_module_dirs=`echo $apache_prefix/lib{64,}/{apache,apache2,http,http2,httpd}{$mpm,}{/modules,}`]) And then, since only one of them is available (/usr/lib/apache2/modules/ in Gentoo, for example), test fails to find every mod+modules_path combination. I chose then to preserve the first check for $dir/mod_auth_digest.so to get the proper APACHE_MODULE_DIR and, then, test for all the remaining modules only in that path. How would you suggest to do it in a cleaner way? Thanks a lot :-)
You don't want to find *every* combination. You just want to find one directory that contains at least one of the modules. So do the loop, and if you found all the modules, then you win, and if you found none of the modules, then keep looping. But if you found some-but-not-all of the modules, break, and remember which ones you didn't find so you can warn later.
Could I keep: + if test -f $dir/mod_auth_digest.so; then + APACHE_MODULE_DIR="$dir" + fi for finding proper directory and then skip "mod_auth_digest.so" in APACHE_MODS to not check for it again? The problem of trying to test for all modules at the same time instead, is that I would only be able to do that running multiple concatenated "test" and, if all of them are ok, set APACHE_MODULE_DIR="$dir"
[mass-moving all "UNCONFIRMED" libsoup bugs to "NEW" after disabling the "UNCONFIRMED" status for this product now that bugzilla.gnome.org allows that. bugspam-libsoup-20150210]
Created attachment 371089 [details] [review] Bug 623675: libsoup configure needs to skip apache2 tests if mods are not present Modify the get_apache_module_dirs.py to check for the presence of required Apache modules. If any of the modules are not found then the script returns a failure and prints the missing modules names to stderr. At this point Meson won't build tests that require Apache (this is already implemented). Also warn about missing regression tests that will be shown unless all the required parts for them are installed and configured properly.
Comment on attachment 371089 [details] [review] Bug 623675: libsoup configure needs to skip apache2 tests if mods are not present This landed as https://gitlab.gnome.org/GNOME/libsoup/commit/81735cf96ffc8f4cda50da32ce456d2882bf991a