After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 794372 - glib-networking doesn't respect installed_tests meson option
glib-networking doesn't respect installed_tests meson option
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: network
2.56.x
Other Linux
: Normal minor
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2018-03-15 18:49 UTC by thinkabit.ukim
Modified: 2018-03-16 17:42 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Don't generate installed test files when not enabled (2.19 KB, patch)
2018-03-16 17:42 UTC, Michael Catanzaro
committed Details | Review

Description thinkabit.ukim 2018-03-15 18:49:56 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
Comment 1 Michael Catanzaro 2018-03-16 00:56:09 UTC
Looks like a meson bug
Comment 2 Michael Catanzaro 2018-03-16 00:58:07 UTC
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?
Comment 3 Michael Catanzaro 2018-03-16 01:06:44 UTC
I think it's a bug... meson should check the install argument, and not install if it's false. Inigo, do you agree?
Comment 4 Iñigo Martínez 2018-03-16 07:38:56 UTC
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
Comment 5 Michael Catanzaro 2018-03-16 17:42:07 UTC
The following fix has been pushed:
681c8dc Don't generate installed test files when not enabled
Comment 6 Michael Catanzaro 2018-03-16 17:42:17 UTC
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.