Fix: configure.ac: silently accepting invalid Python configuration
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Thu, 27 Feb 2020 22:08:28 +0000 (17:08 -0500)
committerFrancis Deslauriers <francis.deslauriers@efficios.com>
Sat, 29 Feb 2020 23:30:48 +0000 (18:30 -0500)
commit38c609ff3f2dc76788cc9bf5fc8b32d3a3b692f6
treed88314f01d4fb540dac88e3417cb219d9e30cc8c
parent0f3224e9b4b9de7ccdca674038b6ed0f50cbe5b9
Fix: configure.ac: silently accepting invalid Python configuration

Currently, if the user builds and installs the project with:
  ./configure --enable-python-plugins
  make
  make install

They won't be able to do the `import bt2` necessary to start defining
their BT2 plugin. To write a Python plugin , the user needs to use the
Python bindings as well.

The user gets this:
  >>> import bt2
  Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
  ModuleNotFoundError: No module named 'bt2'

As suggested by Simon Marchi, I implemented the following truth table
for the Python-related configure options (--enable-python-bindings and
 --enable-python-plugins):

  plugins | bindings
  --------+---------
  missing | missing  -> both disabled
  missing | enable   -> plugins disabled, bindings enabled
  missing | disable  -> both disabled
  enable  | missing  -> both enabled
  enable  | enable   -> both enabled
  enable  | disable  -> error
  disable | missing  -> both disabled
  disable | enable   -> plugins disabled, bindings enabled
  disable | disable  -> both disabled

This makes sure the user doesn't get into an invalid configuration _and_
offers the sane default of enabling the bindings (if they were omitted)
when plugins are enabled explicitly.

Fixes #1240

Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Change-Id: I3b94d8911568290239add616f8e794ad73e278db
Reviewed-on: https://review.lttng.org/c/babeltrace/+/3152
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Michael Jeanson <mjeanson@efficios.com>
configure.ac
This page took 0.02454 seconds and 4 git commands to generate.