summaryrefslogtreecommitdiff
path: root/mesonbuild/interpreter/dependencyfallbacks.py
AgeCommit message (Collapse)Author
2025-12-17dependencies: Require 'native' be passed in kwargsDylan Baker
This simplifies a bunch of cases, and likely fixes some annoying bugs in cross compile situations where should have been passing this and weren't.
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: port dependency native to typed_kwargsDylan Baker
2025-10-20interpreter: port dependency modules to typed_kwargsDylan Baker
2025-06-18interpreter: bump priority of default_library=static that comes from fallbackPaolo Bonzini
We're about to lower the priority of the default_options that were passed to subproject() and dependency() below that of machine files and command line options. Whenever a static dependency is falling back to a subproject, however, do not do that. It makes no sense to build a shared library in that case. Another possibility however could be to just make it an error. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-05-07interpreter: reintroduce a convertor for override_options and default_optionsPaolo Bonzini
Replace optlist2optdict with a convertor. However, while default_options should use OptionKeys like it did before the option refactoring, override_options keeps using strings. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2025-05-06interpreter: allow passing default default_options to do_subprojectPaolo Bonzini
Apply the default_library=... default after the default options have been converted to a dictionary, to avoid having to deal with all the possible types of the default_options keyword argument. Fixes: #14532 Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
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-13Make all Meson level options overridable per subproject.Jussi Pakkanen
2024-11-15interpreter/dependencyfallbacks: Add copyright headerDylan Baker
2024-07-11Move OptionKey in the option source file.Jussi Pakkanen
2024-05-19Pass wrapmode value around as a string. (#13229)Jussi Pakkanen
2023-09-22Allow to fallback to cmake subprojectXavier Claessens
The method can be overridden by setting the `method` key in the wrap file and always defaults to 'meson'. cmake.subproject() is still needed in case specific cmake options need to be passed. This also makes it easier to extend to other methods in the future e.g. cargo.
2023-06-20interpreter: allow default_options and override_options as a dictDylan Baker
2023-05-29avoid clearing the dependency cache unnecessarily based on wrap-modeEli Schwartz
We actually do not and should not care about wrap-mode at all for this. We want to cache dependency lookups whenever humanly possible, but only use them in cases where we would anyways be using them -- which in particular means if we said to force a subproject fallback for this dep, we want to bypass the cache. Currently, we handle this by always looking up the cache for all dependencies, but clearing the cache at startup if a reconfigure means we are changing our resolution strategy. This is bad -- we might have many dependencies that are worth caching, and only one dependency that should stop being cached and use a subproject instead. The simple solution is to handle the forcefallback case when doing a cache lookup, and not do a cache lookup at all. Now we don't have to nuke the entire cache. In fact, if a future reconfigure changes the forcefallback state back to not being forced, we can reuse the original cached dependency, which is still there. Closes #11828
2022-10-09Get fallback varname from wrap file after it has been configuredXavier Claessens
When _subproject_impl() is called the wrap file could not have been downloaded form wrapdb yet, it is done when fetching the subproject. Delay getting the variable name to when we actually need it, at that point we are sure the wrap file has been downloaded.
2022-06-17fix parameter expansion in several error messagesMichael Mera
At several points in the code base, f-strings are not correctly expanded due to missing 'f' string prefix. This fixes all the occurrences I could find.
2022-03-29move a bunch of imports into TYPE_CHECKING blocksEli Schwartz
These are only used for type checking, so don't bother importing them at runtime. Generally add future annotations at the same time, to make sure that existing uses of these imports don't need to be quoted.
2022-03-03interpreter: use typed_kwargs for subproject()Dylan Baker
2022-03-03interpreter/dependencyfallbacks: fix a number of low hanging type issuesDylan Baker
2022-03-03modules/cmake: add type annotations for subproject methodDylan Baker
This will be used to handle the interpreter subproject as well
2021-10-26dep.name(): return dependency name even if dependency is not foundThomas Heijligen
The dep.name() function schould always return the name of the dependency as documented. No matter if it was found or not. https://mesonbuild.com/Reference-manual_returned_dep.html#depfound
2021-09-20dependency: If cached version is outdated, look on system againXavier Claessens
Fixes: #9271
2021-09-20dependencyfallbacks: Use default_options for implicit fallbacksXavier Claessens
This removes the warning when using default_options without fallback kwarg completely because a subproject does not know if the main project has an implicit fallback or not, so it could set default_options even if not fallback is available at all. Fixes: #9278
2021-09-01dependency: fallback and allow_fallback are mutually exclusiveXavier Claessens
That used to abort in previous Meson versions but 0.59 stopped forbidding that by mistake.
2021-08-23interpreter: Fix dependency(..., static: true) fallbackXavier Claessens
It should build the fallback subprject with default_library=static and override the dependency for both static=True and static kwarg not given. Fixes: #8050.
2021-08-07Fix --force-fallack-for with --wrap-mode=nofallbackXavier Claessens
Fixes: #9065
2021-07-21Fix meson.version().version_compare() regression in subprojectXavier Claessens
2021-06-18holders: remove unholderDaniel Mensinger
2021-06-18dependency: Empty fallback is the same as allow_fallback: falseXavier Claessens
2021-06-16interpreter: Extract dependency() logic into its own helper classXavier Claessens
The dependency lookup is a lot of complex code. This refactor it all into a single file/class outside of interpreter main class. This new design allows adding more fallbacks candidates in the future (e.g. using cc.find_library()) but does not yet add any extra API.