summaryrefslogtreecommitdiff
path: root/mesonbuild/dependencies/dub.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-12-17dependencies: stop passing "language" as a keyword argumentDylan Baker
It's allowed in the `DependencyKeywordArguments` TypeDict already, so we now have two sources of truth. Additionally, it's often populated by reading from that dict, so we're just doing useless work.
2025-12-17dependencies: Pass the `name` to `ExternalDependency` constructorDylan Baker
So we don't create a default name that is overwritten except in the case of appleframeworks. This allows for some cleanup, including deleting some initializers that were only setting the name.
2025-12-17dependencies: Move type_name to class levelDylan Baker
This is really class constant for all dependencies, and by taking it out of the initializer we make the `__init__` call have a more consistent interface.
2025-10-20dependencies: Add `silent` to known keyword arguments to DependencyDylan Baker
2025-10-20interpreter: port dependency required 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-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-03-05dependencies/dub: First try to describe local projectAndrei Horodniceanu
The current approach of determining dub dependencies is by specifying a name and, optionally, a version. Dub will then be called to generate a json summary of the package and code in meson will parse that and extract relevant information. This can be insufficient because dub packages can provide multiple configurations for multiple use-cases, examples include providing a configuration for an executable and a configuration for a library. As a practical example, the dub package itself provides an application configuration and multiple library configurations, the json description of dub will, by default, be for the application configuration which will make dub as a library unusable in meson. This can be solved without modifying the meson build interface by having dub describe the entire local project and collecting dependencies information from that. This way dub will generate information based on the project's 'dub.json' file, which is free to require dependencies in any way accepted by dub, by specifying configurations, by modifying compilation flags etc. This is all transparent to meson as dub's main purpose is to provide a path to the library file generated by the dependency in addition to other command-line arguments for the compiler. This change will, however, require that projects that want to build with meson also provided a 'dub.json' file in which dependency information is recorded. Failure to do so will not break existing projects that didn't use a 'dub.json', but they will be limited to what the previous implementation offered. Projects that already have a 'dub.json' should be fine, so long as the file is valid and the information in it matches the one in 'meson.build'. For example for a 'dependency()' call in 'meson.build' that dependency must exist in 'dub.json', otherwise the call will now fail when it worked previously. Using a 'dub.json' also has as a consequence that the version of the dependencies that are found are the ones specified in 'dub.selections.json', which can be helpful for projects that already provide a 'dub.json' in addition to 'meson.build' to de-duplicate code. In terms of other code changes: - multiple version requirements for a dub dependency now work, though they can only be used when a 'dub.json' is present in which case the version of dependencies is already pinned by 'dub.selections.json' - the 'd/11 dub' test case has been changed to auto-generate the 'dub.json' config outside of the source directory, as the auto-generated file triggers warning when parsed by dub, which upsets the new code as the warnings interfere with the legitimate output. Signed-off-by: Andrei Horodniceanu <a.horodniceanu@proton.me>
2025-01-28dependencies/dub: Fix arguments passed as strings that should be boolsDylan Baker
2024-08-06dependencies/dub: Correctly handle dub >= 1.35 as well as older dubRemi Thebault
- check version of DUB for compatibility with Meson - use "cacheArtifactPath" to locate DUB libraries in the cache - propose `dub build --deep` command to Meson users for missing DUB packages Depending on DUB version, it will look either in the old cache structure or use this new `dub describe` entry.
2024-07-11Move OptionKey in the option source file.Jussi Pakkanen
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-10-03temp disable pylint falsepositive on dub.pyCharles Brunet
This was introduced by pylint 3.0.0. See https://github.com/pylint-dev/pylint/issues/9095.
2023-05-18Check dub version (#11794)Remi Thebault
* DubDependency._check_dub returns the version * check for compatible Dub version Dub versions starting at 1.32 have a new cache structure into which Meson doesn't know where to find compatible artifacts * skipping D tests involving Dub * refactor _check_dub makes mypy happier * make linters happy * localize some logic
2023-02-01treewide: add future annotations importEli Schwartz
2022-09-28Move classes used by scripts to their own moduleXavier Claessens
Those classes are used by wrapper scripts and we should not have to import the rest of mesonlib, build.py, and all their dependencies for that. This renames mesonlib/ directory to utils/ and add a mesonlib.py module that imports everything from utils/ to not have to change `import mesonlib` everywhere. It allows to import utils.core without importing the rest of mesonlib.
2022-09-19compilers: perform targeted imports for detectEli Schwartz
Only import the ones we need for the language we are detecting, once we actually detect that language. This will allow finally dropping the main imports of these files in a followup commit.
2022-09-19compilers: directly import from subpackagesEli Schwartz
It turns out we don't generally need to proxy every compiler ever through the top-level package. The number of times we directly poke at one is negligible and direct imports are pretty clean.
2022-06-13flake8: fix non-idiomatic ordering of "if not in" checksEli Schwartz
2022-06-13flake8: fix various whitespace nitsEli Schwartz
2022-03-23Fix DUB dependenciesRemi Thebault
- fix the research of target built by DUB - explicitely state that DUB dynamic libraries and source libraries are not supported (yet) (mesonbuild#6581) - fix the build settings of recipes having sub-dependencies (mesonbuild#7560) - fix winlibs added from dub recipe - sanitization, comments, explanations...
2021-07-13dependencies: drop Dependency.methods and Dependency.get_methods()Dylan Baker
Both of these are artifacts of the time before Dependency Factories, when a dependency that could be discovered multiple ways did ugly stuff like finding a specific dependency, then replacing it's own attributes with that dependency's attributes. We don't have cases of that left in the tree, so let's get rid of this code too
2021-06-14dependencies: Use a typing.NewType for Dependency.type_nameDylan Baker
This allow mypy to catch cases where we accidently assign the dependency name to the type_name, as it sees them as having different types (though at runtime they're all strings).
2021-06-06typing: Fully annotate dependencies.dubDaniel Mensinger
2021-06-03deps: Split dependencies.baseDaniel Mensinger
Split the Factory and dependency classes out of the base.py script to improve maintainability.