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 790236 - Various meson related improvements
Various meson related improvements
Status: RESOLVED OBSOLETE
Product: dconf
Classification: Core
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: dconf-maint
dconf-maint
Depends on:
Blocks: 790673
 
 
Reported: 2017-11-12 10:28 UTC by Iñigo Martínez
Modified: 2018-08-10 09:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
build: Rename build options (3.87 KB, patch)
2017-11-12 10:40 UTC, Iñigo Martínez
none Details | Review
build: Remove default warning level option (919 bytes, patch)
2017-11-12 10:44 UTC, Iñigo Martínez
none Details | Review
build: Use meson 0.43.0 features (1.24 KB, patch)
2017-11-12 10:47 UTC, Iñigo Martínez
none Details | Review
build: Remove macro definition (845 bytes, patch)
2017-11-12 10:53 UTC, Iñigo Martínez
none Details | Review
build: Remove default options (888 bytes, patch)
2017-11-20 17:59 UTC, Iñigo Martínez
none Details | Review
build: Use meson 0.43.0 features (1.22 KB, patch)
2017-11-20 18:00 UTC, Iñigo Martínez
none Details | Review
build: Retrieve D-Bus and gio paths (3.78 KB, patch)
2017-11-21 16:21 UTC, Iñigo Martínez
none Details | Review
build: Rename build options (3.97 KB, patch)
2018-04-09 18:02 UTC, Iñigo Martínez
none Details | Review
build: Remove default options (892 bytes, patch)
2018-04-09 18:04 UTC, Iñigo Martínez
none Details | Review
build: Use get_supported_arguments helper (1.23 KB, patch)
2018-04-09 18:06 UTC, Iñigo Martínez
none Details | Review
build: Retrieve D-Bus and gio paths from pkg-config files (3.99 KB, patch)
2018-04-09 18:46 UTC, Iñigo Martínez
none Details | Review
build: Retrieve D-Bus and gio paths from pkg-config files (4.38 KB, patch)
2018-04-10 19:53 UTC, Iñigo Martínez
none Details | Review
build: Remove config.h definitions (1.76 KB, patch)
2018-04-10 19:54 UTC, Iñigo Martínez
none Details | Review
build: Avoid building libraries twice (5.58 KB, patch)
2018-04-10 20:53 UTC, Iñigo Martínez
none Details | Review
build: Fix internal dependencies (10.52 KB, patch)
2018-04-10 20:55 UTC, Iñigo Martínez
none Details | Review
build: Use get_supported_arguments helper (1.70 KB, patch)
2018-04-11 07:17 UTC, Iñigo Martínez
none Details | Review
build: Fix internal dependencies (10.56 KB, patch)
2018-04-11 07:19 UTC, Iñigo Martínez
none Details | Review
build: Remove unnecessary variables (2.71 KB, patch)
2018-04-11 07:20 UTC, Iñigo Martínez
none Details | Review
build: Use gnome's gtkdoc_html_dir function (1.03 KB, patch)
2018-04-11 07:23 UTC, Iñigo Martínez
none Details | Review
build: Fix parameters order (980 bytes, patch)
2018-04-11 07:52 UTC, Iñigo Martínez
none Details | Review
build: Fix pkg-config exec_prefix variable (971 bytes, patch)
2018-04-11 07:52 UTC, Iñigo Martínez
none Details | Review
build: Remove duplicated warning parameter (767 bytes, patch)
2018-04-11 07:53 UTC, Iñigo Martínez
none Details | Review
build: Use completions dir from pkg-config file (2.48 KB, patch)
2018-04-11 07:54 UTC, Iñigo Martínez
none Details | Review

Description Iñigo Martínez 2017-11-12 10:28:14 UTC
This bug includes various meson improvements.
Comment 1 Iñigo Martínez 2017-11-12 10:40:37 UTC
Created attachment 363431 [details] [review]
build: Rename build options

Following the new meson porting guidelines[0], this patch renames the build options. The list of changes is as follows:

- Remove the `enable` prefix from boolean options.
- Remove the `with` prefix from string options.
- The character separator from multi-word options has been changed to underscore (`_`).

[0] https://wiki.gnome.org/Initiatives/GnomeGoals/MesonPorting
Comment 2 Iñigo Martínez 2017-11-12 10:44:47 UTC
Created attachment 363433 [details] [review]
build: Remove default warning level option

dconf uses 1 as the project's default warning level. However, meson already sets this option by default.

This patch removes the option from project's default options.
Comment 3 Iñigo Martínez 2017-11-12 10:47:44 UTC
Created attachment 363434 [details] [review]
build: Use meson 0.43.0 features

meson 0.43.0 comes with a new function in the compiler's object called get_supported_arguments, which allows checking multiple optiones at once.

This patch bumps meson's version number and also takes advantage of this new feature.
Comment 4 Iñigo Martínez 2017-11-12 10:53:33 UTC
Created attachment 363435 [details] [review]
build: Remove macro definition

meson uses the compiler's HAVE_CONFIG_H macro definiton, inherited from autotools behaviours. However it is not necessary.

This patch removes the use of the macro definition.
Comment 5 Iñigo Martínez 2017-11-20 17:59:17 UTC
Created attachment 364068 [details] [review]
build: Remove default options

A slightly modified patch where it also removes debugoptimized build type.
Comment 6 Iñigo Martínez 2017-11-20 18:00:18 UTC
Created attachment 364069 [details] [review]
build: Use meson 0.43.0 features

A follow up update due to the changes in the previous patch.
Comment 7 Iñigo Martínez 2017-11-21 16:21:32 UTC
Created attachment 364130 [details] [review]
build: Retrieve D-Bus and gio paths

D-Bus' session bus services' paths and gio's module's paths are hardcoded. However, these directories can be retrieved by checking this information from their pkgconfig files.

This patch retrieves the paths for their correspondant pkgconfig files and uses those paths as installation directories.

The user can override this paths by using the provided options.
Comment 8 Brendan L 2018-04-06 22:35:29 UTC
Comment on attachment 363431 [details] [review]
build: Rename build options

> 
>-if get_option('enable-man')
>+if get_option('man')
>   xsltproc = find_program('xsltproc', required: false)
>   assert(xsltproc.found(), 'xsltproc is required for enable-man')
> 

I think this might need to be changed now to like:

assert(xsltproc.found(), 'xsltproc is required for enabling man')
Comment 9 Iñigo Martínez 2018-04-09 18:02:09 UTC
Created attachment 370700 [details] [review]
build: Rename build options

(In reply to Brendan L from comment #8)
> I think this might need to be changed now to like:
> 
> assert(xsltproc.found(), 'xsltproc is required for enabling man')

Right! I have updated the patch with a slightly modified message: 'xsltproc is required for man generation'.

What do you think?
Comment 10 Iñigo Martínez 2018-04-09 18:04:42 UTC
Created attachment 370701 [details] [review]
build: Remove default options

A minor update due to version number change that also affects this patch.
Comment 11 Iñigo Martínez 2018-04-09 18:06:04 UTC
Created attachment 370703 [details] [review]
build: Use get_supported_arguments helper

I have updated the commit message (and description) as it better describes it. The version number bump also affected this patch.
Comment 12 Iñigo Martínez 2018-04-09 18:46:59 UTC
Created attachment 370705 [details] [review]
build: Retrieve D-Bus and gio paths from pkg-config files

An update to the previous patch that follows the new approach by redefining some variables present in the `pkg-config` files that makes paths to be located under prefix.
Comment 13 Iñigo Martínez 2018-04-10 19:53:07 UTC
Created attachment 370753 [details] [review]
build: Retrieve D-Bus and gio paths from pkg-config files

I noticed that `libdconfsettings` was using a hardcoded `gio_module_dir`. I have updated the patch to also reuse the `gio_module_dir` from the `gio-2.0.pc` file.
Comment 14 Iñigo Martínez 2018-04-10 19:54:01 UTC
Created attachment 370754 [details] [review]
build: Remove config.h definitions

Although many files include the `config.h` file, no defitions are used at all. Due to this, all the definitions have been removed.

However, the `config.h` file is still generated and included in many files, as it may be useful for future global definitions.
Comment 15 Iñigo Martínez 2018-04-10 20:53:23 UTC
Created attachment 370755 [details] [review]
build: Avoid building libraries twice

dconf builts a number of internal static libraries which in some cases are duplicated. This duplication comes from autotools that used to built two libraries for each library, one with PIC enabled and the other one without it.

This has been changed to build only one library for each library to be built, except `libdconf-common-hidden` which hides some symbols for the GIO module to be built.
Comment 16 Iñigo Martínez 2018-04-10 20:55:11 UTC
Created attachment 370756 [details] [review]
build: Fix internal dependencies

meson is able to generate internal dependencies for handling built libraries. These internal dependencies depend on other dependencies as well, based on the includes exposed by their headers.

This have been fixed by using proper internal dependencies for these libraries.
Comment 17 Iñigo Martínez 2018-04-11 07:17:34 UTC
Created attachment 370767 [details] [review]
build: Use get_supported_arguments helper

I've extended the use of `get_supported_arguments` helper to `fvisibility` compiler option which is used when building `libdconf-common-hidden`.
Comment 18 Iñigo Martínez 2018-04-11 07:19:14 UTC
Created attachment 370769 [details] [review]
build: Fix internal dependencies

The last update also affected this patch that has been updated accordingly.
Comment 19 Iñigo Martínez 2018-04-11 07:20:27 UTC
Created attachment 370770 [details] [review]
build: Remove unnecessary variables

There are some defined variables that are not used. Some of these variables are also used as install directories, that are equal to default installation directories.

These all unnecessary variables and explicit default installation directories have been removed.
Comment 20 Iñigo Martínez 2018-04-11 07:23:58 UTC
Created attachment 370771 [details] [review]
build: Use gnome's gtkdoc_html_dir function

meson's `gtkdoc_html_dir` function returns the path where HTML files will be installed for a given module.

Instead of hard coding the directory, this function is used to set documentations installation directory.
Comment 21 Iñigo Martínez 2018-04-11 07:52:06 UTC
Created attachment 370773 [details] [review]
build: Fix parameters order

The install parameters should be the last parameters when calling a function.

The `configuration` parameter has been moved leaving install parameters at the end.
Comment 22 Iñigo Martínez 2018-04-11 07:52:53 UTC
Created attachment 370775 [details] [review]
build: Fix pkg-config exec_prefix variable

The `exec_prefix` variable in the pkg-config file should point to `prefix` but it is pointing to `libexecdir`.

This has been updated to point to `${prefix}`.
Comment 23 Iñigo Martínez 2018-04-11 07:53:48 UTC
Created attachment 370777 [details] [review]
build: Remove duplicated warning parameter

The `dconf` binary uses the `-w` compiler argument which is already added by meson by default.

This duplicated parameter has been removed.
Comment 24 Iñigo Martínez 2018-04-11 07:54:38 UTC
Created attachment 370778 [details] [review]
build: Use completions dir from pkg-config file

The `bash-completions` pkg-config file provides a variable with the location of the completion files.

This variable is checked to set the installation directory of the completion file provided by dconf.

As a side note, the variable in the `bash-completions` pkg-config file is not totally correct, because it provides a directory that is relative to prefix while it should be relative to datadir.
Comment 25 Iñigo Martínez 2018-04-11 07:57:51 UTC
To ease the review of this patches and test them I've created a wip branch: https://git.gnome.org/browse/dconf/log/?h=wip/inigomartinez/meson
Comment 26 Brendan L 2018-05-29 02:02:06 UTC
> 
> Right! I have updated the patch with a slightly modified message: 'xsltproc
> is required for man generation'.
> 
> What do you think?

Looks fine to me.  I tried your WIP branch and it builds fine for me.  There is still this bug present though:  https://bugzilla.gnome.org/show_bug.cgi?id=794446
Comment 27 Philip Withnall 2018-08-08 11:33:33 UTC
Iñigo, would you mind opening a GitLab merge request for these changes? That’ll make them easier to review. Thanks.

(There’s an open issue about fully migrating dconf to GitLab: https://gitlab.gnome.org/Infrastructure/GitLab/issues/309)
Comment 28 Iñigo Martínez 2018-08-10 09:29:33 UTC
Sure. I have reviewed the commits present here and included a pair of new commits with minor / aesthetic changes: https://gitlab.gnome.org/GNOME/dconf/merge_requests/11

I'm closing this bug as obsolete.