jolt 0.9.76__py3-none-any.whl → 0.9.429__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.
Files changed (201) hide show
  1. jolt/__init__.py +88 -7
  2. jolt/__main__.py +9 -1
  3. jolt/bin/fstree-darwin-x86_64 +0 -0
  4. jolt/bin/fstree-linux-x86_64 +0 -0
  5. jolt/cache.py +839 -367
  6. jolt/chroot.py +156 -0
  7. jolt/cli.py +362 -143
  8. jolt/common_pb2.py +63 -0
  9. jolt/common_pb2_grpc.py +4 -0
  10. jolt/config.py +99 -42
  11. jolt/error.py +19 -4
  12. jolt/expires.py +2 -2
  13. jolt/filesystem.py +8 -6
  14. jolt/graph.py +705 -117
  15. jolt/hooks.py +63 -1
  16. jolt/influence.py +129 -6
  17. jolt/loader.py +369 -121
  18. jolt/log.py +225 -63
  19. jolt/manifest.py +28 -38
  20. jolt/options.py +35 -10
  21. jolt/pkgs/abseil.py +42 -0
  22. jolt/pkgs/asio.py +25 -0
  23. jolt/pkgs/autoconf.py +41 -0
  24. jolt/pkgs/automake.py +41 -0
  25. jolt/pkgs/b2.py +31 -0
  26. jolt/pkgs/boost.py +111 -0
  27. jolt/pkgs/boringssl.py +32 -0
  28. jolt/pkgs/busybox.py +39 -0
  29. jolt/pkgs/bzip2.py +43 -0
  30. jolt/pkgs/cares.py +29 -0
  31. jolt/pkgs/catch2.py +36 -0
  32. jolt/pkgs/cbindgen.py +17 -0
  33. jolt/pkgs/cista.py +19 -0
  34. jolt/pkgs/clang.py +44 -0
  35. jolt/pkgs/cli11.py +23 -0
  36. jolt/pkgs/cmake.py +48 -0
  37. jolt/pkgs/cpython.py +196 -0
  38. jolt/pkgs/crun.py +29 -0
  39. jolt/pkgs/curl.py +38 -0
  40. jolt/pkgs/dbus.py +18 -0
  41. jolt/pkgs/double_conversion.py +24 -0
  42. jolt/pkgs/fastfloat.py +21 -0
  43. jolt/pkgs/ffmpeg.py +28 -0
  44. jolt/pkgs/flatbuffers.py +29 -0
  45. jolt/pkgs/fmt.py +27 -0
  46. jolt/pkgs/fstree.py +20 -0
  47. jolt/pkgs/gflags.py +18 -0
  48. jolt/pkgs/glib.py +18 -0
  49. jolt/pkgs/glog.py +25 -0
  50. jolt/pkgs/glslang.py +21 -0
  51. jolt/pkgs/golang.py +16 -11
  52. jolt/pkgs/googlebenchmark.py +18 -0
  53. jolt/pkgs/googletest.py +46 -0
  54. jolt/pkgs/gperf.py +15 -0
  55. jolt/pkgs/grpc.py +73 -0
  56. jolt/pkgs/hdf5.py +19 -0
  57. jolt/pkgs/help2man.py +14 -0
  58. jolt/pkgs/inja.py +28 -0
  59. jolt/pkgs/jsoncpp.py +31 -0
  60. jolt/pkgs/libarchive.py +43 -0
  61. jolt/pkgs/libcap.py +44 -0
  62. jolt/pkgs/libdrm.py +44 -0
  63. jolt/pkgs/libedit.py +42 -0
  64. jolt/pkgs/libevent.py +31 -0
  65. jolt/pkgs/libexpat.py +27 -0
  66. jolt/pkgs/libfastjson.py +21 -0
  67. jolt/pkgs/libffi.py +16 -0
  68. jolt/pkgs/libglvnd.py +30 -0
  69. jolt/pkgs/libogg.py +28 -0
  70. jolt/pkgs/libpciaccess.py +18 -0
  71. jolt/pkgs/libseccomp.py +21 -0
  72. jolt/pkgs/libtirpc.py +24 -0
  73. jolt/pkgs/libtool.py +42 -0
  74. jolt/pkgs/libunwind.py +35 -0
  75. jolt/pkgs/libva.py +18 -0
  76. jolt/pkgs/libvorbis.py +33 -0
  77. jolt/pkgs/libxml2.py +35 -0
  78. jolt/pkgs/libxslt.py +17 -0
  79. jolt/pkgs/libyajl.py +16 -0
  80. jolt/pkgs/llvm.py +81 -0
  81. jolt/pkgs/lua.py +54 -0
  82. jolt/pkgs/lz4.py +26 -0
  83. jolt/pkgs/m4.py +14 -0
  84. jolt/pkgs/make.py +17 -0
  85. jolt/pkgs/mesa.py +81 -0
  86. jolt/pkgs/meson.py +17 -0
  87. jolt/pkgs/mstch.py +28 -0
  88. jolt/pkgs/mysql.py +60 -0
  89. jolt/pkgs/nasm.py +49 -0
  90. jolt/pkgs/ncurses.py +30 -0
  91. jolt/pkgs/ng_log.py +25 -0
  92. jolt/pkgs/ninja.py +45 -0
  93. jolt/pkgs/nlohmann_json.py +25 -0
  94. jolt/pkgs/nodejs.py +19 -11
  95. jolt/pkgs/opencv.py +24 -0
  96. jolt/pkgs/openjdk.py +26 -0
  97. jolt/pkgs/openssl.py +103 -0
  98. jolt/pkgs/paho.py +76 -0
  99. jolt/pkgs/patchelf.py +16 -0
  100. jolt/pkgs/perl.py +42 -0
  101. jolt/pkgs/pkgconfig.py +64 -0
  102. jolt/pkgs/poco.py +39 -0
  103. jolt/pkgs/protobuf.py +77 -0
  104. jolt/pkgs/pugixml.py +27 -0
  105. jolt/pkgs/python.py +19 -0
  106. jolt/pkgs/qt.py +35 -0
  107. jolt/pkgs/rapidjson.py +26 -0
  108. jolt/pkgs/rapidyaml.py +28 -0
  109. jolt/pkgs/re2.py +30 -0
  110. jolt/pkgs/re2c.py +17 -0
  111. jolt/pkgs/readline.py +15 -0
  112. jolt/pkgs/rust.py +41 -0
  113. jolt/pkgs/sdl.py +28 -0
  114. jolt/pkgs/simdjson.py +27 -0
  115. jolt/pkgs/soci.py +46 -0
  116. jolt/pkgs/spdlog.py +29 -0
  117. jolt/pkgs/spirv_llvm.py +21 -0
  118. jolt/pkgs/spirv_tools.py +24 -0
  119. jolt/pkgs/sqlite.py +83 -0
  120. jolt/pkgs/ssl.py +12 -0
  121. jolt/pkgs/texinfo.py +15 -0
  122. jolt/pkgs/tomlplusplus.py +22 -0
  123. jolt/pkgs/wayland.py +26 -0
  124. jolt/pkgs/x11.py +58 -0
  125. jolt/pkgs/xerces_c.py +20 -0
  126. jolt/pkgs/xorg.py +360 -0
  127. jolt/pkgs/xz.py +29 -0
  128. jolt/pkgs/yamlcpp.py +30 -0
  129. jolt/pkgs/zeromq.py +47 -0
  130. jolt/pkgs/zlib.py +69 -0
  131. jolt/pkgs/zstd.py +33 -0
  132. jolt/plugins/alias.py +3 -0
  133. jolt/plugins/allure.py +5 -2
  134. jolt/plugins/autotools.py +66 -0
  135. jolt/plugins/cache.py +133 -0
  136. jolt/plugins/cmake.py +74 -6
  137. jolt/plugins/conan.py +238 -0
  138. jolt/plugins/cxx.py +698 -0
  139. jolt/plugins/cxxinfo.py +7 -0
  140. jolt/plugins/dashboard.py +1 -1
  141. jolt/plugins/docker.py +91 -23
  142. jolt/plugins/email.py +5 -2
  143. jolt/plugins/email.xslt +144 -101
  144. jolt/plugins/environ.py +11 -0
  145. jolt/plugins/fetch.py +141 -0
  146. jolt/plugins/gdb.py +44 -21
  147. jolt/plugins/gerrit.py +1 -14
  148. jolt/plugins/git.py +316 -101
  149. jolt/plugins/googletest.py +522 -1
  150. jolt/plugins/http.py +36 -38
  151. jolt/plugins/libtool.py +63 -0
  152. jolt/plugins/linux.py +990 -0
  153. jolt/plugins/logstash.py +4 -4
  154. jolt/plugins/meson.py +61 -0
  155. jolt/plugins/ninja-compdb.py +107 -31
  156. jolt/plugins/ninja.py +929 -134
  157. jolt/plugins/paths.py +11 -1
  158. jolt/plugins/pkgconfig.py +219 -0
  159. jolt/plugins/podman.py +148 -91
  160. jolt/plugins/python.py +137 -0
  161. jolt/plugins/remote_execution/__init__.py +0 -0
  162. jolt/plugins/remote_execution/administration_pb2.py +46 -0
  163. jolt/plugins/remote_execution/administration_pb2_grpc.py +170 -0
  164. jolt/plugins/remote_execution/log_pb2.py +32 -0
  165. jolt/plugins/remote_execution/log_pb2_grpc.py +68 -0
  166. jolt/plugins/remote_execution/scheduler_pb2.py +41 -0
  167. jolt/plugins/remote_execution/scheduler_pb2_grpc.py +141 -0
  168. jolt/plugins/remote_execution/worker_pb2.py +38 -0
  169. jolt/plugins/remote_execution/worker_pb2_grpc.py +112 -0
  170. jolt/plugins/report.py +12 -2
  171. jolt/plugins/rust.py +25 -0
  172. jolt/plugins/scheduler.py +710 -0
  173. jolt/plugins/selfdeploy/setup.py +9 -4
  174. jolt/plugins/selfdeploy.py +138 -88
  175. jolt/plugins/strings.py +35 -22
  176. jolt/plugins/symlinks.py +26 -11
  177. jolt/plugins/telemetry.py +5 -2
  178. jolt/plugins/timeline.py +13 -3
  179. jolt/plugins/volume.py +46 -48
  180. jolt/scheduler.py +591 -191
  181. jolt/tasks.py +1783 -245
  182. jolt/templates/export.sh.template +12 -6
  183. jolt/templates/timeline.html.template +44 -47
  184. jolt/timer.py +22 -0
  185. jolt/tools.py +749 -302
  186. jolt/utils.py +245 -18
  187. jolt/version.py +1 -1
  188. jolt/version_utils.py +2 -2
  189. jolt/xmldom.py +12 -2
  190. {jolt-0.9.76.dist-info → jolt-0.9.429.dist-info}/METADATA +98 -38
  191. jolt-0.9.429.dist-info/RECORD +207 -0
  192. {jolt-0.9.76.dist-info → jolt-0.9.429.dist-info}/WHEEL +1 -1
  193. jolt/plugins/amqp.py +0 -834
  194. jolt/plugins/debian.py +0 -338
  195. jolt/plugins/ftp.py +0 -181
  196. jolt/plugins/ninja-cache.py +0 -64
  197. jolt/plugins/ninjacli.py +0 -271
  198. jolt/plugins/repo.py +0 -253
  199. jolt-0.9.76.dist-info/RECORD +0 -79
  200. {jolt-0.9.76.dist-info → jolt-0.9.429.dist-info}/entry_points.txt +0 -0
  201. {jolt-0.9.76.dist-info → jolt-0.9.429.dist-info}/top_level.txt +0 -0
jolt/plugins/ninjacli.py DELETED
@@ -1,271 +0,0 @@
1
- import glob
2
- import sys
3
- import os
4
- import subprocess
5
- import hashlib
6
- import json
7
- import errno
8
- import uuid
9
- join = os.path.join
10
-
11
-
12
- _hash_cache = {}
13
-
14
-
15
- class Depfile(object):
16
- def __init__(self, objfile, dependencies=None, cmdline=None):
17
- self.valid = False
18
- self.product = ""
19
- self.cmdline = cmdline
20
- self.path = objfile + ".d"
21
- self.dependencies = []
22
-
23
- if not dependencies:
24
- if not os.path.exists(self.path):
25
- return
26
-
27
- with open(self.path) as f:
28
- data = f.read()
29
-
30
- data = data.split(":", 1)
31
- if len(data) <= 1:
32
- return
33
-
34
- dependencies = data[1]
35
- dependencies = dependencies.split()
36
- dependencies = [f.rstrip("\\").strip() for f in dependencies]
37
- dependencies = [os.path.normpath(f)
38
- for f in filter(lambda n: n, dependencies)]
39
-
40
- self.product = objfile
41
- self.dependencies = dependencies or []
42
- self.valid = True
43
-
44
- def _hash_file(self, filepath):
45
- digest = _hash_cache.get(filepath)
46
- if digest:
47
- return digest
48
-
49
- sha = hashlib.sha1()
50
- try:
51
- with open(filepath, "rb") as f:
52
- sha.update(f.read())
53
- except Exception:
54
- sha.update(str(uuid.uuid4()).encode())
55
-
56
- _hash_cache[filepath] = digest = sha.hexdigest()
57
- return digest
58
-
59
- @property
60
- def hash_cmdline(self):
61
- sha_cmd = hashlib.sha1(str(self.cmdline).replace(os.getenv("JOLT_CACHEDIR"), "").encode())
62
- return sha_cmd.hexdigest()
63
-
64
- @property
65
- def hash_deps(self):
66
- if type(self.dependencies) == str:
67
- return self.dependencies
68
- sha = hashlib.sha1()
69
- for dep in sorted(self.dependencies):
70
- fh = self._hash_file(dep)
71
- sha.update(fh.encode())
72
- return sha.hexdigest()
73
-
74
- @property
75
- def hash(self):
76
- sha = hashlib.sha1()
77
- sha.update(self.hash_cmdline.encode())
78
- sha.update(self.hash_deps.encode())
79
- return sha.hexdigest()
80
-
81
-
82
- class LibraryManifest(object):
83
- def __init__(self, path):
84
- self._path = path
85
- self._data = {}
86
- self._objects = set()
87
-
88
- def read(self):
89
- try:
90
- with open(self._path, "r") as f:
91
- self._data = json.loads(f.read())
92
- except Exception:
93
- pass
94
-
95
- def write(self):
96
- with open(self._path, "w") as f:
97
- f.write(json.dumps(self._data, indent=2))
98
-
99
- def add_library(self, library_file):
100
- self._data["filename"] = library_file
101
-
102
- def add_object_file(self, objpath, cmdline):
103
- depfile = Depfile(objpath, cmdline=cmdline)
104
- objects = self.objects
105
- objects[objpath] = {"digest": depfile.hash, "deps": depfile.dependencies}
106
- self._data["objects"] = objects
107
-
108
- if objpath in self._objects:
109
- print("error: object file name collision: {}".format(objpath))
110
- sys.exit(1)
111
- self._objects.add(objpath)
112
-
113
- def get_object(self, objpath, builddir):
114
- objdir = join(builddir, os.path.dirname(objpath))
115
- data = self.objects.get(objpath)
116
- if not data:
117
- return False
118
-
119
- try:
120
- os.makedirs(objdir)
121
- except OSError as e:
122
- if e.errno != errno.EEXIST:
123
- return False
124
-
125
- rv = subprocess.call([os.getenv("AR", "ar"), "x", self.library, objpath], cwd=objdir)
126
- if rv != 0:
127
- return False
128
-
129
- with open(objpath + ".d", "w") as f:
130
- f.write("{}: {}\n".format(objpath, " ".join(data["deps"])))
131
- return True
132
-
133
- return False
134
-
135
- @property
136
- def objects(self):
137
- return self._data.get("objects", {})
138
-
139
- @property
140
- def library(self):
141
- return os.path.join(os.path.dirname(self._path), self._data["filename"])
142
-
143
- @property
144
- def path(self):
145
- return self._path
146
-
147
-
148
- class Cache(object):
149
- def __init__(self, builddir):
150
- self._builddir = builddir
151
- self._objects = {}
152
- self._objnames = {}
153
- self._sources = {}
154
-
155
- def add_manifest(self, manifest):
156
- for objpath, objdata in manifest.objects.items():
157
- objname = os.path.basename(objpath)
158
- objpath_known = self._objnames.get(objname, objpath)
159
- if objpath_known != objpath:
160
- # Multiple objects with the same basename.
161
- # No way to know which object will be extracted
162
- # from the archive. Remove entries and fall back
163
- # to compilation.
164
- try:
165
- self._objnames[objname] = None
166
- del self._objects[objpath_known]
167
- except KeyError:
168
- pass
169
- continue
170
- self._objnames[objname] = objpath
171
- obj = self._objects.get(str(objpath), [])
172
- deps = [join(self._builddir, dep) for dep in objdata["deps"]]
173
- obj.append({
174
- "digest": objdata["digest"],
175
- "manifest": manifest.path,
176
- "deps": Depfile(objpath, dependencies=deps).hash_deps})
177
- self._objects[str(objpath)] = obj
178
-
179
- def load_manifests(self, cachedir, task):
180
- pattern = "{cachedir}/{task}/*/.ninja.json".format(cachedir=cachedir, task=task)
181
- manifests = glob.glob(pattern)
182
-
183
- maxartifacts = int(os.getenv("NINJACACHE_MAXARTIFACTS", 0))
184
- if maxartifacts > 0:
185
- manifests = manifests[:maxartifacts]
186
-
187
- for manifest in manifests:
188
- manifest = LibraryManifest(manifest)
189
- manifest.read()
190
- self.add_manifest(manifest)
191
-
192
- def load(self):
193
- with open(join(self._builddir, ".cache.json")) as f:
194
- self._objects = json.load(f)
195
-
196
- def save(self):
197
- with open(join(self._builddir, ".cache.json"), "w") as f:
198
- json.dump(self._objects, f, indent=2)
199
-
200
- def lookup(self, objpath, cmdline):
201
- for objdata in self._objects.get(objpath, []):
202
- dep = Depfile(objpath, objdata["deps"], cmdline)
203
- if dep.hash == objdata["digest"]:
204
- manifest = LibraryManifest(objdata["manifest"])
205
- manifest.read()
206
- return manifest
207
-
208
-
209
- class LockFile(object):
210
- def __init__(self, path=".", *args, **kwargs):
211
- from fasteners import process_lock
212
- self._file = process_lock.InterProcessLock(os.path.join(path, ".ninja.lock"))
213
-
214
- def __enter__(self, *args, **kwargs):
215
- self._file.acquire()
216
- return self
217
-
218
- def __exit__(self, *args, **kwargs):
219
- self._file.release()
220
-
221
-
222
- ###############################################################################
223
-
224
- def argscan(args, arg):
225
- try:
226
- index = args.index(arg)
227
- except ValueError:
228
- return None
229
- if len(args) <= index + 1:
230
- return None
231
- return args[index + 1]
232
-
233
-
234
- def verbose(fmt, *args, **kwargs):
235
- if os.getenv("NINJACACHE_VERBOSE", "0") == "1":
236
- print(fmt.format(*args, **kwargs))
237
-
238
-
239
- def cli(compiler_args):
240
- objfile = argscan(sys.argv, "-o")
241
-
242
- if os.getenv("NINJACACHE_DISABLE", "0") != "1":
243
- cache = Cache(os.getcwd())
244
- cache.load()
245
- manifest = cache.lookup(objfile, compiler_args)
246
- if manifest:
247
- if manifest.get_object(objfile, os.getcwd()):
248
- verbose("Reusing {} from {}", objfile, manifest.library)
249
- with LockFile():
250
- manifest = LibraryManifest(".ninja.json")
251
- manifest.read()
252
- manifest.add_object_file(objfile, compiler_args)
253
- manifest.write()
254
- sys.exit(0)
255
- else:
256
- verbose("Extraction from library failed, rule will be executed normally")
257
-
258
- rv = subprocess.call(compiler_args)
259
- if rv != 0:
260
- sys.exit(rv)
261
-
262
- with LockFile():
263
- manifest = LibraryManifest(".ninja.json")
264
- manifest.read()
265
- manifest.add_object_file(objfile, compiler_args)
266
- manifest.write()
267
-
268
-
269
- if __name__ == "__main__":
270
- compiler_args = sys.argv[sys.argv.index("--") + 1:]
271
- cli(compiler_args)
jolt/plugins/repo.py DELETED
@@ -1,253 +0,0 @@
1
- from copy import copy
2
- from threading import RLock
3
- from xml.dom import minidom
4
-
5
- from jolt.influence import HashInfluenceProvider, HashInfluenceRegistry
6
- from jolt.tools import Tools
7
- from jolt import filesystem as fs
8
- from jolt import log
9
- from jolt.plugins import git
10
- from jolt.scheduler import NetworkExecutorExtension, NetworkExecutorExtensionFactory
11
- from jolt.xmldom import Attribute, Composition, SubElement, Element, ElementTree, ET
12
-
13
-
14
- @Attribute('name')
15
- @Attribute('fetch')
16
- class RepoRemote(SubElement):
17
- def __init__(self, elem=None):
18
- super(RepoRemote, self).__init__('remote', elem=elem)
19
-
20
-
21
- @Attribute('revision')
22
- @Attribute('remote')
23
- @Attribute('sync-j')
24
- class RepoDefault(SubElement):
25
- def __init__(self, elem=None):
26
- super(RepoDefault, self).__init__('default', elem=elem)
27
-
28
-
29
- @Attribute('path')
30
- @Attribute('name')
31
- @Attribute('revision')
32
- @Attribute('upstream')
33
- @Attribute('remote')
34
- class RepoProject(SubElement):
35
- def __init__(self, elem=None):
36
- super(RepoProject, self).__init__('project', elem=elem)
37
-
38
- def get_diff(self):
39
- with self.tools.cwd(self.path_or_name):
40
- return self.tools.run("git diff --no-ext-diff HEAD", output_on_error=True)
41
- assert False, "git command failed"
42
-
43
- def get_head(self):
44
- with self.tools.cwd(self.path_or_name):
45
- return self.tools.run("git rev-parse HEAD", output_on_error=True).strip()
46
- assert False, "git command failed"
47
-
48
- def get_remote_branches(self, commit):
49
- with self.tools.cwd(self.path_or_name):
50
- result = self.tools.run("git branch -r --contains {0}", commit, output_on_error=True)
51
- if not result:
52
- return []
53
- result = result.strip().splitlines()
54
- result = [line.strip() for line in result]
55
- return result
56
- assert False, "git command failed"
57
-
58
- def get_local_commits(self):
59
- with self.tools.cwd(self.path_or_name):
60
- result = self.tools.run("git rev-list HEAD ^@{{upstream}}", output_on_error=True)
61
- if not result:
62
- return []
63
- result = result.strip("\r\n ")
64
- return result.splitlines()
65
- assert False, "git command failed"
66
-
67
- def has_local_ref(self, ref):
68
- with self.tools.cwd(self.path_or_name):
69
- try:
70
- return True if self.tools.run("git show-ref {0}", ref, output=False) else False
71
- except Exception:
72
- return False
73
-
74
- def get_remote_ref(self, commit, remote, pattern=None):
75
- with self.tools.cwd(self.path_or_name):
76
- result = self.tools.run(
77
- "git ls-remote {0}{1}",
78
- remote,
79
- " {0}".format(pattern) if pattern else "",
80
- output_on_error=True)
81
- if not result:
82
- return None
83
- result = result.strip().splitlines()
84
- result = [line.split("\t") for line in result]
85
- result = {line[0]: line[1] for line in result}
86
- return result.get(commit)
87
- assert False, "git command failed"
88
-
89
- @property
90
- def path_or_name(self):
91
- return self.path or self.name
92
-
93
-
94
- @Composition(RepoRemote, "remote")
95
- @Composition(RepoDefault, "default")
96
- @Composition(RepoProject, "project")
97
- class RepoManifest(ElementTree):
98
- def __init__(self, task, path):
99
- super(RepoManifest, self).__init__(element=Element('manifest'))
100
- self.path = path
101
- self.tools = task.tools
102
-
103
- def append(self, element):
104
- self.getroot().append(element)
105
-
106
- def get(self, key):
107
- self.getroot().get(key)
108
-
109
- def set(self, key, value):
110
- self.getroot().set(key, value)
111
-
112
- def parse(self, filename=".repo/manifest.xml"):
113
- with open(fs.path.join(self.tools.getcwd(), filename)) as f:
114
- root = ET.fromstring(f.read())
115
- self._setroot(root)
116
- for project in self.projects:
117
- project.tools = self.tools
118
- return self
119
- raise Exception("failed to parse xml file")
120
-
121
- def format(self):
122
- return minidom.parseString(ET.tostring(self.getroot())).toprettyxml(indent=" ")
123
-
124
- def write(self, filename):
125
- with open(filename, 'w') as f:
126
- f.write(self.format())
127
-
128
- def get_remote(self, project):
129
- if len(self.defaults) > 0:
130
- return project.remote or self.defaults[0].remote
131
- return project.remote
132
-
133
- def get_upstream(self, project):
134
- if len(self.defaults) > 0:
135
- return project.upstream or self.defaults[0].revision or "master"
136
- return project.upstream or "master"
137
-
138
- def assert_clean(self):
139
- for project in self.projects:
140
- assert not project.get_diff(), \
141
- "repo project '{0}' has local changes"\
142
- .format(project.path_or_name)
143
-
144
- def lock_revisions(self):
145
- for project in self.projects:
146
- head = project.get_head()
147
- if not project.get_remote_branches(head):
148
- remote_ref = project.get_remote_ref(
149
- head, self.get_remote(project))
150
- assert remote_ref, \
151
- "repo project '{0}' has unpublished commits"\
152
- .format(project.path_or_name)
153
- head = remote_ref
154
-
155
- if not project.upstream:
156
- if project.revision and project.has_local_ref(project.revision):
157
- project.upstream = project.revision
158
- else:
159
- project.upstream = self.get_upstream(project)
160
-
161
- if not project.revision.startswith("refs/changes"):
162
- project.revision = head
163
-
164
-
165
- _git_repos = {}
166
- _git_repo_lock = RLock()
167
-
168
- _repo_manifests = {}
169
- _repo_manifest_lock = RLock()
170
-
171
-
172
- class RepoInfluenceProvider(HashInfluenceProvider):
173
- name = "Repo"
174
- path = "."
175
-
176
- def __init__(self, path=None, include=None, exclude=None, network=True):
177
- self.path = path or self.__class__.path
178
- self.include = include
179
- self.exclude = exclude
180
- self.network = network
181
-
182
- def get_influence(self, task):
183
- self.tools = Tools(task, task.joltdir)
184
- try:
185
- manifest_path = fs.path.join(task.joltdir, task.expand(self.path))
186
- manifest = RepoManifest(task, manifest_path)
187
- manifest.parse(fs.path.join(manifest_path, ".repo", "manifest.xml"))
188
-
189
- result = []
190
- for project in sorted(manifest.projects, key=lambda p: p.name):
191
- if self.include is not None and project.path_or_name not in self.include:
192
- continue
193
- if self.exclude is not None and project.path_or_name in self.exclude:
194
- continue
195
-
196
- with _git_repo_lock:
197
- gip = _git_repos.get(project.path_or_name)
198
- if gip is None:
199
- gip = git.GitInfluenceProvider(project.path_or_name)
200
- _git_repos[project.path_or_name] = gip
201
- result.append(gip.get_influence(task))
202
-
203
- return "\n".join(result)
204
-
205
- except KeyError:
206
- log.exception()
207
- assert False, "failed to calculate hash influence for repo manifest at {0}".format(self.path)
208
-
209
- def get_manifest(self, task):
210
- manifest_path = fs.path.join(task.joltdir, task.expand(self.path))
211
- with _repo_manifest_lock:
212
- manifest = _repo_manifests.get(manifest_path)
213
- if manifest is None:
214
- manifest = RepoManifest(task, manifest_path)
215
- manifest.parse()
216
- manifest.assert_clean()
217
- manifest.lock_revisions()
218
- _repo_manifests[manifest_path] = manifest
219
- return manifest
220
-
221
-
222
- class RepoNetworkExecutorExtension(NetworkExecutorExtension):
223
- def get_parameters(self, task):
224
- rip = list(filter(
225
- lambda n: isinstance(n, RepoInfluenceProvider),
226
- task.task.influence))
227
- if rip:
228
- assert len(rip) == 1, "task influenced by multiple repo manifests"
229
- rip = rip[0]
230
- if rip.network:
231
- manifest = rip.get_manifest(task.task)
232
- return {"repo_manifest": manifest.format()}
233
- return {}
234
-
235
-
236
- @NetworkExecutorExtensionFactory.Register
237
- class RepoNetworkExecutorExtensionFactory(NetworkExecutorExtensionFactory):
238
- def create(self):
239
- return RepoNetworkExecutorExtension()
240
-
241
-
242
- def global_influence(path, include=None, exclude=None, network=True, cls=RepoInfluenceProvider):
243
- HashInfluenceRegistry.get().register(cls(path, include, exclude, network))
244
-
245
-
246
- def influence(path='.', include=None, exclude=None, network=True, cls=RepoInfluenceProvider):
247
- def _decorate(taskcls):
248
- if "influence" not in taskcls.__dict__:
249
- taskcls.influence = copy(taskcls.influence)
250
- provider = cls(path, include, exclude, network)
251
- taskcls.influence.append(provider)
252
- return taskcls
253
- return _decorate
@@ -1,79 +0,0 @@
1
- jolt/__init__.py,sha256=qutdbYzm0pxIkt77a_DESDzaHVy7Ew-m4vfBOStW9YM,1391
2
- jolt/__main__.py,sha256=w_97LnlsoL6TI-Fnh-XC8BwMu4pWbv4Hqx-XqBuARO4,1393
3
- jolt/cache.py,sha256=nc647OkK9tqIpXmbkA8MaViFRV2bFMt4P0n7UdwLu6A,59840
4
- jolt/cli.py,sha256=Nil4cw_wIKZQyUZU3DRGqOAyXJqA8NzzEwTvLD0rmAw,35197
5
- jolt/colors.py,sha256=P6vhaILGoOn8odEwQ6-z871YQoTe3HRLgS6clavwVHs,737
6
- jolt/config.py,sha256=3N5efjG7GcrVcne_BTEv7ogWWlpuoVYJdK3SDvzWlbg,8543
7
- jolt/error.py,sha256=s19gQwTXDovl3Vh5XTmsU-3bdTBx1apg3FRCczvAJQs,2110
8
- jolt/expires.py,sha256=SNJpZ7mKYIyde81I5K1h08GDlpgk0uFcG9Yk-lfXUEM,2330
9
- jolt/filesystem.py,sha256=9l0bevHb48W46pHOAaDEDR0fD4fm06ybzXpZ2ndNmYw,5815
10
- jolt/graph.py,sha256=xhILzRYvCygApRqSCiWa2faQ2JTNOlWeAQz-wYzPME8,22861
11
- jolt/hooks.py,sha256=foeQR5MAMj2JBIoMxEBWneFSNutE79p4v1GsTrwHCvY,9475
12
- jolt/influence.py,sha256=FITkvqjyIWQmsusGoL4GCx3lUbaC6g6Xy3wWc67saQ8,15426
13
- jolt/inspection.py,sha256=QkOCXAbjJBdw1SMsb6xH_3GHXV5BcdzaGD7HrGmOJss,3931
14
- jolt/loader.py,sha256=D_VpzrEh4XmSFVvoAdkdAVBv5GUoi-FHi4uG7Ut_Evg,10179
15
- jolt/log.py,sha256=tKtPgOLrMYB_KzN6MR7YI51UYmRG8wczuY1HXjFfH3k,11117
16
- jolt/manifest.py,sha256=j_ajjoBh2xou7Gpsp8G-v1tRNDrwlmIseAdZ8xT61fc,7639
17
- jolt/options.py,sha256=vfdgIDSlXwjhVLZW00Ez6bcyv5QJkhkUGuz1RY2jz2A,371
18
- jolt/scheduler.py,sha256=RAFbxL5ur32xaRYML5Il_kFXAcrWOjVpMafa3NWg5-M,18404
19
- jolt/tasks.py,sha256=b0hbLUWB_aDkAKwbOCMqeY9nOhD3GTtzPzvyAC1Pe6U,66235
20
- jolt/tools.py,sha256=6YBIFb73_1VSaY1jOdEedSfUaA7xM7UHno3SjbB75Sw,66050
21
- jolt/utils.py,sha256=EdgEFwgxwN4mKNI3-Ltjh1Xwdq3ja4CqaVgJ6hLy6B0,12806
22
- jolt/version.py,sha256=kKIBQ2qBgSohxcmuzxuKRIG9_A1ZZCxZhuUoulze8TU,23
23
- jolt/version_utils.py,sha256=32nJyuhv__rE4Phqq5TCo6_tB4RlZTmhqbFeaCR_OBM,3900
24
- jolt/xmldom.py,sha256=bD-d5OG9_I_nFRdMN397D62xM3L_bXPvK8FYTX-4uos,5543
25
- jolt/pkgs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
26
- jolt/pkgs/golang.py,sha256=r5QLhyAswvMMEbTZiKdZxSwPxn3if-NT2T-MkXIND_8,1153
27
- jolt/pkgs/nodejs.py,sha256=lqO7snxMhHb0ZiG0YfU_JtDGXkXU2zxJ5_Ac4uoM0Xk,1197
28
- jolt/plugins/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
29
- jolt/plugins/alias.py,sha256=yRstDB8H-JPiN3-hwI6hnt8Seh7KBr3U-Vam8UivUWA,313
30
- jolt/plugins/allure.py,sha256=uc8ZWRSLhOterCM4GLFjPgd7OEbk5Gbd3FXdUQzHjFY,10151
31
- jolt/plugins/amqp.py,sha256=afFaMC4pIGeVPDmlx4q9r37fWZBtg4p1Z-_LDlpCykU,32129
32
- jolt/plugins/autoweight.py,sha256=LTpma3HM1jsAx1PatDIWcddAkRw1SPhHA4Dl9H9p2lo,1245
33
- jolt/plugins/cmake.py,sha256=IAF8PhaaByJVwBYSEdVlu1MdIyhXp8Luv4ygIvtPkqo,2687
34
- jolt/plugins/conan.py,sha256=fTidFjF5lKYsrTRb_yokmnRUvMIt6FNhAPMT-5wz5_w,7654
35
- jolt/plugins/cxxinfo.py,sha256=yuHkgT2Lqg2v1GmrjINXBF--KeSOfMya7_HN8AA2hbw,2398
36
- jolt/plugins/dashboard.py,sha256=hCbmv8mCYHu-9EtE-Hr-r5Zu5WiAmdnvomHSeJv0sHM,641
37
- jolt/plugins/debian.py,sha256=5uzICZzFscV-HwLqvlqtLr7EpcUFm0N5qa2jDoHd3A8,11569
38
- jolt/plugins/docker.py,sha256=ZdPuSoqNZGUF-NaHvOd63JWujJbDWAeUX9_3D4aBubY,19171
39
- jolt/plugins/email.py,sha256=-iudgYKijSnpZdrZRcuBtYyqK7UVEvaUQOAyudJJL0I,3356
40
- jolt/plugins/email.xslt,sha256=qEbCHlfcm_epv36xirCRQO2ncxqseiGHmS1oRnQ4PY8,7200
41
- jolt/plugins/environ.py,sha256=TKyajli6790VRMAVFKxKxUgdTR8Gg-4ftsgTd05cO74,3371
42
- jolt/plugins/ftp.py,sha256=Ei1OJI5waCGaqvQt6RSAAnCy8Q5zORLeU7p5Op2WxmU,6545
43
- jolt/plugins/gdb.py,sha256=rhhzGsDwVTtVRWvK74db8RaK04__qjOJYhwxIkXFAg4,5470
44
- jolt/plugins/gerrit.py,sha256=hpJhDDKpHyzBxh2e1RsOaoLFoDllD-Zw9OUC5R6Zi_M,1420
45
- jolt/plugins/git.py,sha256=eu52zRmc-JOwVoTuFnc6u4pscV4h4I1FzDW_OjXxwAs,13855
46
- jolt/plugins/golang.py,sha256=vV4iRoJpWkyfrBa96s6jgU8Sz8GnGl-lzG_FSj5epzQ,2049
47
- jolt/plugins/googletest.py,sha256=8BQUlaeXmfJE7PtBdSUkirllk8nvZeYUDWMILuIYsak,191
48
- jolt/plugins/http.py,sha256=2tm_givpyGCB7jbfGgNcXMDDIWW2iHZnpMwj-H3S9Jc,4002
49
- jolt/plugins/junit.py,sha256=_1vXMEQBNuLbwc8l4UFm1iONYdehxJxWDRgFtPy3do8,1342
50
- jolt/plugins/logstash.py,sha256=0Se6ZDBuwUZkSdquqBJk3MzRd0BltClmzPl_lYrR_rw,1788
51
- jolt/plugins/ninja-cache.py,sha256=S7ARx1O5zki02mPw3YJjqqp933H-pcyVCtJ1wwc5xhk,2629
52
- jolt/plugins/ninja-compdb.py,sha256=NldGQt83bbpQed37wtrL2OOLvuAY1tzxIQExC9zRi6s,7852
53
- jolt/plugins/ninja.py,sha256=-20fo0L6_8nG99Y8lTZiUx-j42hmMahnzvAs6BJwUFY,73515
54
- jolt/plugins/ninjacli.py,sha256=cYGuOzBmTuT1IGfG6Etl1zDIV1lZMy85RZWCHVkmVb8,8165
55
- jolt/plugins/nodejs.py,sha256=HHDbvmdlqnao3qOtpCD9UY7iyTIX4gb2WxKUBtn-3cM,1879
56
- jolt/plugins/paths.py,sha256=lcHQdTrc7jQ-lHFWJhOUzm9TKLf1CyCn_d9op_KVcV4,1686
57
- jolt/plugins/podman.py,sha256=S55rjyC28Fk5PHohVVeNUc5EAFpOli1FxXJVqFG3bnE,20101
58
- jolt/plugins/python.py,sha256=kLx1Y3ezMH9AOW36DH_cNyDlvbIdTkyvPjwLYolnCEU,3073
59
- jolt/plugins/repo.py,sha256=tBlNVrn5F1kU8D-kHOfUTMUcPdMnG_BbP44hirALHNA,8947
60
- jolt/plugins/report.py,sha256=e7aJ-XeqjvWib7fTewvOubi9xVSY6NwfdU6bdVJtNfo,2179
61
- jolt/plugins/selfdeploy.py,sha256=vQW90DLdO0WL-R609LO-TloeaGlHuZl5f9nVcEmokfE,5994
62
- jolt/plugins/strings.py,sha256=ngrSxPT2eFOlmJkc8ZKEabYL5ltisFnwxldRQUgen8k,1538
63
- jolt/plugins/symlinks.py,sha256=E-M4tmF-rfBvIXetflz906MxG7-vIAfKULT3y9HtQSc,1921
64
- jolt/plugins/telemetry.py,sha256=L3QDUORkl57310quO_DA-NUCayqw_yQz_0JRKjejOVM,3461
65
- jolt/plugins/timeline.py,sha256=pqQpnhYjE3eRnOZUSHI4Qz6X4Ehvo-kAaRXdRihdXaM,1620
66
- jolt/plugins/volume.py,sha256=5mAsLNs47DKvfdkDb4E413VAEQOM0RIJOsrWBFinutQ,3583
67
- jolt/plugins/yaml-ninja.py,sha256=6V5YlGaZ3G1EyCTW6flMcslIh6DHttRSoUXdi0rX2Mc,3060
68
- jolt/plugins/yamltask.py,sha256=yECalMWOI48rn7yqWwxXxlSq1HDKnJ2llLD_SI_Ogys,3528
69
- jolt/plugins/selfdeploy/README.rst,sha256=dAer5CQHPOOCUAMcVljKzn5ICzjsNKWhw2tAvBAL8So,3130
70
- jolt/plugins/selfdeploy/setup.py,sha256=NxI9mg5iccZ29zdAq6g2QwTANtbWsSZLX-YVlqnaNps,3015
71
- jolt/templates/cxxexecutable.cmake.template,sha256=f0dg1VOFlamlF8fuHFTki5dsJ2ssSupiqk62QmRby4Y,1720
72
- jolt/templates/cxxlibrary.cmake.template,sha256=GMEG2G3QoY3E5fsNer52zOqgM221-abeCkV__mVbZ94,1750
73
- jolt/templates/export.sh.template,sha256=8RBkv8ebN4D-VlwH6ZAWo_i7EzBGzmRwqbDwZvlbh-g,1778
74
- jolt/templates/timeline.html.template,sha256=w6K11kwyMrA7w3GWlVlubbK0a3vcP6TGXU5n-0s6PP4,1410
75
- jolt-0.9.76.dist-info/METADATA,sha256=IwM2hfq-s3r8OcINp_BrD2ofvLhMmMyyRCLJ5o-RHVk,5493
76
- jolt-0.9.76.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
77
- jolt-0.9.76.dist-info/entry_points.txt,sha256=VZ-QH38Z9HJc1O57wfzr-soHn6exwc3N0TSrRum4tYg,44
78
- jolt-0.9.76.dist-info/top_level.txt,sha256=HwzVmAwUrvCUUHRi3zUfcpdKTsdNrZmPCvsrsWSFyqE,5
79
- jolt-0.9.76.dist-info/RECORD,,