add a hidden environment variable to make Meson complain hard on deprecations

Useful for running the testsuite with this environment variable and
catching obscure issues. Just like with the encoding warning later down,
we have to do this inside meson itself, not externally injected.
pull/11215/head
Eli Schwartz 2 years ago
parent d573db77bc
commit 9aff189e31
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6
  1. 7
      mesonbuild/mesonmain.py

@ -235,6 +235,13 @@ def set_meson_command(mainfile):
mesonlib.set_meson_command(mainfile)
def run(original_args, mainfile):
if os.environ.get('MESON_SHOW_DEPRECATIONS'):
# workaround for https://bugs.python.org/issue34624
import warnings
for typ in [DeprecationWarning, SyntaxWarning, FutureWarning, PendingDeprecationWarning]:
warnings.filterwarnings('error', category=typ, module='mesonbuild')
warnings.filterwarnings('ignore', message=".*importlib-resources.*")
if sys.version_info >= (3, 10) and os.environ.get('MESON_RUNNING_IN_PROJECT_TESTS'):
# workaround for https://bugs.python.org/issue34624
import warnings

Loading…
Cancel
Save