From 4380ded0110b2f4f9e2b944e6639e8b2a14e5356 Mon Sep 17 00:00:00 2001 From: lixinyu Date: Tue, 16 Jan 2024 19:16:27 +0800 Subject: [PATCH] platform: remove platform key from compile.yaml * platform key was used to refer that which platform we are building, but it seems to be not necessary, so in order to simple compile conf file, remove it. Signed-off-by: lixinyu --- src/oebuild/local_conf.py | 7 ------- src/oebuild/parse_compile.py | 9 --------- src/oebuild/parse_template.py | 9 +++------ 3 files changed, 3 insertions(+), 22 deletions(-) diff --git a/src/oebuild/local_conf.py b/src/oebuild/local_conf.py index 8b05595..269d826 100644 --- a/src/oebuild/local_conf.py +++ b/src/oebuild/local_conf.py @@ -114,13 +114,6 @@ class LocalConf: new_str=f'MACHINE = "{parse_compile.machine}"', content=content) - # replace platform - content = match_and_replace( - pre="OPENEULER_PLATFORM ", - new_str=f'OPENEULER_PLATFORM = "{parse_compile.platform}"', - content=content - ) - # replace toolchain if parse_compile.toolchain_dir is not None: if parse_compile.build_in == oebuild_const.BUILD_IN_DOCKER: diff --git a/src/oebuild/parse_compile.py b/src/oebuild/parse_compile.py index e943918..cde5580 100644 --- a/src/oebuild/parse_compile.py +++ b/src/oebuild/parse_compile.py @@ -107,7 +107,6 @@ class ParseCompile: self.compile = Compile( build_in=oebuild_const.BUILD_IN_DOCKER if 'build_in' not in data else data['build_in'], - platform=data['platform'], machine=data['machine'], toolchain_type=data['toolchain_type'], toolchain_dir=None if 'toolchain_dir' not in data else data['toolchain_dir'], @@ -129,13 +128,6 @@ class ParseCompile: ''' return self.compile.build_in - @property - def platform(self): - ''' - return attr of platform - ''' - return self.compile.platform - @property def machine(self): ''' @@ -257,7 +249,6 @@ class ParseCompile: ''' keys = { - "platform": "the key platform is None", "machine": "the key machine is None", "toolchain_type": "the key toolchain_type is None" } diff --git a/src/oebuild/parse_template.py b/src/oebuild/parse_template.py index 1eaecf8..d93ffc2 100644 --- a/src/oebuild/parse_template.py +++ b/src/oebuild/parse_template.py @@ -55,8 +55,6 @@ class PlatformTemplate(Template): ''' the object will be parsed by platform config ''' - platform: LiteralScalarString - machine: LiteralScalarString toolchain_type: LiteralScalarString @@ -127,9 +125,9 @@ class ParseTemplate: config_type = data['type'] config_name = os.path.basename(config_dir) + platform = os.path.splitext(config_name)[0].strip("\n") if config_type == oebuild_const.PLATFORM: self.platform_template = PlatformTemplate( - platform=LiteralScalarString(os.path.splitext(config_name)[0]), machine=data['machine'], toolchain_type=data['toolchain_type'], repos=repo_dict, @@ -143,8 +141,8 @@ class ParseTemplate: support_arch = [] if 'support' in data: support_arch = data['support'].split('|') - if self.platform_template.platform not in support_arch: - raise FeatureNotSupport(f'your arch is {self.platform_template.platform}, \ + if platform not in support_arch: + raise FeatureNotSupport(f'your arch is {platform}, \ the feature is not supported, please check your \ application support archs') @@ -237,7 +235,6 @@ class ParseTemplate: compile_conf = {} compile_conf['build_in'] = build_in - compile_conf['platform'] = self.platform_template.platform compile_conf['machine'] = self.platform_template.machine compile_conf['toolchain_type'] = self.platform_template.toolchain_type -- Gitee