Projects
Eulaceura:Mainline:GA
distributed-build_lite
_service:obs_scm:0004-feat-for-embedded-check-c...
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:obs_scm:0004-feat-for-embedded-check-clang-path.patch of Package distributed-build_lite
From 654f79ad11d2e4930312cd5f8b38df0e9c7908dd Mon Sep 17 00:00:00 2001 From: s_c_c <shichuchao@huawei.com> Date: Tue, 12 Mar 2024 11:04:45 +0800 Subject: [PATCH] feat for embedded check clang path --- hb_internal/preloader/preloader.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/hb_internal/preloader/preloader.py b/hb_internal/preloader/preloader.py index 2cc8869..614023d 100644 --- a/hb_internal/preloader/preloader.py +++ b/hb_internal/preloader/preloader.py @@ -17,6 +17,7 @@ from dataclasses import dataclass import os import sys import argparse +import subprocess sys.path.append( os.path.dirname(os.path.dirname(os.path.dirname( @@ -27,6 +28,21 @@ from hb_internal.common.utils import dump_json_file from hb_internal.preloader.parse_lite_subsystems_config import parse_lite_subsystem_config from hb_internal.preloader.parse_vendor_product_config import get_vendor_parts_list +def _find_clang(finddirs): + cmd = ["which", "clang"] + for _dir in finddirs: + if os.path.exists(_dir): + path = os.environ.get('PATH') + os.environ['PATH'] = f'{_dir}:{path}' + try: + output = subprocess.check_output(cmd, env=os.environ) + _path = output.strip() + if len(_path) > 1: + return True + except subprocess.CalledProcessError as e: + ret = e.output + print("Error! {} failed, failed log is {}".format(cmd, ret)) + return False def _get_base_parts(base_config_dir, os_level): system_base_config_file = os.path.join(base_config_dir, @@ -615,6 +631,10 @@ class Preloader(): toolchain_label = '//build/toolchain/{0}:{0}_clang_{1}'.format( target_os, target_cpu) + clang_found = _find_clang(["/usr/lib64/llvm15/bin"]) + if clang_found is False: + toolchain_label = '//build/toolchain/{0}:{0}_{1}'.format( + target_os, target_cpu) # add toolchain label build_vars['product_toolchain_label'] = toolchain_label -- 2.20.1 (Apple Git-117)
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2