aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2025-04-09options: always look up root-project options in self.optionsPaolo Bonzini1-4/+5
Previously, root-project options (key.subproject == '') would always be stored as an augment or as pending_project_options. But they might actually be included in self.options instead, so exclude them from the initial test. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-04-09tests: enhance deprecated options testMarvin Scholz3-0/+64
This actually tests the handling of deprecated options when passed to meson instead of just as default_options. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-04-09options: go through set_option for non-:-prefixed optionsPaolo Bonzini1-2/+2
Allow proper handling of deprecated and read-only options, which is missing from set_value. Fixes: #14433 Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-04-09options: fix incorrect commentPaolo Bonzini1-6/+6
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-04-09options: make cmd_line_options handling more similar to the restPaolo Bonzini1-7/+5
The structure of the "if" statements in the cmd_line_options iteration is a bit different from the others due to the need to raise an error for some kinds of unknown options. Reduce the dissimilarity by checking key.subproject is None just before raising the exception. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-04-09gnome: Add a test consuming PythonL. E. Segovia7-12/+113
2025-04-09modules/gnome, modules/Python: Allow injecting RPATH flags through LDFLAGS ↵L. E. Segovia2-11/+18
if needed Fixes communicating the RPATH to g-i-scanner in macOS. See #14169
2025-04-08coredata: delete set_default_optionsDylan Baker3-47/+13
This was only being used by the introspection interpreter, which meant the two interpreters had different behavior. They still do, which is really bad because the IntrospectionInterpreter doesn't have the command line options or project_default_options. I have a plan to fix that later, and I don't want to spend time on it here, as it's not a regression of this patch, it's just the status quo. This also fixes an issue caused by dead code being left, and hit, due to the option refactor branch. Fixes: #14382
2025-04-08tests: Add a rewriter test that handles prefixDylan Baker2-0/+20
"prefix" has a lot of special handling that has to go on because so many other options depend on prefix. It was also regressed by the option refactor changes, so having a test feels appropriate. This was verified against the 1.7 release, so it has the same behavior as pre-option refactor Meson.
2025-04-08options: fix an assertion that is incorrectDylan Baker1-2/+4
The key can be an OptionKey, particularly in the next patch.
2025-04-08options: fix typing issues stemming from initialize_from_top_level_project_callDylan Baker2-7/+15
Machine files provide a `Mapping[OptionKey, ElementaryOptionValues]`, but the expectation listed was that they provided options in the raw DSL format.
2025-04-08coredata: move update_project_options to the optstoreDylan Baker4-33/+34
2025-04-08coredata: move MutableKeyedOptionDict to optionsDylan Baker18-36/+35
2025-04-07Fix documentation typosEmil Berg7-9/+9
2025-04-07Fix link to "Building Fancy DMG Images on Mac OS X"Heikki Rauhala1-1/+1
2025-04-06ci: arch: add vulkan-headers and vulkan-icd-loaderSam James1-1/+1
The latter is needed for vulkan.pc now, but let's add vulkan-headers explicitly while at it.
2025-04-06ci: arch: workaround cmake-4 vs wxwidgetsSam James1-0/+3
Workaround for cmake-4.0 vs wxwidgets-gtk2 by setting CMAKE_POLICY_VERSION_MINIMUM=3.5.
2025-04-06ci: opensuse: handle libSDL2-devel going awaySam James1-1/+1
See https://lists.opensuse.org/archives/list/factory@lists.opensuse.org/thread/BJO756KHSCBPDMXVGFMGPHPUMW4PZK6T/#SLVEVFEFOCT3R5RCSVZPQN3GZSZYAEXL. Use sdl2-compat-devel instead. I did try 'pkgconfig(sdl2)' but it failed with some resolver error I didn't probe further.
2025-04-06Add C# to home page supported language listEmil Berg1-1/+1
2025-04-06docs: say '--wrapper', not '--wrap' for testsSam James1-3/+3
We document --wrapper and --wrap works only by expanding it automatically to --wrapper as it is unambiguous.
2025-04-05cmake/interpreter: Don't add __CMake_build to includesTomi Lähteenmäki6-2/+43
Don't add "<project_source_dir>/<subproject>/__CMake_build" directory to include directories. Fixes #12351
2025-04-05tests/d: Limit integer debug and version statementsAndrei Horodniceanu2-12/+31
Since dmd frontend version 2.111 integer debug and version statements error during parsing: https://dlang.org/changelog/2.111.0.html#dmd.deprecation-version-debug-number
2025-04-04templates: Fix style by adding space after ifPaul Caprioli6-12/+12
2025-04-04rust: add shared library testcase for "objects"Paolo Bonzini2-0/+25
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-04-04rust: add external objects to the link command linePaolo Bonzini9-4/+71
Because rustc does not support extract_objects, QEMU creates a static library with all the C objects. It then passes this static library as link_whole, together with another static library containing general purpose utility functions which is passed as link_with. However, this is brittle because the two have a circular dependency and they cannot be merged because of the link_whole/link_with difference. While lld seems to have the --start-group/--end-group semantics automatically, ld.bfd can fail if these options are needed. This can cause difference between distros depending on how Rust is packaged (e.g. Ubuntu 22.04 and Debian bookworm seem to use ld.bfd). The simplest solution is for Meson to implement "objects:" properly for Rust. Then QEMU can use the same internal dependency objects that it already has in place for C programs. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-04-04backends: extract get_fortran_order_deps()Paolo Bonzini1-8/+12
Allow reusing it for Rust targets. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-04-04cmake: filter and order clib_compiler languagesAndrei Alexeyev1-6/+11
2025-04-04cmake: pass clib_compiler to resolve_cmake_trace_targets()Andrei Alexeyev1-1/+7
This is required to resolve ambiguous LINK_LIBRARIES passed as bare names.
2025-04-04add test case for cpp_std/cuda_stdPaolo Bonzini1-1/+2
This was broken twice, so check that it does not regress. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-04-04compilers: move -std options to get_option_std_args, special-casing CUDAPaolo Bonzini9-64/+88
Move building the -std option to the new get_option_std_args method, special casing CUDA to never include the option from the host compiler. This fixes again #8523, which was broken by the option refactoring (unsurprisingly, since the fix was ripped out unceremoniously without a replacement). Fixes: #14365 Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-04-04compilers: introduce get_option_std_argsPaolo Bonzini6-0/+9
Allow CUDA to completely override the -std arguments but not the rest. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-04-04compilers: remove useless get_option_compile_argsPaolo Bonzini2-6/+0
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-04-03Docs: Set note/warning title color to black textFeRD (Frank Dana)1-1/+1
The white text previously used (inadvertently) doesn't show up well against the blue color used as the background for Note boxes.
2025-04-03tests/fortran: use fs.copyfileDylan Baker1-14/+1
Since the comment saying we need a generic way to do this is a little outdated.
2025-04-03tests/fortran: also test using a generator()Dylan Baker2-2/+64
We already test for custom_targets and configure_file, but we should test a generator too
2025-04-03backend/ninja: use a two step process for dependency scanningDylan Baker3-67/+254
This splits the scanner into two discrete steps, one that scans the source files, and one that that reads in the dependency information and produces a dyndep. The scanner uses the JSON format from https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1689r5.html, which is the same format the MSVC and Clang use for C++ modules scanning. This will allow us to more easily move to using MSVC and clang-scan-deps when possible. As an added bonus, this correctly tracks dependencies across TU and Target boundaries, unlike the previous implementation, which assumed that if it couldn't find a provider that everything was good, but could run into issues. Because of that limitation Fortran code had to fully depend on all of it's dependencies, transitive or not. Now, when using the dep scanner, we can remove that restriction, allowing more parallelism.
2025-04-03backend/ninja: fix cross module dependenciesDylan Baker1-0/+7
This requires that every Fortran target that uses modules have a full dependency on the scan target of it's dependencies. This means that for a three step target `A -> B -> C`, we cannot start compiling any of B until all of A is linked, and cannot start compiling any of C until all of A and B is linked. This fixes various kinds of races, but it serializes the build and makes it slow. This is the best we can do though, since we don't have any sort of portable format for telling C what is in A and B, so C can't know what sources to wait on for it's modules to be fulfilled.
2025-04-03backend/ninja: depfile generation needs a full dependency on all scanned sourcesDylan Baker1-7/+9
It is not sufficient to have an order dependency on generated sources. If any of those sources change we need to rescan, otherwise we may not notice changes to modules.
2025-04-03backend/ninja: Fortran targets need to -I transitive deps private dirsDylan Baker3-2/+43
Otherwise they won't be able to find their module outputs. This requires a new method to look at dependencies, as the existing ones wont find static libraries that were linked statically into previous targets (this links with A which link_whole's B). We still need to have B in that case because we need it's BMI outputs.
2025-04-03backend/ninja: fortran must fully depend on all linked targetsDylan Baker1-5/+7
Because we use this dependency to ensure that any binary module files are generated, we must have a full dependency. Otherwise, if a new module is added to a dependent target, and used in our target, we race the generation of the binary module definition.
2025-04-03tests: our fortran order deps are wrong if a new module is introducedDylan Baker1-0/+40
Because we don't set the appropriate dependencies
2025-04-03tests: demonstrate that our scanner cannot handle cross target modulesDylan Baker7-7/+50
2025-04-03environment: build_dir is allowed to be None in the initializerDylan Baker1-2/+3
But we really expect it to be a string once the initializer is done. Therefore, let's set it to `''` just like we do with the scratchdir in the case that it's set to None in the initializer.
2025-04-03compilers/rust: fix sanity_check for Windows targetsKacper Michajłow1-1/+1
Windows toolchains append `.exe` to executables. When cross-compiling on Linux, attempting to run `./rusttest` will not execute the generated `rusttest.exe`. Fix this by always appending `.exe`, which is a valid filename on all supported platforms. This is what the `CLikeCompiler` class does too. While reviewing `rust.py`, there are opportunities for improvements and better unification with the rest of the Meson code. However, this commit focuses on fixing cross-compilation with minimal changes. Fixes: #14374
2025-04-03Docs: Cleaner admonishment stylingFeRD (Frank Dana)2-4/+56
2025-04-02docs: fix default for mformat sort_files optionBenjamin Gilbert1-1/+1
sort_files has always defaulted to true. Fixes: 2b37101998c8 ("meson format command")
2025-04-02mtest: refactor get_wrapper slightlySam James1-3/+4
--wrapper and --gdb are mutually exclusive per run(), so make get_wrapper reflect this (which would've saved me some time earlier with trying to make the two work together for something else, when it turns out that's impossible). As suggested by Eli.
2025-04-02mtest: set VALGRIND_OPTS to fail tests on errorsSam James2-0/+15
We currently suggest that users run `meson test --wrapper valgrind`, but this doesn't do what one might expect: Valgrind doesn't error out on violations/issues it detects. In the past, we had special handling for Valgrind in tests, see 1f76b76a84cb635f764ecbd2b77aaba1d375d72b but it was later dropped in 951262d7590343ffa9730666c427ad9d708a9fb6. This is similar to what we do for {A,UB,M}SAN_OPTIONS to give sensible behaviour that users expect out-of-the-box. Only do this if we see 'valgrind' in the wrapper command to avoid polluting logs. We may want to do that for the sanitizers variables in future too. Note that we're not adding --exit-on-first-error=yes here, as there may be several issues in an application, or a test may be rather slow, and so on. But --error-exitcode=1 to simply make Valgrind's exit status reflect whether an error was found is uncontroversial. Bug: https://github.com/mesonbuild/meson/issues/4727 Bug: https://github.com/mesonbuild/meson/issues/1105 Bug: https://github.com/mesonbuild/meson/issues/1175 Bug: https://github.com/mesonbuild/meson/issues/13745
2025-04-02options: we need to skip build options for machine files as wellDylan Baker2-5/+4
When doing a host == build configuration. This allows us to remove the ignore in check_unused_options, which was papering over this bug.
2025-04-02environment: filter machine file build options that are invalidDylan Baker1-0/+7
Because it makes machine files more generically useful (ie, you can use a file as both a cross and native file) we allow all options to be defined in native files, even when those options are not per machine. It makes more sense to filter invalid options at Environment setup time then to wait and have them filtered when the initializing the project call.