summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2025-12-17interpreter: validate that a target is linkable in link_whole checkDylan Baker
This catches the addition of un-linkable targets at the interpreter level rather than requiring the build layer to handle this. In turn, this gives the end user a better error message.
2025-12-17build|interpreter: use the LINK_WHOLE validator for BuildTargetDylan Baker
2025-12-17interpreter|build: Use typed_kwargs for build_target(dependencies)Dylan Baker
What is basically impossible is to handle `SubprojectHolder`, because it's not a true holder but an interpreter object. Well, impossible without changing SubprojectHolder into a true holder, because it's avoiding the circular import becomes extremely convoluted otherwise, and refactoring is difficult because the held object is itself an Interpreter. It's a rather complex problem to solve gracefully. I've punted to avoid the complexity, it does mean that the error message is somewhat less exact. I don't think this is actually a huge problem because we've really guided people away from using `subproject()` and to instead use dependency fallbacks, which don't have this problem to begin with. This removes validation from the build layer, and puts it in interpreter. For code sharing reasons this means that `internal_dependency` also gets more fine grained error messages. The test case for this has been modified to use the `testcase expect_error` construct, and thus has been moved to the common tests directory. It's also been extended to cover both the library case, which gives coverage for the `extra_types` in `KwargInfo`
2025-12-17modules/python: use typed_kwargs for `install_dir`Dylan Baker
This `install_dir` is slightly different than the one in `BuildTarget` (though I'd like to make them the same in the future). It is only allowed to be `str | bool | None`, and the implementation has always assumed this, it would have broken with an array value.
2025-12-17backend: improve error message about install_dir install_count mismatchDylan Baker
Among other things it will say "expects X but only has Y", even if Y > X.
2025-12-17interpreter: Add type checking for BuildTarget(install_dir: )Dylan Baker
This just puts the type checking in the frontend, there's still some serious cleanup in the build and backend that need to happen.
2025-12-17docs: fix documentation for build_target(install_dir)Dylan Baker
2025-12-17interpreter: use the new feature where it is usefulDylan Baker
2025-12-17interpreterbase: Add a new field to KwargInfo for extra typesDylan Baker
We have some cases where we want to have an extra set of validators that run on specific types, and give detailed answers. However, we don't want those types to show up in the list of accepted types. This new keyword allows for that.
2025-12-16build: cleanup include_directories codeDylan Baker
With the previous change the build layer no longer needs to be concerned about strings
2025-12-16interpreter: use typed_kwargs for build_target(include_directories)Dylan Baker
This allows some additional cleanup, as we had code specifically for doing version checking that was not only used here, and that can be removed.
2025-12-16interpreter/compiler: Use typed_kwargs for include_directories string featureDylan Baker
This removes the use of interpreter.extract_incdirs since_strings, and instead let's typed_kwargs do the work
2025-12-16interpreter: use typed_kwargs ifor dependency (include_directories) stringsDylan Baker
Instead of using the `extract_incdirs` function.
2025-12-16build: simplify `add_include_dirs`Dylan Baker
By setting the default `set_is_system` to `'preserve'`, we don't have to have a check for None inside the body of the method.
2025-12-16review get_subdir vs get_builddirPaolo Bonzini
Comparing the implementation of build_subdir with https://github.com/mesonbuild/meson/pull/12258, both of them introduced a similar separation between srcdir and builddir. There were some differences in the choices of srcdir vs builddir; this commit tries to identify which are bugs in which implementation, and get the best of both worlds.
2025-12-16remove get_source_subdirPaolo Bonzini
2025-12-15docs(summary): Correct example outputFrank Dana
The sample output for the example failed to jibe with reality in several ways: - 'prefix' was not included in the inputs, so it isn't displayed - Boolean values are printed lowercase ('true', not 'True') - The array formatting would be properly aligned
2025-12-15cargo: convert TOMLDecodeError or toml2json errors to a MesonExceptionPaolo Bonzini
Avoid getting a raw exception, instead use a (subclass of) MesonException that is printed in the usual "FILE:LINE:COLUMN: MESSAGE" format. Fixes: #15023 Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-12-15cargo: fix UnboundLocalError if Cargo.lock only has local packagesPaolo Bonzini
2025-12-15cargo: include the implicit feature for dependencies in the manifestPaolo Bonzini
Make the implicit `xyz = ["dep:xyz"]` declaration explicit in the Manifest. This also makes it possible to implement correctly the part of the spec where "If you specify the optional dependency with the dep: prefix anywhere in the [features] table, that disables the implicit feature." Unfortunately, this can only be done after target-specific configurations are resolved, which makes it hard to write a unit test for this. Rustix requires it, though; without this patch, something like [package] name = "rustix" edition = "2021" rust-version = "1.63" version = "0.38.34" [dependencies] alloc = { version = "1.0.0", optional = true, package = "rustc-std-workspace-alloc" } libc = { version = "0.2.0", optional = true, package = "libc" } libc_errno = { version = "0.3.8", optional = true, package = "errno" } [features] alloc = [] default = ["std"] rustc-dep-of-std = ["dep:alloc"] std = ["alloc"] use-libc = ["libc_errno", "libc"] would incorrectly request the rustc-std-workspace-alloc crate via the chain default->std->alloc. The patch blocks it because it finds the "dep:alloc" dependency of feature rustc-dep-of-std. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-12-15cargo: add --check-cfg cfg(test) unconditionallyPaolo Bonzini
It should be added even if unexpected_cfgs is not part of Cargo.toml. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-12-11Add closing backtick to the install_headers docsAlex Rao
This commit adds a closing backtick to the mention of `configure_file()`, that way it shows up correctly as preformatted
2025-12-11MPI detection: support Intel MPI on WindowsLisandro Dalcin
Co-authored-by: Dylan Baker <dylan@pnwbakers.com>
2025-12-11MPI detection: do not look for mpicc on WindowsLisandro Dalcin
2025-12-11symbolextractor: implement on OS/2KO Myung-Hun
2025-12-10cmake: Fix version kwarg being added to static_library targetsRobotLeopard86
2025-12-10CI: Delete the macos qt4 jobDylan Baker
The macos 13 runner has been removed, and OpenSSL 1.0 fails to build, so let's just retire this test.
2025-12-10ci: disable unitests for arch cudaDylan Baker
Because they're the same as the main arch image.
2025-12-09Fix typo in release notesLuca Bacci
2025-12-08docs: Fix typos in 1.10.0 release notesThomas Lange
2025-12-08build: Add de-duplication for non-result targets in get_all_link_depsRobotLeopard86
2025-12-08dependencies/ui.py: Improve Vulkan detection on WindowsChun-wei Fan
There now exists a Windows Vulkan SDK for ARM64, and the latest Vulkan SDKs for x64 Windows also provides ARM64 libraries and binaries for cross-builds (and vice-versa). So, now we have the following in the Vulkan SDKs: * Bin-ARM64 and Lib-ARM64 in x64 Windows SDKs that contains ARM64 Vulkan binaries and libraries. * Bin-X64 and Lib-X64 in ARM64 Windows SDKs that contains x64 Vulkan binaries and libraries * SDKs after 1.4.x (or so) no longer ships 32-bit Windows binaries and libraries. This updates the Vulkan detection logic to account for these differences so that the correct library is picked up upon linking on Windows, especially when cross-compiling ARM64 binaries on x64 Windows, and vice versa, while maintaining compatibility with native and 32-bit builds.
2025-12-08compilers: clike: Deduplicate compile and link args from actually used arg listLeonid Zaburunov
Current behaviour is to loop over 'sys_args' list which contains both included and ignored compiler arguments. This could produce unexpected results when argument is both ignored and deduplicated. With the following changes, 'cleaned_sys_args' is used to ensure only included args are deduplicated. Example: CFLAGS (or 'c_args' as Meson option) has '-I${includedir} -L${libdir}' and LDFLAGS ('c_link_args') has '-L${libdir}'. Given CFLAGS value is wrong: -L entry belongs to LDFLAGS and thus should not be included in compiler argument list. Since we have -L in 'sys_args' list this entry will not be included as linker flag too! This is definitely not our goal: wrong entry should just be ignored. Some debug prints from Meson: C_ARGS: ['-I/opt/x64-compile/include', '-L/opt/x64-compile/lib'] LINKER_ARGS: ['-L/opt/x64-compile/lib'] RESULT_CARGS: ['-I/opt/x64-compile/include', '-D_FILE_OFFSET_BITS=64'] RESULT_LDARGS: [] (this is captured during compiler.find_library() call) And this is what we see after applying patch: C_ARGS: ['-I/opt/x64-compile/include', '-L/opt/x64-compile/lib'] LINKER_ARGS: ['-L/opt/x64-compile/lib'] RESULT_CARGS: ['-I/opt/x64-compile/include', '-D_FILE_OFFSET_BITS=64'] RESULT_LDARGS: ['-L/opt/x64-compile/lib']
2025-12-08qt.compile_moc: look for targets in dependenciesDavid Véron
If qt.compile_moc dependencies contain targets. The generated build does not exibit this dependency ie it is possible that the dependency build is run concurrently with MOC. Tell the generator that the MOC calls depends on targets in dependencies to be generated.
2025-12-08build|interpreter: use typed_kwargs for BuildTarget(install_tag)Dylan Baker
2025-12-08build|interpreter: use typed_kwargs for BuildTarget(link_args)Dylan Baker
2025-12-08interpreterbase: make ArithmeticNode and MesonOperator both use operator namesPaolo Bonzini
This avoids creating a dictionary every time an arithmetic operator is evaluated. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-12-08mparser: move dictionaries to toplevelPaolo Bonzini
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-12-08mparser: tweak typing of accept_any, use it for comparisons.Paolo Bonzini
Tuples are inefficient, require the ability to use hash table lookup via either a frozenset or a dictionary. This also allows using accept_any with COMPARISON_MAP.
2025-12-08mparser: make comparison_map global uppercsaePaolo Bonzini
2025-12-08mparser: use a literal for arithmetic operatorsPaolo Bonzini
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-12-08make ctype the same as the printed ASTPaolo Bonzini
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-12-08mparser: lexer: check early against common tokensPaolo Bonzini
Identifiers are more common than strings, check against 'id' first. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-12-08mparser: lexer: reduce regular expression usagePaolo Bonzini
Match single-character tokens a separate dictionary lookup. As pointed out by dcbaker, this is even faster than str.index and gives the syntax error check for free (via KeyError). It also enables splitting the special-case "if" in two parts, one for long tokens and one for short tokens, thus providing further speedup. This shaves about 2/3rds of the time spent in lex(). Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-12-08cargo: autodetect patch directoryPaolo Bonzini
Many crates that have a build.rs will usually require an overlay with the translated meson/meson.build file. To avoid having to create a .wrap file, when parsing Cargo.lock autodetect a directory in subproject/packagefiles/ and add it as the patch_directory. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-12-08cargo: unify call to PackageDefinition.from_valuesPaolo Bonzini
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-12-08compilers/nvidia_hpc: compilers: move -std options to get_option_std_argsZephyr Lykos
Fixes: 6c88d9992192379511c4777c526786cbacf06167 Fixes: d3542ff690d0be723cfd3ebfaaac99290517837f Fixes: ff0c758b2a8015f7e7ca6fc627c29ef7bb4771b3
2025-12-08Use gnu_syms() on Haiku too.OscarL
2025-12-08compilers/xc32: add updates for v5.00Liza Chevalier
2025-12-08compilers/xc32: add _LTO_CACHE_VERSION to match GnuCompilerLiza Chevalier