summaryrefslogtreecommitdiff
path: root/mesonbuild/mintro.py
AgeCommit message (Collapse)Author
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-10-16intro: compute meson_variables for dependencies at setup timePaolo Bonzini
Another place where the interpreter is accessed surreptitiously is dependency introspection, which looks at the variables. Do that at setup time instead while the interpreter is alive. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-10-16build, backend: store build_def_files in BuildPaolo Bonzini
The interpreter's build_def_files are the only remaining piece of interpreter state used by the backend. Compute it once and store it in build, using a property to ensure that it's initialized and accessed correctly. This also removes one of the cases in which introspection uses the interpreter object. 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-09-24ast/introspection: remove keyword arguments from build targets that are ↵Dylan Baker
UnknownValue It is not the build layer's job to handle ast types, so instead filter out UnknownValues before passing them to the build layer, then fix up any special values we need in the ast layer. This reveals that some of what we were previously doing only works because the build layer is pretty much untyped, if it was typed it would have screamed loudly.
2025-08-18Revert "backends: Use POSIX paths for target paths"Jussi Pakkanen
This reverts commit 12563f74a9f3dda70dcd4778aa958de355d1fae7.
2025-07-22mintro: Record rpath_dirs_to_remove in install_planDaniele Nicolodi
This is required by meson-python to fix RPATH entries when building a wheel.
2025-07-13backends: Use POSIX paths for target pathsL. E. Segovia
This commit completes 5de09cbe8838e8febf1ca3aa83b53cf06972bff3, ensuring that only POSIX style paths are passed to the compiler line, and thus fixing UNIX-style tools that treat single backward slashes as Unicode escaped characters. Fixes #12191 Completes #12534 Completes #12564
2025-05-29rewriter: Bugfix concerning `UnknownValue`Volker Weißmann
Without this commit, the static introspection tool crashes when introspecting systemd since certain values are `UnknownValue` which was unexpected. (I tested sytemd's commit hash fefcb935cd.)
2025-05-29rewriter: Rewrite how we add/remove source filesVolker Weißmann
Change the semantics of IntrospectionBuildTarget.source_nodes and IntrospectionBuildTarget.extra_files . The rewriter and the static introspection tool used to be very broken, now it is *less* broken, hence we add some tests in this commit. Fixes #11763
2025-05-29AstInterpreter: Replace resolve_node with node_to_runtime_valueVolker Weißmann
`resolve_node` is simply a half-broken, worse implementation of `node_to_runtime_value` that we recently introduced. In the example below, the static introspection tool/rewriter now understands that the name of the executable is foo instead of bar: ``` var = 'foo' name = var var = 'bar' executable(name, 'foo.c') ```
2025-05-29rewriter: Add IntrospectionDependencyVolker Weißmann
To improve type-safety and readability we replace a dictionary with a new class `IntrospectionDependency`.
2025-05-29rewriter: Add IntrospectionBuildTargetVolker Weißmann
To improve type-safety and readability we replace a dictionary with a new class `IntrospectionBuildTarget`.
2025-05-29Refactoring and removal of dead codeVolker Weißmann
2025-04-08coredata: move MutableKeyedOptionDict to optionsDylan Baker
2025-04-02option: move the `is_per_machine_option` to the `OptionStore`Dylan Baker
2025-03-10coredata: replace get_option with optstore.get_value_forDylan Baker
This is an old method, that is now just a wrapper around the OptionStore method, that doesn't add any value. It's also an option related method attached to the CoreData instead of the OptionStore, so useless and a layering violation.
2025-02-27coredata: delete the OptionsViewDylan Baker
This also makes KeyedOptionDictType obsolete and it's removed
2025-02-13Make all Meson level options overridable per subproject.Jussi Pakkanen
2025-02-05options: Replace uses of `UserOption[T.Any]` with a Union of UserOption typesDylan Baker
The fact that UserOption is generic is really an implementation detail, not something to be used publicly. So by having an `AnyOptionType` alias, we can get better type checking, as can be seen by the patch as a whole. One of the big fixes it replace open-coded equivlalents of `MutableKeydOptionDictType` with that type alias.
2025-02-05options: split UserIntegerOption and UserUmaskOptionDylan Baker
They are very similar, but they are not exactly the same. By splitting them we can get full type safety, and run mypy over the options.py file!
2025-02-05options: Add an EnumeratedUserOption classDylan Baker
This will allow us to take choices out of the UserOption class, which doesn't actually use this attribute.
2025-02-05options: Add a printable_choices method to UserOptionDylan Baker
This provides a method to get choices for options in a printable form. The goal is to make refactoring options simpler.
2024-12-19introspect: add machine to target_sourcesPaolo Bonzini
Even though the "targets" introspection info already includes the command line arguments used to invoke the compiler, this is not enough to correlated with the "compilers" introspection info and get extra information from there. Together with the existing "language" key, adding a "machine" key is enough to identify completely an entry in the compilers info. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2024-10-13mintro: Add license and license_files to project introspection dataDaniele Nicolodi
2024-09-03intro: add install_rpath to intro-install_plan.jsonDaniele Nicolodi
2024-07-11Move OptionKey in the option source file.Jussi Pakkanen
2024-07-11Move compiler option check into OptionStore.Jussi Pakkanen
2024-07-11Move builtin option check into OptionStore.Jussi Pakkanen
2024-07-11Move backend option check into OptionStore.Jussi Pakkanen
2024-07-11Move base option check into OptionStore.Jussi Pakkanen
2024-07-11Move project option detection into OptionStore.Jussi Pakkanen
2024-06-14Fix mypy.Jussi Pakkanen
2024-06-14Rename option variable to optstore to make it unique.Jussi Pakkanen
2024-06-01mintro: write humman-readable JSONFilipe Laíns
Signed-off-by: Filipe Laíns <lains@riseup.net>
2024-05-23Refactor option classes to their own file.Jussi Pakkanen
2024-04-08parser: revert to single StringNode typeCharles Brunet
this will allow transforming string types in the formater
2023-12-13Use SPDX-License-Identifier consistentlyDylan Baker
This replaces all of the Apache blurbs at the start of each file with an `# SPDX-License-Identifier: Apache-2.0` string. It also fixes existing uses to be consistent in capitalization, and to be placed above any copyright notices. This removes nearly 3000 lines of boilerplate from the project (only python files), which no developer cares to look at. SPDX is in common use, particularly in the Linux kernel, and is the recommended format for Meson's own `project(license: )` field
2023-11-01Add comments suggesting to keep shell completion scripts up-to-date near cmd ↵Luke Elliott
line argument code
2023-10-04Remove unused parameter in IntroCommand::get_meson_introspection_types()Tristan Partin
2023-09-11parser: use IdNode for function name and assignment nameCharles Brunet
2023-09-11parser: preserve escape chars in stringsCharles Brunet
use separate Node for multiline strings
2023-08-28include_directories: Always add both source and build dirsXavier Claessens
Compiler checks were not adding build dir side, which prevents using headers generated with configure_file().
2023-08-11treewide: automatic rewriting of all comment-style type annotationsEli Schwartz
Performed using https://github.com/ilevkivskyi/com2ann This has no actual effect on the codebase as type checkers (still) support both and negligible effect on runtime performance since __future__ annotations ameliorates that. Technically, the bytecode would be bigger for non function-local annotations, of which we have many either way. So if it doesn't really matter, why do a large-scale refactor? Simple: because people keep wanting to, but it's getting nickle-and-dimed. If we're going to do this we might as well do it consistently in one shot, using tooling that guarantees repeatability and correctness. Repeat with: ``` com2ann mesonbuild/ ```
2023-08-11rewrite a couple comment-style type annotations for oddly indented dictsEli Schwartz
Make them into real type annotations. These are the only ones that if automatically rewritten, would cause flake8 to error out with the message: "E128 continuation line under-indented for visual indent".
2023-07-24fix a few miscellaneous implicit-optional typing issuesEli Schwartz
2023-07-19move various bits of type-checking only code to TYPE_CHECKING blocksEli Schwartz
Mostly detected with flake8-type-checking. Also quote T.cast() first arguments, since those are not affected by future annotations.
2023-07-19fix implicit_reexport issues and enforce them going forwardEli Schwartz
This detects cases where module A imports a function from B, and C imports that same function from A instead of B. It's not part of the API contract of A, and causes innocent refactoring to break things.
2023-06-26mintro: record subproject in install_planDaniele Nicolodi
2023-05-22intro: add more details to generated files(part 2)Charles Brunet
- add `extra_paths` to intro-tests.json to know paths needed to run a test on Windows; - add `depends` to alias targets in intro-targets.json to know what targets does an alias point to; - add `depends` to intro-dependencies.json to know libraries linked with an internal dependency; - renamed `deps` to `dependencies` in `intro-dependencies.json` for more uniformity.