openubmc-bingo 0.6.13__py3-none-any.whl → 0.6.17__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 +28 -5
- bmcgo/codegen/lua/codegen.py +47 -4
- bmcgo/component/template_v2/conanbase.py.mako +4 -1
- bmcgo/utils/build_conans.py +1 -0
- {openubmc_bingo-0.6.13.dist-info → openubmc_bingo-0.6.17.dist-info}/METADATA +1 -1
- {openubmc_bingo-0.6.13.dist-info → openubmc_bingo-0.6.17.dist-info}/RECORD +10 -10
- {openubmc_bingo-0.6.13.dist-info → openubmc_bingo-0.6.17.dist-info}/WHEEL +0 -0
- {openubmc_bingo-0.6.13.dist-info → openubmc_bingo-0.6.17.dist-info}/entry_points.txt +0 -0
- {openubmc_bingo-0.6.13.dist-info → openubmc_bingo-0.6.17.dist-info}/top_level.txt +0 -0
bmcgo/__init__.py
CHANGED
bmcgo/cli/cli.py
CHANGED
|
@@ -20,6 +20,7 @@ import stat
|
|
|
20
20
|
import json
|
|
21
21
|
import re
|
|
22
22
|
import traceback
|
|
23
|
+
from tempfile import NamedTemporaryFile
|
|
23
24
|
from importlib.util import spec_from_file_location, module_from_spec
|
|
24
25
|
|
|
25
26
|
import yaml
|
|
@@ -244,7 +245,8 @@ class Command(object):
|
|
|
244
245
|
"""
|
|
245
246
|
if not self._check_conan():
|
|
246
247
|
return 1
|
|
247
|
-
self._check_conan_profile
|
|
248
|
+
self._check_conan_profile()
|
|
249
|
+
|
|
248
250
|
try:
|
|
249
251
|
command = args[0][0]
|
|
250
252
|
except IndexError: # No parameters
|
|
@@ -313,13 +315,34 @@ class Command(object):
|
|
|
313
315
|
|
|
314
316
|
def _check_conan_profile(self):
|
|
315
317
|
profile_dir = os.path.join(tools.conan_home, "profiles")
|
|
316
|
-
if os.path.isdir(profile_dir):
|
|
317
|
-
|
|
318
|
+
if not os.path.isdir(profile_dir):
|
|
319
|
+
os.makedirs(profile_dir)
|
|
318
320
|
|
|
319
321
|
if misc.conan_v2():
|
|
320
|
-
|
|
322
|
+
bingo_profiles = "/usr/share/bingo/profiles_for_conan2"
|
|
321
323
|
else:
|
|
322
|
-
|
|
324
|
+
bingo_profiles = "/usr/share/bingo/profiles_for_conan1"
|
|
325
|
+
if not os.path.isdir("/opt/RTOS"):
|
|
326
|
+
log.info(f"未检测到/opt/RTOS目录,可能未安装构建工具,请正确安装构建工具(可以manifest仓执行init.py或{misc.tool_name()} build)")
|
|
327
|
+
return
|
|
328
|
+
rtos_version = ""
|
|
329
|
+
for ver in os.listdir("/opt/RTOS"):
|
|
330
|
+
if re.match("^208\\.[0-9]+\\.[0-9]+$", ver):
|
|
331
|
+
if rtos_version:
|
|
332
|
+
log.warning(f"/opt/RTOS安装了多个RTOS工具版本,版本不匹配将导致编译失败,建议只保留其中一个,本次将使用{rtos_version}构建。")
|
|
333
|
+
break
|
|
334
|
+
rtos_version = ver
|
|
335
|
+
if not rtos_version:
|
|
336
|
+
log.info(f"未检测到/opt/RTOS目录下的构建工具,可能未安装构建工具,请正确安装构建工具(可以manifest仓执行init.py或{misc.tool_name()} build)")
|
|
337
|
+
return
|
|
338
|
+
for file in os.listdir(bingo_profiles):
|
|
339
|
+
os.makedirs(profile_dir, exist_ok=True)
|
|
340
|
+
src_file = os.path.join(bingo_profiles, file)
|
|
341
|
+
dst_file = os.path.join(profile_dir, file)
|
|
342
|
+
if not os.path.isfile(dst_file):
|
|
343
|
+
log.info(f"复制 {src_file} 到 {dst_file}")
|
|
344
|
+
tools.run_command(f"cp {src_file} {dst_file}")
|
|
345
|
+
tools.run_command(f"sed -i 's/208\\.[0-9]\\+\\.[0-9]\\+/{rtos_version}/g' {dst_file}", command_echo=False)
|
|
323
346
|
|
|
324
347
|
def _check_conan(self):
|
|
325
348
|
need_conan_v2 = False
|
bmcgo/codegen/lua/codegen.py
CHANGED
|
@@ -51,7 +51,7 @@ class CodeGen(object):
|
|
|
51
51
|
return lua_format
|
|
52
52
|
|
|
53
53
|
def get_mdb_interface_package(self):
|
|
54
|
-
channel = f"@{misc.conan_user()}/{misc.StageEnum.
|
|
54
|
+
channel = f"@{misc.conan_user()}/{misc.StageEnum.STAGE_STABLE.value}"
|
|
55
55
|
package = f"mdb_interface/[>=0.0.1]{channel}"
|
|
56
56
|
dependencies = self.read_service_json().get(misc.CONAN_DEPDENCIES_KEY)
|
|
57
57
|
if not dependencies:
|
|
@@ -110,7 +110,7 @@ class CodeGen(object):
|
|
|
110
110
|
mdb_interface_tmp_dir = os.path.join(conan_home, "latest_mdb_interface")
|
|
111
111
|
env = dict(os.environ, CONAN_STORAGE_PATH=mdb_interface_tmp_dir)
|
|
112
112
|
|
|
113
|
-
channel = f"@{misc.conan_user()}/{misc.StageEnum.
|
|
113
|
+
channel = f"@{misc.conan_user()}/{misc.StageEnum.STAGE_STABLE.value}"
|
|
114
114
|
package = f"mdb_interface/[>=0.0.1]{channel}"
|
|
115
115
|
|
|
116
116
|
cmd = ["conan", "install", package, f"-if={temp_dir}", "--update", "--build=missing", "-g", "deploy"]
|
|
@@ -121,6 +121,45 @@ class CodeGen(object):
|
|
|
121
121
|
subprocess.run(cmd, env=env)
|
|
122
122
|
shutil.copytree(os.path.join(temp_dir, "mdb_interface/opt/bmc/apps/mdb_interface"), target_dir)
|
|
123
123
|
shutil.rmtree(temp_dir, ignore_errors=True)
|
|
124
|
+
|
|
125
|
+
def setup_mdb_interfacev2(self):
|
|
126
|
+
target_dir = os.path.join(self.project_dir, 'temp/opt/bmc/apps/mdb_interface')
|
|
127
|
+
shutil.rmtree(target_dir, ignore_errors=True)
|
|
128
|
+
temp_dir = os.path.join(self.project_dir, 'temp/.mdb_interface_temp')
|
|
129
|
+
shutil.rmtree(temp_dir, ignore_errors=True)
|
|
130
|
+
os.makedirs(temp_dir, exist_ok=True)
|
|
131
|
+
if self.get_mdb_interface_url(temp_dir, target_dir):
|
|
132
|
+
shutil.rmtree(temp_dir, ignore_errors=True)
|
|
133
|
+
return
|
|
134
|
+
package = self.get_mdb_interface_package()
|
|
135
|
+
cmd = ["conan", "install", f"--requires={package}", f"-of={temp_dir}", "--build=missing", "-d", "direct_deploy",
|
|
136
|
+
f"--deployer-folder={temp_dir}"]
|
|
137
|
+
cmd += ["-pr=profile.dt.ini"]
|
|
138
|
+
if self.remote:
|
|
139
|
+
cmd += ["-r", self.remote]
|
|
140
|
+
subprocess.call(cmd)
|
|
141
|
+
shutil.copytree(os.path.join(temp_dir, "direct_deploy/mdb_interface/opt/bmc/apps/mdb_interface"), target_dir)
|
|
142
|
+
shutil.rmtree(temp_dir, ignore_errors=True)
|
|
143
|
+
|
|
144
|
+
def setup_latest_mdb_interfacev2(self):
|
|
145
|
+
target_dir = os.path.join(self.project_dir, 'temp/opt/bmc/apps/latest_mdb_interface')
|
|
146
|
+
shutil.rmtree(target_dir, ignore_errors=True)
|
|
147
|
+
temp_dir = os.path.join(self.project_dir, 'temp/.latest_mdb_interface_temp')
|
|
148
|
+
shutil.rmtree(temp_dir, ignore_errors=True)
|
|
149
|
+
os.makedirs(temp_dir, exist_ok=True)
|
|
150
|
+
|
|
151
|
+
channel = f"@{misc.conan_user()}/{misc.StageEnum.STAGE_STABLE.value}"
|
|
152
|
+
package = f"mdb_interface/[>=0.0.1]{channel}"
|
|
153
|
+
|
|
154
|
+
cmd = ["conan", "install", f"--requires={package}", f"-of={temp_dir}", "--build=missing", "-d", "direct_deploy",
|
|
155
|
+
"--update", f"--deployer-folder={temp_dir}"]
|
|
156
|
+
cmd += ["-pr=profile.dt.ini"]
|
|
157
|
+
if self.remote:
|
|
158
|
+
cmd += ["-r", self.remote]
|
|
159
|
+
|
|
160
|
+
subprocess.run(cmd)
|
|
161
|
+
shutil.copytree(os.path.join(temp_dir, "direct_deploy/mdb_interface/opt/bmc/apps/mdb_interface"), target_dir)
|
|
162
|
+
shutil.rmtree(temp_dir, ignore_errors=True)
|
|
124
163
|
|
|
125
164
|
def is_valid_date(self, date_str):
|
|
126
165
|
pattern = r'^-- Create: \d{4}-\d{1,2}-\d{1,2}$'
|
|
@@ -164,8 +203,12 @@ class CodeGen(object):
|
|
|
164
203
|
def generate_code_run(self, args):
|
|
165
204
|
shutil.rmtree(self.gen_tool_dir, ignore_errors=True)
|
|
166
205
|
shutil.copytree(cwd, self.gen_tool_dir)
|
|
167
|
-
|
|
168
|
-
|
|
206
|
+
if misc.conan_v2():
|
|
207
|
+
self.setup_mdb_interfacev2()
|
|
208
|
+
self.setup_latest_mdb_interfacev2()
|
|
209
|
+
else:
|
|
210
|
+
self.setup_mdb_interface()
|
|
211
|
+
self.setup_latest_mdb_interface()
|
|
169
212
|
lua_format = self.get_lua_format()
|
|
170
213
|
cmd = [
|
|
171
214
|
"/usr/bin/make", "-j12", f"PROJECT_NAME={self.project_name}", f"TPL_DIR={self.gen_tool_dir}",
|
|
@@ -115,7 +115,10 @@ class ConanBase(ConanFile):
|
|
|
115
115
|
if not url:
|
|
116
116
|
update_conandata(self, {"sources": {self.version: {"branch": None, "url": None, "pwd": os.getcwd(), "timestamp": int(time.time())}}})
|
|
117
117
|
return
|
|
118
|
-
|
|
118
|
+
try:
|
|
119
|
+
tag = git.run(f"tag --points-at HEAD | grep {self.version}")
|
|
120
|
+
except:
|
|
121
|
+
tag = ""
|
|
119
122
|
update_conandata(self, {"sources": {self.version: {"branch": f"refs/tags/{tag}" if tag else commit, "url": url}}})
|
|
120
123
|
% endif
|
|
121
124
|
|
bmcgo/utils/build_conans.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
bmcgo/__init__.py,sha256
|
|
1
|
+
bmcgo/__init__.py,sha256=-ZiFjQB0Op9berOvBtulbZEJLN5Qomt1CPbhMxDRZfA,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
|
|
@@ -7,7 +7,7 @@ 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=
|
|
10
|
+
bmcgo/cli/cli.py,sha256=O1E4QnAF453rj1jnfLkXfXNDPyZ6h6ry8_eoJiW7mXY,26859
|
|
11
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
|
|
@@ -35,7 +35,7 @@ bmcgo/codegen/c/template/server.h.mako,sha256=hZg1U64YKtlUm4wuKRobhjGW8e7rzFu9xg
|
|
|
35
35
|
bmcgo/codegen/lua/.lua-format,sha256=h6RLqe84SjDqKO1mqoCW7XVtrAwDMTRM1Rj8nwzPGwQ,188
|
|
36
36
|
bmcgo/codegen/lua/Makefile,sha256=wliuAhxhChrpsTnWuOlje3gtW2KRqayIhGRYBkvFi-c,3304
|
|
37
37
|
bmcgo/codegen/lua/__init__.py,sha256=2yU9vzUVQmMJ0qBtNJ-AfKpnOzYZo4wAxlRnpFwgE7M,521
|
|
38
|
-
bmcgo/codegen/lua/codegen.py,sha256=
|
|
38
|
+
bmcgo/codegen/lua/codegen.py,sha256=Ka2ZCkbhkB9b8QwMSE7tMPI9argikmWmbFm_YrTuRkY,11222
|
|
39
39
|
bmcgo/codegen/lua/proto/Makefile,sha256=rS4nEBwWJEDYAb5XN9S7SfII7RMFb071jh0eh_KJePo,3098
|
|
40
40
|
bmcgo/codegen/lua/proto/ipmi_types.proto,sha256=BX09mymhhPkWqZE1UCVJACpLBeQh1vQN31oBRVVieFY,377
|
|
41
41
|
bmcgo/codegen/lua/proto/types.proto,sha256=_X8JCKZCvO6PfWh6tuWcEqKHROrh46rCZab-OCkfirA,1162
|
|
@@ -190,7 +190,7 @@ bmcgo/component/coverage/c_incremental_cov_report.template,sha256=FPhK1DZtmWsjDx
|
|
|
190
190
|
bmcgo/component/coverage/incremental_cov.py,sha256=Uf-UdY4CW9rpP4sbURkCXBWyYMXWaG3R1Pyo3cDNvcQ,16859
|
|
191
191
|
bmcgo/component/template/conanbase.py.mako,sha256=dNvbToMSYI7jod7maCpR0PBizvVoQHvXxglmN9LNflg,10984
|
|
192
192
|
bmcgo/component/template/conanfile.deploy.py.mako,sha256=zpxluBjUFmJHfFrnBknxZ3cv3cxcqzJuGh2eN0uMXZA,889
|
|
193
|
-
bmcgo/component/template_v2/conanbase.py.mako,sha256=
|
|
193
|
+
bmcgo/component/template_v2/conanbase.py.mako,sha256=fz2i1A4LecWfsvKno7ru_jRAVqR7G8dyj54SgQPKAv4,15676
|
|
194
194
|
bmcgo/component/template_v2/conanfile.deploy.py.mako,sha256=Xbd-PlfVHOWeRFLfvzINeykiZzzSHsgO_yUUvYrKqTw,512
|
|
195
195
|
bmcgo/functional/__init__.py,sha256=BDXz8BcSlCkfo5UYt6j2rm89-HiYA1ZzfpFhy99MH-0,538
|
|
196
196
|
bmcgo/functional/analysis.py,sha256=pXakxSojBH-dULngbmgMHR3bq9tphOaAN4euGKgEYoc,4016
|
|
@@ -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=lEaZFCTjRc8pLWXWw71n7zl4zwmWg1s561Atn-Y32HA,9748
|
|
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
|
|
@@ -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.17.dist-info/METADATA,sha256=qPEuNbLIleXDMDQrn7OmQrjBGBvdyKM4gd1iJF9yxh0,1010
|
|
268
|
+
openubmc_bingo-0.6.17.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
|
269
|
+
openubmc_bingo-0.6.17.dist-info/entry_points.txt,sha256=UUoUP-vAWTgg9vEYbRwYqOBHgpRtkngdzMPb-ocz90g,42
|
|
270
|
+
openubmc_bingo-0.6.17.dist-info/top_level.txt,sha256=9AcvCAt1nZcOgMsGt6T07mg2Bgtdet-3mHTwg91axgI,6
|
|
271
|
+
openubmc_bingo-0.6.17.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|