openubmc-bingo 0.6.25__py3-none-any.whl → 0.6.27__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of openubmc-bingo might be problematic. Click here for more details.
- bmcgo/__init__.py +1 -1
- bmcgo/tasks/task_build_conan.py +35 -7
- bmcgo/utils/build_conans.py +44 -60
- bmcgo/utils/tools.py +8 -6
- {openubmc_bingo-0.6.25.dist-info → openubmc_bingo-0.6.27.dist-info}/METADATA +1 -1
- {openubmc_bingo-0.6.25.dist-info → openubmc_bingo-0.6.27.dist-info}/RECORD +9 -9
- {openubmc_bingo-0.6.25.dist-info → openubmc_bingo-0.6.27.dist-info}/WHEEL +0 -0
- {openubmc_bingo-0.6.25.dist-info → openubmc_bingo-0.6.27.dist-info}/entry_points.txt +0 -0
- {openubmc_bingo-0.6.25.dist-info → openubmc_bingo-0.6.27.dist-info}/top_level.txt +0 -0
bmcgo/__init__.py
CHANGED
bmcgo/tasks/task_build_conan.py
CHANGED
|
@@ -25,6 +25,7 @@ import time
|
|
|
25
25
|
import subprocess
|
|
26
26
|
import random
|
|
27
27
|
import pathlib
|
|
28
|
+
from tempfile import NamedTemporaryFile
|
|
28
29
|
from multiprocessing import Process, Queue
|
|
29
30
|
from copy import deepcopy
|
|
30
31
|
from collections import Counter
|
|
@@ -699,6 +700,30 @@ class TaskClass(Task):
|
|
|
699
700
|
options += " -o */*:gcov=True"
|
|
700
701
|
return options
|
|
701
702
|
|
|
703
|
+
def clean_folder_not_exist_packages(self):
|
|
704
|
+
"""
|
|
705
|
+
检查缓存的所有包路径是否存在,不存在的删除对应的包
|
|
706
|
+
缓解"folder must exist"错误
|
|
707
|
+
"""
|
|
708
|
+
tmp = NamedTemporaryFile(suffix=".json")
|
|
709
|
+
cmd = f"conan list -f json '*/*@*/*#*:*' --out-file={tmp.name}"
|
|
710
|
+
self.run_command(cmd)
|
|
711
|
+
with open(tmp.name, "r") as fd:
|
|
712
|
+
cache = json.load(fd)
|
|
713
|
+
for name, recipe in cache.get("Local Cache", {}).items():
|
|
714
|
+
for rrid, revision in recipe.get("revisions", {}).items():
|
|
715
|
+
for pid, _ in revision.get("packages", {}).items():
|
|
716
|
+
cmd = f"conan cache path {name}#{rrid}:{pid}"
|
|
717
|
+
path = self.run_command(cmd, capture_output=True).stdout.strip()
|
|
718
|
+
if not os.path.isdir(path):
|
|
719
|
+
cmd = f"conan remove {name}#{rrid}:{pid} -c"
|
|
720
|
+
self.run_command(cmd)
|
|
721
|
+
cmd = f"conan cache path {name}#{rrid}"
|
|
722
|
+
path = self.run_command(cmd, capture_output=True).stdout.strip()
|
|
723
|
+
if not os.path.isdir(path):
|
|
724
|
+
cmd = f"conan remove {name}#{rrid} -c"
|
|
725
|
+
self.run_command(cmd)
|
|
726
|
+
|
|
702
727
|
def install_openubmc_v2(self):
|
|
703
728
|
profile_file = os.path.join(self.tools.conan_profiles_dir, self.config.profile)
|
|
704
729
|
if not os.path.isfile(profile_file):
|
|
@@ -716,12 +741,17 @@ class TaskClass(Task):
|
|
|
716
741
|
self.success(f"start build dependency packages of {self.config.board_name}")
|
|
717
742
|
if self.skip_install_comp:
|
|
718
743
|
return
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
744
|
+
if self.config.from_source:
|
|
745
|
+
"""
|
|
746
|
+
多进程并行构建组件
|
|
747
|
+
conan原生不支持多组件并行构建,BuildConans会尝试构建所有组件但忽略构建失败
|
|
748
|
+
"""
|
|
749
|
+
bcp = BuildConans(self.graphfile, self.lockfile, base_cmd, self.config.from_source, self.config.log_path)
|
|
750
|
+
bcp.build()
|
|
751
|
+
self.clean_folder_not_exist_packages()
|
|
722
752
|
cmd = f"conan create . {base_cmd} --build=missing"
|
|
723
753
|
self.info(f"start build {self.config.board_name}: {cmd}")
|
|
724
|
-
self.run_command(cmd
|
|
754
|
+
self.run_command(cmd)
|
|
725
755
|
|
|
726
756
|
# 检查使用到的组件是否都在单板目录 manifest.yml 中配置了
|
|
727
757
|
self.component_check.run()
|
|
@@ -990,9 +1020,7 @@ class TaskClass(Task):
|
|
|
990
1020
|
for name, node in self.graph_nodes.items():
|
|
991
1021
|
if node.package_folder.startswith(self.conan_install):
|
|
992
1022
|
continue
|
|
993
|
-
|
|
994
|
-
if not os.path.isfile(cust):
|
|
995
|
-
continue
|
|
1023
|
+
|
|
996
1024
|
comp_dir = os.path.join(self.conan_install, name)
|
|
997
1025
|
shutil.copytree(node.package_folder, comp_dir)
|
|
998
1026
|
|
bmcgo/utils/build_conans.py
CHANGED
|
@@ -37,8 +37,6 @@ class GraphNode():
|
|
|
37
37
|
self.pkg = self.ref.split("#")[0] + "-" + self.context
|
|
38
38
|
self.is_host = self.context == "host"
|
|
39
39
|
self.building = False
|
|
40
|
-
binary = node.get("binary")
|
|
41
|
-
self.binary_exist = (binary in ["Cache"])
|
|
42
40
|
self.builded = False
|
|
43
41
|
|
|
44
42
|
@property
|
|
@@ -79,7 +77,6 @@ class BuildConans(object):
|
|
|
79
77
|
skip = True
|
|
80
78
|
continue
|
|
81
79
|
self.cmd += f"{arg} "
|
|
82
|
-
self.exception = None
|
|
83
80
|
self.force_build = force_build
|
|
84
81
|
self.log_dir = log_dir
|
|
85
82
|
if not os.path.isdir(log_dir):
|
|
@@ -93,45 +90,35 @@ class BuildConans(object):
|
|
|
93
90
|
cmd += f" --build=missing -f json --lockfile={self.lockfile}"
|
|
94
91
|
if self.force_build:
|
|
95
92
|
cmd += f" --build=\"{node.name}/*\""
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
continue
|
|
126
|
-
log.error(f"================== {node.name} 构建失败日志起始位置 ==================")
|
|
127
|
-
log.error(conan_log)
|
|
128
|
-
log.error(f"================== {node.name} 构建失败日志结束位置 ==================")
|
|
129
|
-
raise errors.BmcGoException(f"================== {node.name} 构建失败 ==================")
|
|
130
|
-
else:
|
|
131
|
-
break
|
|
132
|
-
log.success(f"<<<< build {node.ref} finished")
|
|
133
|
-
except Exception as e:
|
|
134
|
-
self.exception = e
|
|
93
|
+
logfile = f"{self.log_dir}/conan_build_{node.name}.log"
|
|
94
|
+
logfd = os.fdopen(os.open(logfile, os.O_RDWR | os.O_CREAT, stat.S_IWUSR | stat.S_IRUSR), "a+")
|
|
95
|
+
# 最多重试3次
|
|
96
|
+
max_cnt = 3
|
|
97
|
+
for i in range(0, max_cnt):
|
|
98
|
+
log.debug(f">>>> {cmd}")
|
|
99
|
+
log.info(f">>>> build {node.ref} start, logfile: {logfile}")
|
|
100
|
+
real_cmd = shlex.split(cmd)
|
|
101
|
+
pipe = subprocess.Popen(real_cmd, stdout=logfd, stderr=logfd)
|
|
102
|
+
start_time = time.time()
|
|
103
|
+
while True:
|
|
104
|
+
if pipe.poll() is not None:
|
|
105
|
+
break
|
|
106
|
+
# 1800秒超时
|
|
107
|
+
if time.time() - start_time > 1800:
|
|
108
|
+
pipe.kill()
|
|
109
|
+
log.info(f"================== {node.name} 构建超时 ==================")
|
|
110
|
+
self.queue.put(node)
|
|
111
|
+
return
|
|
112
|
+
time.sleep(1)
|
|
113
|
+
if pipe.returncode != 0:
|
|
114
|
+
log.info(f"<<<< build {node.ref} not ok")
|
|
115
|
+
# 首次增量构建失败时切换到源码构建模式
|
|
116
|
+
if i == 0 and not self.force_build:
|
|
117
|
+
cmd += f" --build=\"{node.name}/*\""
|
|
118
|
+
continue
|
|
119
|
+
else:
|
|
120
|
+
break
|
|
121
|
+
log.success(f"<<<< build {node.ref} finished")
|
|
135
122
|
self.queue.put(node)
|
|
136
123
|
|
|
137
124
|
def build(self):
|
|
@@ -213,28 +200,25 @@ class BuildConans(object):
|
|
|
213
200
|
continue
|
|
214
201
|
if dep.builded:
|
|
215
202
|
continue
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
thread.start()
|
|
203
|
+
# 当依赖的构建工具存在正在构建的组件时不能构建
|
|
204
|
+
skip_build = False
|
|
205
|
+
for _, build_dep in dep.build_packages.items():
|
|
206
|
+
# 正在构建且未构建出制品时
|
|
207
|
+
if build_dep.building and not build_dep.builded:
|
|
208
|
+
skip_build = True
|
|
209
|
+
break
|
|
210
|
+
if skip_build:
|
|
211
|
+
continue
|
|
212
|
+
# 启动构建前将其依赖的构建工具置为正在构建
|
|
213
|
+
for _, build_dep in dep.build_packages.items():
|
|
214
|
+
build_dep.building = True
|
|
215
|
+
tasks_cnt += 1
|
|
216
|
+
thread = Thread(target=self.build_task, args=(dep, options,))
|
|
217
|
+
thread.start()
|
|
232
218
|
build_tasks[dep.name] = True
|
|
233
219
|
if not tasks_cnt:
|
|
234
220
|
return
|
|
235
221
|
dep = self.queue.get()
|
|
236
|
-
if not dep or self.exception:
|
|
237
|
-
raise self.exception
|
|
238
222
|
dep.builded = True
|
|
239
223
|
build_tasks[dep.name] = False
|
|
240
224
|
tasks_cnt -= 1
|
bmcgo/utils/tools.py
CHANGED
|
@@ -77,6 +77,7 @@ class Tools():
|
|
|
77
77
|
file_handle = os.fdopen(os.open(self.lock_file, os.O_WRONLY | os.O_CREAT,
|
|
78
78
|
stat.S_IWUSR | stat.S_IRUSR), 'a')
|
|
79
79
|
file_handle.close()
|
|
80
|
+
self.last_succ_remote = ""
|
|
80
81
|
|
|
81
82
|
@property
|
|
82
83
|
def user_home(self):
|
|
@@ -488,19 +489,20 @@ class Tools():
|
|
|
488
489
|
return conan_remote_list
|
|
489
490
|
|
|
490
491
|
def download_conan_recipes(self, conan_version, conan_remote_list):
|
|
491
|
-
download_flag = False
|
|
492
492
|
args = "--only-recipe" if misc.conan_v2() else "--recipe"
|
|
493
|
-
|
|
493
|
+
remote_list = conan_remote_list
|
|
494
|
+
if self.last_succ_remote:
|
|
495
|
+
remote_list.insert(0, self.last_succ_remote)
|
|
496
|
+
for remote in remote_list:
|
|
494
497
|
# 重试3次
|
|
495
498
|
for _ in range(1, 3):
|
|
496
499
|
try:
|
|
497
500
|
self.run_command(f"conan download {conan_version} -r {remote} {args}", show_error_log=False)
|
|
498
|
-
|
|
499
|
-
|
|
501
|
+
self.last_succ_remote = remote
|
|
502
|
+
return
|
|
500
503
|
except Exception as e:
|
|
501
504
|
self.log.info(f"Recipe not fount in {remote}: {conan_version}")
|
|
502
|
-
|
|
503
|
-
raise BmcGoException(f"Download {conan_version} failed")
|
|
505
|
+
raise BmcGoException(f"Download {conan_version} failed")
|
|
504
506
|
|
|
505
507
|
def yaml_load_template(self, yaml_name: str, template: dict, need_validate=True):
|
|
506
508
|
with open(yaml_name, "r", encoding="utf-8") as fp:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
bmcgo/__init__.py,sha256=
|
|
1
|
+
bmcgo/__init__.py,sha256=oqZ8oOARtejTeAecTilQ7hon25T3svORSMnhnL6HQwY,562
|
|
2
2
|
bmcgo/bmcgo.py,sha256=uD4TsfjrFB5aQPIS6WRUVc9ShXX-dSImY9ezkB13g1w,685
|
|
3
3
|
bmcgo/bmcgo_config.py,sha256=-HZcTsnccE5wUsgGJ59kq8sDdu8feftIbpyoFvyvBhU,11264
|
|
4
4
|
bmcgo/errors.py,sha256=QW1ndrJcJ2Ws7riOznPKVvZsNlrYk73eZol7w8gJTPU,3076
|
|
@@ -224,7 +224,7 @@ bmcgo/tasks/__init__.py,sha256=VapgzhPMmB7dzPIRohoVm1jjfVn_v97cYNCRmkxScaU,539
|
|
|
224
224
|
bmcgo/tasks/download_buildtools_hm.py,sha256=f4UxStARc8Z8DnT_5O6ONajQ7P0sKyJ8brixr43fHVQ,5988
|
|
225
225
|
bmcgo/tasks/misc.py,sha256=GK_bSDLGZW0FxywB2ICG1iIEz2y2QoCb1YQQk8SYOIA,711
|
|
226
226
|
bmcgo/tasks/task.py,sha256=w8tdU5NwoUfVF4xKFvSzcCWCf0FGTBHJAToNLlP0p4w,18424
|
|
227
|
-
bmcgo/tasks/task_build_conan.py,sha256=
|
|
227
|
+
bmcgo/tasks/task_build_conan.py,sha256=EpxDBOSmj9YIDSF8ifG0lREIAhOfQbWjt29lmO6mI1g,52546
|
|
228
228
|
bmcgo/tasks/task_build_rootfs_img.py,sha256=JKEvldJnLWu2IdVSntuVowocQwdVtBQUpxzhplYauPI,29209
|
|
229
229
|
bmcgo/tasks/task_build_wbd_up.py,sha256=X9-0Qqad-s3mGfJBMeBQvfZ99KlWcgaMluDr_zv6Z-o,3122
|
|
230
230
|
bmcgo/tasks/task_buildgppbin.py,sha256=epBxxrYFPgoTzpBgPzSRXcUs-ia_BJWsLGflylEJS7I,6614
|
|
@@ -241,7 +241,7 @@ bmcgo/tasks/conan/conanfile.py,sha256=MI6c2QNKixrkA5Tx4i9EKw7bZ20GVDIKgkaMwNHQKc
|
|
|
241
241
|
bmcgo/utils/__init__.py,sha256=BDXz8BcSlCkfo5UYt6j2rm89-HiYA1ZzfpFhy99MH-0,538
|
|
242
242
|
bmcgo/utils/basic_enums.py,sha256=L5VtHtzSvs6duAnphgqDGXX80Wit3Y7DjMlpi9MCxyI,1348
|
|
243
243
|
bmcgo/utils/buffer.py,sha256=t1SkWntWksboNFMPsltslwRdXZi3FAe8eV0JAAE7Vto,4004
|
|
244
|
-
bmcgo/utils/build_conans.py,sha256=
|
|
244
|
+
bmcgo/utils/build_conans.py,sha256=27aPzS7Q6e6xNlK9pkGgqJBe_pIs8YJHJXxqbaPoCN8,8920
|
|
245
245
|
bmcgo/utils/combine_json_schemas.py,sha256=08JrAlLeo_JgUqzYcZNgSwJZPLfjbWVJ4esPPt9bPMY,7967
|
|
246
246
|
bmcgo/utils/component_post.py,sha256=rTSMv36geI6rbm6ZFQenZfG0mn1nVPpdJqn7g8bYtKA,2330
|
|
247
247
|
bmcgo/utils/component_version_check.py,sha256=nKfav7EnJ_JWfCvH_SiyhhIapGXUzhFs1QvLb58MPBs,6266
|
|
@@ -252,7 +252,7 @@ bmcgo/utils/json_validator.py,sha256=_k5wU78wfYGrzvSDaqOEtT4otgKUjquVhZNpVf2PW_c
|
|
|
252
252
|
bmcgo/utils/mapping_config_patch.py,sha256=_gKfZnrvsLPgHn1yXhEJRVTAeuGpeGD9T-Pqyw5Ydys,16827
|
|
253
253
|
bmcgo/utils/merge_csr.py,sha256=JNxHCfW1au84WQshdz0aQy8wMTEOHonjQT3s6LjlZN4,4580
|
|
254
254
|
bmcgo/utils/perf_analysis.py,sha256=fh6lV9AAKVhpPkGPwAJ8EWfGfUoHjqGYQxrvc32Xiac,4767
|
|
255
|
-
bmcgo/utils/tools.py,sha256=
|
|
255
|
+
bmcgo/utils/tools.py,sha256=dB7lX0jv-mE6pBalzm-VUZEnxPSbYkgC9soD_FAAnFg,32587
|
|
256
256
|
bmcgo/utils/installations/README.md,sha256=hKXnFYmeHEuROFMFE-vzlGLSHg71bei5ZYwyYZphWNk,2
|
|
257
257
|
bmcgo/utils/installations/__init__.py,sha256=BDXz8BcSlCkfo5UYt6j2rm89-HiYA1ZzfpFhy99MH-0,538
|
|
258
258
|
bmcgo/utils/installations/base_installer.py,sha256=3UZiKWoa41ygRbLD3QsE2FTp-VFp79V0I53QLRIf4E8,5902
|
|
@@ -264,8 +264,8 @@ bmcgo/utils/installations/install_plans/qemu.yml,sha256=lT7aKag60QUH6hTGFKa3hGRq
|
|
|
264
264
|
bmcgo/utils/installations/install_plans/studio.yml,sha256=APR3GM-3Q11LFfe8vh7t3LztDn4LLEpNHRUNjkaVekA,143
|
|
265
265
|
bmcgo/utils/installations/installers/apt_installer.py,sha256=nPaCb4cobSi9InN_aHsEPtQ0k4FgsCUWE5_VgBPvcRE,3769
|
|
266
266
|
bmcgo/utils/installations/installers/pip_installer.py,sha256=dDdios1EQ7fzt90r02pZeoM3jCmjslLzkSvzd2hgRVM,3241
|
|
267
|
-
openubmc_bingo-0.6.
|
|
268
|
-
openubmc_bingo-0.6.
|
|
269
|
-
openubmc_bingo-0.6.
|
|
270
|
-
openubmc_bingo-0.6.
|
|
271
|
-
openubmc_bingo-0.6.
|
|
267
|
+
openubmc_bingo-0.6.27.dist-info/METADATA,sha256=RJul5-nRe2BswGFKly97xf_nQAlfpNu2_AeO1OOOAs0,1010
|
|
268
|
+
openubmc_bingo-0.6.27.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
|
269
|
+
openubmc_bingo-0.6.27.dist-info/entry_points.txt,sha256=UUoUP-vAWTgg9vEYbRwYqOBHgpRtkngdzMPb-ocz90g,42
|
|
270
|
+
openubmc_bingo-0.6.27.dist-info/top_level.txt,sha256=9AcvCAt1nZcOgMsGt6T07mg2Bgtdet-3mHTwg91axgI,6
|
|
271
|
+
openubmc_bingo-0.6.27.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|