Module: Mesa
Branch: main
Commit: 22c1f4be8c16a60017bc6a740c488c77129989ae
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=22c1f4be8c16a60017bc6a740c488c77129989ae

Author: Eric Engestrom <[email protected]>
Date:   Wed Feb 22 16:00:35 2023 +0000

docs: mention `meson configure` and drop broken workaround script

The script is broken, and nobody noticed so it wasn't used much.

Meson has had support for printing the options by pointing to the source
dir for a while (not sure the exact version though) so I think we can
just recommend users do that.

Signed-off-by: Eric Engestrom <[email protected]>
Reviewed-by: Yonggang Luo <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21469>

---

 bin/meson-options.py | 63 ----------------------------------------------------
 docs/meson.rst       |  8 +++----
 2 files changed, 3 insertions(+), 68 deletions(-)

diff --git a/bin/meson-options.py b/bin/meson-options.py
deleted file mode 100755
index e22aef54b2f..00000000000
--- a/bin/meson-options.py
+++ /dev/null
@@ -1,63 +0,0 @@
-#!/usr/bin/env python3
-
-from os import get_terminal_size
-from textwrap import wrap
-from mesonbuild import coredata
-from mesonbuild import optinterpreter
-
-(COLUMNS, _) = get_terminal_size()
-
-def describe_option(option_name: str, option_default_value: str,
-                    option_type: str, option_message: str) -> None:
-    print('name:    ' + option_name)
-    print('default: ' + option_default_value)
-    print('type:    ' + option_type)
-    for line in wrap(option_message, width=COLUMNS - 9):
-        print('         ' + line)
-    print('---')
-
-oi = optinterpreter.OptionInterpreter('')
-oi.process('meson_options.txt')
-
-for (name, value) in oi.options.items():
-    if isinstance(value, coredata.UserStringOption):
-        describe_option(name,
-                        value.value,
-                        'string',
-                        "You can type what you want, but make sure it makes 
sense")
-    elif isinstance(value, coredata.UserBooleanOption):
-        describe_option(name,
-                        'true' if value.value else 'false',
-                        'boolean',
-                        "You can set it to 'true' or 'false'")
-    elif isinstance(value, coredata.UserIntegerOption):
-        describe_option(name,
-                        str(value.value),
-                        'integer',
-                        "You can set it to any integer value between '{}' and 
'{}'".format(value.min_value, value.max_value))
-    elif isinstance(value, coredata.UserUmaskOption):
-        describe_option(name,
-                        str(value.value),
-                        'umask',
-                        "You can set it to 'preserve' or a value between 
'0000' and '0777'")
-    elif isinstance(value, coredata.UserComboOption):
-        choices = '[' + ', '.join(["'" + v + "'" for v in value.choices]) + ']'
-        describe_option(name,
-                        value.value,
-                        'combo',
-                        "You can set it to any one of those values: " + 
choices)
-    elif isinstance(value, coredata.UserArrayOption):
-        choices = '[' + ', '.join(["'" + v + "'" for v in value.choices]) + ']'
-        value = '[' + ', '.join(["'" + v + "'" for v in value.value]) + ']'
-        describe_option(name,
-                        value,
-                        'array',
-                        "You can set it to one or more of those values: " + 
choices)
-    elif isinstance(value, coredata.UserFeatureOption):
-        describe_option(name,
-                        value.value,
-                        'feature',
-                        "You can set it to 'auto', 'enabled', or 'disabled'")
-    else:
-        print(name + ' is an option of a type unknown to this script')
-        print('---')
diff --git a/docs/meson.rst b/docs/meson.rst
index 82de602df6c..24343cfe251 100644
--- a/docs/meson.rst
+++ b/docs/meson.rst
@@ -105,11 +105,9 @@ To review the options which Meson chose, run:
 
    meson configure build/
 
-Meson does not currently support listing configuration options before
-running ``meson setup build/`` but this feature is being discussed upstream. 
For
-now, we have a ``bin/meson-options.py`` script that prints the options
-for you. If that script doesn't work for some reason, you can always
-look in the
+Recent version of Meson can print the available options and their
+default values by running ``meson configure`` in the source directory.
+If your Meson version is too old, you can always look in the
 `meson_options.txt 
<https://gitlab.freedesktop.org/mesa/mesa/-/blob/main/meson_options.txt>`__
 file at the root of the project.
 

Reply via email to