summaryrefslogtreecommitdiff
path: root/mesonbuild/scripts
AgeCommit message (Collapse)Author
2021-10-10Fix typos discovered by codespellChristian Clauss
2021-10-10clangformat: Only format files tracked by git by defaultXavier Claessens
2021-10-04fix extra whitespaceEli Schwartz
discovered via flake8 --select E303
2021-10-04various python neatness cleanupsEli Schwartz
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-09-24scripts/meson_exe: narrow type annotationDylan Baker
Not just a `dict`, but a `dict[str, str]`
2021-09-24scripts/meson_exe: close fd if we open itDylan Baker
2021-09-14unused variable -- open() does not need "as f"Eli Schwartz
2021-08-31pylint: turn on superflous-parensDylan Baker
We have a lot of these. Some of them are harmless, if unidiomatic, such as `if (condition)`, others are potentially dangerous `assert(...)`, as `assert(condtion)` works as expected, but `assert(condition, message)` will result in an assertion that never triggers, as what you're actually asserting is `bool(tuple[2])`, which will always be true.
2021-08-20external-project: Add support for WAF build systemXavier Claessens
Fixes: #7638
2021-08-18backends/ninja: write depscan input files to jsonDylan Baker
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-09i18n: use real build/install targets for gmo filesEli Schwartz
Don't just create a .PHONY target which runs a script that magically generates files ninja doesn't know about. It results in untracked files, and `meson install` has to run additional commands instead of copying over files, and then cannot track them to uninstall them later. I'm not even really sure why it was originally done via a proxy script, most likely bad legacy design. This is after all one of the oldest modules... One side effect of this is that meson doesn't know how to rename build.CustomTarget files on install (only data files are supported?), and every file needs to be installed as "domainname.mo" so it must be named that in-tree too. To prevent clashes, every locale gets its own locale-specific subdirectory. Once we are doing that anyway, we can output them to the actual structure required by the gettext family of functions, and bindtextdomain() can therefore point to this location if desired. This might be useful for running localized programs from the build tree.
2021-08-04Escape path in exclude filter passed to gcovrAlois Wohlschlager
Gcovr interprets exclude filters, as passed to the -e option, as regexes. Since we want to exclude a raw path, the argument must be escaped.
2021-07-23Add support for gcovr --sonarqube reportWeston Schmidt
Sonarcloud.io only can read the sonarqube based report that gcovr can produce. This change enables support for this output in meson and ninja. Signed-off-by: Weston Schmidt <Weston_Schmidt@alumni.purdue.edu>
2021-07-05use modern set syntaxEli Schwartz
In one place, we reintroduced old set syntax after having initially cleaned it up everywhere via commit 4340bf34faca7eed8076ba4c388fbe15355f2183
2021-06-29Add feed arg to custom_target()Simon Ser
2021-06-29fix: Always explicitly set encoding for text files (fixes #8263)Daniel Mensinger
2021-06-02Do not delete workdir in case scan-build fails.Jussi Pakkanen
2021-05-01Do not accidentally format files when only checking if they are formatted.Jussi Pakkanen
2021-04-19Xcode: regenerato project file when build conf changes.Jussi Pakkanen
2021-03-30scripts/meson_exe: fix stdout and stderr decodingAleksandr Mezin
1. use `locale.getpreferredencoding()` to get encoding name. `bytes.decode()` assumes `encoding='utf-8'` by default. It is incorrect on my Windows setup, and causes `UnicodeDecodeError`. 2. use `errors='replace'`. `bytes.decode()` assumes `errors='strict'` by default. Meson shouldn't crash if subprocess outputs some garbage that can't be decoded. `surrogateescape` doesn't work as expected on Windows. On Linux, default `errors` for `sys.stdout` is `strict`, so `surrogateescape` can't be used there too (at least until `sys.stdout` is reconfigured). Fixes https://github.com/mesonbuild/meson/issues/8480
2021-03-24depfixer: temporarily modify file permissionsHemmo Nieminen
If the installed files don't have suitable file permissions depfixer will fail to process it. Temporarily lax file permissions to work around this.
2021-03-16clangformat: Add clang-format-check targetXavier Claessens
2021-03-16clangformat: Add include and ignore filesXavier Claessens
2021-03-16Add `meson devenv` command and meson.add_devenv()Xavier Claessens
2021-03-04mass rewrite of string formatting to use f-strings everywhereEli Schwartz
performed by running "pyupgrade --py36-plus" and committing the results
2021-03-04various python neatness cleanupsEli Schwartz
All changes were created by running "pyupgrade --py3-only --keep-percent-format" and committing the results. I have not touched string formatting for now. - use set literals - simplify .format() parameter naming - remove __future__ - remove default "r" mode for open() - use OSError rather than compatibility aliases - remove stray parentheses in function(generator) scopes
2021-03-04raw string literals are next to godlinessEli Schwartz
Invalid escape sequences are deprecated and will be removed from a future version of python. Use r"" to define them so they remain readable.
2021-02-05run_target: Add env kwargXavier Claessens
Re-implement it in backend using the same code path as for custom_target(). This for example handle setting PATH on Windows when command is an executable.
2021-01-30Merge pull request #8264 from xclaesse/ep-miscJussi Pakkanen
external_project: misc improvements
2021-01-30Fix executable as script on WindowsXavier Claessens
On Windows this would fail because of missing DLL: ``` mylib = library(...) exe = executable(..., link_with: mylib) meson.add_install_script(exe) ``` The reason is on Windows we cannot rely on rpath to find libraries from build directory, they are searched in $PATH. We already have all that mechanism in place for custom_target() using ExecutableSerialisation class, so reuse it for install/dist/postconf scripts too. This has bonus side effect to also use exe_wrapper for those scripts. Fixes: #8187
2021-01-29external_project: Improve loggingXavier Claessens
Write output of 'make' and 'make install' into log files as well when not verbose.
2021-01-27custom_target: Add env kwargXavier Claessens
2021-01-20Use case-insensitive suffix check for fortranJonas Lundholm Bertelsen
In Fortran it is common to use capital F in the suffix (eg. '.F90') if the source file makes use of preprocessor statements. Such files should probably be treated like all other fortran files by meson. Case insensitivity for suffixes was already implemented several places in meson before this. So most likely, the few places changed here were oversights anyway.
2021-01-14Merge pull request #8192 from dcbaker/submit/minstall-type-annotationsJussi Pakkanen
Add type annotations to minstall (and some related cleanups)
2021-01-13scripts/depfixer: make rpaths_dirs_to_remove a setDylan Baker
It's only used for doing an `if x in container` check, which will be faster with a set, and the only caller already has a set, so avoid we can avoid a type conversion as well.
2021-01-13Fix misspellsAntonin Décimo
Signed-off-by: Antonin Décimo <antonin.decimo@gmail.com>
2021-01-04Use a single coredata dictionary for optionsDylan Baker
This patches takes the options work to it's logical conclusion: A single flat dictionary of OptionKey: UserOptions. This allows us to simplify a large number of cases, as we don't need to check if an option is in this dict or that one (or any of 5 or 6, actually).
2020-12-25Extend the C++ module scanner to handle Fortran, too.Jussi Pakkanen
2020-12-22depfixer: split new rpath into multiple entries for dedup comparisonsAlan Coopersmith
Fixes: #8115 Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2020-12-13Add mypy annotations.Jussi Pakkanen
2020-12-13Scan all C++ sources and ignore everything else.Jussi Pakkanen
2020-12-13C++ module compilation works for a simple project.Jussi Pakkanen
2020-12-10Respect MESON_INSTALL_QUIET in gettext.pyDaan De Meyer
Fixes #8068.
2020-11-17Collect and return clang-format's return codeFlorian Schmaus
There is no reason why meson should swallow any non-zero exit(/return) code of clang-format.
2020-11-17Fix clang-tidy return value reporting (Part Ⅱ)Florian Schmaus
It turns out my first attempt to fix this in 00d5ef3191e5 ("Fix clang-tidy return value reporting (#7949)") is not sufficient: The local variable returncode is never updated and stays at 0. This fixes the returncode calculation. Fixes: cce172432be3 ("Use run-clang-tidy when available.")
2020-11-07Fix clang-tidy return value reporting (#7949)Florian Schmaus
* Fix clang-tidy return value reporting In case clang-tidy is invoked manually, i.e. if run-clang-tidy(.py) is not found, Meson would not report the return value. This is caused by ignoring the return value of manual_clangformat() in clangformat() within mesonbuild/scripts/clangtidy.py. Even though only more recent-versions of clang-tidy actually report an non-zero exit code if errors are found, there is no reason Meson shouldn't simply report any error codes it received from clang-tidy. Fixes #7948. * Rename methods in clangtidy.py from clangformat to clangtidy For some unknown reason, the method names in clangtidy.py are clangformat() and manual_clangformat(). This is confusing, as clang-format is not invoked by them, clang-tidy is. Hence rename those from {manual_}clangformat() → {manual_}clangtidy()
2020-11-04symbolextractor: Add FreeBSD supportThibault Payet
2020-11-01Fix #5492 (#7919)Elliot
* fix 5492 with cleaner code * remove argparse import * replace list(map( with list comprehension * pass str rather than Path to get_cmd_line_file
2020-10-12exclude generated file from clang-tidy processingMichele Dionisio
by default run_clang_tidy process al file in compile_commands.json but the file generated has to be esclude like already done from manual_clangformat
2020-10-05Never run clang-format / clang-tidy against directoriesBernd Busse
`pathlib.Path.glob()` also returns directories that match source filenames (i.e. a directory named `test.h/`), but `clang-format` and `clang-tidy` fail when handed a directory. We manually skip calling `clang-format` and `clang-tidy` on those directories.