Skip to content
This repository has been archived by the owner on Jun 14, 2021. It is now read-only.

Commit

Permalink
Merge branch 'dev' into feature/#151/represent-local-env
Browse files Browse the repository at this point in the history
  • Loading branch information
benoit-dubreuil committed Apr 13, 2021
2 parents 28e4e44 + 40fefa3 commit d257954
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

import build_system.compiler.build_option.sanitizer
import build_system.compiler.family
import build_system.compiler.host.architecture
import build_system.compiler.host.os_family
import build_system.compiler.version
import host.architecture
import host.os_family
import utils.error.cls_def
import utils.error.format
import utils.error.try_external_errors
Expand All @@ -17,15 +17,15 @@
@dataclass(order=True, frozen=True)
class CompilerInstance(metaclass=abc.ABCMeta):
compiler_family: build_system.compiler.family.CompilerFamily
os_family: build_system.compiler.host.os_family.OSFamily
arch: build_system.compiler.host.architecture.Architecture
os_family: host.os_family.OSFamily
arch: host.architecture.Architecture
version: build_system.compiler.version.CompilerVersion
installation_dir: Path

def __init__(self,
compiler_family: build_system.compiler.family.CompilerFamily,
os_family: build_system.compiler.host.os_family.OSFamily,
arch: build_system.compiler.host.architecture.Architecture,
os_family: host.os_family.OSFamily,
arch: host.architecture.Architecture,
version: build_system.compiler.version.CompilerVersion,
installation_dir: Path
):
Expand All @@ -41,8 +41,8 @@ def __init__(self,
@final
def create_from_installed_compiler(cls,
compiler_family: build_system.compiler.family.CompilerFamily,
os_family: build_system.compiler.host.os_family.OSFamily,
arch: build_system.compiler.host.architecture.Architecture,
os_family: host.os_family.OSFamily,
arch: host.architecture.Architecture,
installation_dir: Optional[Path] = None) -> 'CompilerInstance':
import build_system.cmd.compiler.host.get_info.version.fetch_by_criteria

Expand Down
8 changes: 4 additions & 4 deletions conf/script/src/build_system/compiler/reqs/reqs.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@
from typing import Final

import build_system.compiler.family
import build_system.compiler.host.os_family
import build_system.compiler.reqs.scheme
import build_system.compiler.version
import host.os_family
import utils.error.cls_def
import utils.error.try_external_errors


@dataclass(frozen=True)
class CompilerReqs:
compiler_family: build_system.compiler.family.CompilerFamily
os_families: list[build_system.compiler.host.os_family.OSFamily]
os_families: list[host.os_family.OSFamily]
min_compiler_version: build_system.compiler.version.CompilerVersion

@classmethod
Expand Down Expand Up @@ -61,7 +61,7 @@ def __read_min_version_from_config_compiler_reqs_section(config_compiler_reqs_se
@classmethod
def filter_by_os(cls,
all_compilers_reqs: dict[build_system.compiler.family.CompilerFamily, 'CompilerReqs'],
os_family: build_system.compiler.host.os_family.OSFamily) -> list['CompilerReqs']:
os_family: host.os_family.OSFamily) -> list['CompilerReqs']:
return [compiler_reqs for compiler_family, compiler_reqs in all_compilers_reqs.items() if os_family in compiler_reqs.os_families]

@classmethod
Expand All @@ -81,7 +81,7 @@ def _get_config_parser_list_converter():
@staticmethod
def _get_config_parser_os_family_converter():
# noinspection PyArgumentList
return {'osfamily': lambda whole_option: [build_system.compiler.host.os_family.OSFamily(split_options.strip()) for split_options in whole_option.split(',')]}
return {'osfamily': lambda whole_option: [host.os_family.OSFamily(split_options.strip()) for split_options in whole_option.split(',')]}

@staticmethod
def _filter_config_default_section(config: ConfigParser):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import build_system.compiler.host.architecture
import build_system.compiler.host.os_family
import build_system.compiler.installed_instance
import build_system.compiler.reqs.reqs
import host.architecture
import host.os_family


def _fetch_filtered_compilers_reqs_by_os(os_family: build_system.compiler.host.os_family.OSFamily) -> list[build_system.compiler.reqs.reqs.CompilerReqs]:
def _fetch_filtered_compilers_reqs_by_os(os_family: host.os_family.OSFamily) -> list[build_system.compiler.reqs.reqs.CompilerReqs]:
all_compilers_reqs = build_system.compiler.reqs.reqs.CompilerReqs.create_all_from_config_file()
return build_system.compiler.reqs.reqs.CompilerReqs.filter_by_os(all_compilers_reqs, os_family)


def fetch_supported_installed_compiler_instances_by_os_and_arch(os_family: build_system.compiler.host.os_family.OSFamily,
arch: build_system.compiler.host.architecture.Architecture) \
def fetch_supported_installed_compiler_instances_by_os_and_arch(os_family: host.os_family.OSFamily,
arch: host.architecture.Architecture) \
-> list[build_system.compiler.installed_instance.CompilerInstance]:
filtered_compiler_reqs = _fetch_filtered_compilers_reqs_by_os(os_family)
supported_compiler_instances: list[build_system.compiler.installed_instance.CompilerInstance] = list()
Expand All @@ -30,7 +30,7 @@ def fetch_supported_installed_compiler_instances_by_os_and_arch(os_family: build


def fetch_supported_installed_compiler_instances() -> list[build_system.compiler.installed_instance.CompilerInstance]:
os_family = build_system.compiler.host.os_family.fetch_os_family()
arch = build_system.compiler.host.architecture.detect_arch()
os_family = host.os_family.fetch_os_family()
arch = host.architecture.detect_arch()

return fetch_supported_installed_compiler_instances_by_os_and_arch(os_family=os_family, arch=arch)

0 comments on commit d257954

Please sign in to comment.