aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
AgeCommit message (Collapse)AuthorFilesLines
2021-02-17compilers: Only insert -flto-jobs in clang's link argumentsDylan Baker3-3/+9
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-17Do not validate options when finding non-matchingDylan Baker1-5/+2
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-17Substitute @CURRENT_SOURCE_DIR@ in run_target() and custom_target()Xavier Claessens1-0/+2
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-17mconf: only print correct options in the correct sectionsDylan Baker1-2/+2
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-17Environment: Fix passing envrionment variables CPPFLAGS and CFLAGSDylan Baker2-8/+12
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-16Add optional -Dcuda_ccbindir= option and -ccbin flag to CUDA compiler.Olexa Bilaniuk1-8/+32
Closes #8110.
2021-02-16Armour-grade quoting to account for NVCC's -Xcompiler peculiarities.Olexa Bilaniuk1-14/+84
2021-02-16Extensive rewrite of GCC/MVSC flag translation to NVCC flags.Olexa Bilaniuk1-31/+313
2021-02-16Add default debug flags for two configurations to NVCC.Olexa Bilaniuk1-2/+2
2021-02-16CUDA Toolkit 11.2.1 has been released, update version tableOlexa Bilaniuk1-1/+2
Strangely, the minimum version of CUDA Toolkit 11.2.0 has also been updated - downwards. We pick up this change as well.
2021-02-16Fix VS C++ module support.Jussi Pakkanen1-1/+2
2021-02-16Fix destdir detection for installation via polkitXℹ Ruoyao1-1/+1
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-14Bump version for new development.Jussi Pakkanen1-1/+1
2021-02-14Set up release 0.57.0.57.0Jussi Pakkanen1-1/+1
2021-02-14aix: avoid -bsvr4 flagPeter Harris1-9/+22
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-14Add custom entyr to cuda buildtype dict. Closes #8336.Jussi Pakkanen1-0/+1
2021-02-11Merge pull request #8322 from bonzini/mtest-fixesJussi Pakkanen1-44/+73
mtest fixes for 0.57
2021-02-10mtest: include classname in <testcase> JUnit elementPaolo Bonzini1-2/+4
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-10mtest: cancel stdout/stderr tasks on timeoutPaolo Bonzini1-18/+35
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-10mtest: clean up conditions on whether tests are run in parallelPaolo Bonzini1-10/+13
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-10mtest: fix nits in printing test stdoutPaolo Bonzini1-4/+5
- 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-09mtest: TestSetup can have [] as an exe_wrapperPaolo Bonzini1-2/+2
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-09mtest: run the test output parser as a taskPaolo Bonzini1-5/+6
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-09mtest: hide infinite timeout from the progress reportPaolo Bonzini1-3/+8
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-09backends: Fix custom_target() with configure_file() exeXavier Claessens1-0/+3
2021-02-09backends: Always use the command returned by as_meson_exe_cmdline()Xavier Claessens2-15/+12
Even if the command is not wrapped by meson, it could have been modified to add java/mono interpreters. This fix potential inconsistency between wrapped and unwrapped commands.
2021-02-09Bump version numbers for rc1.0.57.0.rc1Jussi Pakkanen1-2/+2
2021-02-08Fix exe wrapper detection for run targets.Jussi Pakkanen3-3/+13
2021-02-07Add Qt6 moduleLuca Weiss4-3/+41
2021-02-07Merge pull request #8162 from dcbaker/wip/2021-01/rust-module-bindgenJussi Pakkanen5-18/+103
Add a wrapper to the rust module for bindgen
2021-02-07Merge pull request #8288 from bonzini/test-setup-exclude-suitesJussi Pakkanen3-67/+79
introduce add_test_setup(exclude suites: ...) keyword argument
2021-02-07Merge pull request #8305 from xclaesse/run-target-envJussi Pakkanen9-240/+110
run_target: Add env kwarg
2021-02-06mesonlib: Add better errormessage to typelistifyDylan Baker1-2/+2
2021-02-06rust: Add a module wrapper for bindgenDylan Baker1-3/+77
This has a couple of advantages over rolling it by hand: 1. it correctly handles include_directories objects, which is always handy 2. it correctly generates a depfile for you, which makes it more reliable 3. it requires less typing
2021-02-06interpreter: Add annotations for CustomTargetHolderDylan Baker1-1/+1
needed in the rust module
2021-02-06build: Add type annotations for CustomTarget constructorDylan Baker1-2/+3
which are needed in the rust module for bindgen support.
2021-02-06Add a method to IncludeDirs to convert to string listDylan Baker2-3/+8
I'm going to use this in the rust module as well, so having a single source of truth is useful.
2021-02-06backends/ninja: Implement linking a C ABI target into a rust targetDylan Baker1-7/+12
2021-02-06clarify some things in typed_pos_argsDylan Baker1-27/+30
This uses some variables to simplify some logic, and updates the docstring to be more useful.
2021-02-06modules/rust: use typed_pos_argsDylan Baker1-10/+5
2021-02-06interpreterbase: Add support for optional arguments to typed_pos_argsDylan Baker1-2/+38
This allows representing functions like assert(), which take optional positional arguments, which are not variadic. More importnatly you can represent a function like (* means optional, but possitional): ```txt func(str, *int, *str) ``` typed_pos_args will check that all of your types are correct, and if not provide None, which allow simplifying a number of implementation details
2021-02-06interpreterbase: Add support for variadic arguments to typed_pos_argsDylan Baker1-7/+35
This allows functions like `files()` to be decorated.
2021-02-06interpreterbase: Add a helper method for typing positional argumentsDylan Baker1-0/+55
We don't do a very good job of type checking in the interpreter, sometimes we leave it to the mid layers of backends to do that (layering violations) and sometimes we just don't check them at all. When we do check them it's a ton of boilerplate and complicates the code. This should help quite a bit.
2021-02-06interpreter: use noPosArgs and noKwargs instead of opencodingDylan Baker1-8/+6
2021-02-06add loongarch supportXiaotian Wu2-1/+3
2021-02-05vala: Disable unity buildsDylan Baker2-14/+13
Our approach to unity builds with vala is broken, you cannot unify the generated C files, as they contain duplicate symbols. We would need to instead combine the files while they are still in their vala form, then convert that to C and compile the unified C file. This does not fix the linked issue, as this removed the ability to do vala unity builds, but it does allow running vala with `--unity=on`. Related: #5280
2021-02-05ninjabackend: add a few annotationsDylan Baker1-5/+7
2021-02-05ninjabackend: Remove useless call to replace_paths()Xavier Claessens2-5/+4
Replacements are already done by eval_custom_target_command() and must be done BEFORE calling as_meson_exe_cmdline() anyway. replace_paths() is still used by generators. Make eval_custom_target_command() more readable by handling error in the final else case instead of in the middle of elif.
2021-02-05backend: Do not check for exe wrapper twiceXavier Claessens3-17/+4
It is already checked by as_meson_exe_cmdline().
2021-02-05run_target: Add env kwargXavier Claessens9-218/+102
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.