summaryrefslogtreecommitdiff
path: root/mesonbuild
AgeCommit message (Collapse)Author
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-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-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-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-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
2025-12-08style: use singe quotes for stringsLiza Chevalier
2025-12-08Bump version number for new development.Jussi Pakkanen
2025-12-08Bump version number for 1.10.Jussi Pakkanen
2025-12-05modules/cuda: Cuda 13.0 doesn't support the 10.1 profileDylan Baker
Even thought 12.8 and 12.9 do. So don't add then when we have 13
2025-12-05mesonmain: mark getting a language from another subproject as brokenDylan Baker
Currently, you can call `meson.get_compiler('c')`, if you haven't initialized 'c' for your project, but a super-project has initialized it. This happens because we check the wrong set of compilers (the global list vs the per-subproject one). Because of how fragile this is, we can mark it as broken an move on.
2025-12-05modules/cuda: Update arch flags for versions through 13.0Dylan Baker
This includes adding Blackwell support, as well as the deprecation of many older architectures in 12.9 and 13.0
2025-12-05modules/cuda: Update versions up through 13.0.2Dylan Baker
There is currently no Windows versions for 13.0.x I've marked with comments versions where a new release has the same version as the previous release. This should help reduce the number of list iterations, but also make easier to keep this list up to date.
2025-12-05modules/cuda: Pull driver table out of class bodyDylan Baker
This makes use of a small class to simplify the implementation
2025-12-04implement --env-set parameter manually in rustdoc scriptPaolo Bonzini
Rustdoc does not yet support the --env-set parameter, change the environment directly instead. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-12-04Remove --crate-type parameter filter from the rustdoc script.John Turner
Filtering out this flag causes the rustdoc script to fail when building docs for proc-macro crates. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>