Age | Commit message (Collapse) | Author | Files | Lines |
|
|
|
performed by running "pyupgrade --py36-plus" and committing the results
|
|
This patches takes the options work to it's logical conclusion: A single
flat dictionary of OptionKey: UserOptions. This allows us to simplify a
large number of cases, as we don't need to check if an option is in this
dict or that one (or any of 5 or 6, actually).
|
|
There's starting to be a lot of things including coredata that coredata
needs to itself include. putting it in mesonlib makes more sense
|
|
|
|
|
|
It is much easier to not try to parse options into complicated
structures until we actually collected all options: machine files,
command line, project()'s default_options, environment.
|
|
|
|
When we add type annotations to this in compilers this will break,
unless we've already filtered out the non-string arguments.
|
|
typing: Strict type annotations
|
|
Handle add_languages(native:) in introspector
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Something like {a: foo} currently stymies the IntrospectionInterpreter and
breaks introspection of the source directory. The fix is just to walk the keys
and return a dummy dictionary.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Factor out an _add_languages() function in introspector, rather than
calling func_add_languages() with arguments crafted to fake an
interpreter call.
|
|
This creates a full set of option in environment that mirror those in
coredata, this mirroring of the coredata structure is convenient because
lookups int env (such as when initializing compilers) becomes a straight
dict lookup, with no list iteration. It also means that all of the
command line and machine files are read and stored in the correct order
before they're ever accessed, simplifying the logic of using them.
|
|
|
|
|
|
|
|
Mesonlib type annotations
|
|
|
|
Fixes: #6748
|
|
|
|
|
|
|
|
|
|
|
|
This commit annotates most of interpreterbase.py. However,
there are stil the @wraps missing, since I am unsure what
the types are supposed to be here.
|
|
|
|
|
|
This also fixes that the keys in ArgumentNode.kwargs are
all of the type BaseNode now. Before this commit, it was
possible that both strings and Nodes where used as keys.
|
|
Warnings have a location node object (with subdir and lineno
attributes), which is passed as a location: kwarg to mlog.warning() and
formatted in _log_error().
Re-purpose the subdir attribute (path relative to the source root dir,
with an implied filename of 'meson.build'), which is stored into the
node by parser(), to contain a pathname.
(Properly I should rename 'subdir' -> 'file' everywhere, but that's a
lot of churn just to see if this works)
Notes:
The warning location node may also have a colno attribute, which is
currently ignored by _log_error().
We can't currently issue warnings with locations in meson_options.txt
because the filename isn't part of the location (as it's assumed to be
'meson.build).
|
|
A MesonException has file, lineno and colno attributes, which get
formatted as a location in mlog.exception().
The file attribute got changed from a path relative to the root source
directory to a pathname (absolute or relative to cwd) in one place in
commit b8fbbf59. Adjust all the other places the file attribute is set
to match.
Also:
Setting MesonException.file seems to be missing in the case where Parser
returned a non-CodeBlockNode object. Fortunately, that looks like it's
unreachable, but add it just in case.
|
|
|
|
Based on patch from Dylan Baker.
Fixes #757
|
|
|
|
|
|
- Typos were found by codespell v1.16.0
|
|
|
|
This is useful if one needs to check if a variable is a disabler.
Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
|
|
|
|
Add alias_target() function
|
|
|
|
|
|
In most cases instead pass `for_machine`, the name of the relevant
machines (what compilers target, what targets run on, etc). This allows
us to use the cross code path in the native case, deduplicating the
code.
As one can see, environment got bigger as more information is kept
structured there, while ninjabackend got a smaller. Overall a few amount
of lines were added, but the hope is what's added is a lot simpler than
what's removed.
|