openubmc-bingo 0.6.33__py3-none-any.whl → 0.6.43__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 +1 -0
- bmcgo/codegen/lua/script/render_utils/messages_lua.py +7 -0
- bmcgo/codegen/lua/templates/messages.lua.mako +1 -1
- bmcgo/component/analysis/analysis.py +21 -8
- bmcgo/component/analysis/data_deps.py +5 -0
- bmcgo/component/analysis/dep-rules.json +6 -2
- bmcgo/component/analysis/dep_node.py +13 -0
- bmcgo/component/package_info.py +1 -1
- bmcgo/component/template_v2/conanbase.py.mako +29 -29
- bmcgo/functional/maintain.py +27 -59
- bmcgo/tasks/task.py +7 -3
- bmcgo/tasks/task_build_conan.py +2 -2
- bmcgo/tasks/task_build_rootfs_img.py +1 -3
- bmcgo/tasks/task_download_buildtools.py +0 -76
- bmcgo/tasks/task_prepare.py +53 -1
- bmcgo/utils/build_conans.py +3 -1
- bmcgo/utils/config.py +18 -2
- bmcgo/utils/tools.py +25 -17
- {openubmc_bingo-0.6.33.dist-info → openubmc_bingo-0.6.43.dist-info}/METADATA +1 -1
- {openubmc_bingo-0.6.33.dist-info → openubmc_bingo-0.6.43.dist-info}/RECORD +24 -24
- {openubmc_bingo-0.6.33.dist-info → openubmc_bingo-0.6.43.dist-info}/WHEEL +0 -0
- {openubmc_bingo-0.6.33.dist-info → openubmc_bingo-0.6.43.dist-info}/entry_points.txt +0 -0
- {openubmc_bingo-0.6.33.dist-info → openubmc_bingo-0.6.43.dist-info}/top_level.txt +0 -0
bmcgo/__init__.py
CHANGED
bmcgo/cli/cli.py
CHANGED
|
@@ -25,6 +25,10 @@ class MessagesLuaUtils(Base, Utils):
|
|
|
25
25
|
"Critical": "log.ERROR"
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
DEFAULT_PARAMS_MAP = {
|
|
29
|
+
"ResetOperationNotAllowed": " or 'The current status does not support the reset operation'"
|
|
30
|
+
}
|
|
31
|
+
|
|
28
32
|
def __init__(self, data: dict, options: Options):
|
|
29
33
|
super().__init__(data, options=options)
|
|
30
34
|
|
|
@@ -144,6 +148,9 @@ class MessagesLuaUtils(Base, Utils):
|
|
|
144
148
|
return ""
|
|
145
149
|
return f", {params}"
|
|
146
150
|
|
|
151
|
+
def fill_default_params(self, name):
|
|
152
|
+
return MessagesLuaUtils.DEFAULT_PARAMS_MAP.get(name, "")
|
|
153
|
+
|
|
147
154
|
def params(self, msg):
|
|
148
155
|
placeholders = self.match_placeholders(msg)
|
|
149
156
|
if len(placeholders) == 0:
|
|
@@ -25,7 +25,7 @@ M.${name}Message = {
|
|
|
25
25
|
}
|
|
26
26
|
---@return Error
|
|
27
27
|
function M.${name}(${params})
|
|
28
|
-
return create_error(M.${name}Message${render_utils.error_params(err)})
|
|
28
|
+
return create_error(M.${name}Message${render_utils.error_params(err)}${render_utils.fill_default_params(name)})
|
|
29
29
|
end
|
|
30
30
|
|
|
31
31
|
% endfor
|
|
@@ -40,12 +40,19 @@ class AnalysisComp():
|
|
|
40
40
|
if not self.artifact_dir:
|
|
41
41
|
self.artifact_dir = os.path.join(os.getcwd(), "..", "output/packet/inner")
|
|
42
42
|
if not lock_file:
|
|
43
|
-
|
|
43
|
+
graph_file_name = "package.lock" if misc.conan_v1() else "graph.info"
|
|
44
|
+
self.lock_file = os.path.join(os.getcwd(), "..", f"output/{graph_file_name}")
|
|
44
45
|
self.nodes: list[DepNode] = []
|
|
45
46
|
self.subsystems = {}
|
|
46
47
|
self.rules: list[Rules] = []
|
|
47
48
|
self.rule_file = os.path.join(script_dir, "dep-rules.json")
|
|
48
49
|
|
|
50
|
+
@staticmethod
|
|
51
|
+
def process_str(input_str):
|
|
52
|
+
if misc.conan_v2():
|
|
53
|
+
return input_str.lower()
|
|
54
|
+
return input_str
|
|
55
|
+
|
|
49
56
|
def read_rules(self):
|
|
50
57
|
if not os.path.isfile(self.rule_file):
|
|
51
58
|
raise Exception(f"依赖规则文件 {self.rule_file} 不存在")
|
|
@@ -58,19 +65,19 @@ class AnalysisComp():
|
|
|
58
65
|
subsys = SubSys(int(level))
|
|
59
66
|
apps = sys_data.get("Apps", [])
|
|
60
67
|
for app in apps:
|
|
61
|
-
subsys.apps.append(app)
|
|
68
|
+
subsys.apps.append(self.process_str(app))
|
|
62
69
|
libs = sys_data.get("Libraries", [])
|
|
63
70
|
for lib in libs:
|
|
64
|
-
subsys.libraries.append(lib)
|
|
71
|
+
subsys.libraries.append(self.process_str(lib))
|
|
65
72
|
tools = sys_data.get("Tools", [])
|
|
66
73
|
for tool in tools:
|
|
67
|
-
subsys.tools.append(tool)
|
|
74
|
+
subsys.tools.append(self.process_str(tool))
|
|
68
75
|
configurations = sys_data.get("Configurations", [])
|
|
69
76
|
for config in configurations:
|
|
70
|
-
subsys.configurations.append(config)
|
|
77
|
+
subsys.configurations.append(self.process_str(config))
|
|
71
78
|
commands = sys_data.get("Commands", [])
|
|
72
79
|
for cmd in commands:
|
|
73
|
-
subsys.commands.append(cmd)
|
|
80
|
+
subsys.commands.append(self.process_str(cmd))
|
|
74
81
|
self.subsystems[sub] = subsys
|
|
75
82
|
self.rules.append(Rules(rules.get("Allowed", []), True))
|
|
76
83
|
self.rules.append(Rules(rules.get("UnAllowed", []), False))
|
|
@@ -102,16 +109,22 @@ class AnalysisComp():
|
|
|
102
109
|
lock = json.load(file_descriptor)
|
|
103
110
|
requires: dict = {}
|
|
104
111
|
packages = {}
|
|
112
|
+
graph_str = "graph_lock" if misc.conan_v1() else "graph"
|
|
105
113
|
for i in range(0, 10000):
|
|
106
|
-
node_data = lock.get(
|
|
114
|
+
node_data = lock.get(graph_str, {}).get("nodes", {}).get(str(i), None)
|
|
107
115
|
if not node_data:
|
|
108
116
|
break
|
|
109
117
|
node = DepNode(node_data, i)
|
|
110
118
|
# busybox是调测包,当dev包引入时忽略架构治理分析(由schema模型看护)
|
|
111
|
-
|
|
119
|
+
excluded_str = "/dev" if misc.conan_v1() else "openubmc"
|
|
120
|
+
if node.package_name == "busybox" and excluded_str in node.ref:
|
|
112
121
|
continue
|
|
113
122
|
packages[node.index] = node
|
|
114
123
|
requires[node.index] = node_data.get("requires", [])
|
|
124
|
+
if misc.conan_v2():
|
|
125
|
+
dependencies_data = node_data.get("dependencies", [])
|
|
126
|
+
dependencies_keys = list(dependencies_data.keys())
|
|
127
|
+
requires[node.index] = dependencies_keys
|
|
115
128
|
comm_name = misc.community_name()
|
|
116
129
|
for index, pkg in packages.items():
|
|
117
130
|
if not pkg.name.startswith(comm_name):
|
|
@@ -129,10 +129,15 @@ class DataDependenciesAnalysis(SrParser):
|
|
|
129
129
|
if node.package_name == 'vpd':
|
|
130
130
|
pkg_dir = node.ref.split("#")[0].replace("@", "/")
|
|
131
131
|
sr_dir = os.path.join(os.environ["HOME"], CONAN_DATA, pkg_dir, "source")
|
|
132
|
+
if misc.conan_v2():
|
|
133
|
+
sr_dir = os.path.join(node.recipe_folder, "..", "s")
|
|
132
134
|
if node.package_name == 'mdb_interface':
|
|
133
135
|
pkg_dir = node.ref.split("#")[0].replace("@", "/")
|
|
134
136
|
mdb_interface_dir = os.path.join(os.environ["HOME"], CONAN_DATA, pkg_dir,
|
|
135
137
|
"package", node.package_id, "opt/bmc/apps/mdb_interface/intf/mdb/bmc")
|
|
138
|
+
if misc.conan_v2():
|
|
139
|
+
mdb_interface_dir = os.path.join(node.package_folder,
|
|
140
|
+
"opt/bmc/apps/mdb_interface/intf/mdb/bmc")
|
|
136
141
|
if custom_sr_dir:
|
|
137
142
|
sr_dir = custom_sr_dir
|
|
138
143
|
super().__init__(sr_dir)
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
"libyaml",
|
|
43
43
|
"opentelemetry",
|
|
44
44
|
"grpc",
|
|
45
|
+
"grpc_tool",
|
|
45
46
|
"abseil",
|
|
46
47
|
"protobuf",
|
|
47
48
|
"re2",
|
|
@@ -68,7 +69,9 @@
|
|
|
68
69
|
"storagecore"
|
|
69
70
|
],
|
|
70
71
|
"Tools": [
|
|
71
|
-
"meta_template"
|
|
72
|
+
"meta_template",
|
|
73
|
+
"bison",
|
|
74
|
+
"flex"
|
|
72
75
|
],
|
|
73
76
|
"Apps": [
|
|
74
77
|
"secbox"
|
|
@@ -113,7 +116,8 @@
|
|
|
113
116
|
"libmdbc",
|
|
114
117
|
"libmcc",
|
|
115
118
|
"libmgmt_protocol",
|
|
116
|
-
"libkvs"
|
|
119
|
+
"libkvs",
|
|
120
|
+
"liblogger"
|
|
117
121
|
],
|
|
118
122
|
"Configurations": [
|
|
119
123
|
"rootfs_user"
|
|
@@ -16,9 +16,12 @@ import sys
|
|
|
16
16
|
|
|
17
17
|
from typing import List, Set
|
|
18
18
|
from bmcgo.logger import Logger
|
|
19
|
+
from bmcgo.utils.tools import Tools
|
|
20
|
+
from bmcgo import misc
|
|
19
21
|
|
|
20
22
|
global log
|
|
21
23
|
log = Logger()
|
|
24
|
+
tools = Tools()
|
|
22
25
|
|
|
23
26
|
TABLE_CONFLICT_WHITE_LIST = {"nsm": "t_snmp_config", "event_policy": "t_snmp_config"}
|
|
24
27
|
|
|
@@ -48,6 +51,14 @@ class DepNode():
|
|
|
48
51
|
self.local_tables = {}
|
|
49
52
|
self.remote_tables = {}
|
|
50
53
|
self.table_conflict = False
|
|
54
|
+
if misc.conan_v2():
|
|
55
|
+
self.recipe_folder = node.get("recipe_folder")
|
|
56
|
+
self.binary = node.get("binary", "")
|
|
57
|
+
if self.binary == "Skip":
|
|
58
|
+
return
|
|
59
|
+
result = tools.run_command(f"conan cache path {self.ref}:{self.package_id}",
|
|
60
|
+
capture_output=True, text=True)
|
|
61
|
+
self.package_folder = str(result.stdout).strip()
|
|
51
62
|
self._parse_mds()
|
|
52
63
|
|
|
53
64
|
@staticmethod
|
|
@@ -92,6 +103,8 @@ class DepNode():
|
|
|
92
103
|
def _parse_mds(self):
|
|
93
104
|
pkg_dir = self.ref.split("#")[0].replace("@", "/")
|
|
94
105
|
package_source = os.path.join(os.environ["HOME"], ".conan/data", pkg_dir, "package", self.package_id)
|
|
106
|
+
if misc.conan_v2():
|
|
107
|
+
package_source = self.package_folder
|
|
95
108
|
mds_path = os.path.join(package_source, "include/mds")
|
|
96
109
|
self.model_path = os.path.join(mds_path, "model.json")
|
|
97
110
|
if os.path.exists(self.model_path):
|
bmcgo/component/package_info.py
CHANGED
|
@@ -242,7 +242,7 @@ class InfoComp():
|
|
|
242
242
|
def _conan_define_v2(self):
|
|
243
243
|
self.package = "%s/%s@%s/%s" % (self.name, self.version, self.user, self.stage)
|
|
244
244
|
profiles = [f"-pr:h {self.profile}"]
|
|
245
|
-
profiles.append("-pr:b
|
|
245
|
+
profiles.append("-pr:b profile.dt.ini")
|
|
246
246
|
if self.enable_luajit:
|
|
247
247
|
self.options.append("*/*:enable_luajit=True")
|
|
248
248
|
if self.build_type == "debug":
|
|
@@ -22,16 +22,13 @@ import shutil
|
|
|
22
22
|
from conan import ConanFile
|
|
23
23
|
from conan.tools.scm import Git
|
|
24
24
|
from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout
|
|
25
|
-
from conan.tools.files import copy, update_conandata, chdir, rm
|
|
26
|
-
from conan.errors import ConanInvalidConfiguration
|
|
25
|
+
from conan.tools.files import copy, update_conandata, chdir, rm, mkdir
|
|
27
26
|
% if language == "c":
|
|
28
27
|
from bmcgo.component.gen import GenComp
|
|
29
28
|
% endif
|
|
30
29
|
% if pkg.is_maintain:
|
|
31
|
-
from conans import tools
|
|
32
|
-
from conans.util.files import mkdir
|
|
33
30
|
from conan.tools.files import patch as apply_patch
|
|
34
|
-
from
|
|
31
|
+
from conan.errors import ConanException
|
|
35
32
|
% endif
|
|
36
33
|
|
|
37
34
|
urllib3.disable_warnings()
|
|
@@ -105,17 +102,20 @@ class ConanBase(ConanFile):
|
|
|
105
102
|
update_conandata(self, {"sources": {self.version: {"branch": None, "url": None, "pwd": os.getcwd(), "timestamp": int(time.time())}}})
|
|
106
103
|
return
|
|
107
104
|
url = None
|
|
105
|
+
url_remote = None
|
|
108
106
|
commit = git.get_commit()
|
|
109
107
|
branches = git.run("branch -r --contains {}".format(commit))
|
|
110
108
|
remotes = git.run("remote")
|
|
111
109
|
for remote in remotes.splitlines():
|
|
112
110
|
if "{}/".format(remote) in branches:
|
|
113
111
|
url = git.get_remote_url(remote)
|
|
112
|
+
url_remote = remote
|
|
114
113
|
break
|
|
115
114
|
if not url:
|
|
116
115
|
update_conandata(self, {"sources": {self.version: {"branch": None, "url": None, "pwd": os.getcwd(), "timestamp": int(time.time())}}})
|
|
117
116
|
return
|
|
118
117
|
try:
|
|
118
|
+
self.run(f"git fetch --prune --prune-tags {url_remote}")
|
|
119
119
|
tag = git.run(f"tag --points-at HEAD | grep -m 1 {self.version}")
|
|
120
120
|
except:
|
|
121
121
|
tag = ""
|
|
@@ -132,7 +132,7 @@ class ConanBase(ConanFile):
|
|
|
132
132
|
# 与export_conandata_patches方法不同点:所有patches将从recipes_folder/../pacthes读取
|
|
133
133
|
src = os.path.join(self.recipe_folder, "..", patch_file)
|
|
134
134
|
dst = os.path.join(self.export_sources_folder, patch_file)
|
|
135
|
-
mkdir(os.path.dirname(dst))
|
|
135
|
+
mkdir(self, os.path.dirname(dst))
|
|
136
136
|
shutil.copy2(src, dst)
|
|
137
137
|
|
|
138
138
|
% endif
|
|
@@ -150,28 +150,7 @@ class ConanBase(ConanFile):
|
|
|
150
150
|
% if language == "c":
|
|
151
151
|
self._codegen()
|
|
152
152
|
% endif
|
|
153
|
-
|
|
154
|
-
def generate(self):
|
|
155
|
-
tc = self._pre_generate()
|
|
156
|
-
tc.generate()
|
|
157
|
-
|
|
158
|
-
% if pkg.is_maintain:
|
|
159
|
-
@staticmethod
|
|
160
|
-
def _get_patch_changed_files(patch_file):
|
|
161
|
-
files = {}
|
|
162
|
-
for line in open(patch_file):
|
|
163
|
-
if not line.startswith("diff --git"):
|
|
164
|
-
continue
|
|
165
|
-
line = line.strip()
|
|
166
|
-
chunk = line.split()
|
|
167
|
-
a_file = chunk[-2][2:]
|
|
168
|
-
b_file = chunk[-1][2:]
|
|
169
|
-
files[a_file] = b_file
|
|
170
|
-
return files
|
|
171
|
-
|
|
172
|
-
%endif
|
|
173
|
-
def build(self):
|
|
174
|
-
% if pkg.is_maintain:
|
|
153
|
+
% if pkg.is_maintain:
|
|
175
154
|
for patch in self.conan_data.get("patches", {}).get(self.version, []):
|
|
176
155
|
patch_file = patch.get("patch_file")
|
|
177
156
|
if not patch_file:
|
|
@@ -193,7 +172,28 @@ class ConanBase(ConanFile):
|
|
|
193
172
|
self.run(cmd, ignore_errors=True)
|
|
194
173
|
cmd = "git am " + real_path
|
|
195
174
|
self.run(cmd)
|
|
196
|
-
% endif
|
|
175
|
+
% endif
|
|
176
|
+
|
|
177
|
+
def generate(self):
|
|
178
|
+
tc = self._pre_generate()
|
|
179
|
+
tc.generate()
|
|
180
|
+
|
|
181
|
+
% if pkg.is_maintain:
|
|
182
|
+
@staticmethod
|
|
183
|
+
def _get_patch_changed_files(patch_file):
|
|
184
|
+
files = {}
|
|
185
|
+
for line in open(patch_file):
|
|
186
|
+
if not line.startswith("diff --git"):
|
|
187
|
+
continue
|
|
188
|
+
line = line.strip()
|
|
189
|
+
chunk = line.split()
|
|
190
|
+
a_file = chunk[-2][2:]
|
|
191
|
+
b_file = chunk[-1][2:]
|
|
192
|
+
files[a_file] = b_file
|
|
193
|
+
return files
|
|
194
|
+
|
|
195
|
+
%endif
|
|
196
|
+
def build(self):
|
|
197
197
|
cmake = self._configure_cmake()
|
|
198
198
|
cmake.build()
|
|
199
199
|
|
bmcgo/functional/maintain.py
CHANGED
|
@@ -92,11 +92,9 @@ class BmcgoCommand:
|
|
|
92
92
|
self.bconfig = bconfig
|
|
93
93
|
parser = argparse.ArgumentParser(prog=f"{misc.tool_name()} maintain", description="BMC组件的维护管理工具",
|
|
94
94
|
add_help=True, formatter_class=argparse.RawTextHelpFormatter)
|
|
95
|
-
|
|
96
|
-
parser.add_argument("-cp", "--conan_package", help="指定需要维护的组件版本,示例:component/1.2.3", required=True)
|
|
97
|
-
else:
|
|
98
|
-
parser.add_argument("-cp", "--conan_package",
|
|
95
|
+
parser.add_argument("-cp", "--conan_package",
|
|
99
96
|
help="指定需要维护的组件版本,示例:component/1.2.3@{misc.conan_user()}/stable", required=True)
|
|
97
|
+
parser.add_argument("--conan2", help="是否生成conan2.x版本的维护组件包", action=misc.STORE_TRUE)
|
|
100
98
|
parser.add_argument("-p", "--patch_file", help="添加patch文件,可指定多个,顺序追加到代码中", action='append')
|
|
101
99
|
parser.add_argument("-b", "--branch", help="用于提取patch的分支,与commit_id配合使用", default="master")
|
|
102
100
|
parser.add_argument("-c", "--commit_id", help="需要生成patch的提交节点,长度不低于8个字符,可指定多个,顺序追加到代码中",
|
|
@@ -106,20 +104,9 @@ class BmcgoCommand:
|
|
|
106
104
|
help="conan远程仓,请检查conan remote list查看已配置的conan仓")
|
|
107
105
|
parsed_args = parser.parse_args(*args)
|
|
108
106
|
cp = parsed_args.conan_package
|
|
109
|
-
if misc.conan_v1():
|
|
110
|
-
if (not re.match("^[a-zA-Z0-9_-]+/([1-9][0-9]*|[0-9])\.[0-9]+\.[0-9]+$", cp) and
|
|
111
|
-
not re.match("^[a-zA-Z0-9_-]+/(([1-9][0-9]*|[0-9])\.[0-9]+\.[0-9]+)(-build\.[0-9]+)$", cp) and
|
|
112
|
-
not re.match("^[a-zA-Z0-9_-]+/(([1-9][0-9]*|[0-9])\.[0-9]+\.[0-9]+)(.p[0-9]+)$" + cp)):
|
|
113
|
-
raise errors.BmcGoException("-cp参数错误,不满足格式\"<name>/<version>\"要求")
|
|
114
|
-
else:
|
|
115
|
-
restr = misc.CONAN_NAME_RESTR
|
|
116
|
-
if (not re.match(f"^{restr}/([1-9][0-9]*|[0-9])\.[0-9]+\.[0-9]+@{restr}/{restr}$", cp) and
|
|
117
|
-
not re.match(f"^{restr}/(([1-9][0-9]*|[0-9])\.[0-9]+\.[0-9]+)(-build\.[0-9]+)@{restr}/{restr}$", cp) and
|
|
118
|
-
not re.match(f"^{restr}/(([1-9][0-9]*|[0-9])\.[0-9]+\.[0-9]+)(.p[0-9]+)@{restr}/{restr}$" + cp)):
|
|
119
|
-
raise errors.BmcGoException("-cp参数错误,不满足格式\"<name>/<version>@user/channel\"要求")
|
|
120
107
|
self.conan_package = cp
|
|
121
108
|
self.name = self.conan_package.split("/")[0]
|
|
122
|
-
self.base_version = self.conan_package.split("/")[1]
|
|
109
|
+
self.base_version = self.conan_package.split("/")[1].split("@")[0]
|
|
123
110
|
self.remote = parsed_args.remote
|
|
124
111
|
self.arg_special_version = parsed_args.version
|
|
125
112
|
if parsed_args.patch_file is None:
|
|
@@ -158,6 +145,10 @@ class BmcgoCommand:
|
|
|
158
145
|
bconfig = BmcgoConfig()
|
|
159
146
|
comp = BuildComp(bconfig, ["--maintain"], gen_conanbase=True)
|
|
160
147
|
self.recipe_folder = os.path.join(self.bconfig.conan_index.folder, comp.info.name)
|
|
148
|
+
if misc.conan_v2():
|
|
149
|
+
recipe2_folder = os.path.join(self.bconfig.conan_index.folder, "..", "recipes2")
|
|
150
|
+
recipe2_folder = os.path.realpath(recipe2_folder)
|
|
151
|
+
self.recipe_folder = os.path.join(recipe2_folder, comp.info.name)
|
|
161
152
|
if not os.path.isdir(self.recipe_folder):
|
|
162
153
|
os.makedirs(self.recipe_folder)
|
|
163
154
|
self._update_next_version()
|
|
@@ -194,37 +185,19 @@ class BmcgoCommand:
|
|
|
194
185
|
log.success(f"生成维护版本 {self.name}/{self.next_version} 成功")
|
|
195
186
|
return 0
|
|
196
187
|
|
|
197
|
-
def
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
tool.run_command(cmd, error_log=f"组件 {self.conan_package} 未找到,请检查网络连接以及该版本是否已发布")
|
|
201
|
-
cmd = f"conan cache path {self.conan_package}"
|
|
202
|
-
export_path = tool.run_command(cmd, capture_output=True, shell=True).stdout.strip()
|
|
203
|
-
conanfile = os.path.join(export_path, "conanfile.py")
|
|
204
|
-
conandata = os.path.join(export_path, "conandata.yml")
|
|
205
|
-
if not os.path.isfile(conandata):
|
|
206
|
-
raise errors.BmcGoException(f"未找到组件 {self.conan_package} 的conandata.yml文件")
|
|
207
|
-
log.info(f"从 {conandata} 读取源码tag的url")
|
|
208
|
-
# 尝试从conandata中获取代码仓地址
|
|
209
|
-
with open(conandata, "r") as fp:
|
|
210
|
-
data = yaml.safe_load(fp)
|
|
211
|
-
cfg = data.get("sources", {}).get(self.base_version)
|
|
212
|
-
if cfg is None:
|
|
213
|
-
raise RuntimeError(f"${conandata}不存在组件 {self.conan_package} 配置, 请检查是否正确")
|
|
214
|
-
self.url = cfg.get("url")
|
|
215
|
-
self.tag = cfg.get("branch")
|
|
216
|
-
if re.match("^refs/tags/[0-9]+\\.[0-9]+\\.[0-9]+$", self.tag):
|
|
217
|
-
self.tag = self.tag[len("refs/tags/"):]
|
|
218
|
-
elif not self.tag:
|
|
219
|
-
self.tag = self.base_version
|
|
220
|
-
|
|
221
|
-
def _fetch_conan_info_v1(self):
|
|
222
|
-
user = misc.conan_user()
|
|
223
|
-
args = "--only-recipe" if misc.conan_v2() else "--recipe"
|
|
224
|
-
export_path = os.path.join(tool.conan_data, self.conan_package, f"{user}/stable", "export")
|
|
225
|
-
if not os.path.isdir(export_path):
|
|
226
|
-
cmd = f"conan download {self.conan_package}@{user}/stable -r {self.remote} {args}"
|
|
188
|
+
def _fetch_conan_info(self):
|
|
189
|
+
if misc.conan_v2():
|
|
190
|
+
cmd = f"conan download {self.conan_package} -r {self.remote} --only-recipe"
|
|
227
191
|
tool.run_command(cmd, error_log=f"组件 {self.conan_package} 未找到,请检查网络连接以及该版本是否已发布")
|
|
192
|
+
cmd = f"conan cache path {self.conan_package}"
|
|
193
|
+
export_path = tool.run_command(cmd, capture_output=True, shell=True).stdout.strip()
|
|
194
|
+
else:
|
|
195
|
+
conan_package_path = self.conan_package.replace("@", "/")
|
|
196
|
+
export_path = os.path.join(tool.conan_data, conan_package_path, "export")
|
|
197
|
+
if not os.path.isdir(export_path):
|
|
198
|
+
cmd = f"conan download {self.conan_package} -r {self.remote} -re"
|
|
199
|
+
tool.run_command(cmd, error_log=f"组件 {self.conan_package} 未找到,请检查网络连接以及该版本是否已发布")
|
|
200
|
+
|
|
228
201
|
conanfile = os.path.join(export_path, "conanfile.py")
|
|
229
202
|
conandata = os.path.join(export_path, "conandata.yml")
|
|
230
203
|
if os.path.isfile(conandata):
|
|
@@ -237,7 +210,7 @@ class BmcgoCommand:
|
|
|
237
210
|
raise RuntimeError(f"${conandata}不存在组件 {self.conan_package} 配置, 请检查是否正确")
|
|
238
211
|
self.url = cfg.get("url")
|
|
239
212
|
branch = cfg.get("branch")
|
|
240
|
-
if re.match("^refs/tags/[0-9]+\\.[0-9]+\\.[0-9]
|
|
213
|
+
if re.match("^refs/tags/[0-9]+\\.[0-9]+\\.[0-9]+", branch):
|
|
241
214
|
self.tag = branch[len("refs/tags/"):]
|
|
242
215
|
else:
|
|
243
216
|
raise RuntimeError(f"${conandata}的组件 {self.conan_package} 配置错误, 未找到有效的tag")
|
|
@@ -253,28 +226,23 @@ class BmcgoCommand:
|
|
|
253
226
|
else:
|
|
254
227
|
raise RuntimeError("无法找到版本(revision)和地址(url)字段")
|
|
255
228
|
|
|
256
|
-
def _fetch_conan_info(self):
|
|
257
|
-
if misc.conan_v1():
|
|
258
|
-
self._fetch_conan_info_v1()
|
|
259
|
-
else:
|
|
260
|
-
self._fetch_conan_info_v2()
|
|
261
|
-
|
|
262
229
|
def _update_next_version(self):
|
|
263
230
|
self.next_version = self.arg_special_version
|
|
264
231
|
if not self.next_version:
|
|
265
|
-
if re.match("^(([1-9][0-9]*|[0-9])\.[0-9]+\.[0-9]+)(
|
|
232
|
+
if re.match("^(([1-9][0-9]*|[0-9])\.[0-9]+\.[0-9]+)([-|+]build\.[0-9]+)$", self.base_version):
|
|
266
233
|
temp_version = self.base_version.split(".")
|
|
234
|
+
temp_version[-2] = temp_version[-2].replace("-", "+")
|
|
267
235
|
temp_version[-1] = str(int(temp_version[-1]) + 1)
|
|
268
236
|
self.next_version = ".".join(temp_version)
|
|
269
237
|
else:
|
|
270
|
-
self.next_version = self.base_version.split("
|
|
238
|
+
self.next_version = self.base_version.split("+")[0] + "+build.1"
|
|
271
239
|
log.info(f"自动生成的版本号为 {Fore.GREEN}{self.next_version}{Style.RESET_ALL}")
|
|
272
|
-
version = input("请回车确认 或者 输入你期望的版本号(
|
|
240
|
+
version = input("请回车确认 或者 输入你期望的版本号(必须以+build.x结束,如1.2.3+build.1): ").strip()
|
|
273
241
|
if version:
|
|
274
242
|
self.next_version = version
|
|
275
|
-
if not self.arg_special_version and "
|
|
276
|
-
raise errors.BmcGoException(f"
|
|
277
|
-
restr = r"^(([1-9][0-9]*|[0-9])\.[0-9]+\.[0-9]+)(
|
|
243
|
+
if not self.arg_special_version and "+build." not in self.next_version:
|
|
244
|
+
raise errors.BmcGoException(f"版本号格式必须以+build.x结束,如1.2.3+build.1")
|
|
245
|
+
restr = r"^(([1-9][0-9]*|[0-9])\.[0-9]+\.[0-9]+)(\+build\.[1-9][0-9]*)$"
|
|
278
246
|
match = re.match(restr, self.next_version)
|
|
279
247
|
if not match:
|
|
280
248
|
raise errors.BmcGoException(f"版本号 {self.next_version} 不满足正则表达式 '{restr}' 要求")
|
bmcgo/tasks/task.py
CHANGED
|
@@ -236,12 +236,16 @@ class Task(Process):
|
|
|
236
236
|
# 新增profile文件需要存在在manifest/build/profiles目录
|
|
237
237
|
profiles = os.path.join(self.config.code_path, "profiles")
|
|
238
238
|
if os.path.isdir(profiles):
|
|
239
|
-
|
|
239
|
+
self.run_command(f"cp -rf {profiles}/. {self.conan_profiles_dir}")
|
|
240
240
|
platform_profiles = os.path.join(self.config.temp_platform_build_dir, "profiles")
|
|
241
241
|
if os.path.isdir(platform_profiles):
|
|
242
|
-
|
|
242
|
+
self.run_command(f"cp -rf {platform_profiles}/. {self.conan_profiles_dir}")
|
|
243
|
+
|
|
244
|
+
if self.config.manifest_sdk_flag:
|
|
245
|
+
if os.path.isdir(profiles):
|
|
246
|
+
self.run_command(f"cp -rf {profiles}/. {self.conan_profiles_dir}")
|
|
243
247
|
self.run_command("conan remote remove conancenter", ignore_error=True)
|
|
244
|
-
|
|
248
|
+
|
|
245
249
|
def check_need_install(self, download_dir_path, old_sha, new_sha):
|
|
246
250
|
need_install_flag = True
|
|
247
251
|
# 计算sha256
|
bmcgo/tasks/task_build_conan.py
CHANGED
|
@@ -692,9 +692,9 @@ class TaskClass(Task):
|
|
|
692
692
|
|
|
693
693
|
def calc_options_v2(self):
|
|
694
694
|
if self.config.build_type == "debug":
|
|
695
|
-
options = "-s build_type=Debug"
|
|
695
|
+
options = "-s:a build_type=Debug"
|
|
696
696
|
else:
|
|
697
|
-
options = "-s build_type=Release"
|
|
697
|
+
options = "-s:a build_type=Release"
|
|
698
698
|
|
|
699
699
|
if self.config.enable_arm_gcov:
|
|
700
700
|
options += " -o */*:gcov=True"
|
|
@@ -358,9 +358,7 @@ class TaskClass(Task):
|
|
|
358
358
|
base.append("grep -v \".target$\"")
|
|
359
359
|
if self.config.build_type == "debug":
|
|
360
360
|
# so库一般带有版本号,此处不能注明具体的版本号,否则可能导致版本变更时不能正确strip
|
|
361
|
-
not_striped_list = ["rootfs/opt/bmc"
|
|
362
|
-
not_striped_list += ["libfilehook.so", "liblogging.so", "liblua.so", "libmctp.so", "libnsm_kmc.so"]
|
|
363
|
-
not_striped_list += ["libplatform.so", "libsnmp.so", "libsoc_adapter.so", "libuip.so"]
|
|
361
|
+
not_striped_list = ["rootfs/opt/bmc"]
|
|
364
362
|
for file in not_striped_list:
|
|
365
363
|
base.append("grep -v \"{}\"".format(file))
|
|
366
364
|
base.append("sudo xargs -P 0 -I {{}} file {{}}".format(file_list))
|
|
@@ -15,10 +15,6 @@
|
|
|
15
15
|
修改记录:2021-10-11 创建
|
|
16
16
|
'''
|
|
17
17
|
import os
|
|
18
|
-
import tempfile
|
|
19
|
-
import shutil
|
|
20
|
-
from pathlib import Path
|
|
21
|
-
from urllib.parse import urlparse
|
|
22
18
|
|
|
23
19
|
from bmcgo.tasks.task import Task
|
|
24
20
|
from bmcgo.tasks.misc import BUILD_TOOLS_SHA256_PATH
|
|
@@ -77,79 +73,7 @@ class DownloadDefaultBuildtools(Task):
|
|
|
77
73
|
self.run_command("cp -af {} {}".format(self.buildtools_new_sha256, BUILD_TOOLS_SHA256_PATH), sudo=True)
|
|
78
74
|
self.run_command("chmod a+r {}".format(BUILD_TOOLS_SHA256_PATH), sudo=True)
|
|
79
75
|
|
|
80
|
-
def download_sdk(self):
|
|
81
|
-
downloads = self.get_manufacture_config("sdk/downloads")
|
|
82
|
-
if downloads is None:
|
|
83
|
-
self.log.warning("请在 manifest.yml 配置 sdk 字段或更新 manifest 仓库")
|
|
84
|
-
return
|
|
85
|
-
|
|
86
|
-
download_path = Path.home() / "downloads"
|
|
87
|
-
download_path.mkdir(exist_ok=True, parents=True)
|
|
88
|
-
|
|
89
|
-
for item in downloads:
|
|
90
|
-
self.log.info(f"配置 {item['name']}...")
|
|
91
|
-
|
|
92
|
-
curr_file_name = Path(urlparse(item['url']).path).name
|
|
93
|
-
curr_file = download_path / curr_file_name
|
|
94
|
-
curr_file_path = curr_file.as_posix()
|
|
95
|
-
|
|
96
|
-
need_download = True
|
|
97
|
-
if curr_file.exists():
|
|
98
|
-
curr_pkg_sha256 = self.tools.sha256sum(curr_file_path)
|
|
99
|
-
if curr_pkg_sha256 == item['sha256']:
|
|
100
|
-
self.log.info(f"已下载 {item["name"]}, 跳过.")
|
|
101
|
-
need_download = False
|
|
102
|
-
|
|
103
|
-
if need_download:
|
|
104
|
-
with tempfile.TemporaryDirectory() as tmp:
|
|
105
|
-
self.log.info(f"开始下载 {item['url']}...")
|
|
106
|
-
download_pkg_path = os.path.join(tmp, curr_file_name)
|
|
107
|
-
self.tools.download_file(item['url'], download_pkg_path)
|
|
108
|
-
downloaded_sha256 = self.tools.sha256sum(download_pkg_path)
|
|
109
|
-
|
|
110
|
-
if item['sha256'] != downloaded_sha256:
|
|
111
|
-
raise RuntimeError(f"manifest.yml /sdk/downloads/{item['name']} sha256 内容和下载包体不符,请检查配置!")
|
|
112
|
-
|
|
113
|
-
shutil.move(download_pkg_path, curr_file_path)
|
|
114
|
-
|
|
115
|
-
if hasattr(self, f"install_{item['name']}"):
|
|
116
|
-
getattr(self, f"install_{item['name']}")(curr_file_path)
|
|
117
|
-
|
|
118
|
-
self.log.info(f"配置 {item['name']} 完成!")
|
|
119
|
-
|
|
120
|
-
def install_bmc_sdk(self, zip_path):
|
|
121
|
-
with tempfile.TemporaryDirectory() as tmp:
|
|
122
|
-
self.log.info("安装 bmc_sdk")
|
|
123
|
-
home_path = Path.home().as_posix()
|
|
124
|
-
real_path = zip_path
|
|
125
|
-
|
|
126
|
-
self.log.debug(f"解压 {real_path} 到 {tmp}")
|
|
127
|
-
self.run_command(f"unzip {real_path} -d {tmp}")
|
|
128
|
-
|
|
129
|
-
rtos_compiler_path = Path.home() / "rtos_compiler"
|
|
130
|
-
if rtos_compiler_path.exists():
|
|
131
|
-
shutil.rmtree(rtos_compiler_path)
|
|
132
|
-
|
|
133
|
-
sdk_path = Path.home() / "sdk"
|
|
134
|
-
if sdk_path.exists():
|
|
135
|
-
shutil.rmtree(sdk_path)
|
|
136
|
-
|
|
137
|
-
self.log.debug(f"move {tmp}/rtos_compiler -> {home_path}")
|
|
138
|
-
self.run_command(f"mv {tmp}/rtos_compiler/ {home_path}")
|
|
139
|
-
self.log.debug(f"move {tmp}/sdk -> {home_path}")
|
|
140
|
-
self.run_command(f"mv {tmp}/sdk/ {home_path}")
|
|
141
|
-
self.log.debug(f"move {tmp}/lua-format -> /usr/bin")
|
|
142
|
-
self.run_command(f"chmod +x {tmp}/lua-format")
|
|
143
|
-
self.run_command(f"mv -f {tmp}/lua-format /usr/bin/", sudo=True)
|
|
144
|
-
|
|
145
|
-
self.log.debug(f"copy {tmp}/hpm_tools/. -> {home_path}")
|
|
146
|
-
self.run_command(f"chmod -R +x {tmp}/hpm_tools")
|
|
147
|
-
self.run_command(f"cp -rf {tmp}/hpm_tools/. /usr/local/bin/", sudo=True)
|
|
148
|
-
|
|
149
|
-
self.log.info(f"安装 bmc_sdk 完成!")
|
|
150
|
-
|
|
151
76
|
def run(self):
|
|
152
|
-
self.download_sdk()
|
|
153
77
|
self.download_tools()
|
|
154
78
|
self.info("下载依赖工具结束")
|
|
155
79
|
|
bmcgo/tasks/task_prepare.py
CHANGED
|
@@ -18,8 +18,11 @@
|
|
|
18
18
|
import os
|
|
19
19
|
import json
|
|
20
20
|
import shutil
|
|
21
|
-
import
|
|
21
|
+
from pathlib import Path
|
|
22
|
+
import tempfile
|
|
23
|
+
import shutil
|
|
22
24
|
import yaml
|
|
25
|
+
import jsonschema
|
|
23
26
|
from bmcgo.tasks.task import Task
|
|
24
27
|
from bmcgo import misc
|
|
25
28
|
from bmcgo import errors
|
|
@@ -95,6 +98,54 @@ class TaskClass(Task):
|
|
|
95
98
|
self.schema_subsys_valid("rc")
|
|
96
99
|
self.schema_subsys_valid("stable")
|
|
97
100
|
|
|
101
|
+
def pre_download(self):
|
|
102
|
+
downloads = self.get_manufacture_config("pre_download", {})
|
|
103
|
+
if downloads is None:
|
|
104
|
+
self.log.warning("请在 manifest.yml 配置 sdk 字段或更新 manifest 仓库")
|
|
105
|
+
return
|
|
106
|
+
|
|
107
|
+
download_path = os.path.join(self.config.temp_path, "downloads")
|
|
108
|
+
os.makedirs(download_path, exist_ok=True)
|
|
109
|
+
for key, item in downloads.items():
|
|
110
|
+
sha256 = item['sha256']
|
|
111
|
+
url = item['url']
|
|
112
|
+
dst_file = os.path.join(download_path, sha256)
|
|
113
|
+
self.info(f"开始下载 {url} 到 {dst_file}")
|
|
114
|
+
self.tools.download_file(key, url, dst_file, sha256)
|
|
115
|
+
if key == "bmc_sdk":
|
|
116
|
+
self.install_bmc_sdk(dst_file)
|
|
117
|
+
|
|
118
|
+
def install_bmc_sdk(self, zip_path):
|
|
119
|
+
with tempfile.TemporaryDirectory() as tmp:
|
|
120
|
+
self.log.info("安装 bmc_sdk")
|
|
121
|
+
home_path = Path.home().as_posix()
|
|
122
|
+
real_path = zip_path
|
|
123
|
+
|
|
124
|
+
self.log.debug(f"解压 {real_path} 到 {tmp}")
|
|
125
|
+
self.run_command(f"unzip {real_path} -d {tmp}")
|
|
126
|
+
|
|
127
|
+
rtos_compiler_path = Path.home() / "rtos_compiler"
|
|
128
|
+
if rtos_compiler_path.exists():
|
|
129
|
+
shutil.rmtree(rtos_compiler_path)
|
|
130
|
+
|
|
131
|
+
sdk_path = Path.home() / "sdk"
|
|
132
|
+
if sdk_path.exists():
|
|
133
|
+
shutil.rmtree(sdk_path)
|
|
134
|
+
|
|
135
|
+
self.log.debug(f"move {tmp}/rtos_compiler -> {home_path}")
|
|
136
|
+
self.run_command(f"mv {tmp}/rtos_compiler/ {home_path}")
|
|
137
|
+
self.log.debug(f"move {tmp}/sdk -> {home_path}")
|
|
138
|
+
self.run_command(f"mv {tmp}/sdk/ {home_path}")
|
|
139
|
+
self.log.debug(f"move {tmp}/lua-format -> /usr/bin")
|
|
140
|
+
self.run_command(f"chmod +x {tmp}/lua-format")
|
|
141
|
+
self.run_command(f"mv -f {tmp}/lua-format /usr/bin/", sudo=True)
|
|
142
|
+
|
|
143
|
+
self.log.debug(f"copy {tmp}/hpm_tools/. -> {home_path}")
|
|
144
|
+
self.run_command(f"chmod -R +x {tmp}/hpm_tools")
|
|
145
|
+
self.run_command(f"cp -rf {tmp}/hpm_tools/. /usr/local/bin/", sudo=True)
|
|
146
|
+
|
|
147
|
+
self.log.info(f"安装 bmc_sdk 完成!")
|
|
148
|
+
|
|
98
149
|
def run(self):
|
|
99
150
|
self.built_type_check()
|
|
100
151
|
self.prepare_conan()
|
|
@@ -103,3 +154,4 @@ class TaskClass(Task):
|
|
|
103
154
|
self.run_signature_prepare()
|
|
104
155
|
self.schema_valid()
|
|
105
156
|
self.config.dump_manifest()
|
|
157
|
+
self.pre_download()
|
bmcgo/utils/build_conans.py
CHANGED
|
@@ -15,6 +15,7 @@ import subprocess
|
|
|
15
15
|
import shlex
|
|
16
16
|
import time
|
|
17
17
|
import json
|
|
18
|
+
import math
|
|
18
19
|
import tempfile
|
|
19
20
|
from queue import Queue
|
|
20
21
|
from threading import Thread
|
|
@@ -185,9 +186,10 @@ class BuildConans(object):
|
|
|
185
186
|
if option not in options:
|
|
186
187
|
options += option
|
|
187
188
|
tasks_cnt = 0
|
|
189
|
+
max_proc = max(int(math.sqrt(os.cpu_count())), 4)
|
|
188
190
|
while True:
|
|
189
191
|
for _, dep in dependencies.items():
|
|
190
|
-
if tasks_cnt >=
|
|
192
|
+
if tasks_cnt >= max_proc:
|
|
191
193
|
break
|
|
192
194
|
# 如果是构建工具,不参与构建
|
|
193
195
|
if not dep.is_host:
|
bmcgo/utils/config.py
CHANGED
|
@@ -71,7 +71,7 @@ class Config:
|
|
|
71
71
|
|
|
72
72
|
def __init__(self, bconfig: BmcgoConfig, board_name=misc.boardname_default(), target="target_personal"):
|
|
73
73
|
self.bconfig = bconfig
|
|
74
|
-
|
|
74
|
+
self.manifest_sdk_flag = False
|
|
75
75
|
# 单板名
|
|
76
76
|
self.board_name = board_name
|
|
77
77
|
# 构建目标的文件名,不包含py尾缀,文件存储在application/build/target目录
|
|
@@ -731,7 +731,9 @@ class Config:
|
|
|
731
731
|
"product": f"{self.code_path}/product"
|
|
732
732
|
}
|
|
733
733
|
mani = self.load_manifest_yml(template=template)
|
|
734
|
-
|
|
734
|
+
sdk_flag = mani.get("base", {}).get("rtos_sdk", {})
|
|
735
|
+
if sdk_flag:
|
|
736
|
+
self.manifest_sdk_flag = True
|
|
735
737
|
self.merge_platform_manifest(mani)
|
|
736
738
|
self.complement_components(mani)
|
|
737
739
|
|
|
@@ -809,7 +811,19 @@ class Config:
|
|
|
809
811
|
if os.path.isdir(self.temp_platform_build_dir):
|
|
810
812
|
shutil.rmtree(self.temp_platform_build_dir)
|
|
811
813
|
os.makedirs(os.path.join(self.code_path, "temp"), exist_ok=True)
|
|
814
|
+
mainfest_buildtools_file = os.path.realpath(os.path.join(
|
|
815
|
+
self.code_path, self.get_manufacture_config("base/dependency_buildtools")
|
|
816
|
+
))
|
|
817
|
+
temp_buildtools_file = os.path.realpath(os.path.join(
|
|
818
|
+
self.temp_platform_build_dir, self.get_manufacture_config("base/dependency_buildtools")
|
|
819
|
+
))
|
|
812
820
|
tools.run_command(f"cp -rf {package_conan_dir} {self.temp_platform_build_dir}")
|
|
821
|
+
if self.manifest_sdk_flag:
|
|
822
|
+
if os.path.isfile(mainfest_buildtools_file):
|
|
823
|
+
tools.run_command(f"cp {mainfest_buildtools_file} {os.path.dirname(temp_buildtools_file)}")
|
|
824
|
+
else:
|
|
825
|
+
raise errors.BmcGoException("manifest.yaml中未配置base/dependency_buildtools," +
|
|
826
|
+
"或在manifest代码仓下无法找到所配置的文件")
|
|
813
827
|
self.copy_rtos_sdk(package_conan_dir)
|
|
814
828
|
platform_manifest_path = os.path.join(
|
|
815
829
|
self.temp_platform_build_dir, "manifest.yml"
|
|
@@ -822,6 +836,8 @@ class Config:
|
|
|
822
836
|
rtos_sdk_dir = os.path.join(self.code_path, "rtos_sdk")
|
|
823
837
|
rtos_sdk_src_dir = os.path.join(package_conan_dir, "rtos_sdk")
|
|
824
838
|
if os.path.isdir(rtos_sdk_dir):
|
|
839
|
+
if self.manifest_sdk_flag:
|
|
840
|
+
return
|
|
825
841
|
shutil.rmtree(rtos_sdk_dir)
|
|
826
842
|
tools.run_command(f"cp -rf {rtos_sdk_src_dir} {rtos_sdk_dir}")
|
|
827
843
|
|
bmcgo/utils/tools.py
CHANGED
|
@@ -352,23 +352,6 @@ class Tools():
|
|
|
352
352
|
else:
|
|
353
353
|
os.makedirs(conan_bin)
|
|
354
354
|
|
|
355
|
-
@staticmethod
|
|
356
|
-
def download_file(url, file_path):
|
|
357
|
-
response = requests.get(url, stream=True)
|
|
358
|
-
response.raise_for_status()
|
|
359
|
-
total_size = int(response.headers.get("content-length", 0))
|
|
360
|
-
|
|
361
|
-
with open(file_path, 'wb') as f, tqdm(
|
|
362
|
-
total=total_size,
|
|
363
|
-
unit='B',
|
|
364
|
-
unit_scale=True,
|
|
365
|
-
desc=file_path,
|
|
366
|
-
miniters=1
|
|
367
|
-
) as pbar:
|
|
368
|
-
for chunk in response.iter_content(chunk_size=8192):
|
|
369
|
-
f.write(chunk)
|
|
370
|
-
pbar.update(len(chunk))
|
|
371
|
-
|
|
372
355
|
@staticmethod
|
|
373
356
|
def get_hi171x_module_symver_option(path: str):
|
|
374
357
|
sha256 = Tools.sha256sum(path)
|
|
@@ -430,6 +413,31 @@ class Tools():
|
|
|
430
413
|
return True
|
|
431
414
|
return False
|
|
432
415
|
|
|
416
|
+
|
|
417
|
+
def download_file(self, name, url, file_path, sha256):
|
|
418
|
+
if os.path.isfile(file_path):
|
|
419
|
+
curr_pkg_sha256 = self.sha256sum(file_path)
|
|
420
|
+
if curr_pkg_sha256 == sha256:
|
|
421
|
+
self.log.info(f"已下载 {name}, 跳过.")
|
|
422
|
+
return
|
|
423
|
+
response = requests.get(url, stream=True)
|
|
424
|
+
response.raise_for_status()
|
|
425
|
+
total_size = int(response.headers.get("content-length", 0))
|
|
426
|
+
|
|
427
|
+
with open(file_path, 'wb') as f, tqdm(
|
|
428
|
+
total=total_size,
|
|
429
|
+
unit='B',
|
|
430
|
+
unit_scale=True,
|
|
431
|
+
desc=file_path,
|
|
432
|
+
miniters=1
|
|
433
|
+
) as pbar:
|
|
434
|
+
for chunk in response.iter_content(chunk_size=8192):
|
|
435
|
+
f.write(chunk)
|
|
436
|
+
pbar.update(len(chunk))
|
|
437
|
+
real_sha256 = self.sha256sum(file_path)
|
|
438
|
+
if sha256 != real_sha256:
|
|
439
|
+
raise RuntimeError(f"下载文件 {url} 校验sha256失败,预期 {sha256}, 实际 {real_sha256},请检查配置!")
|
|
440
|
+
|
|
433
441
|
def install_platform_v2(self, platform_package, remote, update_conan_cache=False):
|
|
434
442
|
name = platform_package.get(misc.CONAN)
|
|
435
443
|
if misc.conan_v2():
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
bmcgo/__init__.py,sha256=
|
|
1
|
+
bmcgo/__init__.py,sha256=BJa5lG5w1ONn8K63XashMcH9wCq2YZOssQ7u8IX48_A,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=cPkTL0xwikjcfkT4UGQqNz9EUFkzli1_O2SwbYO2hgs,27859
|
|
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
|
|
@@ -90,7 +90,7 @@ bmcgo/codegen/lua/script/render_utils/ipmi_lua.py,sha256=jZ98qP_gJi6dAU40OmDr_J2
|
|
|
90
90
|
bmcgo/codegen/lua/script/render_utils/ipmi_message_lua.py,sha256=Y-5pXMfAPDZqqoA9spkk80UHr63S6Z35gDeyAcu1tnc,1021
|
|
91
91
|
bmcgo/codegen/lua/script/render_utils/mdb_lua.py,sha256=gKX_GUkIbYbbviBw9cEO3pfTwoLWurczYFmoOoWA1Us,6141
|
|
92
92
|
bmcgo/codegen/lua/script/render_utils/message_lua.py,sha256=ZHJy35iJir1O149dafZnl-oEdU89-eP6VIeQmKjh9D8,1155
|
|
93
|
-
bmcgo/codegen/lua/script/render_utils/messages_lua.py,sha256=
|
|
93
|
+
bmcgo/codegen/lua/script/render_utils/messages_lua.py,sha256=hFBLl3tqh7KIeljm0JEEyeDXkKSDxjtVMirc3euckyI,5189
|
|
94
94
|
bmcgo/codegen/lua/script/render_utils/model_lua.py,sha256=kxlPkPboUKtUfK2HTWakmgKMFLLZ3UofPouWvng7UWY,18456
|
|
95
95
|
bmcgo/codegen/lua/script/render_utils/old_model_lua.py,sha256=OFUPJOaiXDjXpknbh6Pw0TNC1dUVtjPbuIs-3fSN7p4,15611
|
|
96
96
|
bmcgo/codegen/lua/script/render_utils/plugin_lua.py,sha256=-_r-MqjDNnoYel6zdsNSkqYI3w1DKJPwJy5Vsevl33s,1481
|
|
@@ -101,7 +101,7 @@ bmcgo/codegen/lua/script/render_utils/utils_message_lua.py,sha256=MPAwH4lZUF1JqZ
|
|
|
101
101
|
bmcgo/codegen/lua/script/render_utils/validate_lua.py,sha256=NVjMWZwMxwUj9kdTaCRpyVZJkUQuR9kdzI7Y-MZDPaE,7079
|
|
102
102
|
bmcgo/codegen/lua/templates/Makefile,sha256=-br3qnXM_73_nJhYVgF7TsNtVxt_p_h4l5TYPjWqQIs,4044
|
|
103
103
|
bmcgo/codegen/lua/templates/errors.lua.mako,sha256=T93tESJl0K3r5izufq6NsqqCptQbVslpsTEjkQdDq0U,1536
|
|
104
|
-
bmcgo/codegen/lua/templates/messages.lua.mako,sha256=
|
|
104
|
+
bmcgo/codegen/lua/templates/messages.lua.mako,sha256=tbvVXx-zodE5sqyKNW4-dzNmPpZ2yBKpkECsIf9-tkU,1115
|
|
105
105
|
bmcgo/codegen/lua/templates/apps/Makefile,sha256=IPU-LW3i9xTQUrb9XCWYTWlATCTu2JE3aayL43juEeM,19484
|
|
106
106
|
bmcgo/codegen/lua/templates/apps/Makefile.mdb.mk,sha256=Qmd-n_YsQbfnpED_6PIp_6pL13w6UCCGgBoBA4h6r_0,3296
|
|
107
107
|
bmcgo/codegen/lua/templates/apps/app.lua.mako,sha256=Y_aZCPyNgeqfa39_RWxV-_m3out1p4vTTWnzqXtPV7E,276
|
|
@@ -173,13 +173,13 @@ bmcgo/component/component_dt_version_parse.py,sha256=-Rt6i2fZrmYNZGoMqB21D_T9fC7
|
|
|
173
173
|
bmcgo/component/component_helper.py,sha256=rNwfhagfz6E3BjKERq9oOPLRfeKQlqhLojb6oJLXcEA,7933
|
|
174
174
|
bmcgo/component/deploy.py,sha256=Iy5CsiolKS1h5jDg13nYkfy6--BtbBZ8FLou2oVuoLQ,6544
|
|
175
175
|
bmcgo/component/gen.py,sha256=lhPe_VV08CDFSydSLCX7IC5m8obNvYZSSzIp9o84nd0,7248
|
|
176
|
-
bmcgo/component/package_info.py,sha256=
|
|
176
|
+
bmcgo/component/package_info.py,sha256=pYgubJ-564JXQmEaSlYfGnoVgrNlY3O5jJP1vxZe-Qc,14844
|
|
177
177
|
bmcgo/component/test.py,sha256=Kpg5fmcJ-F2lDlHsKTBXjhB00T-IOr5QWGfHsRXVgA0,45260
|
|
178
|
-
bmcgo/component/analysis/analysis.py,sha256=
|
|
178
|
+
bmcgo/component/analysis/analysis.py,sha256=flNkGn468I0wi6mAIuygyPK7eA5PWBw3Ks56B5rrhmc,9179
|
|
179
179
|
bmcgo/component/analysis/build_deps.py,sha256=cyQh5D3R1syQfMJcNxEIKKSJGanPMNRFPGlJRitDAa0,7324
|
|
180
|
-
bmcgo/component/analysis/data_deps.py,sha256=
|
|
181
|
-
bmcgo/component/analysis/dep-rules.json,sha256=
|
|
182
|
-
bmcgo/component/analysis/dep_node.py,sha256=
|
|
180
|
+
bmcgo/component/analysis/data_deps.py,sha256=lDCVZ1B56pOW3BApCroujEaak4I07tN9mDOWruhuDkc,16431
|
|
181
|
+
bmcgo/component/analysis/dep-rules.json,sha256=Na1FoRkdcDpT5nlMR3EfdG-xFND4ghZk5Xr_g-fgynk,34995
|
|
182
|
+
bmcgo/component/analysis/dep_node.py,sha256=i3BRg2iHRy-qv653--ckEJbl_sr-TdIhoEmGuTgZRBg,5168
|
|
183
183
|
bmcgo/component/analysis/intf_deps.py,sha256=IlcPixdaBpXpb6U4M-I1hRRGHCg5SCUg07V6kAosacE,7382
|
|
184
184
|
bmcgo/component/analysis/intf_validation.py,sha256=hAY9pB3_-2gkAyCE2aazW_twoAmlU3ePEg4oJHFgCh4,11422
|
|
185
185
|
bmcgo/component/analysis/rule.py,sha256=xvntmvFdGa0J8WBlrHDdJ5bcl3jr4pXezR3KKvOg4Ag,7549
|
|
@@ -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=FA_oKwp3fVC2MsZLiTZWHVeLpLEGkoRYmqhWWZ7EQM4,15768
|
|
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
|
|
@@ -205,7 +205,7 @@ bmcgo/functional/fetch.py,sha256=hkuHDKyrfbEhvnLbZ8-funhXTkSrCY27WFnYBJFRJMY,107
|
|
|
205
205
|
bmcgo/functional/full_component.py,sha256=5lmb4tHVQ3d4RlWW5jQirMQ-F9p1YQP6SZL7Nf8PVHk,16799
|
|
206
206
|
bmcgo/functional/git_history.py,sha256=JTuLhf7kNFoCSxFLAFVLRI4gPd_RBgTHKFgOCAFX2KE,9355
|
|
207
207
|
bmcgo/functional/json_check.py,sha256=ACoABAV1YfrrR98-G_0sX5i5lFHRjl00GspmKRdUFz8,3473
|
|
208
|
-
bmcgo/functional/maintain.py,sha256=
|
|
208
|
+
bmcgo/functional/maintain.py,sha256=lUn0BtMKMqYKm56aYhvuvnzj47p4BinwVCRuNZ2c1P0,18570
|
|
209
209
|
bmcgo/functional/new.py,sha256=g7J4qLRTi4F9N6wlKHOVgJJwDmUFiWZbxO1PeGIWqTE,6171
|
|
210
210
|
bmcgo/functional/schema_valid.py,sha256=WI7_NOJqU8wFC51bgiU9G7HJTYnxnMyzxH-L6jn339A,3924
|
|
211
211
|
bmcgo/functional/simple_sign.py,sha256=AstEnGzcTIxAYs5U9G82JDXj7CnfhN9LyYcnkpGEH2Y,4086
|
|
@@ -223,36 +223,36 @@ bmcgo/target/publish.yml,sha256=WvaJAUZ0_6CMV3O1p1t6dagHe-DdLcXqLxKP11_ki1E,1615
|
|
|
223
223
|
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
|
-
bmcgo/tasks/task.py,sha256=
|
|
227
|
-
bmcgo/tasks/task_build_conan.py,sha256=
|
|
228
|
-
bmcgo/tasks/task_build_rootfs_img.py,sha256=
|
|
226
|
+
bmcgo/tasks/task.py,sha256=95nKxTe5PW3rfhpm5YFasPtmP8oCraeWJKq0D5mbl6A,18578
|
|
227
|
+
bmcgo/tasks/task_build_conan.py,sha256=5VXdm6kyuX93C-ZazDcQ2KCfJFnYRgkzLFJFSPs0OzU,53028
|
|
228
|
+
bmcgo/tasks/task_build_rootfs_img.py,sha256=jRw-psICpACRspQOJ4e6zatG1a63V7yTpajnBmRL59E,28937
|
|
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
|
|
231
231
|
bmcgo/tasks/task_buildhpm_ext4.py,sha256=DBZnmU_eb14J0CW_wVoCc9VKnssFF1vXmRhLJQ6kR28,3482
|
|
232
232
|
bmcgo/tasks/task_create_interface_config.py,sha256=rkFRGLrUgYCics-n1CKwCoQscU2BaRQkH7KP3zwJ6FI,5393
|
|
233
|
-
bmcgo/tasks/task_download_buildtools.py,sha256=
|
|
233
|
+
bmcgo/tasks/task_download_buildtools.py,sha256=QZpsrm2eaoJ0z5PkdSuHXg1n7L9qPz2s3XAVCnQi-hA,4292
|
|
234
234
|
bmcgo/tasks/task_download_dependency.py,sha256=2AW4awv_njlTrKy11ygKWekFBXLyS18FLcws8cVXGz0,3169
|
|
235
235
|
bmcgo/tasks/task_hpm_envir_prepare.py,sha256=Jkt5tu04NUpSuiKG1Iaei8fUloWYhwHwdXehj4PLwMA,4244
|
|
236
236
|
bmcgo/tasks/task_packet_to_supporte.py,sha256=eaNtri3YQfXFBnceM1-2C_6AgMgrGxEj4xKXTgNRPH8,4100
|
|
237
|
-
bmcgo/tasks/task_prepare.py,sha256=
|
|
237
|
+
bmcgo/tasks/task_prepare.py,sha256=K1cb_3lhclRkCYa2wgp5E2FMOd3pC7VHBnm_4L_nrRE,6704
|
|
238
238
|
bmcgo/tasks/task_sign_and_pack_hpm.py,sha256=X8m1WAj3c0bKi2JAaumR81Qxv1FnFi0SrRL-l6vDRAo,1965
|
|
239
239
|
bmcgo/tasks/conan/__init__.py,sha256=BDXz8BcSlCkfo5UYt6j2rm89-HiYA1ZzfpFhy99MH-0,538
|
|
240
240
|
bmcgo/tasks/conan/conanfile.py,sha256=MI6c2QNKixrkA5Tx4i9EKw7bZ20GVDIKgkaMwNHQKcg,1342
|
|
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=3afY0XOwFtfcKud2yp6nODIuPoMKjjsoAl5AV8GbJ6w,8997
|
|
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
|
|
248
|
-
bmcgo/utils/config.py,sha256=
|
|
248
|
+
bmcgo/utils/config.py,sha256=RMrZV39x6q445LdCDnCM1CIoslrIy9FGN4Kp6uV3VRM,50915
|
|
249
249
|
bmcgo/utils/fetch_component_code.py,sha256=WtPJ5h1nM87X6RicrAhMOJzOzh9A0jD3CbjPc4A-REo,11280
|
|
250
250
|
bmcgo/utils/install_manager.py,sha256=XMZUuIHm7_DWRdLV4dAevsyamQ6rt8lb_7OqGWzNBC8,4927
|
|
251
251
|
bmcgo/utils/json_validator.py,sha256=_k5wU78wfYGrzvSDaqOEtT4otgKUjquVhZNpVf2PW_c,7524
|
|
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=xJFmhIQdC2IjqMbVgjcjWOYJk3TwWG0EjN0-FQ4LJ4s,33012
|
|
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.43.dist-info/METADATA,sha256=i8-bjBQtmM-9IHzXefAEDynKZYHKk4Cog334a6pvmkE,1010
|
|
268
|
+
openubmc_bingo-0.6.43.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
|
269
|
+
openubmc_bingo-0.6.43.dist-info/entry_points.txt,sha256=UUoUP-vAWTgg9vEYbRwYqOBHgpRtkngdzMPb-ocz90g,42
|
|
270
|
+
openubmc_bingo-0.6.43.dist-info/top_level.txt,sha256=9AcvCAt1nZcOgMsGt6T07mg2Bgtdet-3mHTwg91axgI,6
|
|
271
|
+
openubmc_bingo-0.6.43.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|