Commit Graph

353 Commits

Author SHA1 Message Date
Xavier Claessens 522392e755 run_target: Add env kwarg
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-02-05 17:53:09 -05:00
Jussi Pakkanen c67e0a8a67
Merge pull request #8264 from xclaesse/ep-misc
external_project: misc improvements
2021-01-30 11:30:16 +00:00
Xavier Claessens 0626465ea8 Fix executable as script on Windows
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-30 09:51:06 +00:00
Xavier Claessens 46b68d4c83 external_project: Improve logging
Write output of 'make' and 'make install' into log files as well when
not verbose.
2021-01-29 10:01:36 -05:00
Xavier Claessens 633264984b custom_target: Add env kwarg 2021-01-27 09:00:54 -05:00
Jonas Lundholm Bertelsen bd2394e872 Use case-insensitive suffix check for fortran
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-20 18:11:02 +01:00
Jussi Pakkanen 4b3d48a8c9
Merge pull request #8192 from dcbaker/submit/minstall-type-annotations
Add type annotations to minstall (and some related cleanups)
2021-01-14 15:17:49 +00:00
Dylan Baker a4e1be4e5b scripts/depfixer: make rpaths_dirs_to_remove a set
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-13 13:30:06 -08:00
Antonin Décimo 39ede12aa5 Fix misspells
Signed-off-by: Antonin Décimo <antonin.decimo@gmail.com>
2021-01-13 12:53:10 -05:00
Dylan Baker e81acbd606 Use a single coredata dictionary for options
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).
2021-01-04 12:20:58 -08:00
Jussi Pakkanen 2f836e3acc Extend the C++ module scanner to handle Fortran, too. 2020-12-25 23:28:42 +00:00
Alan Coopersmith d6ef5b2024 depfixer: split new rpath into multiple entries for dedup comparisons
Fixes: #8115

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2020-12-22 20:21:31 +00:00
Jussi Pakkanen f22d54690b Add mypy annotations. 2020-12-13 16:09:50 +02:00
Jussi Pakkanen 26ffd4f8f2 Scan all C++ sources and ignore everything else. 2020-12-13 16:09:50 +02:00
Jussi Pakkanen f390d22787 C++ module compilation works for a simple project. 2020-12-13 14:03:22 +02:00
Daan De Meyer afb5184ec9 Respect MESON_INSTALL_QUIET in gettext.py
Fixes #8068.
2020-12-10 00:29:40 +02:00
Florian Schmaus eb2c26b2c2 Collect and return clang-format's return code
There is no reason why meson should swallow any non-zero exit(/return)
code of clang-format.
2020-11-17 17:51:07 +02:00
Florian Schmaus 8bc656cccb Fix clang-tidy return value reporting (Part Ⅱ)
It turns out my first attempt to fix this in 00d5ef3191 ("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: cce172432b ("Use run-clang-tidy when available.")
2020-11-17 17:50:27 +02:00
Florian Schmaus 00d5ef3191
Fix clang-tidy return value reporting (#7949)
* 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-07 00:20:54 +02:00
Thibault Payet eec5bb11ba symbolextractor: Add FreeBSD support 2020-11-04 18:16:03 +02:00
Elliot ff50f724bb
Fix #5492 (#7919)
* 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-11-01 10:50:15 -08:00
Michele Dionisio eef880f509 exclude generated file from clang-tidy processing
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-12 18:17:15 +03:00
Bernd Busse c4fa876925 Never run clang-format / clang-tidy against directories
`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-10-05 23:07:20 +03:00
Jon Turney 194dcdef03
Make meson_exe report pickled command when it fails
Make 'meson --internal exe --unpickle' report the actual command
executed when it fails, which is otherwise invisible.
2020-09-20 12:57:50 +01:00
Xavier Claessens 8972c71522 externalproject: Fix typing annotation 2020-09-13 17:33:00 -04:00
Xavier Claessens 6ec0b535ba external-project: Add typing annotation 2020-09-13 13:54:47 -04:00
Xavier Claessens 9d338200da external-project: New module to build configure/make projects
This adds an experimental meson module to build projects with other
build systems.

Closes: #4316
2020-09-13 13:54:47 -04:00
Daniel Mensinger e681235e5f
typing: fix code review 2020-09-08 20:15:58 +02:00
Daniel Mensinger 47373a2438
typing: get rid of most T.cast 2020-09-08 20:15:58 +02:00
Daniel Mensinger 23818fc5a3
typing: more fixes 2020-09-08 20:15:58 +02:00
Daniel Mensinger a4f4379c44
typing: fully annotate scripts 2020-09-08 20:15:56 +02:00
Paolo Bonzini 492afe50a4 environment: use ExternalProgram to find ninja
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-04 15:38:12 +02:00
Nirbheek Chauhan 104b80a75c symbolextractor: Handle PermissionError when running tool
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-09-02 17:06:52 +00:00
Christoph Reiter da1b6d0a9f meson_exe: Remove two unused functions 2020-08-30 23:37:46 +03:00
Jussi Pakkanen 7d0393342a Dedup final install rpath. 2020-08-30 18:58:11 +03:00
Eli Schwartz 86b47250c6 simplify shutil usage by invoking copy2 where appropriate
It's equivalent to copyfile + copystat with the same arguments.
2020-08-20 23:47:54 +03:00
Jussi Pakkanen 91c5b37970 Better log message on rpath error. 2020-08-07 21:13:46 -04:00
Alan Coopersmith e801e0435e symbolextractor: use try/finally in solaris_syms when wrapping gnu_syms
As suggested by dcbaker in
https://github.com/mesonbuild/meson/pull/7370#pullrequestreview-436872661

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2020-07-07 17:12:06 -07:00
georgev93 5acd8acd51 Move mesonbuild/cmake/data/run_ctgt.py to 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. 2020-06-30 23:50:10 +03:00
Alan Coopersmith 45793b6ee2 symbolextractor: Add support for Solaris
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2020-06-22 15:00:17 -07:00
Cary Converse a198e5d191 coverage: llvm-cov support 2020-06-17 23:02:50 -04:00
Jon Turney 9f0e75bb40 Also adjust PATH in gtkdochelper for Cygwin
Also do Windows loader specific PATH adjustment (to emulate rpath) in
gtkdochelper for Cygwin.
2020-06-13 18:48:35 +00:00
Jussi Pakkanen 751ea3df72
Merge pull request #7103 from dankegel/bug4027-rpath-remember
Let .pc files and LDFLAGS provide rpaths.
2020-05-18 23:17:34 +03:00
Antoine Jacoutot bf34b97112 symbolextractor: add OpenBSD support 2020-05-18 11:00:42 -07:00
Dan Kegel d7235c5905 Let .pc files specify rpath.
Fixes #4027
2020-05-16 20:25:58 +00:00
Nirbheek Chauhan 717a2ae128 symbolextractor: Do not store the size of code objects
This will almost always change and cause a relink of everything. Our
other symbol extractor implementations do not store this either. We
only need to store the size of data objects, since that necessitates
a relink due to copy relocations.

Drastically reduces the amount of relinking required in gstreamer and
gtk on Linux.
2020-05-15 08:40:21 +00:00
Chun-wei Fan 89bd55b9da gtkdochelper.py: Ignore UnicodeEncodeError when printing output
Windows cmd.exe consoles may be using a code page that might choke
print() when we are outputting the output from calling gtk-doc.  Let's
just ignore the error when it happens and print as much as we could in
this situation.
2020-04-21 00:17:36 +03:00
Chun-wei Fan 415c9e14e7 gtkdochelper.py: Support Windows cmd.exe consoles
On Windows, prepend the commands to call the gtk-doc scripts using the
currently-used Python executable, since Windows cmd.exe consoles do not
support shebang lines.
2020-04-21 00:17:36 +03:00
Pino Toscano 626522965f symbolextractor: add support for hurd
Use the GNU toolchain for that.
2020-04-10 11:29:35 -07:00
Pino Toscano a2b8ed1446 symbolextractor: rename linux_syms to gnu_syms
It is not specific to Linux but works with the GNU toolchain, so
give it a better name.

No functional changes.
2020-04-10 11:29:35 -07:00