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 795107 - Meson: missing option to enable/disable plugins
Meson: missing option to enable/disable plugins
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: common
git master
Other Linux
: Normal enhancement
: 1.15.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2018-04-09 15:47 UTC by Xavier Claessens
Modified: 2018-07-27 14:13 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Script that generate a meson_options.txt (4.92 KB, text/x-python)
2018-04-09 16:23 UTC, Xavier Claessens
  Details
Generated options for gst-plugins-good (23.37 KB, text/plain)
2018-04-09 16:25 UTC, Xavier Claessens
  Details
Add option to enable/disable each plugin in good (32.63 KB, patch)
2018-04-11 03:10 UTC, Xavier Claessens
none Details | Review
Add option to enable/disable each plugin in good (18.36 KB, patch)
2018-04-11 15:36 UTC, Xavier Claessens
none Details | Review
Script to gen option for each plugin (748 bytes, application/x-shellscript)
2018-04-11 15:37 UTC, Xavier Claessens
  Details
Meson: Add feature option each ext plugin in good (17.23 KB, patch)
2018-06-13 18:07 UTC, Xavier Claessens
none Details | Review
Meson: Add feature option each plugin in good (36.23 KB, patch)
2018-06-13 18:24 UTC, Xavier Claessens
none Details | Review
Feature options for gstreamer core. (7.64 KB, patch)
2018-07-25 13:59 UTC, Nirbheek Chauhan
none Details | Review
Feature options for gst-plugins-base. (22.10 KB, patch)
2018-07-25 14:00 UTC, Nirbheek Chauhan
none Details | Review
Feature options for gst-plugins-good (36.09 KB, patch)
2018-07-25 14:01 UTC, Nirbheek Chauhan
none Details | Review
Feature options for gst-plugins-bad (4.55 KB, patch)
2018-07-25 14:01 UTC, Nirbheek Chauhan
none Details | Review
Feature options for gst-plugins-ugly (2.73 KB, patch)
2018-07-25 14:02 UTC, Nirbheek Chauhan
committed Details | Review
Feature options for gst-editing-services (3.10 KB, patch)
2018-07-25 14:03 UTC, Nirbheek Chauhan
committed Details | Review
Feature options for gst-rtsp-server (2.14 KB, patch)
2018-07-25 14:04 UTC, Nirbheek Chauhan
none Details | Review
Feature options for gst-devtools (6.19 KB, patch)
2018-07-25 14:05 UTC, Nirbheek Chauhan
committed Details | Review
Feature options for gst-build (1.20 KB, patch)
2018-07-25 14:07 UTC, Nirbheek Chauhan
committed Details | Review
Script to gen option for each plugin (633 bytes, application/x-shellscript)
2018-07-25 14:12 UTC, Xavier Claessens
  Details
Feature options for gstreamer core (9.32 KB, patch)
2018-07-27 10:45 UTC, Nirbheek Chauhan
committed Details | Review
Feature options for gst-plugins-base (22.16 KB, patch)
2018-07-27 10:53 UTC, Nirbheek Chauhan
committed Details | Review
Feature options for gst-plugins-good (37.36 KB, patch)
2018-07-27 10:55 UTC, Nirbheek Chauhan
committed Details | Review
Feature options for gst-plugins-bad (11.84 KB, patch)
2018-07-27 10:55 UTC, Nirbheek Chauhan
committed Details | Review
Feature options for gst-rtsp-server (2.74 KB, patch)
2018-07-27 10:59 UTC, Nirbheek Chauhan
committed Details | Review
More feature options for gst-plugins-bad (60.19 KB, patch)
2018-07-27 13:38 UTC, Nirbheek Chauhan
committed Details | Review
More feature options for gst-plugins-ugly (9.68 KB, patch)
2018-07-27 14:04 UTC, Nirbheek Chauhan
committed Details | Review

Description Xavier Claessens 2018-04-09 15:47:09 UTC
There is currently no way with meson to select which plugins to enable/disable. We should add them in meson_options.txt. This could require new feature from meson itself if we want three-state options enabled/disabled/auto like we have with autotools.

I'm opening this bug report to start discussion and define a plan of what we ideally want. If we know what we want, I'm sure we can get support from Meson easily.

In autotools there are currently different types of options, I've spotted them:
- AC_ARG_ENABLE / AC_ARG_WITH
- AG_GST_CHECK_FEATURE
- AG_GST_CHECK_PLUGIN
- AG_GST_CHECK_SUBSYSTEM_DISABLE

For what I understood we would need this:
- For each dependency-less plugins, add option('pluginname', type: 'boolean', value: true). I don't think we need a three-state value here, they should all be built by default and could be disabled explicitly.
- For each plugin with external dep, add a three-state option. 'enabled' means build fails if dep is not found, 'disabled' means we never build it regardless of the dep, 'auto' means build it if dep is found, otherwise just skip that plugin.
- Features are a set of plugins with dependencies that can be enabled/disabled as a group, instead of individually, right? I guess that needs a three-state option too.

Note that nowadays GNOME guideline discourage "auto" options, better make things explicit. I tend to agree that the set of plugins that gets built shouldn't be a surprise. The default value could be true for everything unless the plugin/feature is considered too experimental or niche use-case.

We could also go with just 2 string array options to list enabled/disabled plugins (or 3rd list for auto plugins). It has the advantage to be easier, a list of plugins used is often what users has. It has the disadvantage to be too free-form and requires validate that strings correspond to a plugin that actually exists.
Comment 1 Xavier Claessens 2018-04-09 16:23:16 UTC
Created attachment 370698 [details]
Script that generate a meson_options.txt

I had this script for a while, it generates a meson_options.txt based on all options it finds by parsing m4 files.
Comment 2 Xavier Claessens 2018-04-09 16:25:43 UTC
Created attachment 370699 [details]
Generated options for gst-plugins-good

To get some context, here is the output of my script for gst-plugins-good.
Comment 3 Tim-Philipp Müller 2018-04-09 17:11:22 UTC
I think we should use this opportunity to re-imagine the available options configuration system. We don't have to copy all the existing options or map them 1:1.

The reason I haven't added options for plugins yet is because I want this done properly with support in Meson for auto-options and skipping subdirs, and with a standardised global override for packagers (see below).

We will ignore the guidance in that gnome wiki page, it doesn't match our needs.

I'm just going to write down some initial thoughts/requirements which will hopefully help us decide what to propose on the Meson side.

I would suggest we focus on the plugin selection problematique first, the other bits are less interesting or can already be handled satisfactorily with the existing functionality in Meson (boolean options, disabler object etc.).

In terms of auto functionality, what I think we want is:

1) a tristate enum of some sort (enable/disable/auto) or equivalent

2) in "enabled" mode, checks should fail if the dependency requirements are not met

3) in "disabled" mode, checks for dependencies should not be done at all (!), at least there should be no visible user output. It is not acceptable that the user sees checks for libvorbis in the output or log if they passed -Dvorbis=disable.

4) a global configure switch to use "disable" as default value for all "auto" defaults, so that only things that have been requested explicitly get enabled.

5) a global configure switch to use "enable" as default value for all "auto" defaults, so that meson configure fails if any plugin dependency is not met for plugins that haven't been disabled explicitly. This is useful for distro packagers that want to make sure that all plugins get shipped (or consciously disabled) and don't accidentally disappear from the package just because a dep requirement was added or bumped.

6) plugin-specific dependency() etc. checks should stay in ext/foo/meson.build


For plugins we could probably do something with existing Meson features by doing something like -Drequired-plugins=a,b,c and -Ddisable-plugins=d,e,f and supporting 'all' and 'none' as options. This seems more like an emergency fallback though, and not very nice. Surely we can do something nicer with Meson support?
Comment 4 Tim-Philipp Müller 2018-04-09 17:19:16 UTC
Something else we want (less important though IMHO): enable/disable a group of plugins. Currently in autotools we have --disable-external to disable plugins with external dependencies, but we may also want e.g. audio plugins, video plugins, subtitle plugins, GPL plugins, exotic plugins.

This use case seems to be supported by the Meson "dolphin" PR already:

 https://github.com/mesonbuild/meson/pull/2411

 https://github.com/mesonbuild/meson/commit/904fe4745d8fb285c28f33dff2afbf3754e875fd#diff-ba7afafbb566a046436c614eb21b8968
Comment 5 Xavier Claessens 2018-04-09 20:45:39 UTC
I proposed a new type of option, called 'dependency', it can have 3 values: "required" (i.e. enable), "not-required" (i.e. auto) or "disabled" (i.e. disable).

The intended usage in GStreamer would be to have something like this on the top of ext/cairo/meson.build:

cairo_dep = dependency('cairo-gobject', version : '>=1.10.0', required : get_option('cairo'))
if not cairo_dep.found()
  subdir_done()
endif

And in meson_options.txt:
option('cairo', type: 'dependency', value: 'not-required')
Comment 6 Xavier Claessens 2018-04-09 21:02:18 UTC
About global option to switch all "not-required" to either "required" or "disabled", if I'm not mistaken it could work like this:

meson_options.txt:
option('group_switch', type: 'dependency', value: 'not-required')

ext/cairo/meson.build:
opt = get_option('cairo') or get_option('group_switch')

I think the "or" operator works like this:
required, required => required
required, not-required => required
required, disabled => disabled

no-required, required => required
no-required, not-required => not-required
no-required, disabled => disabled

disabled, required => disabled
disabled, not-required => disabled
disabled, disabled => disabled
Comment 7 Tim-Philipp Müller 2018-04-09 21:14:03 UTC
The global switch option was supposed to be something built into Meson and should be transparent to the user, not something in meson_options.txt.
Comment 8 Xavier Claessens 2018-04-09 23:18:55 UTC
Actually the 'or' operator doesn't give what we want, the code should be:
opt = get_option('cairo')
if not opt
  opt = get_option('group_switch')
endif

That's for grouping. About getting a global switch built-in I guess it can be done with the same logic internally in meson.
Comment 9 Xavier Claessens 2018-04-10 20:44:10 UTC
Forget what I said above, I updated my proposal:
https://github.com/mesonbuild/meson/pull/3376#issuecomment-380239323
Comment 10 Xavier Claessens 2018-04-11 03:10:39 UTC
Created attachment 370762 [details] [review]
Add option to enable/disable each plugin in good
Comment 11 Xavier Claessens 2018-04-11 03:12:07 UTC
(In reply to Xavier Claessens from comment #10)
> Created attachment 370762 [details] [review] [review]
> Add option to enable/disable each plugin in good

Wrote a script to generate this patch, could need a few manual edits.
Comment 12 Tim-Philipp Müller 2018-04-11 09:18:34 UTC
Comment on attachment 370762 [details] [review]
Add option to enable/disable each plugin in good

Thanks for working on this!

Just two comments from a user-point-of-view:

>+if not get_option('audioparsers')
>+  subdir_done()
>+endif

I think this we could probably do nicer if we added something to subdir() ?

But what I think will be confusing is that users now have to know what type a plugin is to enable it or disable it, if I understand correctly. Because the dependencyless options are now booleans so you'd have to do

  meson -Daudioparsers=false

but for the ones with dependencies you'd have to do

  meson -Dpng=required (or whatever name we settle on later)

That seems unfortunate, but easy to fix by just using tristate options there too I guess. Which would still make sense because it will allow for the "disable everything auto by default, and let me opt-in by enabling things explicitly", for example. Which won't be supported with boolean options.
Comment 13 Xavier Claessens 2018-04-11 15:36:07 UTC
Created attachment 370812 [details] [review]
Add option to enable/disable each plugin in good
Comment 14 Xavier Claessens 2018-04-11 15:37:45 UTC
Created attachment 370813 [details]
Script to gen option for each plugin

This is quick and dirty, but does the job.
Comment 15 Olivier Crête 2018-04-17 15:39:40 UTC
Review of attachment 370812 [details] [review]:

::: ext/cairo/meson.build
@@ -1,1 +1,1 @@
-cairo_dep = dependency('cairo-gobject', version : '>=1.10.0', required : false)
+cairo_dep = dependency('cairo-gobject', version : '>=1.10.0', required : required_opt)

I can't not think that these meson scripts would be cleaner is meson let us create functions.
Comment 16 Xavier Claessens 2018-04-17 17:35:36 UTC
(In reply to Olivier Crête from comment #15)
> I can't not think that these meson scripts would be cleaner is meson let us
> create functions.

Every time you think a function would help you, check gstreamer/common/m4/, and you'll see why you certainly don't want functions but a proper build system.
Comment 17 Olivier Crête 2018-04-17 17:52:02 UTC
(In reply to Xavier Claessens from comment #16)
> (In reply to Olivier Crête from comment #15)
> > I can't not think that these meson scripts would be cleaner is meson let us
> > create functions.
> 
> Every time you think a function would help you, check gstreamer/common/m4/,
> and you'll see why you certainly don't want functions but a proper build
> system.

Because copy-pasting is better?!?!
Comment 18 Tim-Philipp Müller 2018-04-17 18:03:57 UTC
I don't think there's much point debating this in this bug report. It's not something that's up for debate in Meson. I don't think it will be a problem for us.
Comment 19 Xavier Claessens 2018-06-13 18:07:58 UTC
Created attachment 372676 [details] [review]
Meson: Add feature option each ext plugin in good
Comment 20 Xavier Claessens 2018-06-13 18:24:08 UTC
Created attachment 372677 [details] [review]
Meson: Add feature option each plugin in good
Comment 21 Tim-Philipp Müller 2018-06-18 16:25:01 UTC
Comment on attachment 372677 [details] [review]
Meson: Add feature option each plugin in good

Tri-state options have landed in Meson master, so we can merge this once there is a new Meson release (0.47.0), as we don't want to depend on Meson from git.

>--- a/ext/meson.build
>+++ b/ext/meson.build
>@@ -1,30 +1,28 @@
>-subdir('aalib')
>-subdir('cairo')
>-subdir('flac')
>-subdir('gdk_pixbuf')
>-subdir('gtk')
>-subdir('jack')
>-subdir('jpeg')
>-subdir('lame')
>-subdir('libcaca')
>-# FIXME: dv plugin fails to link with msvc, wants pthread.lib
>-if cc.get_id() != 'msvc'
>-  subdir('dv')
>-endif
>-subdir('libpng')
>-subdir('mpg123')
>-subdir('raw1394')
>-subdir('qt')
>-subdir('pulse')
>-subdir('shout2')
>-subdir('soup')
>-subdir('speex')
>-# FIXME: taglib fails to compile and link with msvc
>-if cc.get_id() == 'msvc'
>-  message('Building with MSVC, disabling taglib support. Patches welcome!')
>-else
>-  subdir('taglib')
>-endif
>-subdir('twolame')
>-subdir('vpx')
>-subdir('wavpack')
>+plugins = [
>+  'aalib',
>+  'cairo',
>+  'dv',
>+  'flac',
>+  'gdk_pixbuf',
>+  'gtk',
>+  'jack',
>+  'jpeg',
>+  'lame',
>+  'libcaca',
>+  'libpng',
>+  'mpg123',
>+  'pulse',
>+  'qt',
>+  'raw1394',
>+  'shout2',
>+  'soup',
>+  'speex',
>+  'taglib',
>+  'twolame',
>+  'vpx',
>+  'wavpack',
>+]
>+
>+foreach plugin : plugins
>+  subdir(plugin)
>+endforeach

Why are you changing this? This is not an equivalent change, and it's not clear to me this is really nicer or cleaner or shorter. Can we just keep it as it is for now? :) (same for gst/meson.build)
Comment 22 Tim-Philipp Müller 2018-06-18 16:31:23 UTC
> Can we just keep it as it is for now? :)

For maximum correctness we should probably make it so that it errors out if compiler is 'msvc' and the feature was enabled, but that seems like a minor issue.
Comment 23 Xavier Claessens 2018-06-18 17:24:42 UTC
oh that's leftover from the previous patch where I was skipping subdir in the foreach loop because we didn't have subdir_done() back then.
Comment 24 Xavier Claessens 2018-06-18 18:08:07 UTC
Checking in gst-plugins-bad, it seems common check for a lib and its header:

dep = cc.find_library('foo', required : false)
if dep.found() and cc.has_header_symbol('foo.h', 'something')
  ...
endif

Converting that pattern to the tristate option is annoying, because if the option is "enabled" we want to abort if header is not found but there is no "required" kwarg for that function.
Comment 25 Thibault Saunier 2018-06-18 18:26:41 UTC
(In reply to Xavier Claessens from comment #24)
> Checking in gst-plugins-bad, it seems common check for a lib and its header:
> 
> dep = cc.find_library('foo', required : false)
> if dep.found() and cc.has_header_symbol('foo.h', 'something')
>   ...
> endif
> 
> Converting that pattern to the tristate option is annoying, because if the
> option is "enabled" we want to abort if header is not found but there is no
> "required" kwarg for that function.

We probably want cc.find_dependency back: https://github.com/thiblahute/meson/commits/compiler.find_dependency - not 100% sure it is the latest code, I will make sure it is.

You can have a look at how I was using it in the -bad meson component branch: https://github.com/thiblahute/gst-plugins-bad/commit/8bc030477b0f1eed638838e6842fff85efdaae37#diff-f208d0156984b3c606dccdc01ac83d08R9
Comment 26 Tim-Philipp Müller 2018-06-18 18:34:08 UTC
Doing

  gst-plugins-bad $ git grep -B5 -e 'found.*has_header_symbol'

at least some of the checks are a bit weird, e.g. what's the point/reason of doing a check with dependency() and then also doing cc.has_header_symbol()? That is most likely not only not required, but probably also wrong in most cases because the dep is not actually passed in the check so it won't work for non-standard prefixes. (I will make a patch for this.)

For cc.find_library() I can see the point in the header check.

I think we probably want what Thibault proposed (was looking for that).
Comment 27 Xavier Claessens 2018-06-18 20:16:41 UTC
Let's start with -base, the non straighforward plugins are:
- gl, no need of a "feature" option, that one has more complicated options already. Right?

- vorbis has 3 deps: 'vorbis', 'vorbisenc' and 'vorbisidec'. If I understand correctly it needs 2 features: 'vorbis' and 'ivorbis'. We should check for vorbisenc_dep only if vorbis_dep is found.

- theora: Do we need 2 features for env/dec or should it be all-or-nothing?

- cdparanoia: There is a comment saying 10.2 has a pkg-config, but Ubuntu 18.04 has libcdparanoia-dev 3.10.2 and there is no .pc file. The check for header is wrong because cdparanoia_found is true even if no header can be found.
Comment 28 Tim-Philipp Müller 2018-06-19 21:31:11 UTC
- gl: let's skip/ignore it for now

- vorbis: agreed

- theora: I think there should be only one "theora" feature for now and both dec/enc should be mandatory for it. Which doesn't match autotools usage, but I think that's a fringe use case and mostly accidental. Later we may want to add extra features for disabling decoders or encoders in general, but let's cross that bridge when we get there, that's a feature we don't have in the autotools build either yet.

- cdparanoia: the comment says the pkg-config file was added after 10.2, and I don't thin there has been any release since, so we'll have to keep the manual checks I think :/
Comment 29 Nirbheek Chauhan 2018-07-25 13:59:37 UTC
Created attachment 373152 [details] [review]
Feature options for gstreamer core.

meson: Add feature options for optional deps

The only automagic deps are now those used by tests and examples.
Comment 30 Nirbheek Chauhan 2018-07-25 14:00:34 UTC
Created attachment 373153 [details] [review]
Feature options for gst-plugins-base.

meson: Add feature options for most external dependencies

GL dependency detection is still automagic.
Comment 31 Nirbheek Chauhan 2018-07-25 14:01:09 UTC
Created attachment 373154 [details] [review]
Feature options for gst-plugins-good

meson: Add feature options for most external dependencies

Checking for GL, Qt5, and C++ are still automagic. FIXMEs have been
added for these so they can be fixed later.
Comment 32 Nirbheek Chauhan 2018-07-25 14:01:55 UTC
Created attachment 373155 [details] [review]
Feature options for gst-plugins-bad

meson: Convert common options to feature options

The rest will be converted later, these are necessary for gst-build to
set options correctly.
Comment 33 Nirbheek Chauhan 2018-07-25 14:02:40 UTC
Created attachment 373156 [details] [review]
Feature options for gst-plugins-ugly

meson: Convert common options to feature options

The rest will be converted later, these are necessary for gst-build to
set options correctly.
Comment 34 Nirbheek Chauhan 2018-07-25 14:03:29 UTC
Created attachment 373157 [details] [review]
Feature options for gst-editing-services

meson: Convert common options to feature options

The remaining automagic options are in tests and examples.
Comment 35 Nirbheek Chauhan 2018-07-25 14:04:22 UTC
Created attachment 373158 [details] [review]
Feature options for gst-rtsp-server

meson: Convert common options to feature options

These are necessary for gst-build to set options correctly. The
remaining automagic option is cgroup support in examples.
Comment 36 Nirbheek Chauhan 2018-07-25 14:05:19 UTC
Created attachment 373159 [details] [review]
Feature options for gst-devtools

meson: Convert common options to feature options

The rest will be converted later, these are necessary for gst-build to
set options correctly.
Comment 37 Nirbheek Chauhan 2018-07-25 14:07:20 UTC
Created attachment 373160 [details] [review]
Feature options for gst-build

Convert common meson options to feature options

These changes have been mirrored in all subproject repositories.
Comment 38 Nirbheek Chauhan 2018-07-25 14:09:15 UTC
I stopped porting -bad because there's a lot of plugins in there, and decided to do the minimal work first that's needed to be synchronized across all repos (i.e., convert the "common" yield: true options to feature options). Once these are in, the remaining ones can be added at their own pace.
Comment 39 Xavier Claessens 2018-07-25 14:09:41 UTC
Review of attachment 373153 [details] [review]:

::: gst/meson.build
@@ +6,3 @@
+    subdir(plugin)
+  endif
+endforeach

As per earlier discussion in this bug, we prefer to keep all subdir() calls and inside the plugin's meson.build do

if get_option('foo').disabled()
  subdir_done()
endif
Comment 40 Xavier Claessens 2018-07-25 14:12:25 UTC
Created attachment 373161 [details]
Script to gen option for each plugin

I had this updated script for a while, but didn't attach it. It will use subdir_done() instead of the foreach loop in parent directory. Could be useful to Nirbheek if he wants to resume work on this.
Comment 41 Xavier Claessens 2018-07-25 14:15:59 UTC
Review of attachment 373160 [details] [review]:

::: meson_options.txt
@@ +13,3 @@
 # Common options, automatically inherited by subprojects
+option('gtk_doc', type : 'feature', value : 'auto',
+       description : 'Generate API documentation with gtk-doc')

That's going to be inconsistent with all other GNOME modules that has boolean value. There has been effort to consolidate on the "gtk_doc" naming and now we'll divert again... Not saying it's a bad idea, but I think we should try to coordinate this change for all modules.
Comment 42 Nirbheek Chauhan 2018-07-25 14:16:28 UTC
(In reply to Xavier Claessens from comment #39)
> Review of attachment 373153 [details] [review] [review]:
> 
> ::: gst/meson.build
> @@ +6,3 @@
> +    subdir(plugin)
> +  endif
> +endforeach
> 
> As per earlier discussion in this bug, we prefer to keep all subdir() calls
> and inside the plugin's meson.build do
> 
> if get_option('foo').disabled()
>   subdir_done()
> endif

The `foreach` mechanism in that patch seems much more elegant and self-contained to me than adding `subdir_done()` separately for each plugin. It's also much less churn.

Adding a new plugin subdir will automatically associate it with an option, and the build system will immediately complain if you forget to define it.
Comment 43 Nirbheek Chauhan 2018-07-25 14:20:21 UTC
(In reply to Xavier Claessens from comment #41)
> Review of attachment 373160 [details] [review] [review]:
> 
> ::: meson_options.txt
> @@ +13,3 @@
>  # Common options, automatically inherited by subprojects
> +option('gtk_doc', type : 'feature', value : 'auto',
> +       description : 'Generate API documentation with gtk-doc')
> 
> That's going to be inconsistent with all other GNOME modules that has
> boolean value. There has been effort to consolidate on the "gtk_doc" naming
> and now we'll divert again... Not saying it's a bad idea, but I think we
> should try to coordinate this change for all modules.

Well, this sort of thing is actually why I was advocating for -Dfoo={true,false,auto}, because it's backwards-compatible w.r.t. user interface when you switch options over from boolean to feature. I'm sure we can fix that with aliases in the future, so that yes/no|true/false|enabled/disabled are all the same.

Also the name is not set in stone; our build system API is not fixed till we make it the default.
Comment 44 Xavier Claessens 2018-07-25 14:28:55 UTC
(In reply to Nirbheek Chauhan from comment #42)
> Adding a new plugin subdir will automatically associate it with an option,
> and the build system will immediately complain if you forget to define it.

Good point.
Comment 45 Tim-Philipp Müller 2018-07-25 16:57:50 UTC
We should prepare an MR for gnome-continuous before the gtk_doc change lands and let ebassi know in advance: https://gitlab.gnome.org/GNOME/gnome-continuous/blob/master/manifest.json#L689
Comment 46 Tim-Philipp Müller 2018-07-25 23:11:09 UTC
Comment on attachment 373153 [details] [review]
Feature options for gst-plugins-base.

>+# Examples-only feature options
>+option('gdk-pixbuf', type : 'feature', value : 'auto', description : 'GDK-PixBuf support in examples')
>+option('gtk3', type : 'feature', value : 'auto', description : 'GTK+ 3 support in examples')
>+option('qt5', type : 'feature', value : 'auto', description : 'Qt5 support in examples')
>+option('sdl1', type : 'feature', value : 'auto', description : 'SDL 1.2 support in examples')

Not sure if this is really needed, it's certainly more than we provide now and no one ever asked for this as far as  I recall. Wouldn't a simple "examples" option be sufficient?


>+option('x11', type : 'feature', value : 'auto', description : 'X11 ximagesink plugin, and X11 support in libraries, plugins, examples')

Arguably the x11 plugin selection should be independent of x11 support selection for Gst-GL or the examples, but we can always change that later I guess.
Comment 47 Tim-Philipp Müller 2018-07-25 23:27:02 UTC
Comment on attachment 373154 [details] [review]
Feature options for gst-plugins-good

> # Common options
>+option('examples', type : 'boolean', value : true, yield : true)

Wonder if this should be a feature as well and default to auto?

(Even if we don't have a way to pass arrays of features to required:)
Comment 48 Nirbheek Chauhan 2018-07-26 09:47:26 UTC
(In reply to Tim-Philipp Müller from comment #45)
> We should prepare an MR for gnome-continuous before the gtk_doc change lands
> and let ebassi know in advance:
> https://gitlab.gnome.org/GNOME/gnome-continuous/blob/master/manifest.
> json#L689

It looks like continuous is already broken, and is chugging along because Meson ignores unknown option arguments. We should fix it, but it shouldn't block these patches.

(In reply to Tim-Philipp Müller from comment #46)
> Comment on attachment 373153 [details] [review] [review]
> Feature options for gst-plugins-base.
> 
> >+# Examples-only feature options
> >+option('gdk-pixbuf', type : 'feature', value : 'auto', description : 'GDK-PixBuf support in examples')
> >+option('gtk3', type : 'feature', value : 'auto', description : 'GTK+ 3 support in examples')
> >+option('qt5', type : 'feature', value : 'auto', description : 'Qt5 support in examples')
> >+option('sdl1', type : 'feature', value : 'auto', description : 'SDL 1.2 support in examples')
> 
> Not sure if this is really needed, it's certainly more than we provide now
> and no one ever asked for this as far as  I recall. Wouldn't a simple
> "examples" option be sufficient?
> 

Yes, I realized when I looked at -bad that this doesn't scale nor does it make sense. I will put it behind the examples option instead.

(In reply to Tim-Philipp Müller from comment #47)
> Comment on attachment 373154 [details] [review] [review]
> Feature options for gst-plugins-good
> 
> > # Common options
> >+option('examples', type : 'boolean', value : true, yield : true)
> 
> Wonder if this should be a feature as well and default to auto?
> 
> (Even if we don't have a way to pass arrays of features to required:)

Let me have a crack at that and see how it looks, but yes it does make sense to do this.
Comment 49 Nirbheek Chauhan 2018-07-27 10:45:12 UTC
Created attachment 373180 [details] [review]
Feature options for gstreamer core

meson: Add feature options for optional deps

Everything should be behind an option now.
Comment 50 Nirbheek Chauhan 2018-07-27 10:53:31 UTC
Created attachment 373181 [details] [review]
Feature options for gst-plugins-base

meson: Add feature options for all plugins

GL dependency detection is still automagic.
Comment 51 Nirbheek Chauhan 2018-07-27 10:55:00 UTC
Created attachment 373182 [details] [review]
Feature options for gst-plugins-good

meson: Add feature options for all plugins

Checks for GL, Qt5, and C++ are still automagic. FIXMEs have been
added for these so they can be fixed later.
Comment 52 Nirbheek Chauhan 2018-07-27 10:55:58 UTC
Created attachment 373183 [details] [review]
Feature options for gst-plugins-bad

meson: Add feature options for many plugins

The rest will be converted later, these are necessary for gst-build to
set options correctly.
Comment 53 Nirbheek Chauhan 2018-07-27 10:59:16 UTC
Created attachment 373184 [details] [review]
Feature options for gst-rtsp-server

meson: Convert common options to feature options

These are necessary for gst-build to set options correctly. The
remaining automagic option is cgroup support in examples.
Comment 54 Nirbheek Chauhan 2018-07-27 13:38:37 UTC
Created attachment 373188 [details] [review]
More feature options for gst-plugins-bad

Add feature options for almost all plugins

The only plugins remaining are those that haven't been ported to Meson
yet, and msdk. Also, the tests are still automagic.
Comment 55 Nirbheek Chauhan 2018-07-27 14:04:38 UTC
Created attachment 373190 [details] [review]
More feature options for gst-plugins-ugly

Add feature options for all plugins

The only automagic dependency left is C++ availability detection.
Comment 56 Nirbheek Chauhan 2018-07-27 14:06:55 UTC
Everything committed. Some minor automagic left, but that can be dealt with on a case-by-case basis.