aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/interpreter/interpreter.py
AgeCommit message (Collapse)AuthorFilesLines
2021-10-30Added warning if run_command is called without the check kwargVolker Weißmann1-1/+9
2021-10-28configure_file: upgrade deprecation message to FeatureDeprecatedEli Schwartz1-2/+2
install: false was only available since 0.50, so we should not warn people who support older versions to use something they cannot. Fortunately, we can do FeatureDeprecated for this -- and then it even gets summarized. Unfortunately, it's not well used, and certainly isn't here.
2021-10-27fix various flake8 whitespace errorsEli Schwartz1-3/+3
2021-10-26message: Allow boolXavier Claessens1-2/+2
It has always been working even if not documented and there is no reason to not accept it. However, change "True/False" to "true/false" to be consistent with meson language. Fixes: #9436
2021-10-15wrap: move FeatureNew checks to a more natural placeEli Schwartz1-2/+2
Now, warnings are unconditionally raised when parsing the wrap file, whether they are used or not. That being said, these warnings literally just check for a couple of keys used in the .wrap ini file. Moving these checks from the time of use to the time of loading, means that we no longer report warnings only when originally downloading or extracting the file or VCS repo. It also means we no longer report warnings in one subproject, when a wrap file is picked up from a different subproject because the first subproject actually does a dependency lookup. This caused issues for the WrapDB tooling, which uses patch_directory everywhere and the superproject requires a suitable minimum version of meson for this... but individual wraps might use a much lower version, and would then raise a warning (in strict mode, converted to an error) when it resolved a dependency from another WrapDB project. Fixes #9118
2021-10-12interpreter: Fix missing holder entry (fixes #9389)Daniel Mensinger1-0/+2
2021-10-10Add --vsenv command line option and active VS only when neededXavier Claessens1-0/+10
2021-10-10Fix typos discovered by codespellChristian Clauss1-4/+4
2021-10-10Be more strict about target names with slashes.Jussi Pakkanen1-0/+8
2021-10-08Add support for module optionsXavier Claessens1-0/+1
2021-10-08add install_emptydir functionEli Schwartz1-0/+13
This replaces the absolute hack of using ``` install_subdir('nonexisting', install_dir: 'share') ``` which requires you to make sure you don't accidentally or deliberately have a completely different directory with the same name in your source tree that is full of files you don't want installed. It also avoids splitting the name in two and listing them in the wrong order. You can also set the install mode of each directory component by listing them one at a time in order, and in fact create nested structures at all. Fixes #1604 Properly fixes #2904
2021-10-06interpreter: Move RangeHolder out of interpreterbase to interpreterDaniel Mensinger1-3/+3
2021-10-06interpreter: Holderify arrays and dictsDaniel Mensinger1-0/+2
This is the final refactoring for extracting the bultin object logic out of Interpreterbase. I decided to do both arrays and dicts in one go since splitting it would have been a lot more confusing.
2021-10-04fix extra whitespaceEli Schwartz1-1/+0
discovered via flake8 --select E303
2021-10-04work around flake8 F811 for T.overload redefined functionsEli Schwartz1-2/+2
Since typing != T as far as flake8 is aware, give the linter an extra hint.
2021-10-04better error message for modules returning the wrong valueEli Schwartz1-1/+1
2021-09-30interpreter: move some of CustomTarget's args to type_checkingDylan Baker1-31/+13
As there are so many wrappers that need these as well
2021-09-30dependency: Allow searching for multiple namesXavier Claessens1-2/+4
2021-09-30interpreter: Use typed_kwargs for func_custom_targetDylan Baker1-13/+77
This does not convert the build side, or remove any of the checking it does. We still need that for other callers of custom target. What we'll do for those is add an internal interface that defaults things, then we'll be able to have those callers do their own validation, and the CustomTarget validation machinary can be removed. Fixes #9096
2021-09-30interpreter: Allow FileMode to be passed to _get_kwarg_install_modeDylan Baker1-0/+2
This will happen as we transition from doing the conversion in the function body to using the KwargInfo to make that change. If we get one just return it.
2021-09-30interpreter: move command kwarg to type_checkingDylan Baker1-8/+2
2021-09-30interpreter: move KwargInfo('depends') to type_checkingDylan Baker1-6/+2
2021-09-30interpreter: remove duplicate permittedKwargsDylan Baker1-2/+0
func_generator already has typed_kwargs, it doesn't need both.
2021-09-30interpreter: move DEPFILE_KW to type_checkingtDylan Baker1-1/+2
2021-09-30interpreter: use typed_kwargs on func_run_targetDylan Baker1-23/+24
2021-09-30Make custom_target() name argument optionalXavier Claessens1-3/+10
2021-09-26fix message function accepting bools and casting to stringEli Schwartz1-0/+2
This was allowed by accident despite what meson said would work, because in python a bool counts as a subclass of int.
2021-09-25interpreter: Introduce StringHolderDaniel Mensinger1-1/+3
Another commit in my quest to rid InterpreterBase from all higher level object processing logic. Additionally, there is a a logic change here, since `str.join` now uses varargs and can now accept more than one argument (and supports list flattening).
2021-09-24Merge pull request #9167 from dcbaker/submit/meson-main-type-checkingJussi Pakkanen1-5/+7
Add type annotations and type checking to meson main
2021-09-24Add option to to transpile Cython to C++Dylan Baker1-3/+8
This patch adds a new meson built-in option for cython, allowing it to target C++ instead of C as the intermediate language. This can, of course, be done on a per-target basis using the `override_options` keyword argument, or for the entire project in the project function. There are some things in this patch that are less than ideal. One of them is that we have to add compilers in the build layer, but there isn't a better place to do it because of per target override_options. There's also some design differences between Meson and setuptools, in that Meson only allows options on a per-target rather than a per-file granularity. Fixes #9015
2021-09-24build: use an object rather than a dict for the dep_manifestDylan Baker1-2/+1
This really is more of a struct than a dict, as the types are disjoint and they are internally handled, (ie, not from user input). This cleans some things up, in addition I spotted a bug in the ModuleState where the dict with the version and license is passed to a field that expects just the version string.
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-20dependencyfallbacks: Use default_options for implicit fallbacksXavier Claessens1-2/+2
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-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-01interpreter: Introduce BooleanHolder for the bool primitiveDaniel Mensinger1-1/+2
2021-09-01interpreter: Remove permissive from _unholderDaniel Mensinger1-2/+2
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 Mensinger1-0/+5
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-30interpreter: rename EnvironmentVariablesObject -> EnvironmentVariablesHolderDylan Baker1-1/+1
This is more consistent with other Holder classes
2021-08-30make EnvironmentVariablesObject a proper holderDylan Baker1-24/+19
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-30interpreter: move 'env' to type_checkingDylan Baker1-1/+2
2021-08-27interpreter: fix cases of `KwargInfo(..., T, default=None)`Dylan Baker1-11/+12
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 Baker1-1/+2
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 Partin1-4/+5
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