GNOME Bugzilla – Bug 794372
glib-networking doesn't respect installed_tests meson option
Last modified: 2018-03-16 17:42:17 UTC
passing -Dinstalled_tests=false doesn't prevent the following files from being installed. /usr/share/installed-tests/glib-networking/pkcs11-slot.test /usr/share/installed-tests/glib-networking/pkcs11-pin.test /usr/share/installed-tests/glib-networking/pkcs11-array.test /usr/share/installed-tests/glib-networking/pkcs11-util.test /usr/share/installed-tests/glib-networking/dtls-connection.test /usr/share/installed-tests/glib-networking/connection.test /usr/share/installed-tests/glib-networking/file-database.test /usr/share/installed-tests/glib-networking/certificate.test /usr/share/installed-tests/glib-networking/gnome.test /usr/share/installed-tests/glib-networking/libproxy.test
Looks like a meson bug
Well, it's certainly a meson footgun: configure_file( input: test_template, output: program[0] + '.test', install: enable_installed_tests, install_dir: installed_tests_metadir, configuration: test_conf ) Seems the install arg doesn't do anything, and the presence of the install_dir arg controls whether the file gets installed or not?
I think it's a bug... meson should check the install argument, and not install if it's false. Inigo, do you agree?
There is something weird going on here. Yes, the expected behaviour is that those files would not be installed when `installed_tests` is false. However, looking at the documentation[0], `configure_file`, unlike other similar functions, doesn't look like that it has the `install` parameter, though the parameter *is* present in the source code[1]. I have opened an issue[2] to clarify the situation, but the used approach should be changed, because meson should not waste any time on configuring files which are not going to be installed. [0] http://mesonbuild.com/Reference-manual.html#configure_file [1] https://github.com/mesonbuild/meson/blob/master/mesonbuild/interpreter.py#L1495 [2] https://github.com/mesonbuild/meson/issues/3248
The following fix has been pushed: 681c8dc Don't generate installed test files when not enabled
Created attachment 369797 [details] [review] Don't generate installed test files when not enabled These files are not needed except when installed tests are enabled, so they should not be generated at all by default. This is good to do for its own sake, but also works around some weird behavior of meson that has resulted in these files being installed even when installed tests are disabled.