aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
AgeCommit message (Collapse)AuthorFilesLines
2022-01-18modules/gnome: fix _make_typelib_target typesDylan Baker1-3/+4
2022-01-18modules/gnome: Fix typing with _get_dependencies_flags andDylan Baker1-17/+25
_get_gir_target_deps The typing issues with these are tightly intertwined, so it didn't really make sense to solve them independently
2022-01-18build: Fix return types of a couple of methodsDylan Baker2-3/+3
These don't return `Target`, they return `BuildTarget | CustomTarget | CustomTargetIndex`
2022-01-18modules/gnome: fix issues with _make_gir_targetDylan Baker1-5/+13
2022-01-18modules/gnome: fix declared type of listDylan Baker1-1/+1
2022-01-18modules/gnome: use T.Sequence instead of T.ListDylan Baker1-2/+3
Which is pretty much necessary to make anything involving unions of lists work
2022-01-18modules/gnome: use itertools.chain instead of list concatenationDylan Baker1-1/+2
This is better as it avoids building unnecessary lists, and two fixes the typing issue from concatenating lists of different types.
2022-01-18dependencies: fix libraries and whole_libraries typesDylan Baker1-4/+5
gnome points out that CustomTargets can be linked with, so we should allow that.
2022-01-18modules/gnome: ignore the return type of _get_depDylan Baker1-2/+5
This is hard to fix, and it's really doing something bad anyway. But we know it's right, so just tell mypy to not worry about it.
2022-01-18modules/gnome: fix type annotations and issues with ↵Dylan Baker1-5/+9
_gather_typelib_includes_and_update_depends There is the problem of the annotations themselves, then there is the problem with depends being mutated. The mutation side effect is a problem in itself, but there's also the problem that we really want to use Sequence, which isn't mutable.
2022-01-18modules/gnome: define and annotate all instance variables in the initializerDylan Baker1-3/+5
2022-01-18build: Fix annotations to RunTarget and AliasTargetDylan Baker1-2/+2
RunTargets and AliasTargets may depend on RunTargets, so annotate them that way. The Gnome module relies on this internally.
2022-01-18interpreterobjects: deprecated passing a number to configuration_data.set10Dylan Baker1-0/+8
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-18interpreterobjects: remove no-flattening from configuraiton_data.getDylan Baker1-1/+0
It's no longer required because we don't allow arrays as fallbacks anymore.
2022-01-18interpreterobjects: don't allow keyword arguments in configuration_data.keysDylan Baker1-0/+1
Which do nothing, and shouldn't be allowed.
2022-01-18interpreter: replace ConfigurationDataObject with ConfigurationDataHolderDylan Baker6-50/+55
This is much cleaner, and more in line with the way we handle interpreter objects in modern meson practice
2022-01-18build: move configuration_data initial value handling to build.ConfigurationDataDylan Baker1-9/+8
It really belongs here, not in the interpreter
2022-01-18interpreterobjects: clean up ConfigurationData initializerDylan Baker1-4/+2
2022-01-18interpreterobjects: use typed_* for configuration_data.set*Dylan Baker2-43/+28
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-18interpreterobjects: use typed_* with configuration_data.merge_fromDylan Baker1-7/+5
2022-01-18interpreterobjects: use typed_* with configuration_data.get_unquotedDylan Baker1-7/+5
2022-01-18interpreterobjects: use typed_args for configuration_data.getDylan Baker1-12/+6
2022-01-18interpreterobjects: use typed_pos_args and noKwargs for configuration.data.hasDylan Baker1-1/+3
2022-01-18interpreterobjects: use typed_kwargs for dependency.get_variableDylan Baker2-8/+31
2022-01-18interpreterobjects: use typed_kwargs for dependency.get_pkgconfig_variableDylan Baker2-2/+18
2022-01-18dependencies: don't pass kwargs from get_pkgconfig_variableDylan Baker6-30/+25
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-18interpreterobjects: use typed_kwargs for FeatureOption.requireDylan Baker2-10/+14
2022-01-18interpreterobjects: use typed_pos_args for FeatureOpotionDylan Baker1-10/+4
2022-01-18interpreterobjects: use typed_pos_args for dependency.as_system_methodDylan Baker1-11/+3
2022-01-18interpreterobjects: use typed_pos_args for dependency.get_configtool_variableDylan Baker1-8/+3
2022-01-18interpreterobjects: use typed_pos_args for dependency.get_pkgconfig_variableDylan Baker1-8/+3
2022-01-18interpreterobjects: consistently use dependency. for error messagesDylan Baker1-16/+16
We currently use a mixture of dependency, Dependency, and dep
2022-01-18wraps: implement exponential backoff for downloading filesEli Schwartz1-1/+12
Implementation modeled after mesonlib.windows_proof_rmtree(). Implements the other half of #9688
2022-01-18wraps: on failure to apply a patch, delete the subproject directoryEli Schwartz1-2/+6
This code path is only called on initial download of a subproject, but if we raise an error and abort while downloading/applying a patch overlay we still have the upstream sources extracted... which appears to be a subproject, then turns out to be broken due to missing meson.build Partially implements #9688
2022-01-16Add a test for the --vsenv meson setup optionNirbheek Chauhan1-9/+10
The tests and the unittests both unconditionally call setup_vsenv() because all tests are run using the backend commands directly: ninja, msbuild, etc. There's no way to undo this vs env setup, so the only way to test that --vsenv works is by: 1. Removing all paths in PATH that provide ninja 2. Changing setup_vsenv(force=True) to forcibly set-up a new vsenv when MESON_FORCE_VSENV_FOR_UNITTEST is set 3. Mock-patching build_command, test_command, install_command to use `meson` instead of `ninja` 4. Asserting that 'Activating VS' is in the output for all commands 5. Ensure that compilation works because ninja is picked up from the vs env. I manually checked that this test actually does fail when the previous commit is reverted.
2022-01-16install: Setup VS env if we did that during setupNirbheek Chauhan1-1/+4
Otherwise we might not find a ninja that was picked up from the Visual Studio installation. ``` $ meson setup _build ... Activating VS 15.9.40 ... Found ninja-1.8.2 at "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja\ninja.EXE" $ meson compile -C _build Activating VS 15.9.40 ... $ meson install -C _build Can't find ninja, can't rebuild test. ``` Fixes https://github.com/mesonbuild/meson/issues/9774
2022-01-15gnome.genmarshal: restore the ability to pass sources as Files objectsEli Schwartz1-2/+2
It used to support: - a single string - an array of anything And as long as CustomTarget supported it too, everything worked fine. So, a `files('foo')` worked but a `files('foo')[0]` did not, which is silly... and it's not exactly terrible to use files() here, the input is literally a list of source files. Fixes building gnome-terminal Fixes #9827 Test updated by Nirbheek Chauhan <nirbheek@centricular.com>
2022-01-15Fix system include arguments for clang-clGatgat1-0/+4
2022-01-12gome.gdbus_codegen: fix annotations argument for multiple annotations, harderEli Schwartz1-6/+27
The original attempted fix only allowed configuration to succeed, but not building. It was modeled based on the gdbus-codegen documentation, which states: --annotate WHAT KEY VALUE WHAT KEY VALUE WHAT KEY VALUE Add annotation (may be used several times) which clearly indicates that gdbus-codegen accepts an --annotate flag that is followed by a multiple of 3 values, despite this not actually working. The manpage actually contradicts the --help text: --annotate ELEMENT KEY VALUE Used to inject D-Bus annotations into the given XML files. [] ... and gives examples that use multiple --annotate flags each with 3 arguments. To better understand what meson is supposed to do here, we should look at ef52e60936665c982cd17a4a17c2045b445d8e6d, which ported to typed_kwargs. There is actually a big chunk of code to handle annotations that got completely dropped, leading with a comment (that did not get dropped): "they are a list of lists of strings..." Reimplement this logic inside a validator/converter for the annotations kwarg container: - do not listify, we don't accept `annotations: ''` and listify is supposed to be for when either x or list[x] is valid - go back to checking for a list of exactly 3 values - allow a list of the aforementioned, in the traditionally expected form: [ ['foo1', 'foo2', 'foo3'], ['bar1', 'bar2', 'bar3'], ] - pass one --annotate flag per 3-value-list And add some better error reporting for the cause of errors when processing lists of lists.
2022-01-13Search for Visual Studio Express when activating VS envDFOVIT1-0/+4
Visual Studio Express does not come with the 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64' workload. This adds a check for the 'Microsoft.VisualStudio.Workload.WDExpress' workload. Non-express versions take precedence over express versions when activating.
2022-01-12subproject: fix version validation on lookupØyvind Aarrestad Aakre1-0/+5
Fixes a bug where the subproject version was not validated when the subproject had already been processed. The bug would cause inconsistent build results if the subproject was referenced more than once (diamond) with conflicting version requirements.
2022-01-12ninja backend: Fix custom_target() console: kwarg when using envDeclan Qian1-1/+2
When a custom_target() uses an env, meson uses a wrapper script to run the executable. This breaks the console: kwarg because the wrapper script buffers the output. Fix it by setting the verbose flag which will not buffer output.
2022-01-11fix typo in error messageEli Schwartz1-1/+1
2022-01-11gnome.gdbus_codegen: allow File objects as XML fileEli Schwartz1-2/+2
As soon as we check for args[1] we declare it is of type FileOrString, and the additional ones specified in the `sources` kwarg explicitly allow this. It makes no sense to not accept it as the posarg too. Fixes building tracker-miners.
2022-01-11gnome.gtkdoc: fix passing file arguments as a configured fileEli Schwartz1-6/+6
Fixes gtk3 build, which uses typesfile. All these arguments are processed by a function that explicitly handles both str and File, and converts them to absolute paths. They clearly need to handle File objects.
2022-01-11gome.gdbus_codegen: fix annotations argument for multiple annotationsEli Schwartz1-1/+1
Per the gdbus-codegen documentation, this "may be used several times", and it is: - a valid use case - used that way in the wild Fixes building at least geoclue2, gdm.
2022-01-10fix broken module tests which caused gtkdoc-check to traceback on assertEli Schwartz1-1/+4
Regression in commit 566c2c9a9c98d13f85ccef624e9ac584f64c6a4a. The interpreter details are a bit of black magic. Functions expect tuples, but they receive lists and then the type-checking decorators convert those to tuples. So, directly manhandling a self._interpreter.func_*() but passing it the tuple it nominally expected, actually explodes in your face by way of failing an assert, then dumping 'ERROR: Unhandled python exception'. Fixes use of gnome.gtkdoc(..., check: true), for example when building glib.
2022-01-10depfile: type annotateDylan Baker1-15/+20
2022-01-10first pass at migrating to dataclassesEli Schwartz7-281/+259
In some cases, init variables that accept None as a sentinel and immediately overwrite with [], are migrated to dataclass field factories. \o/ Note: dataclasses by default cannot provide eq methods, as they then become unhashable. In the future we may wish to opt into declaring them frozen, instead/additionally.
2022-01-10manually clean up some python 3.6 era codeEli Schwartz1-7/+3