summaryrefslogtreecommitdiff
path: root/mesonbuild/interpreter
AgeCommit message (Collapse)Author
2025-11-12Interpreter: do basic validation of PCH files in interpeterDylan Baker
This moves the listification and string checking to the interpreter, as well as some basic size validation.
2025-11-05interpreter: Move validation of BuildTarget(extra_files) to InterpreterDylan Baker
This gets us to the point that the build layer can assume it's getting valid inputs. This does two checks, an initial cheap check for generated sources, and then an I/O check via `source_strings_to_files`.
2025-11-05interpreter: move rust_api/rust_crate_type interaction to the interpreterDylan Baker
These are two ways to implement the same thing, and at the DSL level the `rust_abi` provides needed flexability, but at the lower level where a target is a thing, the `rust_crate_type` is still proving to be more useful. So, keep the `rust_abi` in the Interpreter and don't let it leak into the build layer.
2025-11-05interpreter: copy keyword arguments in `build_target`Dylan Baker
Because it's not clear how ownership is supposed to work here, and in the case of `both_libraries()`, if there are any mutations made to them then those propagate, which isn't what we want. I'd like to do some further refactoring here that would make this not necessary.
2025-11-05interpreter: add RUST_ABI to the build_target keyword argumentsDylan Baker
2025-11-05interpreter: Add rust_crate_type to kwargs TypeDictDylan Baker
2025-11-05interpreter: Move targetclass validation to top of build_targetDylan Baker
Why do work and then error out?
2025-11-05ExternalProgram: add cmd_array to complete the offferingStéphane Cerveau
In case of python and especially in the case of pyInstaller where the python command is meson.exe runpython, it should not be full path to be used but cmd_array. Fixing #13834
2025-11-04Add build target keyword parameter 'build_subdir' [v8]Keith Packard
Place the build products in a directory of the specified name somewhere within the build directory. This allows use of the target that includes a specific directory name: #include <subdir/configure.h> This also allows creating targets with the same basename by using different subdirectory names. v2: Move build_subdir to Target class. Error if path separator in build_dir v3: Rename to 'build_subdir' to make it clear that the name is appended to a meson-specific build directory, and does not provide the user with a way to define the overall meson build hierarchy. Allow build_subdir to include path separators. Support 'build_subdir' for configure_file. build_subdir must not exist in the source directory and must not contain '..' Add documentation and tests v4: Rebase and prepare for version 1.9.1 Add failing test case when build_subdir is present in the project. Add release note snippet v5: Clarify wording on restrictions on the value of build_subdir. Use the same wording in each place this restriction is described. v6: Move path validation to shared function, validate_build_subdir, instead of duplicating the tests in two places. v7: Update version numbers to 1.10.0 Add TypedDict updates. Remove spurious build_subdir instance variable v8: Oops, missed one version number update. Signed-off-by: Keith Packard <keithp@keithp.com>
2025-10-29options: clean up handling of pending_optionsPaolo Bonzini
Options are now added to pending_options only if they *can* be accepted as pending, so there is never a need check if something is in pending_options but not acceptable. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-10-29options: rename get_value_object_and_value_forPaolo Bonzini
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-10-29options: rename get_value_object_forPaolo Bonzini
No need to focus on the "value" part of the name. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-10-29environment: move detection functions to envconfig.pyPaolo Bonzini
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-10-29coredata: move cmd_line.txt and command line handling to a new modulePaolo Bonzini
cmd_line.txt is not related to serialized data, in fact it's a fallback for when serialized data cannot be used and is also related to setting up argparse for command line parsing. Since there is no code in common with the rest of coredata, move it to a new module. Fixes: #15081 Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-10-29Add snippets.symbol_visibility_header() methodXavier Claessens
Defining public API in a cross platform library is painful, especially on Windows. Since every library have to define pretty much the same macros, better do it in Meson.
2025-10-24cmake: Do not pass install prefix explicitly to the CMake interpreterDaniele Nicolodi
There is no point in doing so as it can be readily obtained from the environment. This in preparation of extracting more installation location from the environment.
2025-10-23mtest: Fix test selection implementationXavier Claessens
Omitting test()'s `suite` kwarg used to default to `test.suite==['']` because of how stringlistify() works. That had inconsistent behavior with `suite: []` which makes `test.suite==[]`. That changed when porting to typed_kwarg (#8855), which made the default `test.suite==[]`. Change `suite: []`, and missing kwarg, back to `test.suite==['']` which was the original intention. It has impact on `meson test --suite` selection, an empty `test.suite` list means that test is never going to be selected when `--suite` is used, even when we want all tests from a given subproject. It was also unclear what `--suite foo` means. Is `foo` a suite or a project name? It can now be either, it selects all tests from project `foo` as well as all tests from any project in suite `foo`.
2025-10-20interpreter/dependencyfallbacks: use DependencyObjectKWsDylan Baker
This allows for a lot of type safety to be introduced, and almost all casting to be removed.
2025-10-20interpreter: Fix argument passing for dependencyfallbacks as subprojectDylan Baker
We passed a DoSubproject call without half of the fields we'd agreed to fill out. Which left things running on hopes and dreams.
2025-10-20interpreter: fix more default_options annotationsDylan Baker
2025-10-20dependencyfallbacks: move required/disabled check to interpreterDylan Baker
The lookup code only has two callers. One of them is an internal caller that never sets the `required` key, and the other is the interpreter. Moving this code to the interpreter allows us to simplify the common code, especially the types.
2025-10-20interpreter: Rework extract_required_kwarg to have better typingDylan Baker
This allows us to avoid making `feature` a union, therefore if we write code like: ```python disabled, required, feature = extract_required_kwarg(...) if disabled: ... ``` and now mypy knows that feature is a `str` inside the `if disabled` block
2025-10-20interpreter: remove dependency_kwargsDylan Baker
Since it's basically unusued, but the DEPENDENCY_KWS can be used instead This requires changing the number of arguments from 19 to 20 because the `DEPENDENCY_KWS` includes `disabler`, but the `permitted_dependency_kwargs` does not.
2025-10-20interpreter: use typed_kwargs for checking disabler dependencyDylan Baker
2025-10-20interpreter: remove permittedKwargs from dependencyDylan Baker
This is also the ideal time to remove the `allow_unknown` from `typed_kwargs`, as permittedKwargs was providing extra key checking, so now `typed_kwargs` can do that instead.
2025-10-20interpreter: port dependency version to typed_kwargsDylan Baker
2025-10-20interpreter: port dependency static to typed_kwargsDylan Baker
Static must be optional, because although the default is static=false, we special case that static : false is different than static being not set in a number of cases.
2025-10-20interpreter: port dependency required to typed_kwargsDylan Baker
2025-10-20interpreter: port dependency private_headers to typed_kwargsDylan Baker
2025-10-20interpreter: port dependency optional_modules to typed_kwargsDylan Baker
2025-10-20interpreter: port dependency not_found_message to typed_kwargsDylan Baker
2025-10-20interpreter: port dependency native to typed_kwargsDylan Baker
2025-10-20interpreter: port dependency modules to typed_kwargsDylan Baker
2025-10-20interpreter: port dependency method to typed_kwargsDylan Baker
This allows us a bunch of nice things: 1. We can use the DependencyMethods enum everywhere 2. The deprecated methods can be checked in the Interpreter, so we can now emit deprecation warnings for stuff that was deperecated in 0.44! 3. We can share this more strongly typed method everywhere
2025-10-20interpreter: port dependency main to typed_kwargsDylan Baker
2025-10-20interpreter: port dependency language to typed_kwargsDylan Baker
2025-10-20interpreter: port dependency include_type to typed_kargsDylan Baker
The cleanup this allows lower down points out that we don't properly validate the value passed to `as_system()`. I have no idea what happens if you pass a non-valid value, but it's a bug and I've simply made it a hard error. We can re-assess if necessary.
2025-10-20interpreter: port dependency fallback to typed_kwargsDylan Baker
2025-10-20interpreter: port dependencies components to typed_kwargsDylan Baker
2025-10-20interpreter: port dependency cmake_package_version to typed_kwargsDylan Baker
2025-10-20interpreter: port dependency cmake_module_path to typed_kwargsDylan Baker
2025-10-20interpreter: port cmake_args to typed_kwargsDylan Baker
2025-10-20dependency: Use a TypedDict to describe the keyword arguments to DependencyDylan Baker
This allows us to check that all of the keyword arguments are of the correct type.
2025-10-20interpreter: port dependency(allow_fallback) to typed_kwargsDylan Baker
2025-10-20cargo: do not propagate cargo interpreter when doing sysdep fallbackXavier Claessens
A cargo subproject can fallback to a regular Meson subproject in the case it has system-deps.
2025-10-20interpreter: Fix extract_object subproject validationXavier Claessens
Fixes: #12519
2025-10-20build: Ensure that `vala_*` properties always exist, and are correctDylan Baker
This allows us to do a lot less proxy checking for vala, and lot more "If this thing says it's going to output vala, it's going to output vala. By only setting them when they use vala, we can also be sure that the fields aren't meaningless.
2025-10-20interpreter|build: Add type checking for vala specific argumentsDylan Baker
2025-10-20Fix typos in authorship informationVlad-Stefan Harbuz
2025-10-17cargo: Small simplification in path joinXavier Claessens