summaryrefslogtreecommitdiff
path: root/mesonbuild/dependencies/configtool.py
AgeCommit message (Collapse)Author
2025-12-17dependencies: Remove `log_tried` methodDylan Baker
It's now only used to populate the DependencyCandidate, so we can remove it and just calculate the same information from the `type_name` parameter. This reduces code and the number of method calls.
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 remaining internal arguments to Dependency classesDylan Baker
These may be better replaced by setting instance attributes, honestly.
2025-10-20interpreter: port dependency version 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.
2024-10-04programs: Allow excluding certain paths when searching in PATHNirbheek Chauhan
2024-09-24MPI detection: support more implementations (any compilers)paugier
2024-09-21Add get_variable() system dependencyunknown
2024-09-14Fix various incorrect uses of `its` vs `it's`.Andrew McNulty
These errors can make reading comments and documentation unnecessarily confusing for users and contributors who do not speak English as their first language.
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-09-18Remove get_configtool_variable()Xavier Claessens
This also makes it more consistent with get_pkgconfig_variable() which always return empty value instead of failing when the variable does not exist. Linking that to self.required makes no sense and was never documented any way.
2023-09-18Remove get_pkgconfig_variable()Xavier Claessens
Make sure that pkgconfig_define is a pair of strings and not a list with more than 2 strings.
2023-09-08Override config-tool get_variable args for qmakeNirbheek Chauhan
2023-06-14WIP: refactor loggable popen calls for consistencyEli Schwartz
2023-06-07dependencies: add more logging to configtoolEli Schwartz
When retrieving variables from the tool, log some debug output the same way that pkg-config does.
2023-05-03dependencies: allow config-tool to fallback to default program namesEli Schwartz
If the dependency permits it, we can just do a PATH search instead of mandating that it be listed in the cross file. This is useful for the limited case where a specific dependency is known to be compatible with any machine choice. Mark the pybind11 dependency as supporting this. It's a valid choice because pybind11 is a header-only C++ library.
2023-02-01treewide: add future annotations importEli Schwartz
2023-01-18dependencies: fix pcap-config which now errors on --versionEli Schwartz
The latest release of libpcap added argument validation to pcap-config, but still doesn't support --version. The next version of libpcap will support --version. Add support for config-tool dependencies which expect to break on --version, to fallback to an option that does not error out or print version info, for sanity checking.
2022-09-12dependencies: simplify log_tried into a staticmethodEli Schwartz
It doesn't really need class instantiation to just know what type it is, and this way we can get the information early if a dependency fails to init.
2022-04-13dependencies: tighten type checking and fix cmake API violation for get_variableEli Schwartz
dep.get_variable() only supports string values for pkg-config and config-tool, because those interfaces use text communication, and internal variables (from declare_dependency) operate the same way. CMake had an oddity, where get_variable doesn't document that it allows list values but apparently it miiiiiight work? Actually getting that kind of result would be dangerously inconsistent though. Also, CMake does not support lists so it's a lie. Strings that are *treated* as lists with `;` splitting don't count... We could do two things here: - raise an error - treat it as a string and return a string It's not clear what the use case of get_variable() on a maybe-list is, and should probably be a hard error. But that's controversial, so instead we just return the original `;`-delimited string. It is probably the wrong thing, but users are welcome to cope with that somehow on their own.
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-07-05condense linesEli Schwartz
2021-07-05more f-strings too complex to be caught by pyupgradeEli Schwartz
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-05typing: Fully annotate dependencies.configtoolDaniel Mensinger
2021-06-03deps: Split dependencies.baseDaniel Mensinger
Split the Factory and dependency classes out of the base.py script to improve maintainability.