lbkit 0.5.10__tar.gz → 0.5.12__tar.gz

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.
Files changed (51) hide show
  1. {lbkit-0.5.10/lbkit.egg-info → lbkit-0.5.12}/PKG-INFO +1 -1
  2. lbkit-0.5.12/lbkit/__init__.py +2 -0
  3. {lbkit-0.5.10 → lbkit-0.5.12}/lbkit/codegen/codegen.py +1 -1
  4. {lbkit-0.5.10 → lbkit-0.5.12}/lbkit/codegen/template/public.h.mako +4 -1
  5. {lbkit-0.5.10 → lbkit-0.5.12}/lbkit/component/build.py +28 -6
  6. {lbkit-0.5.10 → lbkit-0.5.12}/lbkit/integration/build_image.py +6 -2
  7. {lbkit-0.5.10 → lbkit-0.5.12}/lbkit/integration/build_rootfs.py +3 -1
  8. {lbkit-0.5.10 → lbkit-0.5.12}/lbkit/integration/config.py +2 -0
  9. {lbkit-0.5.10 → lbkit-0.5.12/lbkit.egg-info}/PKG-INFO +1 -1
  10. lbkit-0.5.10/lbkit/__init__.py +0 -2
  11. {lbkit-0.5.10 → lbkit-0.5.12}/AUTHORS +0 -0
  12. {lbkit-0.5.10 → lbkit-0.5.12}/LICENSE +0 -0
  13. {lbkit-0.5.10 → lbkit-0.5.12}/MANIFEST.in +0 -0
  14. {lbkit-0.5.10 → lbkit-0.5.12}/README.md +0 -0
  15. {lbkit-0.5.10 → lbkit-0.5.12}/lbkit/ci_robot/__init__.py +0 -0
  16. {lbkit-0.5.10 → lbkit-0.5.12}/lbkit/ci_robot/gitee.py +0 -0
  17. {lbkit-0.5.10 → lbkit-0.5.12}/lbkit/cli.py +0 -0
  18. {lbkit-0.5.10 → lbkit-0.5.12}/lbkit/codegen/__init__.py +0 -0
  19. {lbkit-0.5.10 → lbkit-0.5.12}/lbkit/codegen/ctype_defination.py +0 -0
  20. {lbkit-0.5.10 → lbkit-0.5.12}/lbkit/codegen/idf_interface.py +0 -0
  21. {lbkit-0.5.10 → lbkit-0.5.12}/lbkit/codegen/renderer.py +0 -0
  22. {lbkit-0.5.10 → lbkit-0.5.12}/lbkit/codegen/template/client.c.mako +0 -0
  23. {lbkit-0.5.10 → lbkit-0.5.12}/lbkit/codegen/template/client.h.mako +0 -0
  24. {lbkit-0.5.10 → lbkit-0.5.12}/lbkit/codegen/template/interface.c.mako +0 -0
  25. {lbkit-0.5.10 → lbkit-0.5.12}/lbkit/codegen/template/interface.introspect.xml.mako +0 -0
  26. {lbkit-0.5.10 → lbkit-0.5.12}/lbkit/codegen/template/public.c.mako +0 -0
  27. {lbkit-0.5.10 → lbkit-0.5.12}/lbkit/codegen/template/server.c.mako +0 -0
  28. {lbkit-0.5.10 → lbkit-0.5.12}/lbkit/codegen/template/server.h.mako +0 -0
  29. {lbkit-0.5.10 → lbkit-0.5.12}/lbkit/component/__init__.py +0 -0
  30. {lbkit-0.5.10 → lbkit-0.5.12}/lbkit/component/arg_parser.py +0 -0
  31. {lbkit-0.5.10 → lbkit-0.5.12}/lbkit/component/template/conanbase.mako +0 -0
  32. {lbkit-0.5.10 → lbkit-0.5.12}/lbkit/component/template/deploy.mako +0 -0
  33. {lbkit-0.5.10 → lbkit-0.5.12}/lbkit/component/test.py +0 -0
  34. {lbkit-0.5.10 → lbkit-0.5.12}/lbkit/errors.py +0 -0
  35. {lbkit-0.5.10 → lbkit-0.5.12}/lbkit/helper.py +0 -0
  36. {lbkit-0.5.10 → lbkit-0.5.12}/lbkit/integration/__init__.py +0 -0
  37. {lbkit-0.5.10 → lbkit-0.5.12}/lbkit/integration/build_manifest.py +0 -0
  38. {lbkit-0.5.10 → lbkit-0.5.12}/lbkit/integration/build_prepare.py +0 -0
  39. {lbkit-0.5.10 → lbkit-0.5.12}/lbkit/integration/task.py +0 -0
  40. {lbkit-0.5.10 → lbkit-0.5.12}/lbkit/integration/template/conanfile.py.mako +0 -0
  41. {lbkit-0.5.10 → lbkit-0.5.12}/lbkit/lbkit.py +0 -0
  42. {lbkit-0.5.10 → lbkit-0.5.12}/lbkit/log.py +0 -0
  43. {lbkit-0.5.10 → lbkit-0.5.12}/lbkit/misc.py +0 -0
  44. {lbkit-0.5.10 → lbkit-0.5.12}/lbkit/tools.py +0 -0
  45. {lbkit-0.5.10 → lbkit-0.5.12}/lbkit.egg-info/SOURCES.txt +0 -0
  46. {lbkit-0.5.10 → lbkit-0.5.12}/lbkit.egg-info/dependency_links.txt +0 -0
  47. {lbkit-0.5.10 → lbkit-0.5.12}/lbkit.egg-info/entry_points.txt +0 -0
  48. {lbkit-0.5.10 → lbkit-0.5.12}/lbkit.egg-info/requires.txt +0 -0
  49. {lbkit-0.5.10 → lbkit-0.5.12}/lbkit.egg-info/top_level.txt +0 -0
  50. {lbkit-0.5.10 → lbkit-0.5.12}/setup.cfg +0 -0
  51. {lbkit-0.5.10 → lbkit-0.5.12}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: lbkit
3
- Version: 0.5.10
3
+ Version: 0.5.12
4
4
  Summary: Tools provided by litebmc.com
5
5
  Home-page: https://www.litebmc.com
6
6
  Author: xuhj@litebmc.com
@@ -0,0 +1,2 @@
1
+
2
+ __version__ = '0.5.12'
@@ -17,7 +17,7 @@ from lbkit.misc import SmartFormatter
17
17
  lb_cwd = os.path.split(os.path.realpath(__file__))[0]
18
18
  log = Logger("codegen")
19
19
 
20
- __version__=1
20
+ __version__=2
21
21
 
22
22
  class CodeGen(object):
23
23
  def __init__(self, args):
@@ -149,7 +149,10 @@ typedef struct {
149
149
  } ${class_name}_${method.name}_Rsp;
150
150
 
151
151
  % if not method.is_plugin:
152
- typedef int (*${class_name}_${method.name}_Method)(const ${class_name} *object, const ${class_name}_${method.name}_Req *req, ${class_name}_${method.name}_Rsp **rsp, GError **error);
152
+ typedef int (*${class_name}_${method.name}_Method)(const ${class_name} *object,
153
+ const ${class_name}_${method.name}_Req *req,
154
+ ${class_name}_${method.name}_Rsp **rsp,
155
+ GError **error, gpointer ext_data);
153
156
  % endif
154
157
  void ${class_name}_${method.name}_Req_free(${class_name}_${method.name}_Req **value);
155
158
  void ${class_name}_${method.name}_Rsp_free(${class_name}_${method.name}_Rsp **value);
@@ -4,6 +4,7 @@ import yaml
4
4
  import shutil
5
5
  import re
6
6
  import json
7
+ from multiprocessing import Pool
7
8
  import traceback
8
9
  from argparse import ArgumentParser
9
10
  from jsonschema import validate, ValidationError
@@ -34,11 +35,22 @@ class DeployComponent():
34
35
  package_folder = tools.run(cmd).stdout.strip()
35
36
  log.info(f">>>> deploy {self.package_ref}")
36
37
  cmd = f"cp -rT {package_folder}/ {self.rootfs_dir}"
37
- tools.exec(cmd)
38
+ cnt = 10
39
+ while cnt > 0:
40
+ try:
41
+ cnt -= 1
42
+ tools.exec(cmd)
43
+ return
44
+ except Exception as e:
45
+ if cnt == 0:
46
+ log.warn("Copy failed, msg: " + str(e))
47
+ raise e
48
+ log.info("Copy {self.package_ref} failed, try again")
38
49
 
39
50
 
40
51
  class BuildComponent():
41
52
  def __init__(self, args_parser: ArgumentParser, args=None):
53
+ self.deploy_success = True
42
54
  self.options = args_parser.parse_args(args)
43
55
  self.options.build_type = self.options.build_type.capitalize()
44
56
  if self.options.channel is None or self.options.channel.strip() == "":
@@ -117,10 +129,11 @@ class BuildComponent():
117
129
  # 准备部署依赖
118
130
  requires = pkg.get("requires")
119
131
  if requires is not None:
120
- for rt in requires.get("test", []):
121
- conan = rt.get("conan")
122
- if conan is not None:
123
- self.runtime_packages.append(conan)
132
+ if self.options.test:
133
+ for rt in requires.get("test", []):
134
+ conan = rt.get("conan")
135
+ if conan is not None:
136
+ self.runtime_packages.append(conan)
124
137
  for rt in requires.get("compile", []):
125
138
  conan = rt.get("conan")
126
139
  if conan is not None:
@@ -171,6 +184,10 @@ class BuildComponent():
171
184
  tools.exec(cmd, verbose=True)
172
185
  os.chdir(cwd)
173
186
 
187
+ def _copy_failed(self, result):
188
+ print(result)
189
+ self.deploy_success = False
190
+
174
191
  def deploy(self):
175
192
  log.success(f"start deplay {self.package} and it's dependencies to ./temp/rootfs")
176
193
  # 生成部署deploy命令
@@ -193,6 +210,7 @@ class BuildComponent():
193
210
  res = tools.run(cmd).stdout.strip()
194
211
  graph = json.loads(res)
195
212
  nodes = graph.get("graph", {}).get("nodes", {})
213
+ pool = Pool()
196
214
  for id, info in nodes.items():
197
215
  ref = info.get("ref")
198
216
  id = info.get("package_id")
@@ -200,7 +218,11 @@ class BuildComponent():
200
218
  if context != "host":
201
219
  continue
202
220
  dep = DeployComponent(ref, id, self.rootfs_dir)
203
- dep.run()
221
+ pool.apply_async(dep.run, error_callback=self._copy_failed)
222
+ pool.close()
223
+ pool.join()
224
+ if not self.deploy_success:
225
+ raise Exception("Deploy component failed")
204
226
 
205
227
  # 设置ROOTFS_DIR环境变量,为DT测试提供相对路径
206
228
  os.environ["ROOTFS_DIR"] = self.rootfs_dir
@@ -17,7 +17,9 @@ class BuildImage(Task):
17
17
  tar_file = os.path.join(self.config.download_path, "uboot.tar.gz")
18
18
 
19
19
  url = self.get_manifest_config("components/uboot/url")
20
- sha256 = self.get_manifest_config("components/uboot/sha256")
20
+ sha256 = None
21
+ if not self.config.not_check_download_sha:
22
+ sha256 = self.get_manifest_config("components/uboot/sha256")
21
23
  self.tools.download(url, tar_file, sha256)
22
24
  tar = tarfile.open(tar_file)
23
25
  members = tar.getmembers()
@@ -41,7 +43,9 @@ class BuildImage(Task):
41
43
  tar_file = os.path.join(self.config.download_path, "kernel.tar.gz")
42
44
 
43
45
  url = self.get_manifest_config("components/kernel/url")
44
- sha256 = self.get_manifest_config("components/kernel/sha256")
46
+ sha256 = None
47
+ if not self.config.not_check_download_sha:
48
+ sha256 = self.get_manifest_config("components/kernel/sha256")
45
49
  self.tools.download(url, tar_file, sha256)
46
50
  tar = tarfile.open(tar_file)
47
51
  members = tar.getmembers()
@@ -64,7 +64,9 @@ class BuildRootfs(Task):
64
64
  rootfs_tar = "rootfs.tar.gz"
65
65
 
66
66
  url = self.get_manifest_config("components/rootfs/url")
67
- sha256 = self.get_manifest_config("components/rootfs/sha256")
67
+ sha256 = None
68
+ if not self.config.not_check_download_sha:
69
+ sha256 = self.get_manifest_config("components/rootfs/sha256")
68
70
  self.tools.download(url, rootfs_tar, sha256)
69
71
  tar = tarfile.open(rootfs_tar)
70
72
  members = tar.getmembers()
@@ -25,6 +25,7 @@ class Config(object):
25
25
  self.build_debug = args.debug
26
26
  # conan中心仓
27
27
  self.remote = args.remote
28
+ self.not_check_download_sha = args.not_check_download_sha
28
29
 
29
30
  if not os.path.isfile(self.manifest):
30
31
  raise FileNotFoundError(f"File {args.manifest} not exist")
@@ -61,5 +62,6 @@ class Config(object):
61
62
  parser.add_argument("-pr", "--profile", help="Apply the specified profile to the host machine", default="litebmc.ini")
62
63
  parser.add_argument("-pr:b", "--profile_build", help="Apply the specified profile to the build machine", default="default")
63
64
  parser.add_argument("-d", "--debug", help="Set the build type to debug", action="store_false")
65
+ parser.add_argument("--not_check_download_sha", help="don't check sha256 of download file", action="store_true")
64
66
  parser.add_argument("-r", "--remote", help="specified conan server", default="litebmc")
65
67
  return parser
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: lbkit
3
- Version: 0.5.10
3
+ Version: 0.5.12
4
4
  Summary: Tools provided by litebmc.com
5
5
  Home-page: https://www.litebmc.com
6
6
  Author: xuhj@litebmc.com
@@ -1,2 +0,0 @@
1
-
2
- __version__ = '0.5.10'
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes