meson/mesonbuild/interpreter
Eli Schwartz 878c1604e6
handle meson_version even when the build file fails to parse
If the meson.build file is sufficiently "broken", even attempting to lex
and parse it will totally fail, and we error out without getting the
opportunity to evalaute the project() function. This can fairly easily
happen if we add new grammar to the syntax, which old versions of meson
cannot understand. Setting a minimum meson_version doesn't help, because
people with a too-old version of meson get parser errors instead of
advice about upgrading meson.

Examples of this include adding dict support to meson.

There are two general approaches to solving this issue, one of which
projects are empowered to do:

- refactor the project to place too-new syntax in a subdir() loaded
  build file, so the root file can be interpreted

- teach meson to catch errors in building the initial AST, and just load
  enough of the AST to check for meson_version advice

This implements the latter, allowing to future-proof the build
grammar.
2023-03-01 23:30:49 -05:00
..
primitives treewide: add future annotations import 2023-02-01 17:01:30 -05:00
__init__.py interpreter: replace ConfigurationDataObject with ConfigurationDataHolder 2022-01-18 17:53:29 -05:00
compiler.py Use caching in Compiler.sizeof() and Compiler.alignment() 2023-02-27 20:09:32 -05:00
dependencyfallbacks.py Get fallback varname from wrap file after it has been configured 2022-10-09 13:04:04 -04:00
interpreter.py handle meson_version even when the build file fails to parse 2023-03-01 23:30:49 -05:00
interpreterobjects.py interpreter: add FeatureOption.enable_if and .disable_if 2023-02-15 22:58:50 -05:00
kwargs.py treewide: add future annotations import 2023-02-01 17:01:30 -05:00
mesonmain.py interpreter/mesonmain: Add build_options method 2023-02-20 11:05:06 -05:00
type_checking.py micro-optimize: define typing-only objects in TYPE_CHECKING 2023-02-01 17:01:30 -05:00