Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dependencies/factory: Skip PkgConfig if pkg-config is not available #13909

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sp1ritCS
Copy link
Contributor

Otherwise you might end up with slightly confusing error messages when using the dependency factory: ERROR: Dependency lookup for vulkan with method 'pkgconfig' failed: Pkg-config for machine host machine not found. Giving up.

@@ -12,7 +12,7 @@
from .base import BuiltinDependency, SystemDependency
from .cmake import CMakeDependency
from .framework import ExtraFrameworkDependency
from .pkgconfig import PkgConfigDependency
from .pkgconfig import PkgConfigDependency, PkgConfigInterface

Check failure

Code scanning / CodeQL

Module-level cyclic import Error

'PkgConfigDependency' may not be defined if module
mesonbuild.dependencies.pkgconfig
is imported before module
mesonbuild.dependencies.factory
, as the
definition
of PkgConfigDependency occurs after the cyclic
import
of mesonbuild.dependencies.factory.
'PkgConfigDependency' may not be defined if module
mesonbuild.dependencies.pkgconfig
is imported before module
mesonbuild.dependencies.factory
, as the
definition
of PkgConfigDependency occurs after the cyclic
import
of mesonbuild.dependencies.factory.
'PkgConfigDependency' may not be defined if module
mesonbuild.dependencies.pkgconfig
is imported before module
mesonbuild.dependencies.factory
, as the
definition
of PkgConfigDependency occurs after the cyclic
import
of mesonbuild.dependencies.factory.
'PkgConfigDependency' may not be defined if module
mesonbuild.dependencies.pkgconfig
is imported before module
mesonbuild.dependencies.factory
, as the
definition
of PkgConfigDependency occurs after the cyclic
import
of mesonbuild.dependencies.factory.
'PkgConfigDependency' may not be defined if module
mesonbuild.dependencies.pkgconfig
is imported before module
mesonbuild.dependencies.factory
, as the
definition
of PkgConfigDependency occurs after the cyclic
import
of mesonbuild.dependencies.factory.
'PkgConfigDependency' may not be defined if module
mesonbuild.dependencies.pkgconfig
is imported before module
mesonbuild.dependencies.factory
, as the
definition
of PkgConfigDependency occurs after the cyclic
import
of mesonbuild.dependencies.factory.
'PkgConfigDependency' may not be defined if module
mesonbuild.dependencies.pkgconfig
is imported before module
mesonbuild.dependencies.factory
, as the
definition
of PkgConfigDependency occurs after the cyclic
import
of mesonbuild.dependencies.factory.
'PkgConfigDependency' may not be defined if module
mesonbuild.dependencies.pkgconfig
is imported before module
mesonbuild.dependencies.factory
, as the
definition
of PkgConfigDependency occurs after the cyclic
import
of mesonbuild.dependencies.factory.
@@ -12,7 +12,7 @@
from .base import BuiltinDependency, SystemDependency
from .cmake import CMakeDependency
from .framework import ExtraFrameworkDependency
from .pkgconfig import PkgConfigDependency
from .pkgconfig import PkgConfigDependency, PkgConfigInterface

Check failure

Code scanning / CodeQL

Module-level cyclic import Error

'PkgConfigInterface' may not be defined if module
mesonbuild.dependencies.pkgconfig
is imported before module
mesonbuild.dependencies.factory
, as the
definition
of PkgConfigInterface occurs after the cyclic
import
of mesonbuild.dependencies.factory.
'PkgConfigInterface' may not be defined if module
mesonbuild.dependencies.pkgconfig
is imported before module
mesonbuild.dependencies.factory
, as the
definition
of PkgConfigInterface occurs after the cyclic
import
of mesonbuild.dependencies.factory.
'PkgConfigInterface' may not be defined if module
mesonbuild.dependencies.pkgconfig
is imported before module
mesonbuild.dependencies.factory
, as the
definition
of PkgConfigInterface occurs after the cyclic
import
of mesonbuild.dependencies.factory.
'PkgConfigInterface' may not be defined if module
mesonbuild.dependencies.pkgconfig
is imported before module
mesonbuild.dependencies.factory
, as the
definition
of PkgConfigInterface occurs after the cyclic
import
of mesonbuild.dependencies.factory.
'PkgConfigInterface' may not be defined if module
mesonbuild.dependencies.pkgconfig
is imported before module
mesonbuild.dependencies.factory
, as the
definition
of PkgConfigInterface occurs after the cyclic
import
of mesonbuild.dependencies.factory.
'PkgConfigInterface' may not be defined if module
mesonbuild.dependencies.pkgconfig
is imported before module
mesonbuild.dependencies.factory
, as the
definition
of PkgConfigInterface occurs after the cyclic
import
of mesonbuild.dependencies.factory.
'PkgConfigInterface' may not be defined if module
mesonbuild.dependencies.pkgconfig
is imported before module
mesonbuild.dependencies.factory
, as the
definition
of PkgConfigInterface occurs after the cyclic
import
of mesonbuild.dependencies.factory.
'PkgConfigInterface' may not be defined if module
mesonbuild.dependencies.pkgconfig
is imported before module
mesonbuild.dependencies.factory
, as the
definition
of PkgConfigInterface occurs after the cyclic
import
of mesonbuild.dependencies.factory.
Copy link
Member

@eli-schwartz eli-schwartz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise you might end up with slightly confusing error messages when using the dependency factory: ERROR: Dependency lookup for vulkan with method 'pkgconfig' failed: Pkg-config for machine host machine not found. Giving up.

What in particular is confusing about that? e.g. you could have a package installed (along with its .pc files!), but not have pkg-config installed, and as a result be unable to find a dependency that you KNOW is available, for which the crucial information that you need to know is "ah, it cannot be found because pkg-config could not be found".

Simply removing this information is what I'd call the exact opposite of "make the error message less confusing"?

@sp1ritCS
Copy link
Contributor Author

@eli-schwartz The issue I've encountered in GNOME/gtk!7903 was that @xclaesse suggested that I don't actually need to use pkg-config in order to resolve vulkan as meson as its own internal resolver mechanism for it.

Specifically in my case both pkg-config and the system dependency failed but the error message was the one that pkg-config was not installed, even tho I'd have been far more interesting in the second failure message from the system dependency which wasn't shown.

@eli-schwartz
Copy link
Member

Ok? And obviously that's entirely wrong for packages that don't have a system dependency, or which do have one but the dependency isn't installed anyway. Your argument, I guess, is that you want meson to report multiple error messages here. But you cannot really solve that by taking one highly specific source of error messages and excluding it!

Note that meson also prints the path to a "full build log", which does contain information about the other dependency detectors as debug statements. The "most preferred" dependency detector is re-raised as the "main error" for console logging, but the full details have more information.

I would not be averse to providing more or better-formatted information here but simply deleting pkg-config feels like it won't have the correct results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants