Commit Graph

16 Commits

Author SHA1 Message Date
Xavier Claessens dec85c41a9 Remove get_configtool_variable()
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-18 13:51:27 -04:00
Xavier Claessens 30d7f506c7 Remove get_pkgconfig_variable()
Make sure that pkgconfig_define is a pair of strings and not a list with
more than 2 strings.
2023-09-18 13:51:27 -04:00
Nirbheek Chauhan 6cfd2b4d5b Override config-tool get_variable args for qmake 2023-09-08 13:08:05 +05:30
Eli Schwartz aa13c46822
WIP: refactor loggable popen calls for consistency 2023-06-14 01:04:55 -04:00
Eli Schwartz 2be09bbc92
dependencies: add more logging to configtool
When retrieving variables from the tool, log some debug output the same
way that pkg-config does.
2023-06-07 16:40:51 -04:00
Eli Schwartz a95ebf1077 dependencies: allow config-tool to fallback to default program names
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-05-03 20:26:32 -04:00
Eli Schwartz 680b5ff819
treewide: add future annotations import 2023-02-01 17:01:30 -05:00
Eli Schwartz 921ddb1980
dependencies: fix pcap-config which now errors on --version
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.
2023-01-18 18:06:08 -05:00
Eli Schwartz 7972c49bda
dependencies: simplify log_tried into a staticmethod
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-09-12 19:16:59 -04:00
Eli Schwartz b55349c2e9
dependencies: tighten type checking and fix cmake API violation for get_variable
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.
2022-04-13 17:27:09 -04:00
Dylan Baker dd97ec607d dependencies: drop Dependency.methods and Dependency.get_methods()
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-13 16:43:14 -07:00
Eli Schwartz bd6f46e723 condense lines 2021-07-05 17:55:04 +03:00
Eli Schwartz dd31891c1f more f-strings too complex to be caught by pyupgrade 2021-07-05 17:55:04 +03:00
Dylan Baker 0412bdd753 dependencies: Use a typing.NewType for Dependency.type_name
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-14 09:09:32 -07:00
Daniel Mensinger 969ee9d85b typing: Fully annotate dependencies.configtool 2021-06-05 11:57:01 +02:00
Daniel Mensinger 95b70bcb97 deps: Split dependencies.base
Split the Factory and dependency classes out
of the base.py script to improve maintainability.
2021-06-03 10:23:27 -07:00