openubmc-bingo 0.6.4__py3-none-any.whl → 0.6.7__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/cli/cli.py +23 -8
- bmcgo/cli/config.conan2.yaml +4 -4
- bmcgo/component/build.py +39 -6
- bmcgo/functional/conan_index_build.py +18 -0
- {openubmc_bingo-0.6.4.dist-info → openubmc_bingo-0.6.7.dist-info}/METADATA +1 -1
- {openubmc_bingo-0.6.4.dist-info → openubmc_bingo-0.6.7.dist-info}/RECORD +10 -10
- {openubmc_bingo-0.6.4.dist-info → openubmc_bingo-0.6.7.dist-info}/WHEEL +0 -0
- {openubmc_bingo-0.6.4.dist-info → openubmc_bingo-0.6.7.dist-info}/entry_points.txt +0 -0
- {openubmc_bingo-0.6.4.dist-info → openubmc_bingo-0.6.7.dist-info}/top_level.txt +0 -0
bmcgo/__init__.py
CHANGED
bmcgo/cli/cli.py
CHANGED
|
@@ -24,6 +24,7 @@ from importlib.util import spec_from_file_location, module_from_spec
|
|
|
24
24
|
|
|
25
25
|
import yaml
|
|
26
26
|
from colorama import Fore, Style
|
|
27
|
+
from conan import conan_version
|
|
27
28
|
|
|
28
29
|
from bmcgo import __version__ as client_version
|
|
29
30
|
from bmcgo.component.build import BuildComp
|
|
@@ -142,7 +143,7 @@ class Command(object):
|
|
|
142
143
|
try:
|
|
143
144
|
commands = self._commands(False)
|
|
144
145
|
method = commands[args.command]
|
|
145
|
-
self.
|
|
146
|
+
self._warn_dependencies_version()
|
|
146
147
|
method(["--help"])
|
|
147
148
|
except KeyError as exp:
|
|
148
149
|
log.debug("Exception: %s", str(exp))
|
|
@@ -241,7 +242,7 @@ class Command(object):
|
|
|
241
242
|
"""HIDDEN: entry point for executing commands, dispatcher to class
|
|
242
243
|
methods
|
|
243
244
|
"""
|
|
244
|
-
if not self._check_conan():
|
|
245
|
+
if not self._check_conan() or not self._check_conan_profile():
|
|
245
246
|
return 1
|
|
246
247
|
try:
|
|
247
248
|
command = args[0][0]
|
|
@@ -253,7 +254,7 @@ class Command(object):
|
|
|
253
254
|
self.show_version()
|
|
254
255
|
return 0
|
|
255
256
|
|
|
256
|
-
self.
|
|
257
|
+
self._warn_dependencies_version()
|
|
257
258
|
|
|
258
259
|
if command in ["-h", "--help"]:
|
|
259
260
|
self._show_help()
|
|
@@ -309,6 +310,17 @@ class Command(object):
|
|
|
309
310
|
if studio_version:
|
|
310
311
|
log.info("bmc-studio 版本为: %s", studio_version)
|
|
311
312
|
|
|
313
|
+
def _check_conan_profile(self):
|
|
314
|
+
profile_dir = os.path.join(tools.conan_home, "profiles")
|
|
315
|
+
if os.path.isdir(profile_dir):
|
|
316
|
+
return True
|
|
317
|
+
|
|
318
|
+
if misc.conan_v2():
|
|
319
|
+
log.warning("检测到依赖conan2.0但未正确初始化,请切换到产品仓执行一次构建,以安装和配置工具链")
|
|
320
|
+
else:
|
|
321
|
+
log.warning("检测到依赖conan1.0但未正确初始化,请切换到产品仓执行一次构建,以安装和配置工具链")
|
|
322
|
+
return False
|
|
323
|
+
|
|
312
324
|
def _check_conan(self):
|
|
313
325
|
need_conan_v2 = False
|
|
314
326
|
conf = None
|
|
@@ -323,10 +335,11 @@ class Command(object):
|
|
|
323
335
|
for line in lines:
|
|
324
336
|
if not line.startswith("required_conan_version"):
|
|
325
337
|
continue
|
|
326
|
-
match = re.search("(
|
|
338
|
+
match = re.search("\"(.*)\"", line)
|
|
327
339
|
if not match:
|
|
328
340
|
continue
|
|
329
|
-
|
|
341
|
+
import semver
|
|
342
|
+
if semver.satisfies("2.13.0", match[1]):
|
|
330
343
|
need_conan_v2 = True
|
|
331
344
|
break
|
|
332
345
|
else:
|
|
@@ -348,7 +361,7 @@ class Command(object):
|
|
|
348
361
|
log.info(" [conan]")
|
|
349
362
|
log.info(" version = 2.x.x")
|
|
350
363
|
log.info("3. conan_index仓使用参数`--conan2`控制是否构建conan2.0包(conan2.0包配方存储在recipes2目录)")
|
|
351
|
-
tools.run_command("pip3 install conan==2.13.0 --
|
|
364
|
+
tools.run_command("pip3 install conan==2.13.0 --break-system-packages")
|
|
352
365
|
log.warning("检测到依赖conan2.0但仅安装了conan1.0,已安装conan2.0,任务退出,请重新执行")
|
|
353
366
|
return False
|
|
354
367
|
if not need_conan_v2 and misc.conan_v2():
|
|
@@ -356,7 +369,7 @@ class Command(object):
|
|
|
356
369
|
log.info("1. 组件仓支持conan1.0的依据:conanfile.py中未申明`required_conan_version`或依赖conan 1.x.x")
|
|
357
370
|
log.info("2. manifest或ibmc_sdk仓支持conan1.0的依据:.bmcgo/config或.bingo/config文件未记录的conan.version配置")
|
|
358
371
|
log.info("3. conan_index仓默认(不指定`--conan2`时)构建conan1.0包(conan1.0包配方存储在recipes目录)")
|
|
359
|
-
tools.run_command("pip3 install conan==1.62.0 --
|
|
372
|
+
tools.run_command("pip3 install conan==1.62.0 --break-system-packages")
|
|
360
373
|
log.warning("检测到依赖conan1.0但仅安装了conan2.0,已安装conan1.0,任务退出,请重新执行")
|
|
361
374
|
return False
|
|
362
375
|
return True
|
|
@@ -561,12 +574,14 @@ class Command(object):
|
|
|
561
574
|
result[method_name] = method
|
|
562
575
|
return result
|
|
563
576
|
|
|
564
|
-
def
|
|
577
|
+
def _warn_dependencies_version(self):
|
|
565
578
|
width = 70
|
|
566
579
|
version = sys.version_info
|
|
567
580
|
if version.major < 3:
|
|
568
581
|
log.info("%s\n 不在提供 Python 2支持. 强烈推荐使用 Python >= 3.0\n", "*" * width)
|
|
569
582
|
|
|
583
|
+
log.info("conan版本: " + str(conan_version))
|
|
584
|
+
|
|
570
585
|
def _show_help_data(self, cmd_name, help_lines):
|
|
571
586
|
log.info("%s%s", cmd_name, help_lines[0])
|
|
572
587
|
for help_line in help_lines[1:]:
|
bmcgo/cli/config.conan2.yaml
CHANGED
|
@@ -3,7 +3,7 @@ comp_type:
|
|
|
3
3
|
- component
|
|
4
4
|
- manifest
|
|
5
5
|
dt_dependencies:
|
|
6
|
-
dtframeforlua: dtframeforlua/0.0.24
|
|
7
|
-
luaunit: luaunit/3.2
|
|
8
|
-
luacov: luacov/0.16.3
|
|
9
|
-
luafilesystem: luafilesystem/1.8.0.b022
|
|
6
|
+
dtframeforlua: dtframeforlua/0.0.24@openubmc/stable
|
|
7
|
+
luaunit: luaunit/3.2@openubmc/stable
|
|
8
|
+
luacov: luacov/0.16.3@openubmc/stable
|
|
9
|
+
luafilesystem: luafilesystem/1.8.0.b022@openubmc/stable
|
bmcgo/component/build.py
CHANGED
|
@@ -57,10 +57,6 @@ class BuildComp():
|
|
|
57
57
|
|
|
58
58
|
@staticmethod
|
|
59
59
|
def check_luac():
|
|
60
|
-
luac_path = os.path.join(os.path.expanduser('~'), ".conan", "bin", "luac")
|
|
61
|
-
if not os.path.isfile(luac_path):
|
|
62
|
-
raise BmcGoException(f"当前环境中未安装luac!请更新manifest仓代码,执行环境初始化脚本init.py重新部署环境!")
|
|
63
|
-
|
|
64
60
|
conan_bin = os.path.join(os.path.expanduser('~'), ".conan", "bin")
|
|
65
61
|
# 设置PLD_LIBRARY_PATH环境变量,luajit运行时需要加载so动态库
|
|
66
62
|
ld_library_path = conan_bin + ":" + os.environ.get("LD_LIBRARY_PATH", "")
|
|
@@ -69,6 +65,43 @@ class BuildComp():
|
|
|
69
65
|
path = conan_bin + ":" + os.environ.get("PATH", "")
|
|
70
66
|
os.environ["PATH"] = path
|
|
71
67
|
os.environ["LUA_PATH"] = f"{conan_bin}/?.lua"
|
|
68
|
+
|
|
69
|
+
def install_luac(self):
|
|
70
|
+
self.check_luac()
|
|
71
|
+
if self.bconfig.partner_mode:
|
|
72
|
+
return
|
|
73
|
+
conan_bin = os.path.join(os.path.expanduser('~'), ".conan", "bin")
|
|
74
|
+
luac_path = os.path.join(conan_bin, "luac")
|
|
75
|
+
skynet_pkg = "skynet/1.7.0.B002@hw.ibmc.release/stable"
|
|
76
|
+
skynet_flag = skynet_pkg.split("@")[0].replace("/", "_")
|
|
77
|
+
skynet_flag = os.path.join(conan_bin, skynet_flag)
|
|
78
|
+
|
|
79
|
+
options = ""
|
|
80
|
+
if self.info.enable_luajit:
|
|
81
|
+
luac_path = os.path.join(conan_bin, "luajit")
|
|
82
|
+
options = "-0 skynet:enable_luajit=True"
|
|
83
|
+
skynet_flag += "_luajit"
|
|
84
|
+
else:
|
|
85
|
+
skynet_flag += "luac"
|
|
86
|
+
if os.path.isfile(skynet_flag) and os.path.exists(luac_path):
|
|
87
|
+
os.chmod(luac_path, stat.S_IRWXU)
|
|
88
|
+
return
|
|
89
|
+
if os.path.isdir(conan_bin):
|
|
90
|
+
shutil.rmtree(conan_bin)
|
|
91
|
+
os.makedirs(conan_bin)
|
|
92
|
+
cmd = [misc.CONAN, "install", skynet_pkg, "-pr", "profile.dt.ini", "--build", "-u"]
|
|
93
|
+
cmd += options.split()
|
|
94
|
+
if self.info.remote:
|
|
95
|
+
cmd += ["-r", self.info.remote]
|
|
96
|
+
Helper.run(cmd)
|
|
97
|
+
os.chmod(luac_path, stat.S_IRWXU)
|
|
98
|
+
if self.info.enable_luajit:
|
|
99
|
+
luajit2luac = shutil.which("luajit2luac.sh")
|
|
100
|
+
cmd = ["cp", luajit2luac, f"{conan_bin}/luac"]
|
|
101
|
+
Helper.run(cmd)
|
|
102
|
+
import pathlib
|
|
103
|
+
pathlib.Path(skynet_flag).touch(exist_ok=True)
|
|
104
|
+
|
|
72
105
|
|
|
73
106
|
def gen_conanbase(self, gen_conanbase, service_json):
|
|
74
107
|
if misc.conan_v1():
|
|
@@ -208,7 +241,7 @@ class BuildComp():
|
|
|
208
241
|
def run_conan_v1(self):
|
|
209
242
|
tool.clean_locks()
|
|
210
243
|
self.check_conan_profile()
|
|
211
|
-
self.
|
|
244
|
+
self.install_luac()
|
|
212
245
|
from_source = "--build=missing"
|
|
213
246
|
if self.info.from_source:
|
|
214
247
|
from_source = "--build"
|
|
@@ -238,7 +271,7 @@ class BuildComp():
|
|
|
238
271
|
if self.info.no_cache:
|
|
239
272
|
args += " -u"
|
|
240
273
|
cmd = [misc.CONAN, "create", "--name", self.info.name, "--version", self.info.version]
|
|
241
|
-
args += f" -f json --out-file={self.graph_file.name}"
|
|
274
|
+
args += f" -f json --out-file={self.graph_file.name} -tf="
|
|
242
275
|
cmd += args.split()
|
|
243
276
|
tool.run_command(cmd, show_log=True)
|
|
244
277
|
package_folder = tool.get_package_folder_from_graph_file(self.graph_file.name, self.info.package)
|
|
@@ -276,11 +276,14 @@ class BmcgoCommand:
|
|
|
276
276
|
if self.path == "" or self.version == "":
|
|
277
277
|
raise errors.BmcGoException(f"Path({self.path}) or version({self.version}) error")
|
|
278
278
|
|
|
279
|
+
if not self.check_conan(self.conan2):
|
|
280
|
+
return -1
|
|
279
281
|
os.chdir(self.path)
|
|
280
282
|
if misc.conan_v1():
|
|
281
283
|
self.run_v1()
|
|
282
284
|
else:
|
|
283
285
|
self.run_v2()
|
|
286
|
+
return 0
|
|
284
287
|
|
|
285
288
|
def tag_check(self):
|
|
286
289
|
yaml_file = f"{self.path}/conandata.yml"
|
|
@@ -300,3 +303,18 @@ class BmcgoCommand:
|
|
|
300
303
|
tag_list.append({"tag": value['branch'], "url": value['url']})
|
|
301
304
|
# 这里的 git 命令的意思是检查远端是否有此 tag, 如果不加 grep, 可能导致分支被认为是 tag
|
|
302
305
|
Function.git_check(tag_list)
|
|
306
|
+
|
|
307
|
+
def check_conan(self, need_conan_v2):
|
|
308
|
+
if need_conan_v2 and misc.conan_v1():
|
|
309
|
+
log.warning("检测到依赖conan2.0但仅安装了conan1.0,尝试重新安装conan2.0")
|
|
310
|
+
log.info(" conan_index仓使用参数`--conan2`控制是否构建conan2.0包(conan2.0包配方存储在recipes2目录)")
|
|
311
|
+
self.run_command("pip3 install conan==2.13.0 --break-system-packages")
|
|
312
|
+
log.warning("检测到依赖conan2.0但仅安装了conan1.0,已安装conan2.0,任务退出,请重新执行")
|
|
313
|
+
return False
|
|
314
|
+
if not need_conan_v2 and misc.conan_v2():
|
|
315
|
+
log.warning("检测到依赖conan1.0但仅安装了conan2.0,尝试重新安装conan1.0")
|
|
316
|
+
log.info(" conan_index仓默认(不指定`--conan2`时)构建conan1.0包(conan1.0包配方存储在recipes目录)")
|
|
317
|
+
self.run_command("pip3 install conan==1.62.0 --break-system-packages")
|
|
318
|
+
log.warning("检测到依赖conan1.0但仅安装了conan2.0,已安装conan1.0,任务退出,请重新执行")
|
|
319
|
+
return False
|
|
320
|
+
return True
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
bmcgo/__init__.py,sha256=
|
|
1
|
+
bmcgo/__init__.py,sha256=1tsWug6hVxYeVnfDiz-kIdLcf8bphjLcfRl0l-F-TTM,561
|
|
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
|
|
@@ -7,8 +7,8 @@ bmcgo/logger.py,sha256=rcMqJnyQ5Ag3k04KLEskrG8ZJ508OOU_JH4fMFiGOqQ,6644
|
|
|
7
7
|
bmcgo/misc.py,sha256=w0vzsD7uzrsxTly5Y1viLgYTKHhLP4sxa499XwbqHnU,6986
|
|
8
8
|
bmcgo/worker.py,sha256=OXz5Gam3pmZjgQeoGJrYy73ZrQszCOxk9X19nbeBI_A,15710
|
|
9
9
|
bmcgo/cli/__init__.py,sha256=BDXz8BcSlCkfo5UYt6j2rm89-HiYA1ZzfpFhy99MH-0,538
|
|
10
|
-
bmcgo/cli/cli.py,sha256=
|
|
11
|
-
bmcgo/cli/config.conan2.yaml,sha256=
|
|
10
|
+
bmcgo/cli/cli.py,sha256=kuNrwKpg5Zbi9TG0jhlObkAJ3xJtj35sBIh-q2bmlyU,25583
|
|
11
|
+
bmcgo/cli/config.conan2.yaml,sha256=SAtM_6_qOjZbkgUT5fzWbhbq4aWCayqE8o4xJ2vBRww,261
|
|
12
12
|
bmcgo/cli/config.yaml,sha256=tbnFhz2TTrl2-ALpHHujbXB1ymZpjGC4f0zTfqfUZfM,194
|
|
13
13
|
bmcgo/codegen/__init__.py,sha256=eplRBfR_obzVWMQtIeX1RRq6DOEezBx_l1EqcZYLRPM,775
|
|
14
14
|
bmcgo/codegen/c/__init__.py,sha256=tmBG8c6sfxgIj__lyyU5mydWeKBdqbDuIQkLI38lwjI,522
|
|
@@ -168,7 +168,7 @@ bmcgo/codegen/lua/v1/templates/apps/service.lua.mako,sha256=wd_NJtiSSMbR-lxEqv-r
|
|
|
168
168
|
bmcgo/codegen/lua/v1/templates/apps/utils/mdb_intf.lua.mako,sha256=msdj2SygZvV3RIEHLeVDfZvOzZ99Yy27SwPVrFVVcpc,1242
|
|
169
169
|
bmcgo/codegen/lua/v1/templates/apps/utils/mdb_obj.lua.mako,sha256=oCzx2u3bjvCdNKX5oC8j6Q-Zb21q6SFCqd14_VzrWvo,349
|
|
170
170
|
bmcgo/component/__init__.py,sha256=BDXz8BcSlCkfo5UYt6j2rm89-HiYA1ZzfpFhy99MH-0,538
|
|
171
|
-
bmcgo/component/build.py,sha256=
|
|
171
|
+
bmcgo/component/build.py,sha256=4cusLnULxD42DhIICDdtB-W8wbBBt0CeOhZinRW04I4,12812
|
|
172
172
|
bmcgo/component/component_dt_version_parse.py,sha256=-Rt6i2fZrmYNZGoMqB21D_T9fC7fhhtUFIFvdPsMICM,14188
|
|
173
173
|
bmcgo/component/component_helper.py,sha256=rNwfhagfz6E3BjKERq9oOPLRfeKQlqhLojb6oJLXcEA,7933
|
|
174
174
|
bmcgo/component/deploy.py,sha256=Iy5CsiolKS1h5jDg13nYkfy6--BtbBZ8FLou2oVuoLQ,6544
|
|
@@ -196,7 +196,7 @@ bmcgo/functional/__init__.py,sha256=BDXz8BcSlCkfo5UYt6j2rm89-HiYA1ZzfpFhy99MH-0,
|
|
|
196
196
|
bmcgo/functional/analysis.py,sha256=pXakxSojBH-dULngbmgMHR3bq9tphOaAN4euGKgEYoc,4016
|
|
197
197
|
bmcgo/functional/bmc_studio_action.py,sha256=Gg96UB8QtnhsaqSdMhXuS9fddzAFPhR6UYCpto9UOYA,3605
|
|
198
198
|
bmcgo/functional/check.py,sha256=ReGN_8RRM6isX_r7XXEuHzkooh8pasky5_GpAml5d_g,8356
|
|
199
|
-
bmcgo/functional/conan_index_build.py,sha256=
|
|
199
|
+
bmcgo/functional/conan_index_build.py,sha256=Mp1fDpZVvecn5lUCsWZqq3mKSx9yu5pznQrDZr4Liuk,13443
|
|
200
200
|
bmcgo/functional/config.py,sha256=ZQ-a9hegI0cV41iTo7t49ryBeUH4wPJ-qkVvWp8toV4,10824
|
|
201
201
|
bmcgo/functional/csr_build.py,sha256=JTIvbjn08xvdo7aUhKW4giwPayojyIeQolT14SuwJRo,41146
|
|
202
202
|
bmcgo/functional/deploy.py,sha256=2NsxCpoZjL4jTyRpbIp20-EKKbQkQe-Hsm20uxHK2Xc,10677
|
|
@@ -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.7.dist-info/METADATA,sha256=yseh5MfSjqLah79NzBBPaBXuJrseP6e6H62K1XH4oCA,1009
|
|
268
|
+
openubmc_bingo-0.6.7.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
|
269
|
+
openubmc_bingo-0.6.7.dist-info/entry_points.txt,sha256=UUoUP-vAWTgg9vEYbRwYqOBHgpRtkngdzMPb-ocz90g,42
|
|
270
|
+
openubmc_bingo-0.6.7.dist-info/top_level.txt,sha256=9AcvCAt1nZcOgMsGt6T07mg2Bgtdet-3mHTwg91axgI,6
|
|
271
|
+
openubmc_bingo-0.6.7.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|