Skip to content

Commit

Permalink
Try to fix cyclic import for typing.
Browse files Browse the repository at this point in the history
  • Loading branch information
jpakkane committed Nov 6, 2024
1 parent 9aba065 commit 4a06f8c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mesonbuild/linkers/linkers.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
from .base import ArLikeLinker, RSPFileSyntax
from .. import mesonlib
from ..mesonlib import EnvironmentException, MesonException
from ..arglist import CompilerArgs

if T.TYPE_CHECKING:
from ..arglist import CompilerArgs

Check failure

Code scanning / CodeQL

Module-level cyclic import Error

'CompilerArgs' may not be defined if module
mesonbuild.arglist
is imported before module
mesonbuild.linkers.linkers
, as the
definition
of CompilerArgs occurs after the cyclic
import
of mesonbuild.linkers.linkers.
from ..environment import Environment

Check failure

Code scanning / CodeQL

Module-level cyclic import Error

'Environment' may not be defined if module
mesonbuild.environment
is imported before module
mesonbuild.linkers.linkers
, as the
definition
of Environment occurs after the cyclic
import
of mesonbuild.linkers.linkers.
'Environment' may not be defined if module
mesonbuild.environment
is imported before module
mesonbuild.linkers.linkers
, as the
definition
of Environment occurs after the cyclic
import
of mesonbuild.linkers.linkers.
'Environment' may not be defined if module
mesonbuild.environment
is imported before module
mesonbuild.linkers.linkers
, as the
definition
of Environment occurs after the cyclic
import
of mesonbuild.linkers.linkers.
'Environment' may not be defined if module
mesonbuild.environment
is imported before module
mesonbuild.linkers.linkers
, as the
definition
of Environment occurs after the cyclic
import
of mesonbuild.linkers.linkers.
'Environment' may not be defined if module
mesonbuild.environment
is imported before module
mesonbuild.linkers.linkers
, as the
definition
of Environment occurs after the cyclic
import
of mesonbuild.linkers.linkers.
'Environment' may not be defined if module
mesonbuild.environment
is imported before module
mesonbuild.linkers.linkers
, as the
definition
of Environment occurs after the cyclic
import
of mesonbuild.linkers.linkers.
'Environment' may not be defined if module
mesonbuild.environment
is imported before module
mesonbuild.linkers.linkers
, as the
definition
of Environment occurs after the cyclic
import
of mesonbuild.linkers.linkers.
'Environment' may not be defined if module
mesonbuild.environment
is imported before module
mesonbuild.linkers.linkers
, as the
definition
of Environment occurs after the cyclic
import
of mesonbuild.linkers.linkers.
'Environment' may not be defined if module
mesonbuild.environment
is imported before module
mesonbuild.linkers.linkers
, as the
definition
of Environment occurs after the cyclic
import
of mesonbuild.linkers.linkers.
'Environment' may not be defined if module
mesonbuild.environment
is imported before module
mesonbuild.linkers.linkers
, as the
definition
of Environment occurs after the cyclic
import
of mesonbuild.linkers.linkers.
'Environment' may not be defined if module
mesonbuild.environment
is imported before module
mesonbuild.linkers.linkers
, as the
definition
of Environment occurs after the cyclic
import
of mesonbuild.linkers.linkers.
from ..mesonlib import MachineChoice
from ..build import BuildTarget

Check failure

Code scanning / CodeQL

Module-level cyclic import Error

'BuildTarget' may not be defined if module
mesonbuild.build
is imported before module
mesonbuild.linkers.linkers
, as the
definition
of BuildTarget occurs after the cyclic
import
of mesonbuild.linkers.linkers.
'BuildTarget' may not be defined if module
mesonbuild.build
is imported before module
mesonbuild.linkers.linkers
, as the
definition
of BuildTarget occurs after the cyclic
import
of mesonbuild.linkers.linkers.
'BuildTarget' may not be defined if module
mesonbuild.build
is imported before module
mesonbuild.linkers.linkers
, as the
definition
of BuildTarget occurs after the cyclic
import
of mesonbuild.linkers.linkers.
'BuildTarget' may not be defined if module
mesonbuild.build
is imported before module
mesonbuild.linkers.linkers
, as the
definition
of BuildTarget occurs after the cyclic
import
of mesonbuild.linkers.linkers.
'BuildTarget' may not be defined if module
mesonbuild.build
is imported before module
mesonbuild.linkers.linkers
, as the
definition
of BuildTarget occurs after the cyclic
import
of mesonbuild.linkers.linkers.
'BuildTarget' may not be defined if module
mesonbuild.build
is imported before module
mesonbuild.linkers.linkers
, as the
definition
of BuildTarget occurs after the cyclic
import
of mesonbuild.linkers.linkers.
'BuildTarget' may not be defined if module
mesonbuild.build
is imported before module
mesonbuild.linkers.linkers
, as the
definition
of BuildTarget occurs after the cyclic
import
of mesonbuild.linkers.linkers.
'BuildTarget' may not be defined if module
mesonbuild.build
is imported before module
mesonbuild.linkers.linkers
, as the
definition
of BuildTarget occurs after the cyclic
import
of mesonbuild.linkers.linkers.
'BuildTarget' may not be defined if module
mesonbuild.build
is imported before module
mesonbuild.linkers.linkers
, as the
definition
of BuildTarget occurs after the cyclic
import
of mesonbuild.linkers.linkers.
'BuildTarget' may not be defined if module
mesonbuild.build
is imported before module
mesonbuild.linkers.linkers
, as the
definition
of BuildTarget occurs after the cyclic
import
of mesonbuild.linkers.linkers.
'BuildTarget' may not be defined if module
mesonbuild.build
is imported before module
mesonbuild.linkers.linkers
, as the
definition
of BuildTarget occurs after the cyclic
import
of mesonbuild.linkers.linkers.
'BuildTarget' may not be defined if module
mesonbuild.build
is imported before module
mesonbuild.linkers.linkers
, as the
definition
of BuildTarget occurs after the cyclic
import
of mesonbuild.linkers.linkers.
Expand All @@ -30,7 +30,8 @@ def __init__(self, exelist: T.List[str]):
def get_id(self) -> str:
return self.id

def compiler_args(self, args: T.Optional[T.Iterable[str]] = None) -> CompilerArgs:
def compiler_args(self, args: T.Optional[T.Iterable[str]] = None) -> 'CompilerArgs':
from ..arglist import CompilerArgs # Break cyclic import.
return CompilerArgs(self, args)

def can_linker_accept_rsp(self) -> bool:
Expand Down

0 comments on commit 4a06f8c

Please sign in to comment.