Commit Graph

76 Commits

Author SHA1 Message Date
Eli Schwartz 6c79e97eae
add some forgotten FeatureNew annotations
Forgotten in #8512.
2022-02-09 21:44:46 -05:00
Paolo Bonzini fc661c35a2 interpreter: support for forcibly verbose logging of some tests
Add a new keyword argument to test() and benchmark(), completing the
implementation of the feature.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-02-01 09:05:26 +01:00
Dylan Baker 4f40962a05 interpreterobjects: Don't warn on set10(bool)
Python inherited a really bad design from C, booleans happen to be ints.
Which is awful, but it's true.

Fixes: #9858
2022-01-23 17:21:53 -05:00
Dylan Baker 9c7ddf59fe interpreterobjects: deprecated passing a number to configuration_data.set10
This is currently allowed, and is used in at least a few projects. It
was not intended to work or documented, but it does and since it is in
use a full deprecation period must be used. A warning has also been
added for values < 0, which have surprising behavior.
2022-01-18 17:53:29 -05:00
Dylan Baker bf3fa728fa interpreterobjects: remove no-flattening from configuraiton_data.get
It's no longer required because we don't allow arrays as fallbacks
anymore.
2022-01-18 17:53:29 -05:00
Dylan Baker f16956a951 interpreterobjects: don't allow keyword arguments in configuration_data.keys
Which do nothing, and shouldn't be allowed.
2022-01-18 17:53:29 -05:00
Dylan Baker 5074e2d3b5 interpreter: replace ConfigurationDataObject with ConfigurationDataHolder
This is much cleaner, and more in line with the way we handle
interpreter objects in modern meson practice
2022-01-18 17:53:29 -05:00
Dylan Baker 5c979eb21f interpreterobjects: clean up ConfigurationData initializer 2022-01-18 17:53:29 -05:00
Dylan Baker 574525673f interpreterobjects: use typed_* for configuration_data.set*
This removes the ability to use ConfigurationData as a dict, but
restricting the inputs to `str | int | bool`. This may be a little too
soon for this, and we may want to wait on that part, it's only bee 8
months since we started warning about this.
2022-01-18 17:53:29 -05:00
Dylan Baker 7641bfd0ce interpreterobjects: use typed_* with configuration_data.merge_from 2022-01-18 17:53:29 -05:00
Dylan Baker f7cbe89a13 interpreterobjects: use typed_* with configuration_data.get_unquoted 2022-01-18 17:53:29 -05:00
Dylan Baker baa9ecb1c4 interpreterobjects: use typed_args for configuration_data.get 2022-01-18 17:53:29 -05:00
Dylan Baker 65558445ae interpreterobjects: use typed_pos_args and noKwargs for configuration.data.has 2022-01-18 17:53:29 -05:00
Dylan Baker 1ff2abcd9c interpreterobjects: use typed_kwargs for dependency.get_variable 2022-01-18 17:53:29 -05:00
Dylan Baker 1751dc4701 interpreterobjects: use typed_kwargs for dependency.get_pkgconfig_variable 2022-01-18 17:53:29 -05:00
Dylan Baker 6b272973e0 dependencies: don't pass kwargs from get_pkgconfig_variable
This is a layering violation, we're relying on the way the interpreter
handles keyword arguments. Instead, pass them as free variables,
destructuring in the interpreter
2022-01-18 17:53:29 -05:00
Dylan Baker ab9c0c1735 interpreterobjects: use typed_kwargs for FeatureOption.require 2022-01-18 17:53:29 -05:00
Dylan Baker 55055c3e0e interpreterobjects: use typed_pos_args for FeatureOpotion 2022-01-18 17:53:29 -05:00
Dylan Baker 6ad772cb37 interpreterobjects: use typed_pos_args for dependency.as_system_method 2022-01-18 17:53:29 -05:00
Dylan Baker 7537ec3299 interpreterobjects: use typed_pos_args for dependency.get_configtool_variable 2022-01-18 17:53:29 -05:00
Dylan Baker 0fa3436645 interpreterobjects: use typed_pos_args for dependency.get_pkgconfig_variable 2022-01-18 17:53:29 -05:00
Dylan Baker 482ab09a95 interpreterobjects: consistently use dependency. for error messages
We currently use a mixture of dependency, Dependency, and dep
2022-01-18 17:53:29 -05:00
Daniel Mensinger c5ce9744b2 Fix mypy errors 2021-12-17 14:00:28 -05:00
Paolo Bonzini 10329a1ebc interpreter: use build.GeneratedTypes
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-12-06 13:27:12 -08:00
Paolo Bonzini 901f444ea5 interpreter: allow extract_objects to receive generated sources
Fixes: #8333
2021-12-06 13:27:12 -08:00
Pablo Correa Gómez 4f882ff8ec add install_symlink function
Allows installing symlinks directly from meson, which can
become useful in multiple scenarios. Current main use is to
help moving forward #9557
2021-12-01 13:59:54 -05:00
Eli Schwartz 0ac2e4bb90
fix broken FeatureNew checks that never printed
They passed the arguments in the wrong order, so the version parsed as the
message and the message parsed as a version.

While we are at it, pass the location node in too.
2021-11-30 00:16:14 -05:00
Benoit Pierre 007c4659c2 interpreter: fix `feature.require` handling of error message
Don't show a blank error when no `error_message` was passed as argument.
2021-11-25 20:13:53 -05:00
Eli Schwartz 038b31e72b
various manual conversion of percent-formatted strings to f-strings 2021-11-01 20:26:18 -04:00
rusty-snake 85e92b5c4e Typo fixes (CustomTaget -> CustomTarget) 2021-10-30 14:29:17 -04:00
Christian Clauss a5020857f3 Fix typos discovered by codespell 2021-10-10 16:12:25 -04:00
Eli Schwartz 108bd996ee
add install_emptydir function
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-08 14:35:00 -04:00
Eli Schwartz 1bb2523e58
remove f from f-string that has no formatting 2021-10-04 16:29:31 -04:00
Daniel Mensinger 6b00c7dc81 Remove helpers.check_stringlist() 2021-09-25 12:44:11 +02:00
Daniel Mensinger 43a6b5bd5e interpreter: Remove permissive from _unholder 2021-09-01 19:17:01 +02:00
Dylan Baker 1fc3d8608d pylint: enable unnecessary-not check
This finds things like
```python
if not x == 1:
```
which should be
```python
if x != 1:
```
2021-08-31 16:28:54 -04:00
Dylan Baker 81f5cee218 interpreter: rename EnvironmentVariablesObject -> EnvironmentVariablesHolder
This is more consistent with other Holder classes
2021-08-30 18:05:02 -07:00
Dylan Baker 43f942be34 interpreterobjects: Use typed_kwargs for EnvironmentVariablesObject 2021-08-30 18:05:02 -07:00
Dylan Baker 3731e1d8f3 make EnvironmentVariablesObject a proper holder
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-30 18:05:02 -07:00
Dylan Baker d6a1f85248 Allow EnvironmentVariablesObject to be passed an EnvironmentVariables instance 2021-08-30 18:05:02 -07:00
Dylan Baker 11fbaf29d8 interpreter: fix cases of `KwargInfo(..., T, default=None)`
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-27 14:54:29 -07:00
Dylan Baker abababfb93 interpreterobjects: fix Test annotations 2021-08-20 18:57:19 +02:00
Dylan Baker a1fb3199c8 interpreterobjects: Add TypedDict annoations for `extract_search_dirs`
This allows for more accurate type checking
2021-08-16 16:21:51 -07:00
Eli Schwartz dd31891c1f more f-strings too complex to be caught by pyupgrade 2021-07-05 17:55:04 +03:00
Eli Schwartz c4f5f6364e pyupgrade 2021-07-05 17:55:04 +03:00
Tristan Partin 6f3f43bb2d Flatten test suite value
This behavior is more inline with the rest of Meson
2021-07-02 21:58:22 +03:00
Daniel Mensinger 971a0b1775 fix: get_variable default variables are not ObjectHolders (fixes #8936) 2021-07-02 17:14:44 +03:00
Daniel Mensinger 8f7343831b refactor: Refactor BothLibraries logic
This commit introduces a new type of `HoldableObject`: The
`SecondLevelHolder`. The primary purpose of this class is
to handle cases where two (or more) `HoldableObject`s are
stored at the same time (with one default object). The
best (and currently only) example here is the `BothLibraries`
class.
2021-06-26 12:49:35 +02:00
Daniel Mensinger 0c4dd81c4d
fix: Handling BothLibraries objects (fixes #8907) 2021-06-22 21:09:19 +02:00
Daniel Mensinger 5cd9f88d6c fix: Ensure that build targets have all methods from ExternalProgram
As a side-effect from #8885 `find_program()` returns now `Executable`
objects when `meson.override_find_program` is called with an
executable target. To resolve this conflict the missing methods
from `ExternalProgram` are added to `BuildTarget`.
2021-06-21 20:19:06 +03:00