| Age | Commit message (Collapse) | Author |
|
This has the "processed" keyword arguments that the interpreter is
supposed to create for us, or that we expect internal users to build by
build.
This requires some hacking around in the rust module for the moment
because we suddenly have a type.
|
|
Avoid different but equivalent code between ast and regular
interpreter, and avoid using coredata.set_options since
all options are known to be backend options.
Move to environment since it uses environment.options.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
UnknownValue
It is not the build layer's job to handle ast types, so instead filter
out UnknownValues before passing them to the build layer, then fix up
any special values we need in the ast layer. This reveals that some of
what we were previously doing only works because the build layer is
pretty much untyped, if it was typed it would have screamed loudly.
|
|
Fixes #14840
|
|
subproject
This is already done most of the time for default_library but not in these cases.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Change the semantics of IntrospectionBuildTarget.source_nodes
and IntrospectionBuildTarget.extra_files .
The rewriter and the static introspection tool used to be very broken,
now it is *less* broken, hence we add some tests in this commit.
Fixes #11763
|
|
`AstInterpreter.node_to_runtime_value` can now resolve function calls.
|
|
`resolve_node` is simply a half-broken, worse implementation of
`node_to_runtime_value` that we recently introduced.
In the example below, the static introspection tool/rewriter now
understands that the name of the executable is foo instead of bar:
```
var = 'foo'
name = var
var = 'bar'
executable(name, 'foo.c')
```
|
|
Without this commit, something like this crashes the static
introspection/rewrite tool:
```
default_options : ['warning_level='
+ run_command(['echo', '3']).stdout().strip()],
```
This commit does not reintroduce #14382.
|
|
Replace the variable tracking of `AstInterpreter.assignments`
with a slightly better variable tracking called
`AstInterpreter.cur_assignments`.
We now have a class `UnknownValue` for more explicit handling
of situations that are too complex/impossible.
|
|
|
|
To improve type-safety and readability we replace a
dictionary with a new class `IntrospectionDependency`.
|
|
To improve type-safety and readability we replace a
dictionary with a new class `IntrospectionBuildTarget`.
|
|
|
|
|
|
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Let add_compiler_options and process_compiler_options handle subprojects,
and also run it for the main project to ensure that pending_options are
properly processed.
This exposes a bug because "comp" could have been None, so fix that.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Allow OptionStringLikeDict to use non-string data types, and use it
as much as possible instead of string-valued dictionaries.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Do not go through string first and OptionKey second. Just pass the OptionKeys
down.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
This was only being used by the introspection interpreter, which meant
the two interpreters had different behavior. They still do, which is
really bad because the IntrospectionInterpreter doesn't have the command
line options or project_default_options. I have a plan to fix that
later, and I don't want to spend time on it here, as it's not a
regression of this patch, it's just the status quo.
This also fixes an issue caused by dead code being left, and hit, due to
the option refactor branch.
Fixes: #14382
|
|
|
|
subproject_dir, environment, and coredata
|
|
It is not used elsewhere
|
|
This is an old method, that is now just a wrapper around the OptionStore
method, that doesn't add any value. It's also an option related method
attached to the CoreData instead of the OptionStore, so useless and a
layering violation.
|
|
|
|
Even though the "targets" introspection info already includes the
command line arguments used to invoke the compiler, this is not
enough to correlated with the "compilers" introspection info and
get extra information from there.
Together with the existing "language" key, adding a "machine" key
is enough to identify completely an entry in the compilers info.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
The AstInterpreter does this check as well, so don't do it twice.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
A bare return at the end of a function doesn't do anything. And in the
case of a try/except, it's really just an elaborate "pass" anyway.
|
|
this will allow transforming string types in the formater
|
|
This can happen when a project's meson.options file is updated, and an
old option is removed.
|
|
|
|
These are all passed around interchangably inside Meson, so use a shared
protocol for them.
|
|
|
|
|
|
This replaces all of the Apache blurbs at the start of each file with an
`# SPDX-License-Identifier: Apache-2.0` string. It also fixes existing
uses to be consistent in capitalization, and to be placed above any
copyright notices.
This removes nearly 3000 lines of boilerplate from the project (only
python files), which no developer cares to look at.
SPDX is in common use, particularly in the Linux kernel, and is the
recommended format for Meson's own `project(license: )` field
|
|
|
|
Preserve whitespaces and comments in AST
|
|
The interpreter takes significant amount of time to initialize
everything in project() function. We only need to extract a string from
AST, just like we do in handle_meson_version_from_ast().
|
|
|
|
use separate Node for multiline strings
|
|
Performed using https://github.com/ilevkivskyi/com2ann
This has no actual effect on the codebase as type checkers (still)
support both and negligible effect on runtime performance since
__future__ annotations ameliorates that. Technically, the bytecode would
be bigger for non function-local annotations, of which we have many
either way.
So if it doesn't really matter, why do a large-scale refactor? Simple:
because people keep wanting to, but it's getting nickle-and-dimed. If
we're going to do this we might as well do it consistently in one shot,
using tooling that guarantees repeatability and correctness.
Repeat with:
```
com2ann mesonbuild/
```
|
|
These annotations all had a default initializer of the correct type, or
a parent class annotation.
|