aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/interpreter
AgeCommit message (Collapse)AuthorFilesLines
2021-09-24interpreter: Add a few missing type annotationsDylan Baker1-3/+6
Just enough to make interpreter/mesonmain happy
2021-09-21Use -Oz when optimization=s in ClangAndrea Pappacoda1-1/+1
-Oz is the appropriate flag to use when you want to produce the smallest possible binary, and is one would expect when setting optimization to s or using the minsize build type.
2021-09-20dependency: If cached version is outdated, look on system againXavier Claessens1-0/+4
Fixes: #9271
2021-09-20dependencyfallbacks: Use default_options for implicit fallbacksXavier Claessens2-14/+10
This removes the warning when using default_options without fallback kwarg completely because a subproject does not know if the main project has an implicit fallback or not, so it could set default_options even if not fallback is available at all. Fixes: #9278
2021-09-07interpreter: detect and pass compiler to be used for linker testsPaolo Bonzini1-0/+15
Allow using the links method to test that the C++ driver (e.g. g++) can be used to link C objects. One usecase is that the C compiler's libsanitizer might not be compatible with the one included by the C++ driver. This is theoretically backwards-incompatible, but it should be treated as a bugfix in my opinion. There is no way in Meson to compile a .c file with the C++ driver as part of a build target, therefore there would be no reason to do something like meson.get_compiler(meson.get_compiler('cpp').links(files('main.c')). Fixes: #7703
2021-09-06mintro: add installed_planFilipe Laíns1-5/+16
Signed-off-by: Filipe Laíns <lains@riseup.net>
2021-09-02interpreter: Add summary of all user defined optionsXavier Claessens1-12/+14
It is a commonly needed information to help debugging build issues. We already were printing options with non-default value at the end of the configure but outside of the summary. Keeping the list of user defined options in the interpreter will also in the future be useful to use new default value on reconfigure.
2021-09-01dependency: fallback and allow_fallback are mutually exclusiveXavier Claessens1-0/+2
That used to abort in previous Meson versions but 0.59 stopped forbidding that by mistake.
2021-09-01interpreter: Introduce BooleanHolder for the bool primitiveDaniel Mensinger4-1/+59
2021-09-01interpreter: Remove permissive from _unholderDaniel Mensinger2-5/+5
2021-08-31interpreter: use python dunders instead of lock for unpicklabilityDylan Baker1-2/+4
This simplifies things for us, as we don't have to have threading imported for no other reason, and we can remove the `an_unpicklable_object` from the Interpreter and mesonlib, since there was only one user of this.
2021-08-31interpreter: Add IntegerHolderDaniel Mensinger4-0/+123
2021-08-31pylint: turn on superflous-parensDylan Baker1-2/+2
We have a lot of these. Some of them are harmless, if unidiomatic, such as `if (condition)`, others are potentially dangerous `assert(...)`, as `assert(condtion)` works as expected, but `assert(condition, message)` will result in an assertion that never triggers, as what you're actually asserting is `bool(tuple[2])`, which will always be true.
2021-08-31pylint: enable unnecessary-not checkDylan Baker1-1/+1
This finds things like ```python if not x == 1: ``` which should be ```python if x != 1: ```
2021-08-30interpreter: rename EnvironmentVariablesObject -> EnvironmentVariablesHolderDylan Baker2-4/+4
This is more consistent with other Holder classes
2021-08-30interpreterobjects: Use typed_kwargs for EnvironmentVariablesObjectDylan Baker1-24/+19
2021-08-30make EnvironmentVariablesObject a proper holderDylan Baker4-63/+42
Currently, EnvironmentVariablesObject is a strange holder-that's-not-a-holder. This has implicaitons for things that expect to get an EnvironmentVariables object, as we can't automatically unholder it, and instead have to to manually do so. Now we can automatically unholder it, which makes everything much nicer.
2021-08-30Allow EnvironmentVariablesObject to be passed an EnvironmentVariables instanceDylan Baker1-1/+3
2021-08-30interperter/kwargs: narrow type checkingDylan Baker1-1/+1
Since the convertor has been added env, we are now only going to be an EnvironmentVariables object, nothing else.
2021-08-30interpreter/type_checking: Add convertor to env keyword argumentDylan Baker1-3/+16
This does the conversion to an EnvironmentVariables, so that the receiver always gets a EnvironmentVariables object and not a list, dict, or string
2021-08-30interpreter/type_checking: add a validator to envDylan Baker1-2/+34
Let's start moving the validation out of the interpreter object
2021-08-30interpreter: move 'env' to type_checkingDylan Baker2-1/+8
2021-08-30Simplify condition in can_run_host_binaries()Xavier Claessens1-7/+6
2021-08-28Try to fix NoneTypeDylan Baker1-1/+1
Because mypy doesn't like the type alias.
2021-08-27interpreter: fix cases of `KwargInfo(..., T, default=None)`Dylan Baker5-23/+33
The correct way to mark these is `KwargInfo(..., (T, type(None)))`. There's also a few cases of `(T, None)` which is invalid, as `None` isn't a type
2021-08-27interpreter: fix name of typed_kwargs for `test()`Dylan Baker1-1/+1
There was a copy-n-paste error here, and it was benchmark instead.
2021-08-27interpreter: Add a helper for checking constrained inputsDylan Baker3-3/+15
This is quite valuable for enum-like inputs, where only a certain set of values is allowed.
2021-08-27interpreter: fix IndexError when specifying dependency 'include_type'Rihards Skuja1-1/+1
Exception is thrown when dependency name is empty and when its 'include_type' differs from the default one. Regression from b6d754a40c.
2021-08-26Add typed_kwargs to add_languages()Tristan Partin2-4/+9
2021-08-23interpreter: Fix dependency(..., static: true) fallbackXavier Claessens2-10/+59
It should build the fallback subprject with default_library=static and override the dependency for both static=True and static kwarg not given. Fixes: #8050.
2021-08-22Fix incomplete guidance on solving sandbox violationsEli Schwartz1-0/+4
We recommend people use declare_dependency and access it via dependency() in a parent project. But this requires a wrap file (or to use override_dependency and an explicit subproject call). Let's actually mention that. Fixes #9146
2021-08-20interpreterobjects: fix Test annotationsDylan Baker1-3/+6
2021-08-19Merge pull request #9126 from dcbaker/submit/rust-use-full-typingJussi Pakkanen1-0/+3
Fully type check rust.bindgen
2021-08-17Add install tagsXavier Claessens2-15/+24
Fixes: #7007.
2021-08-16interpreter/compiler: make helper methods protectedDylan Baker1-29/+29
2021-08-16interpreter/compiler: Add type checking for the Compiler objectDylan Baker1-394/+347
This adds a full set of `typed_pos_args` and `typed_kwarg` decorations, as well as fixing all of the typing errors reported by mypy.
2021-08-16interpreter/compiler: Add type annotations to TryRunResultHolderDylan Baker1-4/+4
2021-08-16interpreter/compiler: remove unittest_args methodDylan Baker1-16/+3
It's not documented, and it's been marked deprecated for who knows how long.
2021-08-16interpreter/compiler: Replace permittedKwargs({}) with noKwargsDylan Baker1-19/+19
The former isn't really correct, as it wants a set and is getting a dict, the other is also conceptually clearer I think.
2021-08-16interpreterobjects: Add TypedDict annoations for `extract_search_dirs`Dylan Baker2-1/+11
This allows for more accurate type checking
2021-08-16interpreter: fix `source_strings_to_files` annotationsDylan Baker1-0/+3
It's missing a required overload declaration
2021-08-16Add unset_variable()Tristan Partin1-0/+11
This should be useful for helping to control variable scope within Meson. CMake has something similar for controlling scope.
2021-08-16interpreter: Fix holder_map not being updated when subproject failsXavier Claessens1-6/+5
Fixes: #9038
2021-08-15Revert "interpreter: Fix holder_map not being updated when subproject fails"Jussi Pakkanen1-5/+6
This reverts commit 566383c727219fc20cf1c90c0fe7dae4bcac5c96.
2021-08-09interpreter: Fix spurious warning in configure_data()Xavier Claessens1-2/+2
This is a regression when porting to typed_pos_args().
2021-08-09interpreter: Fix missing subsubproject summary when subproject failsXavier Claessens1-3/+4
In the case main->subp->subsubp, if subsubp succeed to configure but subp subsequentially fails, subsubp is still being built but its summary was missing.
2021-08-09interpreter: Fix holder_map not being updated when subproject failsXavier Claessens1-12/+8
Fixes: #9038
2021-08-07Fix --force-fallack-for with --wrap-mode=nofallbackXavier Claessens1-4/+4
Fixes: #9065
2021-08-06fix spelling error in user output ("depencency" -> "dependency")Felix Schwarz1-2/+2
2021-08-04interpreterbase/decorators: use a named function for lowering stringsDylan Baker1-1/+9
Mypy gets confused by the lambda, so we might as well just use a named function.