summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2025-01-08clippy: skip running it if --cap-lints allow is included in the command linePaolo Bonzini
Meson builds libraries before running clippy, thus all dependencies must be present and clippy is run only for the warnings (instead, Cargo treats clippy as a separate toolchain and builds everything). In Meson's case thus it is pointless to run clippy whenever --cap-lints allow is included in the command line. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-01-08rust: add warning_level=0 to downloaded Cargo subprojectsPaolo Bonzini
This adds --cap-lints allow, matching how Cargo builds them. In the case of Cargo, this is only applied to non-path dependencies. Without this change, clippy will complain about dependencies as well. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-01-08rust: change warning_level=0 to "--cap-lints allow"Paolo Bonzini
This is a better and more backwards-compatible way to disable all warnings, compared to "-A warnings". The Rust RFC (https://rust-lang.github.io/rfcs/1193-cap-lints.html) explains the rationale: > We would very much like to be able to modify lints, however. For example > rust-lang/rust#26473 updated the missing_docs lint to also look for missing > documentation on const items. This ended up breaking some crates in the > ecosystem due to their usage of #![deny(missing_docs)]. While at it, document that Rust deviates from the other languages in its interpretation of warning_level=0. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-01-08Interpret TAP bailout output without test plan or test line as errorgerioldman
2025-01-08qt module: provide qml_modulePierre Lamot
This aims to bring the support of QML modules to meson, the goal is to provide something similar to CMake `qt_add_qml_module` function provided by Qt (see https://doc.qt.io/qt-6/qt-add-qml-module.html ) Fixes: #6988, #9683
2025-01-08qt module: allow moc to generate json introspection filePierre Lamot
2025-01-08qt module: remove quoted annotationsPierre Lamot
2025-01-08interpreter: fix signature type of install_data_implPierre Lamot
in `func_install_data`, `rename` parameter is `ContainerTypeInfo(list, str)` in `module/python.py`, rename is `None` `rename` is stored in `build.Data` object under the type `T.List[str]`
2025-01-07ninja backend: don't rebuild all tests by defaultEli Schwartz
When running `ninja all` we shouldn't build testsuite programs as these might not be wanted e.g. in order to just install the project. We do want them to be built when running `ninja test`. Since meson 0.63 we actually have a dedicated ninja alias for test dependencies -- move these from the "all" rule to the dedicated test/benchmark rules. Closes: https://github.com/mesonbuild/meson/issues/1704 Closes: https://github.com/mesonbuild/meson/issues/1949 Closes: https://github.com/mesonbuild/meson/issues/2518 Closes: https://github.com/mesonbuild/meson/issues/3662 Closes: https://github.com/mesonbuild/meson/pull/5728 Closes: https://github.com/mesonbuild/meson/pull/5867 Closes: https://github.com/mesonbuild/meson/pull/6511 Closes: https://github.com/mesonbuild/meson/pull/11317 Closes: https://github.com/mesonbuild/meson/issues/13378
2025-01-07fix trailing whitespace issuesEli Schwartz
2025-01-07mtest: fix rebuilding all before running testsEli Schwartz
Inconsistency in the original implementation of commit 79e2c52a15e896e46ff3cfa3ec16fbf3f132ee01. If an explicit list of targets is passed on the CLI, then that is passed to rebuild_deps. If not, we pass every loaded test to rebuild_deps instead. This means we cannot distinguish between "trying to run all tests" and "trying to run specific tests". We then load all the deps for all tests, and try to build them all as explicit arguments to the underlying ninja. There are two situations where this falls flat: - given underspecified deps - given all (selected?) tests legitimately happen to have no dependencies In both cases, we calculate that there are no deps to rebuild, we run ninja without any targets, and this invokes the default "all" rule and maybe builds a few thousand targets that this specific test run does not need. Additionally, in large projects which define many tests with many dependencies, we could end up overflowing ARG_MAX when processing *all* tests. Instead, pass no tests to rebuild_deps. We then specially handle this by directly running the relevant ninja target for "all test deps", which is overall more elegant than specifying many many dependencies by name. Given a subset of tests to guarantee the freshness of, we instead skip running ninja at all if there are indeed no test dependencies.
2025-01-08First draft version of Tasking MIL linking with b_lto and prelinkinggerioldman
2025-01-08Add TASKING compiler supportgerioldman
2025-01-08Add TASKING to docsgerioldman
2025-01-08Store commands as arrays.Jussi Pakkanen
2025-01-08CI: remove codeqlDylan Baker
It rarely finds real issues that other scanners (pylint, flake8, mypy) don't find, and gives lots of useless and annoying errors that clutter discussions
2025-01-07Revert "make the testsuite handle MSYS2's addition of cmd"Christoph Reiter
This reverts commit 3c38e4720f7df0a9d0138363a9a995b31e848401.
2025-01-07Revert "check if test 33 running under MinGW"Christoph Reiter
This reverts commit 93f59313e10090bfe6058fabbb235aa549f933c0.
2025-01-07tests: Avoid modifying '17 prebuild shared' test dirJan Alexander Steffens (heftig)
Tests can tread on each other's toes when parallelism is high enough. In this case, `test_prebuilt_shared_lib` creates an object file in the `17 prebuilt shared` test dir. `test_prebuilt_shared_lib_rpath_same_prefix` uses `shutil.copytree` to copy that same test dir to a temporary location. If the former test cleans up its object file while `copytree` is running, the copy can fail with a fatal ENOENT `shutil.Error`. Use `copy_srcdir` to prevent this from happening.
2025-01-07Add run0 as a way to raise privilegesrusty-snake
2025-01-07fix missing extension in command pathCharles Brunet
On Windows, if the native file contains a path without the extension, the executable may be found, but custom target would fail because that path does not exist.
2025-01-07CI: Use a tagged version of cygwin-install-actionJon Turney
Use a tagged version of cygwin-install-action, rather than whatever happens to be master at the moment. This should help isolate meson CI from random breakage there.
2025-01-07Fix internal dependency namesCharles Brunet
Internal dependency names were generated from object id. This cause problem when objects are copied, especially when generating partial dependency, or when extracting shared or static dependencies from both_library, because dependency names in target and dependencies introspection files become unrelated. This fixes that by generating the dependency name from the internal id, and by using that base name when generating partial dependencies.
2025-01-07Only use uninstalled deps if a build dir exists.Jussi Pakkanen
2025-01-07ci: add qt6 QML libraries in Linux imagesPierre Lamot
These packages are required to test `qml_module` from qt
2025-01-06docs: fix cxx -> cppDylan Baker
2025-01-06Fix wrap.py to avoid following symlinksKaruroChori
2024-12-31Fail gracefully when compiler cache is specified without compilerJoel Rosdahl
With CC=ccache meson ... meson crashes with [...] File "/usr/lib/python3.10/site-packages/mesonbuild/compilers/detect.py", line 364, in _detect_c_or_cpp_compiler compiler_name = os.path.basename(compiler[0]) IndexError: list index out of range Improve this by throwing an EnvironmentException to fail gracefully when no compiler is specified. Fixes #9933 Fixes #13589
2024-12-29ninjabackend: prefer "in" to regex searchPaolo Bonzini
Regexes can be surprisingly slow. This small change brings ninja_quote() from 12 to 3 seconds when building QEMU. Before: ncalls tottime percall cumtime percall 3734443 4.872 0.000 11.944 0.000 After: ncalls tottime percall cumtime percall 3595590 3.193 0.000 3.196 0.000 Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Eli Schwartz <eschwartz93@gmail.com>
2024-12-29ninjabackend: use File.from_built_relative()Paolo Bonzini
Do not reinvent it in NinjaBackend.determine_ext_objs(), so as to use the recently added caching of the results of File.from_built_relative(). Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Eli Schwartz <eschwartz93@gmail.com>
2024-12-29utils: cache build directory filesPaolo Bonzini
get_target_generated_sources often calls File.from_built_relative on the same file, if it is used by many sources. This is a somewhat expensive call both CPU- and memory-wise, so cache the creation of build-directory files as well. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Eli Schwartz <eschwartz93@gmail.com>
2024-12-29compilers: cache the results of is_source()Paolo Bonzini
is_source() is called almost 900000 times in a QEMU setup. Together with the previously added caching, this basically removes _determine_ext_objs() from the profile when building QEMU. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Eli Schwartz <eschwartz93@gmail.com>
2024-12-29dependencies: add custom atomic dependencyDudemanguy
Almost exactly the same as how the dl dependency works. On certain systems (like BSDs that use clang), stdatomic is provided by compiler-rt and doesn't need a separate library explictly linked. On a typical GNU/LINUX system, atomic is a separate library that must be explictly found and linked against. So just add a builtin and system method for these two use cases.
2024-12-27compilers: De-dup -Wl,-rpath, and -Wl,-rpath-link,Nirbheek Chauhan
When followed by a comma, we can be absolutely sure that these are argument prefixes, and will not consume the next argument to form a single argument. Fixes spammy warnings on apple clang: `ld: warning: duplicate -rpath 'build/dist/darwin_universal/arm64/lib/pkgconfig/../../lib' ignored` Continuation from https://github.com/mesonbuild/meson/pull/13819
2024-12-27arglist: De-dup arg prefixes only when they are used as a prefixNirbheek Chauhan
This was already done for dedup2_prefixes, also do it for dedup1_prefixes, and move export-dynamic to dedup1_args, where it belongs. Also modify some comments around this to clearly distinguish standalone argument matching and argument-prefix matching.
2024-12-25test cases: fix '8 flex' with C23Sam James
With C23 (as upcoming GCC 15 will default to), `void yyerror()` is the same as `void yyerror(void)`, i.e. `yyerror` takes no arguments. Fix the prototype given we *do* call it with an error string: ``` pgen.p/parser.tab.c: In function ‘yyparse’: pgen.p/parser.tab.c:1104:7: error: too many arguments to function ‘yyerror’ 1104 | yyerror (YY_("syntax error")); | ^~~~~~~ ../test cases/frameworks/8 flex/parser.y:3:12: note: declared here 3 | extern int yyerror(); | ^~~~~~~ pgen.p/parser.tab.c:1215:3: error: too many arguments to function ‘yyerror’ 1215 | yyerror (YY_("memory exhausted")); | ^~~~~~~ ../test cases/frameworks/8 flex/parser.y:3:12: note: declared here 3 | extern int yyerror(); | ^~~~~~~ ``` Bug: https://bugs.gentoo.org/946625
2024-12-20Prioritise Apple's toolchain in project-tests-appleclangCarlo Cabrera
Using Homebrew Clang leads to failures when testing objfw. We probably want to ensure we use Apple Clang here given the workflow job name, in any case.
2024-12-20print out which command needs an exe_wrapperRolf Eike Beer
It's not the first time I run into an issue with an intentionally missing exe_wrapper during cross compilation. In pretty much all the cases the project I tried to build already had code available to not need one in the first place. Print out what command was actually the culprit to make debugging this easier.
2024-12-20modules/rust: Specify the compiler version to bindgen when possibleDylan Baker
bindgen by default may output code that an older rustc cannot successfully consume. To avoid this, we check if bindgen supports the rustc version we're using, if so, and if the user didn't set the `--rust-target` option, we will supply it to ensure that bindgen writes out code our rustc can use. If it does not support that version explicitly, we leave it at the default, assuming that our compiler version is newer than bindgen.
2024-12-20Revert "CI: Windows: downgrade rust to 1.77"Eli Schwartz
This reverts commit 1da230c9e0f66cf7ecf5a9f5fed70e74e15418ac. Should be fixed now in upstream rustc.
2024-12-20ci: gentoo: include sys-devel/gcc[d], bindgen, rust[clippy,rustfmt]Sam James
Signed-off-by: Sam James <sam@gentoo.org>
2024-12-19replace cmake configuration workaround with a straight copyJan200101
2024-12-19add test case for @ and curly brace substitution with cmake formatJan200101
2024-12-19do @ variable substitution when parsing cmake formatJan200101
the upstream behavior of configure_file in cmake parses both @VAR@ and ${VAR} and only supports disabling the bracket variables through the `@ONLY` argument, meson needs to follow this behavior for compatibility
2024-12-19mtest: tap: accept out-of-order or partly-numbered testsPaolo Bonzini
Resolves: #13802 Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2024-12-19compiler: fix leftover chars in compiler.links()meator
The following log output: Checking if "strnstr() available" : links: NO now becomes: Checking if "strnstr() available" links: NO This is more consistent with the compiles() method.
2024-12-19compilers: Do not pass `-fuse-ld=lld` via `-Wl,`LIU Hao
`-fuse-ld=` is a driver option for selection of a linker; it shall not be passed to a linker with `-Wl,`. For the Microsoft compiler and linker, the options for the compiler and those for the linker are separated by `/LINK`, which looks like `cl /cl-options ... /link /link-options ...`. Formally, they are passed in the same command line. When Clang is invoking the Microsoft linker or a Microsoft-style linker (that is, LLD-LINK), every linker option has to prefixed by `-Wl,` or `-Xlink`. Previously, using Clang-CL and LLD-LINK, given: cc = meson.get_compiler('c') assert(cc.has_link_argument('/LTCG')) This code failed to detect the `/LTCG` option, because `-fuse-ld=lld` was passed to the linker, as an invalid option: Command line: `clang E:\lh_mouse\Desktop\t\build\meson-private\tmpg0221fee\testfile.c -o E:\lh_mouse\Desktop\t\build\meson-private\tmpg0221fee\output.exe -D_FILE_OFFSET_BITS=64 -O0 -Werror=implicit-function-declaration -Wl,-WX -Wl,/LTCG -Wl,-fuse-ld=lld` -> 4044 stdout: LINK : warning LNK4044: unrecognized option '/fuse-ld=lld'; ignored LINK : error LNK1218: warning treated as error; no output file generated However, it should be noted that not all LINK options can be passed with `-Wl,`. The `/subsystem:windows,6.1` option has a comma, which would be converted to a space. Therefore, this option must be passed as `-Xlinker -subsystem:windows,6.1`. This issue is not addressed in this commit. Signed-off-by: LIU Hao <lh_mouse@126.com>
2024-12-19rust: raise a warning if clippy is used instead of rustcPaolo Bonzini
clippy-driver is not meant to be a general-purpose compiler front-end. Since Meson can now provide natively the ability to invoke clippy, raise a warning if someone uses it that way. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2024-12-19ninjabackend: add support for "ninja clippy"Paolo Bonzini
Add a target that builds all crates that could be extern to others, and then reruns clippy. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2024-12-19scripts: add "clippy" internal toolPaolo Bonzini
Similar to the "ninja scan-build" target for C, add a clippy internal tool that runs clippy-driver on all crates in the project. The approach used is more efficient than with "ninja scan-build", and does not require rerunning Meson in a separate build directory; it uses the introspection data to find the compiler arguments for the target and invokes clippy-driver with a slightly modified command line. This could actually be applied to scan-build as well, reusing the run_tool_on_targets() function. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>