Commit Graph

165 Commits

Author SHA1 Message Date
Xavier Claessens 06d12064d0 OptionOverrideProxy: Make it immutable to avoid copies
It is always used as an immutable view so there is no point in doing
copies. However, mypy insist it must implement the same APIs as
Dict[OptionKey, UserOption[Any]] so keep faking it.
2022-03-22 17:20:48 -04:00
Jussi Pakkanen ade6e3a19e
Merge pull request #10043 from dcbaker/submit/type-checking-for-subproject
Add typing for subproject()
2022-03-07 16:43:44 +02:00
Xavier Claessens 01e92dc543 Fix default install tag for shared lib symlinks
Versioned shared libraries should have .so file in devel, .so.1 and
.so.1.2.3 in runtime.

Fixes: #9811
2022-03-07 09:27:02 -05:00
Dylan Baker 3e90f27703 interpreter: replace build_def_files with OrderedSet
We do a bunch of backbending to make sure we don't have duplicates,
let's just use the right datastructure to begin with.
2022-03-03 10:29:14 -08:00
Paolo Bonzini 5e96730d7d introspect: include choices for array options
There was even a test covering this, but it did not fail due to a typo.
2021-10-14 09:04:25 -04:00
Eli Schwartz c94d6acc49
remove printf debugging
Why did this dumb thing of mine ever get committed???
2021-10-04 18:37:03 -04:00
Eli Schwartz 47ae0b82f0
use list unpacking to simplify for loop references 2021-10-04 16:29:31 -04:00
Filipe Laíns af8b55d49b mintro: add installed_plan
Signed-off-by: Filipe Laíns <lains@riseup.net>
2021-09-06 18:10:55 +02:00
Daniel Mensinger 3e396b3782
fix: Always explicitly set encoding for text files (fixes #8263) 2021-06-29 11:28:08 +02:00
Eli Schwartz 6a0fabc647
mass rewrite of string formatting to use f-strings everywhere
performed by running "pyupgrade --py36-plus" and committing the results
2021-03-04 17:16:11 -05:00
Eli Schwartz 4340bf34fa
various python neatness cleanups
All changes were created by running

"pyupgrade --py3-only --keep-percent-format"

and committing the results. I have not touched string formatting for
now.

- use set literals
- simplify .format() parameter naming
- remove __future__
- remove default "r" mode for open()
- use OSError rather than compatibility aliases
- remove stray parentheses in function(generator) scopes
2021-03-04 17:11:26 -05:00
Paolo Bonzini be0a05e777 mintro: include the correct target filenames for flat layout
Fixes: #8408
2021-03-04 17:36:41 +01:00
Paolo Bonzini 675bb2f340 mintro: fix flake8 issues 2021-03-04 17:36:41 +01:00
Xavier Claessens 2fabd4c7dc minstall: Add --skip-subprojects option
By default all subprojects are installed. If --skip-subprojects is given
with no value only the main project is installed. If --skip-subprojects
is given with a value, it should be a coma separated list of subprojects
to skip and all others will be installed.

Fixes: #2550.
2021-02-22 23:03:55 +02:00
Dylan Baker f14bf8b2ed mintro: fix mypy warning
The output of list_targets is a pretty horrific jumble of things. We
really need a TypeDict to make this not so terrible we can't deal with
it, so for now just use Any.
2021-01-04 12:20:59 -08:00
Dylan Baker a539fda0cf fix LGTM warnings 2021-01-04 12:20:59 -08:00
Dylan Baker e81acbd606 Use a single coredata dictionary for options
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).
2021-01-04 12:20:58 -08:00
Dylan Baker 71db6b04a3 use OptionKey for builtin and base options
I would have prefered to do these seperatately, but they are combined in
some cases, so it was much easier to convert them together.

this eliminates the builtins_per_machine dict, as it's duplicated with
the OptionKey's machine parameter.
2021-01-04 12:20:40 -08:00
Dylan Baker fe973d9fc4 use OptionKey for compiler_options 2021-01-04 12:20:39 -08:00
Dylan Baker 7142c92285 use OptionKey for backend_options 2021-01-04 12:15:41 -08:00
Dylan Baker e2ef6930ff use OptionKey for coredata.user_options 2021-01-04 12:15:41 -08:00
Paolo Bonzini 879e9d19f5 mintro: export functions to load the meson-info files
With the next patch, "meson test" will be using the targets introspection
information.  Provide helper functions to share bits of code between
mintro.py and mtest.py.
2020-12-14 10:42:32 +01:00
Dylan Baker f6672c7a19 use real pathlib module
We added the _pathlib module to work around defeciencies in python 3.5's
implementation, since we now rely on 3.6 lets drop this
2020-11-20 15:08:40 -08:00
Daniel Mensinger 7c377e5a5d intro: Add extra_files key to intro output (fixes #7310) 2020-10-15 01:56:59 +03:00
Daniel Mensinger 1dfaccfd91 pathlib: Fix resolve() by overriding it in Python 3.5 2020-10-04 10:45:48 +02:00
Dylan Baker 6d173f9678 mesonlib: make OptionOverrideProxy a true MutableMapping
So that we can actually use it anyplace that an OptionDictType could be
used. I've also done a bit optimizing/simplifying of the implementation.
This is needed for cuda, as it returns an OptionOverrideProxy where we
ask for an OptionDicType
2020-10-01 15:05:00 -07:00
Daniel Mensinger e681235e5f
typing: fix code review 2020-09-08 20:15:58 +02:00
Daniel Mensinger 23818fc5a3
typing: more fixes 2020-09-08 20:15:58 +02:00
Daniel Mensinger 0490372449
typing: fully annotate mintro and mtest 2020-09-08 20:15:57 +02:00
Paolo Bonzini fa5c2363eb introspect: add test dependencies info to test/benchmark JSON
Add the ids of any target that needs to be rebuilt before running the
tests as computed by the backend, to the introspection data for tests and benchmarks.
This also includes anything that appears on the test's command line.

Without this information, IDEs must update the entire build before running
any test.  They can now instead selectively build the test executable
itself and anything that is needed to run it.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-09-04 14:45:20 +02:00
Dylan Baker af763e093a mconf/mintro: use authoritative list of options from coredata
This splits the directory options and non-directory options into two
dicts, and then merges them later to maintain API.
2020-08-01 22:00:06 -07:00
TheQwertiest 365b667dc5 mintro: typings again x2
Co-authored-by: Dylan Baker <dylan@pnwbakers.com>
2020-06-12 10:45:30 -07:00
TheQwertiest a8256e4900 mintro: more typing shenanigans 2020-06-12 10:45:30 -07:00
TheQwertiest b71e73fc64 mintro: typing fix 2020-06-12 10:45:30 -07:00
TheQwertiest a43e770071 mintro: typing fix 2020-06-12 10:45:30 -07:00
TheQwertiest f1288ac7ec mintro: enforced order for subcommands 2020-06-12 10:45:30 -07:00
TheQwertiest 2fe4c60ae3 Made --help options sorted 2020-06-09 13:57:44 -07:00
Daniel Mensinger 96eeef62ea
ast: Add AST JSON printer 2020-05-23 18:13:16 +02:00
Dylan Baker 28e3ce67ae Convert test protocol into an enum
This gives us better type safety, and will be important as we add more
test methods
2020-04-30 13:54:46 -07:00
John Ericson 278c294aa4 Compiler options per lang
A current rather untyped storage of options is one of the things that
contributes to the options code being so complex. This takes a small
step in synching down by storing the compiler options in dicts per
language.

Future work might be replacing the langauge strings with an enum, and
defaultdict with a custom struct, just like `PerMachine` and
`MachineChoice`.
2020-04-20 23:23:15 +03:00
Daniel Mensinger 4ce90bcb08 intro: List symlinks in installdata (fixes #6734) 2020-03-08 13:49:53 +02:00
Daniel Mensinger c14aea2812
types: Annotate mparser.py
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.
2020-03-02 10:34:55 +01:00
Xavier Claessens 3ba0073df6 Make 'default_library' per-subproject builtin option
Currently it's just like if all builtin/base/compiler options are
yielding. This patch makes possible to have non-yielding builtin
options. The value in is overriden in this order:
 - Value from parent project
 - Value from subproject's default_options if set
 - Value from subproject() default_options if set
 - Value from command line if set
2020-02-06 14:11:24 -05:00
Daniel Mensinger d0c7b51693 mintro: use interpreter data for buildsystem-files (fixes #6390) 2020-01-28 21:18:25 +02:00
Daniel Mensinger 09b53c534f types: import typing as T (fixes #6333) 2020-01-08 15:28:17 +01:00
Paolo Bonzini 3778a34979 mintro: include test protocol in introspection data 2019-12-13 00:47:10 +02:00
Daniel Mensinger fc800a2cb8 mintro: Add version key to --scan-dependencies (fixes #6287) 2019-12-10 20:17:21 +02:00
Daniel Mensinger 7065a697e3 types: Add type annotations to mintro.py 2019-12-07 21:34:30 +02:00
Daniel Mensinger e4a0ee205d lgtm: Fix redundant code 2019-12-05 00:22:10 +02:00
Daniel Mensinger c361181cd9
mintro: dependencies: added version key 2019-11-14 18:16:47 +01:00