Commit Graph

10494 Commits

Author SHA1 Message Date
Xavier Claessens cef5cab23c Support multiple args in error()
Seems it got forgotten when that was added to warnings() and message().

Fixes: #8414.
2021-02-25 22:58:45 +02:00
Matthias Klumpp 4e5efd3897
Allow custom target output to be processed by generators 2021-02-25 20:53:41 +02:00
Jussi Pakkanen 74ebb1ba59 Clarify that wrap requests are for user submission. [skip ci] 2021-02-25 00:40:20 +02:00
Eli Schwartz c7ddde58fd
mcompile: do not pass the builddir to ninja if it is the current directory
Because when you don't specify -C, this logging feels silly:

ninja: Entering directory `.
2021-02-23 19:37:04 -05:00
Eli Schwartz 691eb0250a
mcompile: make sure arguments are passed in the correct order
meson compile itself doesn't permit GNU-style argument permutation, i.e.
TARGET to precede options, so why should we expect ninja to?

And indeed, ninja doesn't document support for this -- but it does
accept it anyway, which is confusing and results in people thinking it's
"supposed to" work.

However, if NINJA=samu then this is in fact enforced. samu does not
permit GNU-style argument permutation. As a result, the arguments passed
to mcompile are actively re-ordered before being passed to the
subprocess, and samu dies with a fatal error.

Fix ordering in mcompile.py and add a comment to warn future readers
that the order does, in fact, matter.
2021-02-23 19:37:03 -05:00
Jussi Pakkanen 671647188c Add note about using Ninja on old Meson versions. [skip ci] 2021-02-23 22:00:19 +02:00
Olexa Bilaniuk 4c1a0c400f [CUDA] Bugfix: Forward sanitizer_*_args() methods to host compiler.
Enables -Db_sanitize=undefined and company.

Also serves as a testcase for NVCC comma-shielding: Because the test-
case declares `b_sanitize=address,undefined`, the host GCC compiler
needs `-fsanitize=address,undefined`, but this stands a danger of being
split by NVCC when wrapped with `-Xcompiler=args,args`. Special,
already-existing comma-shielding codepaths activate to prevent this
splitting.

Closes #8394.
2021-02-22 23:56:55 +02:00
Xavier Claessens 2fabd4c7dc minstall: Add --skip-subprojects option
By default all subprojects are installed. If --skip-subprojects is given
with no value only the main project is installed. If --skip-subprojects
is given with a value, it should be a coma separated list of subprojects
to skip and all others will be installed.

Fixes: #2550.
2021-02-22 23:03:55 +02:00
Patryk Obara 36d9d7a96f docs/users: Add DOSBox Staging 2021-02-21 19:53:37 -05:00
Jussi Pakkanen 72865a2773 Fix combining C and Fortran. Closes #8377. 2021-02-19 18:18:39 +02:00
Luke Drummond 79f7328d6a [TAP] Fix TAP parser when test exits with status
Some time between 0.56 and 0.57 the TAP parser broke when a test exits
with a nonzero status.
The TAP protocol does not specify this behaviour - giving latitude to
implementers, and meson's previous behaviour was to report the exit
status gracefully.

This patch restores the old behaviour and adds a regression test
2021-02-19 17:17:20 +02:00
Dylan Baker 90a7de3f2b Ensure that $lang_args and $lang_link_args are properly parsed
Currently we don't handle things correctly if we get a string we should
split, and the linker and needs compiler arguments. It would result in
two unsplit strings in a list, instead of the split arguments in a list

Fixes: #8348
2021-02-19 17:16:42 +02:00
Dylan Baker 91e56c7d59 environment: Allow setting build options in cross files
This did work previously, so we need to let it continue working. I'm
proposing removing it in 0.60 because the correct solution has always
worked.

I've also been a bit more defensive here, and made setting
`subproject:opt = foo` in the machine files an error, as we have
`[subproject:built-in options]` or `[subproject:project options]` for
that.
2021-02-18 10:57:20 -08:00
Dylan Baker b03039ec9d allow build.b_* options
These continue to be ignored as they always have, but no longer raise an
error.

Fixes: #8354
2021-02-18 10:57:20 -08:00
Krzysztof Małysa c24a0f8524 compilers: clang: Drop -Xclang before -fcolor-diagnostics flag
Using -Xclang -fcolor-diagnostics provides no advantage to using just -fcolor-diagnostics option and sometimes causes problems:
* uncolored diagnostics on Arch Linux: https://bugs.archlinux.org/task/69662
* simple problem with removing flag -fcolor-diagnostics:  https://github.com/clangd/clangd/issues/279
2021-02-18 17:30:33 +02:00
Jussi Pakkanen fad408a521 Increase OpenMPI timeout to see if it fixes macOS CI test hangs. 2021-02-18 10:43:23 +02:00
Jussi Pakkanen add502c648 Disable failing Cygwin GIR test. 2021-02-18 02:14:07 +02:00
Miro Hrončok 756ea32e06 Don't access other enum members from self
This is deprecated in Python 3.10.
Instead, acces them from the class.

Fixes https://github.com/mesonbuild/meson/issues/8318
2021-02-18 00:08:44 +02:00
Xavier Claessens a5b33db558 ci: Fix failure in unit tests with vs backend 2021-02-17 22:59:54 +02:00
Paolo Bonzini 92134bac8d unittests: expect mtest logs to be utf-8 2021-02-17 21:14:05 +02:00
Paolo Bonzini 2b48d75c7e mtest: use / as path separator for ninja targets
os.path.relpath(f, wd) returns path with \ seperator on Windows, but ninja
targets always uses / separator.

See for example https://gitlab.freedesktop.org/ocrete/libnice/-/jobs/7348274.

Analyzed-by: Xavier Claessens <xavier.claessens@collabora.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-02-17 12:10:05 -05:00
Dylan Baker 6c1467db27 compilers: Only insert -flto-jobs in clang's link arguments
Clang has a hand `-Wunused-command-line-argument` switch, which when
turned to an error, gets very grump about `-flto-jobs=0` being set in
the compiler arguments (although `-flto=` belongs there). We'll refactor
a bit to put that only in the link arguments.

GCC doesn't have this probably because, a) it doesn't have an equivalent
warning, and b) it uses `-flto=<$numthreads.

Fixes: #8347
2021-02-17 18:06:52 +02:00
Dylan Baker 867963f131 Do not validate options when finding non-matching
This is a) useless because it's only used to print which options are not
default, and b) harmful because it can result in cases where things
break, like in projects that set a standard that the chosen compiler
doesn't support, but the project (or some subset) can be built with a
different standard.

Fixes: #8360
2021-02-17 14:51:26 +02:00
Xavier Claessens b6804bf49c Substitute @CURRENT_SOURCE_DIR@ in run_target() and custom_target()
run_target() does some variable substitutions since 0.57.0. This is a
new behavior, and undocumented, caused by sharing more code with
custom_target(). More consistency is better, so document it now.

custom_target() was doing variable substitution in the past, because it
shared some code with generator(), but that was undocumented. Some
refactoring in 0.57.0 caused it to not replace @CURRENT_SOURCE_DIR@,
@SOURCE_DIR@, and @BUILD_DIR@ anymore. This patch adds back
@CURRENT_SOURCE_DIR@ and document it. It does not add back @SOURCE_DIR@
because it is duplicate with @SOURCE_ROOT@ that has a better name. Also
do not add back @BUILD_DIR@ which is duplicate of @PRIVATE_DIR@, and
not @BUILD_ROOT@ surprisingly, adding to the confusion.
2021-02-17 14:48:04 +02:00
Dylan Baker d5238baa45 mconf: only print correct options in the correct sections
A predicate in two comprehensions was dropped, in what looks like a
rebase error on my part. With the predicate added things work correctly.

Fixes: #8344
2021-02-17 14:46:48 +02:00
Dylan Baker 10d94a12b8 Environment: Fix passing envrionment variables CPPFLAGS and CFLAGS
Or other language flags that use CPPFLAGS (like CXXFLAGS). The problem
here is actually rather simple, `dict.setdefault()` doesn't work like I
thought it did, I thought it created a weak entry, but it actually is
equivalent to:
```python
if k not in dict:
    dict[k] = v
```
Instead we'll use an intermediate dictionary (a default dictionary
actually, since that makes things a little cleaner) and then add the
keys from that dict to self.options as applicable.

Test case written by Jussi, Fix by Dylan

Co-authored-by: Jussi Pakkanen
Fixes: #8361
Fixes: #8345
2021-02-17 14:46:15 +02:00
Dylan Baker 7812ceec5f
Merge pull request #8355 from obilaniu/cudafixes
CUDA Compiler Fixes
2021-02-16 16:51:51 -08:00
Olexa Bilaniuk 3410465178 Small patch to unittests to initialize CUDA compiler correctly.
Suggested by Dylan Baker.
2021-02-16 17:01:24 -05:00
Olexa Bilaniuk d1e945f442 Add optional -Dcuda_ccbindir= option and -ccbin flag to CUDA compiler.
Closes #8110.
2021-02-16 15:10:21 -05:00
Olexa Bilaniuk cc09d984f1 Armour-grade quoting to account for NVCC's -Xcompiler peculiarities. 2021-02-16 15:10:11 -05:00
Olexa Bilaniuk 3669be30aa Extensive rewrite of GCC/MVSC flag translation to NVCC flags. 2021-02-16 15:00:31 -05:00
Olexa Bilaniuk a2530373c7 Add default debug flags for two configurations to NVCC. 2021-02-16 14:46:17 -05:00
Olexa Bilaniuk 8b784e7008 CUDA Toolkit 11.2.1 has been released, update version table
Strangely, the minimum version of CUDA Toolkit 11.2.0 has also been
updated - downwards. We pick up this change as well.
2021-02-16 14:46:17 -05:00
Jussi Pakkanen f3727c62c6 Fix VS C++ module support. 2021-02-16 17:05:12 +00:00
Xℹ Ruoyao 3ed30cea6e Fix destdir detection for installation via polkit
In 0.57.0 installation via polkit won't work anymore. `destdir` is
defaulted to an empty string ('') instead of None.  But polkit
installation code incorrectly tests `destdir is None`.
2021-02-16 08:39:29 -05:00
Jussi Pakkanen 110457543d Add missing apostrophes. [skip ci] 2021-02-16 01:04:20 +02:00
Sam Thursfield f5bc0f33da
docs: Fix typo in release notes [skip ci]
Mismatched \` symbol was messing up the formatting.
2021-02-14 23:04:15 +02:00
Jussi Pakkanen 7d1b11d67b Add a release note entry for C++ modules which was missing. [skip ci] 2021-02-14 22:12:18 +02:00
Jussi Pakkanen ba99181ba7 Bump version for new development. 2021-02-14 21:57:29 +02:00
Jussi Pakkanen 5d651e76b5 Set up release 0.57. 2021-02-14 21:28:44 +02:00
Peter Harris c0b448d3ca aix: avoid -bsvr4 flag
The svr4 linker flag causes issues, especially when compiling c++.
Replace '-z' options with the equivalent non-svr4 flags. When using
-blibpath, we must be careful to include the default system library
path, or the resulting executables will not be able to find libc.

This patch was suggested by @andreaskem in #7581.
2021-02-14 09:16:08 -08:00
Jussi Pakkanen 6a75d6c233 Add custom entyr to cuda buildtype dict. Closes #8336. 2021-02-14 18:41:07 +02:00
Jussi Pakkanen 5f697358f0
Merge pull request #8322 from bonzini/mtest-fixes
mtest fixes for 0.57
2021-02-11 17:32:45 +02:00
Paolo Bonzini b1efd03619 mtest: include classname in <testcase> JUnit element
It looks like GitLab ignores the suite name and actually uses
the classname.  Adjust the output accordingly.

Fixes: #8316
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-02-10 15:01:57 +01:00
Paolo Bonzini 6c40b134df mtest: cancel stdout/stderr tasks on timeout
Avoid that the tasks linger and SingleTestRunner.run() never terminates.

In order to do this, we need read_decode() and read_decode_lines() to be
cancellable, and to handle the CancelledError gracefully while returning
the output they have collected so far.

For read_decode(), this means always operating on a line-by-line basis,
even if console_mode is not ConsoleUser.STDOUT.  For read_decode_lines(),
instead, we cannot return an iterator.  Rather, read_decode_lines()
returns the output directly (similar to read_decode) and communication
with the parser is mediated by an asyncio.Queue.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-02-10 12:01:55 +01:00
Paolo Bonzini c6b135c1f9 mtest: clean up conditions on whether tests are run in parallel
This makes non-parallel tests emit their output on the fly,
similar to ninja console jobs.  It also cleans up the code
a bit, avoiding the repetition of "self.options.num_processes"
tests.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-02-10 10:58:21 +01:00
Paolo Bonzini 711d9feb4e mtest: fix nits in printing test stdout
- Ensure the output is terminated with a \n even if the test does not
  include one.

- Ensure that stdout is flushed for each reported result

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-02-10 10:57:55 +01:00
Paolo Bonzini 3506d8daf2 mtest: TestSetup can have [] as an exe_wrapper
Fix "meson test --wrapper foo --setup bar", it should work just fine
if the setup does not define a wrapper.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-02-09 18:51:05 +01:00
Paolo Bonzini b1a9578091 mtest: run the test output parser as a task
Start the parsing of the output early; this avoids a deadlock
if the test writes to stdout but no one reads from it.  It
also reports TAP or Rust subtest results as they happen,
which was the intention all along.

While at it, use a consistent naming conventions for coroutines
vs tasks.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-02-09 18:50:21 +01:00
Paolo Bonzini 8b94aa578a mtest: hide infinite timeout from the progress report
Avoid printing something like "30/-1s" when tests are run without
a timeout or with --timeout-multiplier 0.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-02-09 18:42:26 +01:00