aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/modules
AgeCommit message (Collapse)AuthorFilesLines
2021-10-29Merge pull request #9375 from dcbaker/submit/windows-module-typingJussi Pakkanen1-53/+78
Typing for the Windows module
2021-10-29Remove duplicated CEXE_MAPPING tableXavier Claessens1-3/+4
2021-10-28modules/gnome: use `install_dir = []` instead of falseDylan Baker1-1/+1
2021-10-28modules/gnome: fix missing install_dir, again, harderDylan Baker1-8/+10
It turns out this could be missing in GResource*Target as well, due mostly to the same problem, side effects of mutating a shared dictionary; though it could also happen with a specific set of keywords given and other omitted. Fixes #9350
2021-10-27modules/gnome: ensure that `install_dir` is setDylan Baker1-8/+14
The `mkenums` functions can have this unset if, and only if, the c file only variant is called. Due to side effects if the header file is generated then `install_dir` is ensured to be set for the c file. I have removed this side effect so that our tests actually cover this case. Fixes #9472
2021-10-27do not repeat magic regexes for cmake define replacementsEli Schwartz1-2/+2
We already have this magic string in mesonlib, and this should always have used the cmake@ format which is identical to the meson format other than the regex.
2021-10-27fix various flake8 whitespace errorsEli Schwartz6-14/+14
2021-10-26dep.name(): return dependency name even if dependency is not foundThomas Heijligen1-2/+1
The dep.name() function schould always return the name of the dependency as documented. No matter if it was found or not. https://mesonbuild.com/Reference-manual_returned_dep.html#depfound
2021-10-21Add entries for new CUDA Toolkit versions.Olexa Bilaniuk1-0/+2
2021-10-10Fix typos discovered by codespellChristian Clauss2-6/+6
2021-10-10pkgconfig module: correctly generate Libs search path with absolute install_dirEli Schwartz1-4/+6
For example the OpenRC build files install libraries to install_dir: '/lib' and this works, but causes the generated pkg-config to say: prefix=/usr Libs: -L${prefix}//lib which is both ugly (double //) and resolves to /usr/lib which is exactly what does not work.
2021-10-09modules/windows: allow CustomTargets with more than one output for ↵Dylan Baker1-17/+20
compile_resources
2021-10-09modules/windows: allow CustomTargetIndex for compile_resourcesDylan Baker1-3/+5
In the positional arguments
2021-10-09modules/windows: use typed_kwargsDylan Baker1-21/+38
2021-10-08python: Add platlibdir and purelibdir optionsXavier Claessens1-6/+11
2021-10-08ModuleState: Add wrapper to get optionXavier Claessens1-1/+8
2021-10-08modules/windows: use typed_pos_argsDylan Baker1-11/+7
2021-10-08modules/windows: add some easy type annotationsDylan Baker1-11/+18
This isn't complete, it's just the easy stuff
2021-10-08modules/gnome: Fix unset install_dirDylan Baker1-3/+2
install_dir needs to be set to something, because CustomTarget expects that. genmarshal still relies on CustomTarget setting it internally itself. Fixes #9350
2021-10-08modules/gnome: Fix case that could never be hit due to bad typesDylan Baker1-3/+3
It's impossible to get a Holder here, we'd get the unholdered build types. Mypy points this out for us.
2021-10-08modules/gnome: fix use of undefined variableDylan Baker1-1/+1
Theere is no 'output' key in the kwargs, so if this was it it would result in an exception. Mypy spotted this in a branch I'm working on full typing for gnome, but since that seems unlikely to be done before the 0.60 branchpoint I'd like to get this in sooner
2021-10-07Windows module: Make path flattening for windres work in more casesLuca Bacci1-2/+2
If either 'name' or 'name_formatted' are absolute paths, then they are of the form: C:\path/to/file.ext (example) By only substituting slashes with the underscore, we get: C:_path_to_file.ext This is still not quite right, infact os.path.basename() returns: _path_to_file.ext Also replace colons with underscores to overcome issues when absolute paths are involved.
2021-10-07modules/gnome: deprecate yelp variadic sourcesDylan Baker1-1/+7
Yelp currently can take sources two different ways, the first is via variadic arguments, the second is by a keyword argument. If the keyword is passed then the variadic arguments are silently ignored, which is obviously not ideal. Fortunately the variadic form was never documented, and is likely not in wide use. This patch fixes it by deprecating the variadic form, and warning if both are passed. It does not change behavior as someone may be relying on it.
2021-10-04modules/external_project: use typed_kwargsDylan Baker1-23/+33
Which resolves all of the remaining typing issues.
2021-10-04mdoules/external_project: fix most of the mypy warnings/errorsDylan Baker1-29/+39
2021-10-04modules/external_project: clean up and sort modulesDylan Baker1-6/+7
2021-10-04f-stringsEli Schwartz7-33/+26
2021-10-04various python neatness cleanupsEli Schwartz2-2/+2
All changes were created by running "pyupgrade --py3-only" and committing the results. Although this has been performed in the past, newer versions of pyupgrade can automatically catch more opportunities, notably list comprehensions can use generators instead, in the following cases: - unpacking into function arguments as function(*generator) - unpacking into assignments of the form x, y = generator - as the argument to some builtin functions such as min/max/sorted Also catch a few creeping cases of new code added using older styles.
2021-10-04Merge pull request #8960 from mensinda/yamlDocJussi Pakkanen1-4/+9
Reference Manual 2.0
2021-10-03modules/i18n: fix gettext use of --datadirs paramDan Streetman1-1/+1
The previous commit bd2fcb268b9ff48797bebb6a2ef94d2741234191 accidentally used the wrong var so the param name was missing, leading to an error of "unrecognized arguments" for the datadirs parameter value.
2021-10-03cmake module: if cmake cannot be found, do not tracebackEli Schwartz1-0/+3
We ended up passing a NoneType as the program binary, which is a very awkward way to communicate an error when failing to write a basic package version file.
2021-10-03docs: Hook up the new RefMan generator to MesonDaniel Mensinger1-4/+9
2021-09-30modules/i18n: Fix remaining mypy spotted issuesDylan Baker1-20/+31
2021-09-30modules/i18n: use typed_kwargs for gettextDylan Baker1-19/+50
There were two allowed kwargs that were unused, I've dropped them for now, though I need to check if they were documented. If they are then we need to deprecate them to remove them, otherwise we'll just leave them removed.
2021-09-30modules/i18n: Use typed_kwargs for merge_fileDylan Baker1-26/+61
2021-09-30modules/i18n: use typed_pos_argsDylan Baker1-4/+6
2021-09-30modules/i18n: add easy type annotationsDylan Baker1-7/+12
2021-09-30modules/i18n: sort and clean up importsDylan Baker1-5/+7
2021-09-30modules: make ReturnValue.new_objects covariantDylan Baker1-1/+1
Otherwise we have to do a lot of casting to ensure that we get the appropriate invariant type
2021-09-30interpreter: Use typed_kwargs for func_custom_targetDylan Baker3-13/+14
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-29external-project: variables must be dict not listXavier Claessens1-1/+1
Fixes: #9316
2021-09-29modules: python: better handling of the Python paths for DebianFilipe Laíns1-8/+35
Hardcoding the name is fragile, and enabling it based on the existence of /etc/debian_version (as the is_debianlike helper does) will result in incorrect paths if the Python binary is not provided by Debian. Using the deb_system distuils scheme instead makes sure we use the install path from the current interpreter, which Debian could change between releases, and gives us the correct value on Python installations that are not provided by Debian (eg. deadsnakes, Github Action Python, etc.) Do notice, though, that there is still no guarantee that these are the correct paths, as they assume all schemes paths have the install prefix as a base, see #9284. Signed-off-by: Filipe Laíns <lains@riseup.net>
2021-09-24pylint: check for duplicate importsDylan Baker1-2/+1
I ran into one of these from LGTM, and it would be nice if pylint could warn me as part of my local development process instead of waiting for the CI to tell me.
2021-09-24build: use an object rather than a dict for the dep_manifestDylan Baker3-8/+12
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-14apply flake8 fixes for unused imports and missing importsEli Schwartz2-1/+4
2021-09-14fix traceback for undefined exception when trying to raise exceptionEli Schwartz1-1/+1
2021-09-10qt module: consolidate on one list of binsEli Schwartz1-25/+25
2021-09-10qt module: fix regression in building translations via qresourceEli Schwartz1-1/+1
In commit 3c4c7d042932c23a8ea24d85f24cd290d0a5ea13 the qresource variable stopped being overwritten with a mesonlib.File, which is reasonable. However, one call site for it which relied on being a built file did not get renamed when needed. Make the build target use the built file.
2021-09-10qt module: correctly register a found tool and stop looking for itEli Schwartz1-3/+1
Regression in commit d7ac2f10655433989e5e17867b6c8ef428fd39e8 since self.{tool_name} is not how it used to be tracked, and the "found" dictionary is a legacy of the old location.
2021-09-06mintro: add installed_planFilipe Laíns4-7/+14
Signed-off-by: Filipe Laíns <lains@riseup.net>