aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
AgeCommit message (Collapse)AuthorFilesLines
2021-08-20backends: remove unused name parameter from as_meson_exe_cmdlineDylan Baker4-10/+7
This parameter isn't used, at all, so just remove it
2021-08-20ninjabackend: add missing type annotationDylan Baker1-1/+1
I needed to figure this out for the purposes of annotating CleanTrees anyway.
2021-08-20backends: move method from ninjabackend to base classDylan Baker2-8/+8
The baseclass has code that assumes said method exists, and it really doesn't seem to do anything ninja specific, so move it to the generic backend.
2021-08-20compilers: Add get_no_warn_args to the base Compiler classDylan Baker1-0/+4
Because it should be defined there.
2021-08-20interpreterobjects: fix Test annotationsDylan Baker1-3/+6
2021-08-20environment: add annotations and fix get_meson_commandDylan Baker1-3/+7
It is theoretically possible for the command to be None so we should handle that.
2021-08-20environment: add some missing annotationsDylan Baker1-5/+5
2021-08-20mesonlib: Fix typing of substitute_valuesDylan Baker1-5/+27
This is really, really, annoying. What we really want is (psuedocode): ```python class SubValues(TypedDict[str, str], total=False): @INPUT@: T.List[str] @OUTPUT@: T.List[str] ``` Which would specifiy that `@INPUT@` and `@OUTPUT@` *may* be present and if they are, then they are lists. There may be additional keys, which have a single string as a value. Of course there is currently no way to do that with typing, so we have to instead take a union type and then use asserts to help the type checker unerstand this. More info: https://github.com/python/mypy/issues/4617
2021-08-20mesonlib: Add an exception for what should be unreachable codeDylan Baker1-0/+2
It gives us a little more saftey, and makes pylance happy.
2021-08-20mesonlib: Fix type annotationsDylan Baker1-5/+4
get_compiler_for_source and classify_unity_sources are both wrong, in that they expect to be given a seqence of strings, but they really should take a `Sequence[str | File]`. Additionally, they're using `CompilerType`, which we don't need anymore, and should stop using, most methods for the Compiler are actually defined in the base compiler class.
2021-08-20build: Add type annotations to Target.get_debug_filenameDylan Baker1-2/+2
2021-08-20build: Add annotations to the CustomTargetIndex classDylan Baker1-5/+4
These are not complete, and are just enough for backends/backends.py
2021-08-20build: Add a `name` property to CustomTargetIndexDylan Baker1-0/+4
This is needed to make CustomTargetIndex polymorphic with Target derived classes, and is used in the build module.
2021-08-20build: Fix CustomTarget initializer annotationDylan Baker1-1/+1
the `output` parameter is a string, not an int.
2021-08-20build: Add a couple of annotations to RunTargetDylan Baker1-1/+2
2021-08-20build: Add type annotations for CustomTargetDylan Baker1-12/+11
Again, this is not complete and is just enough for backend.py. Again, typing these is complicated massively by the layering violations in the Target classes and the interpreter.
2021-08-20build: type get_import_filenamesDylan Baker1-2/+2
2021-08-20build: Add some type annotations to BuildTargetDylan Baker1-24/+21
This is not complete, it's just enough for backend/backend.py. A more completely typing would be more difficult, especially whithout untangling the layering violation between the build targets and the interpreter.
2021-08-20build: Add type annotations for ExtractedObjectsDylan Baker1-11/+18
2021-08-20build: Add missing annotations for Build.get_* methodsDylan Baker1-4/+4
The underlying attributes are typed properly, but the getters are not
2021-08-20build: fix annotation for Build.targetsDylan Baker1-2/+2
This really does need to be an OrderedDict, not a MutableMapping, as there are consumers in the backend that need dictionary only methods.
2021-08-20build: add annotation for build.postconf_scriptsDylan Baker1-2/+2
2021-08-20backends/vs: add a missing annotationDylan Baker1-1/+1
2021-08-20external-project: Add support for WAF build systemXavier Claessens2-27/+44
Fixes: #7638
2021-08-19Merge pull request #9126 from dcbaker/submit/rust-use-full-typingJussi Pakkanen2-31/+39
Fully type check rust.bindgen
2021-08-18modules/qt: Allow using generated sources for compile_translations ts_filesDylan Baker1-4/+11
2021-08-18modules/qt: Allow Generated sources in compile_resourcesDylan Baker1-28/+48
2021-08-18modules/qt: allow passing generated targets to compile_uiDylan Baker1-2/+9
2021-08-18modules/qt: Allow generated sources for arguemnts to compile_mocDylan Baker1-4/+18
2021-08-18interpreter: fix overload for `source_strings_to_files`Dylan Baker1-0/+3
2021-08-18python module: fix extensions without explicit subdir being installed to libdirEli Schwartz1-4/+4
They are documented to go in site-packages, and indeed belong there. Regression from the initial implementation via commit ad296976f079cd185ab7361e3e4b18c6bf684090 Fixes #6331
2021-08-18python module: make external program wrapper have access to useful metadataEli Schwartz1-26/+35
Basically just reorganize code. Try to make it a little neater, while we're at it.
2021-08-18Fix incorrect .name attribute for python programEli Schwartz1-3/+4
It is always set to python3 even if we asked for python2...
2021-08-18fix some confusingly indirect codeEli Schwartz1-3/+3
rsplit(..., 1) always produces exactly one split, by design, there's no need to then join a 1-element list via a generator comprehension after extracting the end of it via pop. If this commit message sounds confusing, then so was I when trying to figure out what this actually did and if it needed extracting to PythonExternalModule.
2021-08-18backends/ninja: write depscan input files to jsonDylan Baker2-13/+24
Currently, we write each file to the command line, but this can result in situations where the number of files passed exceeds OS imposed command line limits. For compilers, we solve this with response files. For depscan I've chosen to use a JSON list instead. JSON has several advantages in that it's standardized, there's a built-in python module for it, and it's familiar. I've also chosen to always use the JSON file instead of having a heuristic to decide between JSON and not JSON, while there may be a small performance trade off here, keeping the implementation simple with only one path is wort it. Fixes #9129
2021-08-17rust targets: lld-link is the same as link for static libsNirbheek Chauhan1-3/+3
Without this, rustc will fail to find libfoo.a; same as with MSVC.
2021-08-17Add install tagsXavier Claessens12-51/+131
Fixes: #7007.
2021-08-16compilers/compilers: Fix some potential issues spotted by pyrightDylan Baker1-2/+4
There are two changes here, one is to remove an `elif` that is effectively an `else`, that helps the type checker and provides a small speedup potentially. The second is a potentially unbound variable, that currently isn't hit, but very much could be.
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-16compilers: Fix extra_args parameterDylan Baker6-31/+36
which can also be a callable taking a CompileChekcMode as an argumetn and returning a list of strings.
2021-08-16compilers: Fix annotations for run and cached_compileDylan Baker3-9/+9
Which absolutely should accept `str | File`, but the annotations claim that only strings are accepted.
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-16interperterbase: help type checkers do better type deductionDylan Baker1-1/+5
This assert causes several type checkers (both mypy and pyright) to force `obj` to be a base `HoldableObject` instead of the specialized object. Since the check itself may still be valuable as we don't have fully type annotation coverage it's simply been removed when type checking to aid in type specialization.
2021-08-16interpreter: allow KwargInfo.evolve to change the name as wellDylan Baker1-1/+2
2021-08-16modules/rust: fix initialize signatureDylan Baker1-2/+2
So that it's accurate, and we don't need to use to use `#type: ignore` declaration
2021-08-16modules/rust: use typed_kwargs for bindgenDylan Baker1-29/+34
This was the only function left in here that wasn't fully typed, so let's fix that