Commit Graph

330 Commits

Author SHA1 Message Date
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
Jussi Pakkanen 9c604320a0
Merge pull request #6637 from mesonbuild/nirbheek/implement-symbolextractor-windows
Implement symbolextractor on windows + some cleanups/fixes
2020-02-23 20:23:03 +02:00
Nirbheek Chauhan 04e89d0867 symbolextractor: Add support for Cygwin 2020-02-22 06:49:34 +05:30
Nirbheek Chauhan cbd143844d symbolextractor: Add support for clang-cl
Requires the latest LLVm 9.0 release which implements the `-list`
argument to `llvm-lib` and ships with an implementation of `nm` called
`llvm-nm`.
2020-02-22 06:49:34 +05:30
Nirbheek Chauhan cace70c64e symbolextractor: Add a Windows implementation
Supports both MSVC and MinGW toolchains. Checks for MSVC first, then
falls back to MinGW.
2020-02-22 06:49:34 +05:30
Nirbheek Chauhan 5dcbf10a1b ninjabackend: Pass the import library to SHSYM
We actually use this while linking on Windows, and hence we need to
extract symbols from this file, and not the DLL.

However, we cannot pass it instead of the DLL because it's an optional
output of the compiler. It will not be written out at all if there are
no symbols in the DLL, and we cannot know that at configure time. This
means we cannot describe it as an output of any ninja target, or the
input of any ninja target. We must pass it as an argument without
semantic meaning.
2020-02-22 06:49:34 +05:30
Nirbheek Chauhan 2860bd0385 depfixer: Ignore more extensions that can't need RPATH fixes
Generated headers, PDB files, import libraries, etc.

Speed-up in gst-build on Windows:

```
meson install
before: 5.4 seconds
after:  5.1 seconds

meson install --only-changed
before: 2.7 seconds
after:  1.6 seconds
```
2020-02-17 23:58:20 +05:30
Nirbheek Chauhan 561a284c51 depfixer: Cache searching of install_name_tool
This gives a significant speedup in large projects such as gst-build
since now we only search for the tool once. Speed-up on Windows:

```
meson install:
before: 15.3 seconds
after:   5.4 seconds

meson install --only-changed:
before: 11.6 seconds
after:   2.7 seconds
```
2020-02-17 23:58:20 +05:30
Nirbheek Chauhan feb82e0f0f symbolextractor: Add typing hints 2020-02-17 22:48:19 +05:30
Nirbheek Chauhan 901bbc36d9 symbolextractor: Support passing arguments to tools
This is how we parse all env vars for tools in Meson. Do the same here
too for consistency.
2020-02-17 22:48:19 +05:30
Nirbheek Chauhan 6fe7af5809 symbolextractor: Print a warning if required tools not found
Also write out a dummy symbols file if the tool wasn't found or didn't
work instead of just spewing an exception.
2020-02-17 22:48:11 +05:30
Nirbheek Chauhan 431283b35d symbolextractor: Correctly filter undefined symbols on macOS
-g is --extern-only and -P is --format=posix. We were missing
--defined-only for some reason, which we pass to `nm` on Linux.
This avoids having to manually filter later.
2020-02-16 20:43:27 +05:30
Nirbheek Chauhan 77d163a0e9 symbolextractor: Print one warning when no implementation found
So people know why all their binaries are getting relinked. Do this
only once per build-dir by writing a file to meson-private.
2020-02-16 03:11:51 +05:30
Alberto García Hierro ffa9459eed commandrunner: Forward KeyboardInterrupt to command
Some commands, notably gdb, use ctrl+c themselves to perform actions
without exiting. Instead of making meson exit and thus, kill the
subprocess, ignore the KeyboardInterrupt and continue waiting for
the child.
2019-11-17 13:54:38 +02:00
Binh Nguyen f6758f2434 Prevent install_name_tool to run on EXE when cross compile on OSX 2019-11-12 20:39:23 +02:00
Marc-André Lureau 1ed70e22b9 Add source tags targets 2019-10-22 20:48:24 +03:00
Jussi Pakkanen cce172432b Use run-clang-tidy when available. 2019-10-21 20:34:41 +03:00
Daniel Mensinger 80ec5e9d28 Fix all flake8 warnings 2019-10-20 17:44:43 +03:00
Jussi Pakkanen d3b389f349 Add clang-tidy target. Closes #2383. 2019-10-01 22:02:51 +03:00
Ting-Wei Lan 0390b673f1 Find clang-format with alternative names
This is similar to what we currently do for scan-build except there is
no environment variable to choose a specific clang-format to run. If an
environment variable is needed for better control, we can add it later.
2019-09-29 00:11:15 +08:00
Gabriel Ganne e7197895b2 uniform scan-build detection process
Detect scan-build the same way when trying to launch it and when
generating the target.
The detection method is:
  1. look within SCANBUILD env variable
  2. shutil.which('scan-build')
  3. *on non-linux platforms only*: go through all the possible
     name candidates and test them individually.

The third step is added following this comment
https://github.com/mesonbuild/meson/pull/5857#issuecomment-528305788
However, going through a list of all the possible candidates is neither
easily maintainable nor performant, and is therefore skipped on
platforms that should not require such a step (currently, only Linux
platforms).

This is a follow-up to the issue raised by @lantw44 during PR:
https://github.com/mesonbuild/meson/pull/5857
2019-09-14 05:51:36 +03:00
Aleksey Gurtovoy 75daed27bc mesonlib.split_args/quote_arg/join_args 2019-09-05 23:42:47 +03:00
Thibault Saunier 42c5e4fe2b wine: Try to get the short paths when generating WINEPATH
The size of WINEPATH is limited (1024 [until recently]), we
can very easily reach that limit, and even the new one (2048) so
try to keep path as small as possible by using the shortPath
version of paths.

Also assert that we do not reach the new hard limit.

And avoid having duplicates in the list of path.

[until recently]: https://bugs.winehq.org/show_bug.cgi?id=45810
2019-08-24 06:43:47 -04:00
Xavier Claessens 44ac680e55 gtkdoc: Use find_program() to get gtkdoc tools
This will allow using gtk-doc as a subproject instead of having to
install it on the system. It also has the side effect of failing at
configuration time with a proper message if gtkdoc is not installed,
instead of failing at build time with a python backtrace.
2019-08-04 21:40:55 +03:00