summaryrefslogtreecommitdiff
path: root/mesonbuild/scripts
Commit message (Collapse)AuthorAgeFilesLines
* rename exe_runner to exe_wrapper everywhereEli Schwartz2021-12-051-6/+6
| | | | I don't understand the purpose of this confusing API naming split.
* Share common code between clang tidy and formatXavier Claessens2021-11-143-89/+84
|
* depfixer: always print the file name in messagesZbigniew Jędrzejewski-Szmek2021-11-091-6/+6
| | | | The messages are not useful unless we know what file they are about.
* depfixer: convert unused printing code to debugging functionsZbigniew Jędrzejewski-Szmek2021-11-091-31/+23
| | | | | | | | | | | | | | | | | | When installing with 'meson install --quiet' I'd get the following output: This file does not have an rpath. This file does not have a runpath. (It turns out that of the couple hundred of binaries that are installed, this message was generated for /usr/lib/systemd/boot/efi/linuxx64.elf.stub.) There doesn't seem to be any good reason for this output by default. But those functions can still be used for debugging. Under a debugger, returning the string is just as useful as printing it, but more flexible. So let's suppress printing of anything by default, but keep the extractor functions. The code was somewhat inconsistent wrt. to when .decode() was done. But it seems that we'll get can expect a decodable text string in all cases, so just call .decode() everywhere, because it's nicer to print decoded strings.
* depfixer: f-stringsZbigniew Jędrzejewski-Szmek2021-11-091-3/+3
|
* coverage generator: obey the documentation and only generate supported outputsEli Schwartz2021-11-011-6/+6
| | | | | | | | | | | | | We say: > If version 4.2 or higher of the first is found, targets coverage-text, > coverage-xml, coverage-sonarqube and coverage-html are generated. But this is totally untrue. Make it true, by actually checking (and not generating broken coverage commands when older versions of gcovr are found). Fixes #9505
* fix various flake8 whitespace errorsEli Schwartz2021-10-272-2/+2
|
* Fix typos discovered by codespellChristian Clauss2021-10-102-2/+2
|
* clangformat: Only format files tracked by git by defaultXavier Claessens2021-10-101-4/+12
|
* fix extra whitespaceEli Schwartz2021-10-041-1/+0
| | | | discovered via flake8 --select E303
* various python neatness cleanupsEli Schwartz2021-10-043-3/+3
| | | | | | | | | | | | | | | | 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.
* scripts/meson_exe: narrow type annotationDylan Baker2021-09-241-1/+1
| | | | Not just a `dict`, but a `dict[str, str]`
* scripts/meson_exe: close fd if we open itDylan Baker2021-09-241-0/+3
|
* unused variable -- open() does not need "as f"Eli Schwartz2021-09-141-1/+1
|
* pylint: turn on superflous-parensDylan Baker2021-08-313-6/+6
| | | | | | | | 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.
* external-project: Add support for WAF build systemXavier Claessens2021-08-201-11/+21
| | | | Fixes: #7638
* backends/ninja: write depscan input files to jsonDylan Baker2021-08-181-4/+6
| | | | | | | | | | | | | | 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
* i18n: use real build/install targets for gmo filesEli Schwartz2021-08-091-32/+0
| | | | | | | | | | | | | | | | | | | | | | 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.
* Escape path in exclude filter passed to gcovrAlois Wohlschlager2021-08-041-5/+5
| | | | | | 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.
* Add support for gcovr --sonarqube reportWeston Schmidt2021-07-231-0/+14
| | | | | | | | 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>
* use modern set syntaxEli Schwartz2021-07-051-1/+1
| | | | | In one place, we reintroduced old set syntax after having initially cleaned it up everywhere via commit 4340bf34faca7eed8076ba4c388fbe15355f2183
* Add feed arg to custom_target()Simon Ser2021-06-291-3/+8
|
* fix: Always explicitly set encoding for text files (fixes #8263)Daniel Mensinger2021-06-298-19/+19
|
* Do not delete workdir in case scan-build fails.Jussi Pakkanen2021-06-021-8/+13
|
* Do not accidentally format files when only checking if they are formatted.Jussi Pakkanen2021-05-011-1/+6
|
* Xcode: regenerato project file when build conf changes.Jussi Pakkanen2021-04-191-1/+1
|
* scripts/meson_exe: fix stdout and stderr decodingAleksandr Mezin2021-03-301-2/+4
| | | | | | | | | | | | | | | | | | 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
* depfixer: temporarily modify file permissionsHemmo Nieminen2021-03-241-8/+33
| | | | | | If the installed files don't have suitable file permissions depfixer will fail to process it. Temporarily lax file permissions to work around this.
* clangformat: Add clang-format-check targetXavier Claessens2021-03-161-6/+15
|
* clangformat: Add include and ignore filesXavier Claessens2021-03-161-11/+39
|
* Add `meson devenv` command and meson.add_devenv()Xavier Claessens2021-03-161-0/+22
|
* mass rewrite of string formatting to use f-strings everywhereEli Schwartz2021-03-0411-23/+23
| | | | performed by running "pyupgrade --py36-plus" and committing the results
* various python neatness cleanupsEli Schwartz2021-03-042-2/+2
| | | | | | | | | | | | | | | | 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
* raw string literals are next to godlinessEli Schwartz2021-03-041-2/+2
| | | | | | Invalid escape sequences are deprecated and will be removed from a future version of python. Use r"" to define them so they remain readable.
* run_target: Add env kwargXavier Claessens2021-02-052-87/+8
| | | | | | 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.
* Merge pull request #8264 from xclaesse/ep-miscJussi Pakkanen2021-01-301-6/+19
|\ | | | | external_project: misc improvements
| * external_project: Improve loggingXavier Claessens2021-01-291-6/+19
| | | | | | | | | | Write output of 'make' and 'make install' into log files as well when not verbose.
* | Fix executable as script on WindowsXavier Claessens2021-01-301-10/+16
|/ | | | | | | | | | | | | | | | | | 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
* custom_target: Add env kwargXavier Claessens2021-01-271-1/+2
|
* Use case-insensitive suffix check for fortranJonas Lundholm Bertelsen2021-01-201-2/+2
| | | | | | | | | | 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.
* Merge pull request #8192 from dcbaker/submit/minstall-type-annotationsJussi Pakkanen2021-01-141-4/+4
|\ | | | | Add type annotations to minstall (and some related cleanups)
| * scripts/depfixer: make rpaths_dirs_to_remove a setDylan Baker2021-01-131-4/+4
| | | | | | | | | | | | 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.
* | Fix misspellsAntonin Décimo2021-01-132-2/+2
|/ | | | Signed-off-by: Antonin Décimo <antonin.decimo@gmail.com>
* Use a single coredata dictionary for optionsDylan Baker2021-01-041-1/+2
| | | | | | | 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).
* Extend the C++ module scanner to handle Fortran, too.Jussi Pakkanen2020-12-251-19/+129
|
* depfixer: split new rpath into multiple entries for dedup comparisonsAlan Coopersmith2020-12-221-1/+1
| | | | | | Fixes: #8115 Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
* Add mypy annotations.cppmodulesJussi Pakkanen2020-12-131-11/+13
|
* Scan all C++ sources and ignore everything else.Jussi Pakkanen2020-12-131-0/+2
|
* C++ module compilation works for a simple project.Jussi Pakkanen2020-12-131-0/+87
|
* Respect MESON_INSTALL_QUIET in gettext.pyDaan De Meyer2020-12-101-1/+2
| | | | Fixes #8068.