aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
AgeCommit message (Collapse)AuthorFilesLines
2023-07-28modules/python: use typed_pos_args for extension_moduleDylan Baker1-5/+7
2023-07-28modules/python: typed_kwargs for subdirDylan Baker1-8/+9
We cannot re-use the existing KwargInfo, since we need to know if the keyword was set explicitly or not, since it conflicts with `install_dir`
2023-07-28modules/python: use the SHARED_MOD_KWS for extension methodDylan Baker1-3/+10
2023-07-26Fix install_data() default install pathDaniele Nicolodi3-14/+18
This fixes two issues in constructing the default installation path when install_dir is not specified: - inside a subproject, install_data() would construct the destination path using the parent project name instead than the current project name, - when specifying preserve_path, install_data() would construct the destination path omitting the project name. Fixes #11910.
2023-07-26interpreter: Remove redundant commentDaniele Nicolodi1-1/+0
The function name adheres to the pattern used by many other Meson DSL implementation methods, thus stating that this is the implementation of the functionality without argument validation is not very useful. The docstring is separated from the function declaration by a blank line. Removing the docstring avoids having to decide if the blank line should be there or not.
2023-07-25templates: use common classes for remaining languagesDylan Baker11-369/+182
These all break down into either a single file or a file + header. This means a little more customization per class, but not too much.
2023-07-25templates: use a common template for C# and JavaDylan Baker4-99/+110
The only real differences between these generators is the file extension and the templates themselves. We can uses a shared abstract class with a few abstract properties to provide all of this to the same base class. This results in less code duplication and easier maintanence. I've made a few cleanups to the shared template: - use `str.capitalize()` instead of `str.upper()[0] + str[1:]` - use `open` as a context manager - use f-strings - put some duplicate calculations in the initializer
2023-07-25templates: fix typo in function name `sameple` -> `sample`Dylan Baker2-3/+3
2023-07-25templates: move initializer to base classDylan Baker12-55/+32
Every class implements the exact same initializer, simplify this by putting it in the base class initializer
2023-07-25templates/samplefactory: move type checking only import to special blockDylan Baker1-1/+1
Don't import things we don't actually need at runtime
2023-07-25minit: use a Protocol for argumentsDylan Baker3-11/+34
Which gives better type hinting. It also points out that we're changing the type of sourcefiles. That's now fixed
2023-07-25minit: put imports togetherDylan Baker1-4/+1
2023-07-25minit: fix docstringDylan Baker1-1/+2
Which must come before `from __future__`
2023-07-25make 'gui_app' an interpreter only conceptDylan Baker7-44/+23
Since it's deprecated anyway, we don't really want to plumb it all the way down into the build and backend layers. Instead, we can just turn it into a `win_subsystem` value in the interpreter if `win_subsystem` isn't already set.
2023-07-25interpreter: use typed_kwargs for Executable(win_subsystem)Dylan Baker4-10/+17
2023-07-25interpreter: use typed_kwargs for gui_appDylan Baker4-7/+7
2023-07-25modules/pkgconfig: Don't insert None into devenv listDylan Baker1-1/+2
When the pkgconfig module is imported, but not used, it will insert None on the end of the devenv list. This list is not expected to contain None, and causes Meson to crash. This can happen in complex build setups (reported from mesa), where pkgconfig is only used in some configurations Fixes: #12032
2023-07-24ninjabackend: add or correct various bits of typingEli Schwartz1-24/+24
Down from 607 mypy errors to 379.
2023-07-24ninjabackend: track all outputs using a setEli Schwartz1-3/+3
We need to verify that we don't produce multiple rules for the same file. This uniqueness check is easy to do with a set, but the original old implementation used a dict with True as the value. This isn't a terrible way to implement a set -- we do it for our own internal OrderedSet implementation, even, and back in prehistory (python 2.3) the standard library's set type was one. But it was deleted and replaced with a fast native implementation, and we should too.
2023-07-24ninjabackend: remove useless and unused API bits in phony targetsEli Schwartz1-21/+21
I originally refactored this wrapper function in commit dd2f1c4c57874a0efcd9f6d331985c408101c30d and at the time I made it take the following call pattern: ``` self.create_phony_target(self.all_outputs, ..., implicit_outs=None) ``` I am not sure *why*. There are a couple problems here: - When creating a phony target, there are never implicit outs and we never try to create them. - It's invalid to call it without self.all_outputs as the first argument, so really we should just use that directly. This made the function signature pointlessly longer and more complicated.
2023-07-24force interpreter functions to actually receive tuple from typed posargsEli Schwartz1-1/+1
We always expect the args parameter in the wrapped function to eventually receive a tuple due to reasons. But in one specific optargs condition we passed it along without any fixup at all.
2023-07-24interpreter: fix typing for adding testsEli Schwartz1-1/+3
We know exactly what type we need, since the interpreter function is correctly typed and thinly wraps over this. But we didn't even get the container type correct. :(
2023-07-24fix a few miscellaneous implicit-optional typing issuesEli Schwartz2-5/+5
2023-07-24interpreter: stop setting member out of initializer that isn't even usedDylan Baker1-1/+0
2023-07-24build: remove useless method callDylan Baker1-1/+0
This does nothing, so just delete it.
2023-07-24build: remove BuildTarget.need_installDylan Baker1-8/+6
This would be either the value `kwargs['install']`, or `False`. There isn't any case that `BuildTarget.need_install` handles that `BuildTarget.install` doesn't handle, if we just initialized it correctly. So, just set Target.install correctly in the super initializer, and do away with need_install.
2023-07-23hdf5: remove C sub-dependency for config toolGeorge Sedov1-7/+0
the config tool provided by HDF5 correctly links to the C libraries without explicit sub-dependancy
2023-07-23hdf5: fix wrong env values for config toolGeorge Sedov1-2/+5
2023-07-23backend: fix checking dep instance for xcodeAlbert Tang1-5/+5
2023-07-21Prevent summary displaying timestamp twiceCharles Brunet2-14/+15
Before: [117.000] Subprojects [117.000] OptelMessagingApi : [117.000] YES [117.000] Python27 : [117.000] YES [117.000] op300rtos : [117.000] YES [117.000] optel-common-protos: [117.000] YES After: [38.938] Subprojects [38.938] OptelMessagingApi : YES [38.938] Python27 : YES [38.938] op300rtos : YES [38.938] optel-common-protos: YES
2023-07-21Display more timestamps when profiling ninjaCharles Brunet3-0/+14
When running setup with `--profile-self` option, there are currently no logs after "Found ninja...". However, there are still some lengthy processes for generating targets and ninja.build. This add more log entries, when profiling, only for the purpose of displaying the timestamps of the different steps in ninja generation.
2023-07-20interpreter: deprecate 'jar' value of build_target(target_type)Dylan Baker1-1/+5
Jar has a very low set of overlap with other target types, including that jar sources *must* be .java, and no other target allows .java sources. As such, the difficulty in crafting a useful `build_target` invocation that allows both `jar` and anything else is high, and the usefulness is dubious. Just use `jar()` directly instead. This depends on the changes to make all of the jar() specific keyword arguments be handled by typed_kwargs so that the deprecation messages are correct and consistent.
2023-07-20interpreter: use kwarginfo for build_target(target_type)Dylan Baker3-11/+17
Which lets us remove a bunch of validation code
2023-07-20interpreter: use typed_kwargs for jar(java_resources)Dylan Baker2-1/+3
With the added bonus of adding the correct `since` checking values!
2023-07-20build|interpreter: move main_class to typed_kwargsDylan Baker3-6/+6
Also move it into the Jar class. This is an exclusive Jar keyword argument, and is only used inside java paths, so there's no reason to have this in all build targets.
2023-07-20interpreter: use type_checking defined target argument listsDylan Baker2-9/+90
This moves to a list of shared objects inside the type_checking module. This is based on my experience of fully typing all of these functions several times, and will make it easier to slowly land all of the changes we want to make.
2023-07-20intepreter: add kwargs annotations for build_target classesDylan Baker2-9/+55
This doesn't do much yet, but with my advanced knowledge of what's coming this lays out most of what we're going to need
2023-07-19move various bits of type-checking only code to TYPE_CHECKING blocksEli Schwartz9-12/+16
Mostly detected with flake8-type-checking. Also quote T.cast() first arguments, since those are not affected by future annotations.
2023-07-19avoid module indirection in name resolution for imported objectsEli Schwartz1-56/+56
We already import a bunch of objects directly from ..build but don't use them nearly as much as we can. This resulted both in longer lines and s minor performance difference since python has to resolve the name binding the long way. There's no reason not to rewrite these names to use the direct imports. Found while investigating the fact that Executable was imported but never used. It's easier to just use it.
2023-07-19fix implicit_reexport issues and enforce them going forwardEli Schwartz31-100/+97
This detects cases where module A imports a function from B, and C imports that same function from A instead of B. It's not part of the API contract of A, and causes innocent refactoring to break things.
2023-07-19mypy: add more mixin base classesEli Schwartz1-3/+3
These don't have new errors or old ignored ones, but add them anyway so we can generally validate their sanity.
2023-07-19linkers: fix mypy errors that were ignored due to lack of inheritanceEli Schwartz1-4/+11
A linker mixin has to be able to align with the base linker it will be used for, in order to reference super(). Since they weren't inherited, calls to super() resulted in mypy errors, which we ignored, and casting. Use the same trick we use for compilers, and make the linker inherit from the base linker type when running under mypy, and from object at runtime.
2023-07-19linkers: reorganize code so that linker base classes always come firstEli Schwartz1-199/+200
So that we can later reference them.
2023-07-19add better comments for mypy suppressionsEli Schwartz2-2/+3
2023-07-19cmake: fix empty BOOL generator expression evaluating to truekiwixz1-1/+1
2023-07-19cmake: find dependencies with bare library names on all platformskiwixz1-2/+2
2023-07-18mtest: avoid meddling with stdout by defaultEli Schwartz1-1/+1
The original point of specifying Optional was to default to None... oops. The practical effect of this change is that the testsuite no longer repeatedly logs "No tests defined." in between more meaningful output.
2023-07-17Merge pull request #11976 from tristan957/cleanupsJussi Pakkanen23-463/+494
Some various type related cleanups
2023-07-17Bump version number for new development.Jussi Pakkanen1-1/+1
2023-07-17Bump version number for release.1.2.0Jussi Pakkanen1-1/+1