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
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion mesonbuild/dependencies/factory.py
Original file line number Diff line number Diff line change
Expand 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.

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.

if T.TYPE_CHECKING:
from .base import ExternalDependency
Expand Down Expand Up @@ -113,6 +113,11 @@
if (method is DependencyMethods.EXTRAFRAMEWORK and
not env.machines[for_machine].is_darwin()):
return False

# PkgConfig only works if pkg-config is available
if (method is DependencyMethods.PKGCONFIG and
not PkgConfigInterface.instance(env, for_machine, True)):
return False
return True

def __call__(self, env: 'Environment', for_machine: MachineChoice,
Expand Down
Loading