summaryrefslogtreecommitdiff
path: root/mesonbuild/scripts
AgeCommit message (Collapse)Author
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.
2020-09-20Make meson_exe report pickled command when it failsJon Turney
Make 'meson --internal exe --unpickle' report the actual command executed when it fails, which is otherwise invisible.
2020-09-13externalproject: Fix typing annotationXavier Claessens
2020-09-13external-project: Add typing annotationXavier Claessens
2020-09-13external-project: New module to build configure/make projectsXavier Claessens
This adds an experimental meson module to build projects with other build systems. Closes: #4316
2020-09-08typing: fix code reviewDaniel Mensinger
2020-09-08typing: get rid of most T.castDaniel Mensinger
2020-09-08typing: more fixesDaniel Mensinger
2020-09-08typing: fully annotate scriptsDaniel Mensinger
2020-09-04environment: use ExternalProgram to find ninjaPaolo Bonzini
This allows the NINJA environment variable to support all the Windows special cases, especially allowing an absolute path without extension. Based on a patch by Yonggang Luo. Fixes: #7659 Suggested-by: Nirbheek Chauhan <nirbheek@centricular.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-09-02symbolextractor: Handle PermissionError when running toolNirbheek Chauhan
I can't reproduce this, but it is definitely possible. In this case what we should do is the same as when the tool is not found. Fixes https://github.com/mesonbuild/meson/issues/7605
2020-08-30meson_exe: Remove two unused functionsChristoph Reiter
2020-08-30Dedup final install rpath.Jussi Pakkanen
2020-08-20simplify shutil usage by invoking copy2 where appropriateEli Schwartz
It's equivalent to copyfile + copystat with the same arguments.
2020-08-07Better log message on rpath error.Jussi Pakkanen
2020-07-07symbolextractor: use try/finally in solaris_syms when wrapping gnu_symsAlan Coopersmith
As suggested by dcbaker in https://github.com/mesonbuild/meson/pull/7370#pullrequestreview-436872661 Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2020-06-30Move mesonbuild/cmake/data/run_ctgt.py to ↵georgev93
mesonbuild/scripts/cmake_run_ctgt.py, as well as enclose everything in a run() function so it can be called by `meson --internal cmake_run_ctgt ...`. Also, include mesonbuild/cmake/data/ in the msi package.