Replies: 4 comments 1 reply
-
My implementation is here: #7650. pkg-config implementation is actually not that complex, especially since Meson only requires a subset of it and already implements parts of the needed logic like argument dedup. |
Beta Was this translation helpful? Give feedback.
-
I would be in favor of this. In the long term it makes sense because it allows us to mix and match dependency management solutions, which would be difficult to do with external tools. |
Beta Was this translation helpful? Give feedback.
-
Note that there is a downside in using any in-process pkg-config implementation (python or libpkgconf): CLI implementations are often wrappers that sets specific env. We can easily still fallback to CLI implementation when PKG_CONFIG env is pointing to one, but if user relies on a wrapper set in PATH we are going to break those setup. IMHO that's a downside we just have to accept and document. |
Beta Was this translation helpful? Give feedback.
-
In general, when the topic of "just implement pkgconfig yourself" comes up, I have a few major objections:
Optionally using an externally installable module solves 1, and solves both 2 and 3 by making it opt in (and may also solve 2 by making it much more likely to have dedicated tests including possibly even importing the pkgconf testsuite verbatim?) |
Beta Was this translation helpful? Give feedback.
-
The problem is that, especially on Windows, calling subprocesses for each dependency is slow. The second problem that installing pkgconfig on Windows usually requires a third-party package manager (e.g. chocolatey) 1
Different thigs where tried in the past:
I think the best option would be to implement a complete pure-python pkgconfig implementation in Python. I did a poc (not published yet) based on pkgconf code and algorithmsm abd frankly, I think this could be something viable. They, meson could use it directly as a Python lib, instead of relying on subprocesses, allowing to cache the .pc files parsing between invocations. There could be a syntax in machine files to opt in for that implementation, and a fallback mechanism to use it if the pkgconfig executable is not found, but that Python implementation is importable. That way, it would not break the current way pkgconfig is used.
What do you think about this idea? On the meson side, the changes would be minimal, since @xclaesse already refactored the pkgconfig dependency to allow different implementations #11973. I could publish the Python implementation of pkgconfig on my personal repo, but I think it would be better to have it on the mesonbuild organisation, to allow more maintainers (if any interested...)
Beta Was this translation helpful? Give feedback.
All reactions