summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2025-10-14cargo: improve error message for dependency version conflictsPaolo Bonzini
While developing I often got a confusing 'Neither a subproject directory nor a None.wrap file was found'. Replace it with a clear message that explains: 1. Which dependency couldn't be found 2. What versions are available in the root Cargo.lock 3. That this is likely a version conflict 4. How to fix it (update dependencies to match root Cargo.lock) Example: ERROR: Dependency 'socket2-0.4-rs' not found. Root Cargo.lock provides: socket2-0.5-rs, socket2-0.6-rs. This could be a Meson bug, please report it. I am actually not sure if this is really always a Meson bug. But to be safe, suggest reporting it until more experience is gained. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-10-14cargo: move fetching to _dep_packagePaolo Bonzini
This allows modifying the version number before the package is fetched. Extracted from a patch by Xavier Claessens <xclaessens@netflix.com>. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-10-14cargo: load a toplevel Cargo.lockPaolo Bonzini
2025-10-14cargo: load a single Cargo.lock for a whole chain of subprojectsPaolo Bonzini
When processing cargo subprojects, each Resolver was independently loading Cargo.lock files, leading to duplicate wraps and errors like 'Multiple wrap files provide dependency'. Instead, build the cargo.Interpreter as soon as a Cargo.lock file is found, and merge that Cargo.lock into the wrap resolver. There is no need anymore to build a separate resolver for the dependent packages, because their indirect dependencies are all listed in the parent lockfile.
2025-10-14cargo: retrieve cfgs on demandPaolo Bonzini
Allow creating the cargo.Interpreter (and thus parsing the Cargo.lock file) even before 'rust' is added as a language. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-10-14cargo: create cargo.Interpreter on the flyPaolo Bonzini
Do not create a single cargo.Interpreter for the whole execution, instead create one as soon as a Cargo.lock file is read and only make it last until that Cargo.lock has been processed. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-10-14cargo: When loading wraps multiple packages can have the same URLXavier Claessens
This avoids cloning the same repo multiple times, instead a single wrap can provide multiple cargo dependencies.
2025-10-14cargo: completely ignore unknown depsPaolo Bonzini
These could also be target dependencies, which would fail the test in _add_dependency Extracted from a patch by Xavier Claessens <xclaessens@netflix.com>
2025-10-14scanbuild: obey MESON_NUM_PROCESSES environment variableStephan Lachnit
2025-10-14Detect dependency changes in Windows rc compilerCharles Brunet
The `rc.exe` resource compiler neither provides *depfile* support nor allows showing includes, as is possible with C or C++ compilers. Therefore, changes to files included by the `.rc` file did not trigger recompilation of the resource file. A workaround was added to *meson* by calling the preprocessor on the `.rc` file to detect the included headers and adding the result as a dependency to the resource compilation.
2025-10-14Allow compiler methods to accept strings for include_directoriesCharles Brunet
2025-10-14doc: fix version for build_config optionCharles Brunet
was wrongly tagged in 59c3dd1
2025-10-14compilers: clang: pass /nodefaultlibPaolo Bonzini
Work around https://github.com/llvm/llvm-project/issues/129881. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-10-14compilers: make link/lld-link check homogeneousPaolo Bonzini
Use the same check for all of clang, nasm and rustc. This also avoids the following warning: Sanity check compiler command line: clang++ sanitycheckobjcpp.mm -o sanitycheckobjcpp.exe -D_MT -D_DLL -D_DEBUG -D_FILE_OFFSET_BITS=64 -Wl,-fms-runtime-lib=dll_dbg Sanity check compile stdout: LINK : warning LNK4044: unrecognized option /fms-runtime-lib=dll_dbg; ignored iWhat happens is that -fms-runtime-lib sets up an automatic dependency from the .o files to the final link product, and therefore must be passed as a compiler argument. But the constructor for ClangCompiler was incorrectly allowing b_vscrt for MINGW, so I messed up the logic. With this change, MINGW won't get the b_vscrt option. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-10-14Make use of build TypeAliasesDylan Baker
There are a lot of spelled out unions for these types, lets reduce that number
2025-10-14build: Add a TypeAlias for any valid targetDylan Baker
2025-10-14build: Use `TypeAlias` decorationDylan Baker
Which can help type checkers in some cases
2025-10-14interpreter/kwargs: use options.ElementaryOptionValues when possibleDylan Baker
2025-10-14Add hex error code in meson test failure outputna-trium-144
2025-10-14pkgconfig: Improve handling of empty string depsEyal Itkin
Fix the original bug fix for #13950 to only warn about empty required strings, instead of failing the entire build. This will simplify the workflow for users that build the string from a possibly empty list, and save them the need for the added if-check. Signed-off-by: Eyal Itkin <eyal.itkin@gmail.com>
2025-10-14Generate Android cross files with env2mfile.Jussi Pakkanen
2025-10-14Add C23 and C2Y supported c_std versions for Apple compilers.John Ralls
2025-10-11Avoid running overriden program to get its versionXavier Claessens
The parent `__init__` was setting cached_version back to None. This fixes a regression caused by https://github.com/mesonbuild/meson/pull/8885.
2025-10-11fix rustc -l argument on WindowsPaolo Bonzini
On Windows, rustc searches both FOO.lib and libFOO.a when passed -lfoo. This means that the check for nonstandard names in the Unix sense is too struct, and indeed it breaks passing for example -lkernel32 (which adds kernel32.lib to the link). Fix this by special casing Windows. Extract the logic to the Rust compiler class for clarity. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-10-11ninjabackend: fix cut and paste issuePaolo Bonzini
The variable for the .a here is called "a", not "lib". Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-10-11pkgconfig: Handle malformatted string dependenciesEyal Itkin
Add missing checks for correctness of string dependency, including case for malformatted versioned dependency. Resolves #13950. Signed-off-by: Eyal Itkin <eyal.itkin@gmail.com>
2025-10-08ninja: don't exclude rustc native-static-link argsMarc-André Lureau
`rustc --crate-type staticlib --print native-static-libs` doesn't print the default libraries being linked with rustc by default, at least not with rustc 1.89.0 (29483883e 2025-08-04). Stripping those by default, such as ws2_32 on win32, prevents from linking programs using sockets (ex qemu). Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2025-10-08doc: fix bindgen exampleMarc-André Lureau
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2025-10-08rust: query linker in addition to compiler for verbatim supportPaolo Bonzini
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-10-08ninjabackend: rust: fail on unsupported library namesPaolo Bonzini
When verbatim is not available, libraries that have custom name_prefix or name_suffix will not be found. Fail the build completely instead of ending up with a bad option. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-10-08ninjabackend: unify conversion from path to -L/-lPaolo Bonzini
When Meson cannot use -Clink-arg=, it has to split the path into a -L option (to add to the search directory) and a -l option (to actually link). Furthermore, if rustc does not support verbatim, Meson needs to undo the addition of "lib" and the extension. Do both tasks in the same place and with the same logic, instead of treating internal and external libraries differently. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-10-08ninjabackend: use compilers.is_libraryPaolo Bonzini
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-10-08rust: add test case for issue #15020Marc-André Lureau
Do not link with link_whole/bundle, to show linking issue with Apple ld. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-10-08vala: Add method to get generated GIR from a build_targetDylan Baker
Fixes: #2296 Fixes: #4481 Fixes: #5968
2025-10-08vala: Add method to build_target to get generated vapi fileDylan Baker
Same as the previous, but for VAPI
2025-10-08vala: add a method to get a generated vala headerDylan Baker
This allows targets that don't link with a vala target to rely on the header generation.
2025-10-08format: fix indentation at beginning of argumentsCharles Brunet
Fixes #14998
2025-10-08docs: Add vala_header, vala_vapi, and vala_gir to build_target docsDylan Baker
Which have existed for a *long* time, but are only documented in the Vala docs.
2025-10-07Revert "compilers/asm: Introduce an ASMCompiler base class"Dylan Baker
This reverts commit 1e254ad7f327e5ed2021463e4b66c37072d354e3.
2025-10-07Revert "compilers/asm: Move arch support check to initializer"Dylan Baker
This reverts commit be50d0e23737dc0fc5f074a291644d7fde39ef7b.
2025-10-06options: simplify builtins logicPaolo Bonzini
The keys are always global and there are no yielding options in fact; historically it was the way to make an option not per-subproject, but that's no longer needed. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-10-06coredata: remove pointless @staticmethodPaolo Bonzini
Just move everything to optstore, together with the methods it calls. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-10-06compilers: do not use coredata.set_optionsPaolo Bonzini
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-10-06unittests: do not use coredata.set_optionPaolo Bonzini
optstore is able to set buildtype correctly. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-10-06interpreter: unify and specialize code to set backend optionsPaolo Bonzini
Avoid different but equivalent code between ast and regular interpreter, and avoid using coredata.set_options since all options are known to be backend options. Move to environment since it uses environment.options. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-10-06interpreter: do not use coredata.set_optionPaolo Bonzini
The key is valid and there is no added functionality from coredata. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-10-06interpreter, options: inline get_default_for_b_optionPaolo Bonzini
This is a simple access, and there are already uses of COMPILER_BASE_OPTIONS outside options.py. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-10-06options: make is_base_option stricterPaolo Bonzini
Only return True if the option actually exists. While at it, ensure that the right machine is looked up in get_default_for_b_option; this allows removing the try/except block. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-10-06options: remove set_value_objectPaolo Bonzini
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-10-06options: remove dead codePaolo Bonzini
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>