aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2020-11-17Revert "Add thinlto support. Closes #7493."Jussi Pakkanen7-53/+15
This reverts commit 3e6fbde94c1cb8d4e01b7daf0282c315ff0e6c7d.
2020-11-17Collect and return clang-format's return codeFlorian Schmaus1-3/+4
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 Schmaus1-1/+1
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-17doc: add much-needed accuracy to pip installation instructions [skip ci]Eli Schwartz1-2/+7
- mention installing from local sources, not PyPI - warn against --user installs, which too often screw up users that then cannot install projects because ~/.local won't be in sudo's PYTHONPATH - advise installing with sudo -- current versions of pip assume --user for you rather than failing with permission errors, which is great unless, like meson, there are compelling reasons to need to install as root
2020-11-17gnome: Drop use of volatile in GLib type functionsPhilip Withnall5-17/+17
See https://gitlab.gnome.org/GNOME/glib/-/issues/600 `volatile` was previously mistakenly used in GLib to indicate that a variable was accessed atomically or otherwise multi-threaded. It’s not meant for that, and up to date compilers (like gcc-11) will rightly warn about it. Drop the `volatile` qualifiers. Based on a patch by Jeff Law. See also http://isvolatileusefulwiththreads.in/c/. Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2020-11-17add warning for projects with manually specified -WerrorEli Schwartz1-0/+3
Point people to the "werror" builtin option.
2020-11-16unittests: Simplify and make test_templates more reliableDylan Baker1-46/+8
env.detect_<lang>_compiler only checks that there is a binary called whatever that returns a version. There are several cases where the found binary doesn't work: 1) gcc for ojbc[pp], when support isn't compiled in. 2) the compiler is broken (rust in appveyor somtimes) Because of that we need to call compiler.sanity_check() as well, and if we get an EnvironmentException from that skip the language Also, instead of having a long line of try: ... except: pass, roll all of the checking up into a loop using getattr(), which is less code and makes adding a new language easier
2020-11-16run_unittests: correctly handle users setting init.defaultBranchDylan Baker1-2/+18
2020-11-16run_unittests: Don't assume things are in /usr/binDylan Baker1-21/+17
This is generally a safe assumption, except for some of the more exotic OSes/distros like nixos, where env is the only thing in /usr/bin
2020-11-15ninjabackend: stabilize order of dependencies and order-only dependenciesPaolo Bonzini1-2/+2
These do not go into the command line, and therefore do not matter for the purpose of avoiding unnecessary rebuilds after meson is rerun. However, they complicate the task of finding differences between build lines across meson reruns. So take the easy way out and sort everything after | and ||. With this change, there is absolutely no change in QEMU's 40000-line build.ninja file after meson is rerun.
2020-11-15stabilize iteration order for dictionariesPaolo Bonzini1-2/+2
The order of keys in dictionaries cannot be relied upon, because the hash values are randomized by Python. Whenever we iterate on dictionaries and meson.build generates a list during the iteration, the different iteration orders may cause random changes in the command line and cause ninja to rebuild a lot of files unnecessarily.
2020-11-15stabilize sets that are converted to listsPaolo Bonzini3-4/+4
The order of elements in sets cannot be relied upon, because the hash values are randomized by Python. Whenever sets are converted to lists we need to keep their order stable, or random changes in the command line cause ninja to rebuild a lot of files unnecessarily. To stabilize them, use either sort or OrderedSet. Sorting is not always applicable, but it can be faster because it's done in C and it can produce slightly nicer output.
2020-11-15mtest: switch to asyncio subprocessesPaolo Bonzini1-35/+19
No functional change except that the extra thread goes away.
2020-11-15mtest: use ProactorEventLoopPaolo Bonzini1-0/+4
This is needed to use asyncio with pipes and processes.
2020-11-15mtest: improve handling of SIGINT and SIGTERMPaolo Bonzini1-8/+36
Handle SIGINT and SIGTERM by respectively cancelling the longest running and all the running tests.
2020-11-15mtest: remove usage of executorsPaolo Bonzini1-50/+76
Rewrite the SingleTestRunner to use asyncio to manage subprocesses, while still using subprocess.Popen to run them. Concurrency is managed with an asyncio Semaphore; for simplicity (since this is a temporary state) we create a new thread for each test that is run instead of having a pool. This already provides the main advantage of asyncio, which is better control on cancellation; with the current code, KeyboardInterrupt was never handled by the thread executor so the code that tried to handle it in SingleTestRunner only worked for non-parallel tests. And because executor futures cannot be cancelled, there was no way for the user to kill a test that got stuck. Instead, without executors ^C exits "meson test" immediately. The next patch will improve things even further, allowing a single test to be interrupted with ^C.
2020-11-15mtest: add INTERRUPT to TestResultPaolo Bonzini1-21/+24
Distinguish a failure due to user interrupt from a presumable ERROR result due to the SIGTERM. The test should fail after CTRL+C even if the test traps SIGTERM and exits with a return code of 0.
2020-11-15mtest: always ignore ProcessLookupErrorPaolo Bonzini1-33/+26
ProcessLookupError can also happen from p.kill(). There is also nothing we can do in that case, so move the "try" for that exception to the entire kill_process function. The ValueError case seems like dead code, so get rid of it.
2020-11-15mtest: refactor _run_cmdPaolo Bonzini1-85/+101
A large part of _run_cmd is devoted to setting up and killing the test subprocess. Move that to a separate function to make the test runner logic easier to understand.
2020-11-15mtest: add back SIGINT handlingPaolo Bonzini1-6/+27
2020-11-15mtest: use asyncio for run loopPaolo Bonzini1-26/+39
Use asyncio futures for the run loop, while still handling I/O in a thread pool using run_on_executor. The handling of the test result is not duplicated anymore between run_tests and drain_futures. Instead, the test result is always processed and printed by run_test after single_test.run() completes and (in verbose mode) it cannot interleave with the test output. Therefore the special case for self.options.num_processes == 1 can be removed.
2020-11-15mtest: remove run_specialPaolo Bonzini1-13/+1
run_special and doit are the same except that run_special forgot to set self.is_run. There is no need for the duplication. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-11-15mtest: fix flake8 issuesPaolo Bonzini1-4/+3
2020-11-14Add doc on how to add the [provide] entry to wrapdb entries. [skip ci]Jussi Pakkanen1-41/+69
2020-11-14Merge pull request #7843 from dcbaker/submit/rustc-fixesJussi Pakkanen6-52/+89
A few fixups for rust
2020-11-13Merge pull request #7967 from jpark37/msvc-c17Dylan Baker2-9/+20
msvc: enable /std:c17 flag
2020-11-13msvc: enable /std:c17 flagjpark371-8/+19
Increase allowed c_std options, and check compiler version. Also update mlog pattern to not crash.
2020-11-13Use c99 instead of c11 for buildoptions testjpark371-1/+1
Older verisons of MSVC do not support C11 properly.
2020-11-13environment: Fix detection of rust compilers, moreDylan Baker2-12/+29
2020-11-13compilers/rust: warn about setting -C linker in your compiler argsDylan Baker1-0/+7
2020-11-13compilers/rust: add and use an implementation of use_linker_argsDylan Baker2-7/+11
2020-11-13run_unittests: use textwrap.dedentDylan Baker3-28/+34
So that editors that can fold code (vim, vscode, etc) can correctly fold functions, instead of getting confused by code that doesn't follow the current indention. Also, it makes the code easier to read.
2020-11-13ninjabackend: Fix a couple of rust bugsDylan Baker1-2/+3
There are two bugs here, first is that we open coded the output args, instead of using the compiler method. The second is that rust args are not passed down to the backend invocation.
2020-11-13environment: Properly pass linker to rustcDylan Baker1-7/+9
rustc is very different than other compilers, in that it doesn't generate object files, it just creates a final target out of the intermediate sources. As such, it needs to know about the linker args in the compiler invocation.
2020-11-13Merge pull request #7866 from dcbaker/submit/compiler-std-in-baseJussi Pakkanen4-170/+123
Put the Compiler standard option in the Language mixin
2020-11-13ninjabackend: fix matching of empty stringsAlexander Neumann1-1/+1
closes #7977
2020-11-13Do not warn when -Wpedantic is added as a project argument.Eli Schwartz1-1/+5
The only way to add it via warning_level is top opt in to -Wextra too. But this is often not really desirable, since -Wextra is not stable -- it changes its meaning every compiler release, thus mysteriously adding new warnings. Furthermore, it's not really the same kind of warning -- a pedantic warning is always correct that your code is wrong, but defines wrongness as "not per the portable standard". Unlike -Wextra it doesn't try to judge your code to see if you're doing something that is "often not what you meant", but is prone to false positives. Really, we need different *kinds* of warning levels, possibly as an array -- not just a monotonically increasing number. But since there's currently nothing flexible enough to specify -Wpedantic without -Wextra, we will just remove the warning for the former, and let people add it to their project arguments in peace.
2020-11-13gnome: Handle libraries that are not in the current build dirSam Thursfield11-5/+387
The generate_gir() function previously assumed all library inputs were in the current build dir. This would fail if they weren't.
2020-11-13The version kwarg must be a string. Closes #7975.Jussi Pakkanen1-0/+2
2020-11-12clang-cl: Allow clang-cl (when compiling C) to pass std to underlying clang)Dylan Baker1-34/+33
This allows a wider array of standard support than would be available directly from clang-cl, emulating MSVC stds.
2020-11-12doc: fix typo [skip ci]Eli Schwartz1-1/+1
2020-11-12interpreter: Add get_keys function for configuration_data (#7887)Jones4-0/+16
2020-11-12Merge pull request #7961 from dcbaker/submit/rust-color-outputJussi Pakkanen2-3/+18
Add color output support to rust
2020-11-12Merge pull request #7965 from dcbaker/wip/2020-11/macos-github-actionsJussi Pakkanen12-135/+133
Migrate osx CI from travis to github actions
2020-11-12dependencies: Put pkgconfig options before operandsHaelwenn (lanodan) Monnier3-5/+9
This fixes building with meson when the POSIX behavior of getopt is used, such as when GNU libc is used with POSIXLY_CORRECT=1 defined
2020-11-12compilers/c: Log that MSVC doesn't support gnu stdsDylan Baker1-1/+13
Since the current approach of demoting to the nearest C standard *might* work, but might not. For projects like Glib that detect which standard is used and fall back this is fine. For projects like libdrm that only work with gnu standards, this wont. We're nog tusing a warning because this shouldn't be fatal if --meson-fatal-warnings is used. Also demote a similar message in IntelCl from warning to log.
2020-11-12compilers: define standards in the base language compilerDylan Baker3-152/+71
And then update the choices in each leaf class. This way we don't end up with another case where we implicitly allow an invalid standard to be set on a compiler that doesn't have a 'std' setting currently.
2020-11-12compilers: Standardize the names of compiler optionsDylan Baker3-16/+16
Most options don't use language prefaced options (std vs c_std) internally, as we don't need that due to namespacing. Let's do that across the board
2020-11-12compilers/c: Clang-cl also needs specific handling for standardsDylan Baker1-0/+19
2020-11-12Make MSVC accept gnu11 as a language standard version. Closes: #7611.Jussi Pakkanen1-3/+7
Fixes: #7611