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.
- jolt/__init__.py +88 -7
- jolt/__main__.py +9 -1
- jolt/bin/fstree-darwin-x86_64 +0 -0
- jolt/bin/fstree-linux-x86_64 +0 -0
- jolt/cache.py +839 -367
- jolt/chroot.py +156 -0
- jolt/cli.py +362 -143
- jolt/common_pb2.py +63 -0
- jolt/common_pb2_grpc.py +4 -0
- jolt/config.py +99 -42
- jolt/error.py +19 -4
- jolt/expires.py +2 -2
- jolt/filesystem.py +8 -6
- jolt/graph.py +705 -117
- jolt/hooks.py +63 -1
- jolt/influence.py +129 -6
- jolt/loader.py +369 -121
- jolt/log.py +225 -63
- jolt/manifest.py +28 -38
- jolt/options.py +35 -10
- jolt/pkgs/abseil.py +42 -0
- jolt/pkgs/asio.py +25 -0
- jolt/pkgs/autoconf.py +41 -0
- jolt/pkgs/automake.py +41 -0
- jolt/pkgs/b2.py +31 -0
- jolt/pkgs/boost.py +111 -0
- jolt/pkgs/boringssl.py +32 -0
- jolt/pkgs/busybox.py +39 -0
- jolt/pkgs/bzip2.py +43 -0
- jolt/pkgs/cares.py +29 -0
- jolt/pkgs/catch2.py +36 -0
- jolt/pkgs/cbindgen.py +17 -0
- jolt/pkgs/cista.py +19 -0
- jolt/pkgs/clang.py +44 -0
- jolt/pkgs/cli11.py +23 -0
- jolt/pkgs/cmake.py +48 -0
- jolt/pkgs/cpython.py +196 -0
- jolt/pkgs/crun.py +29 -0
- jolt/pkgs/curl.py +38 -0
- jolt/pkgs/dbus.py +18 -0
- jolt/pkgs/double_conversion.py +24 -0
- jolt/pkgs/fastfloat.py +21 -0
- jolt/pkgs/ffmpeg.py +28 -0
- jolt/pkgs/flatbuffers.py +29 -0
- jolt/pkgs/fmt.py +27 -0
- jolt/pkgs/fstree.py +20 -0
- jolt/pkgs/gflags.py +18 -0
- jolt/pkgs/glib.py +18 -0
- jolt/pkgs/glog.py +25 -0
- jolt/pkgs/glslang.py +21 -0
- jolt/pkgs/golang.py +16 -11
- jolt/pkgs/googlebenchmark.py +18 -0
- jolt/pkgs/googletest.py +46 -0
- jolt/pkgs/gperf.py +15 -0
- jolt/pkgs/grpc.py +73 -0
- jolt/pkgs/hdf5.py +19 -0
- jolt/pkgs/help2man.py +14 -0
- jolt/pkgs/inja.py +28 -0
- jolt/pkgs/jsoncpp.py +31 -0
- jolt/pkgs/libarchive.py +43 -0
- jolt/pkgs/libcap.py +44 -0
- jolt/pkgs/libdrm.py +44 -0
- jolt/pkgs/libedit.py +42 -0
- jolt/pkgs/libevent.py +31 -0
- jolt/pkgs/libexpat.py +27 -0
- jolt/pkgs/libfastjson.py +21 -0
- jolt/pkgs/libffi.py +16 -0
- jolt/pkgs/libglvnd.py +30 -0
- jolt/pkgs/libogg.py +28 -0
- jolt/pkgs/libpciaccess.py +18 -0
- jolt/pkgs/libseccomp.py +21 -0
- jolt/pkgs/libtirpc.py +24 -0
- jolt/pkgs/libtool.py +42 -0
- jolt/pkgs/libunwind.py +35 -0
- jolt/pkgs/libva.py +18 -0
- jolt/pkgs/libvorbis.py +33 -0
- jolt/pkgs/libxml2.py +35 -0
- jolt/pkgs/libxslt.py +17 -0
- jolt/pkgs/libyajl.py +16 -0
- jolt/pkgs/llvm.py +81 -0
- jolt/pkgs/lua.py +54 -0
- jolt/pkgs/lz4.py +26 -0
- jolt/pkgs/m4.py +14 -0
- jolt/pkgs/make.py +17 -0
- jolt/pkgs/mesa.py +81 -0
- jolt/pkgs/meson.py +17 -0
- jolt/pkgs/mstch.py +28 -0
- jolt/pkgs/mysql.py +60 -0
- jolt/pkgs/nasm.py +49 -0
- jolt/pkgs/ncurses.py +30 -0
- jolt/pkgs/ng_log.py +25 -0
- jolt/pkgs/ninja.py +45 -0
- jolt/pkgs/nlohmann_json.py +25 -0
- jolt/pkgs/nodejs.py +19 -11
- jolt/pkgs/opencv.py +24 -0
- jolt/pkgs/openjdk.py +26 -0
- jolt/pkgs/openssl.py +103 -0
- jolt/pkgs/paho.py +76 -0
- jolt/pkgs/patchelf.py +16 -0
- jolt/pkgs/perl.py +42 -0
- jolt/pkgs/pkgconfig.py +64 -0
- jolt/pkgs/poco.py +39 -0
- jolt/pkgs/protobuf.py +77 -0
- jolt/pkgs/pugixml.py +27 -0
- jolt/pkgs/python.py +19 -0
- jolt/pkgs/qt.py +35 -0
- jolt/pkgs/rapidjson.py +26 -0
- jolt/pkgs/rapidyaml.py +28 -0
- jolt/pkgs/re2.py +30 -0
- jolt/pkgs/re2c.py +17 -0
- jolt/pkgs/readline.py +15 -0
- jolt/pkgs/rust.py +41 -0
- jolt/pkgs/sdl.py +28 -0
- jolt/pkgs/simdjson.py +27 -0
- jolt/pkgs/soci.py +46 -0
- jolt/pkgs/spdlog.py +29 -0
- jolt/pkgs/spirv_llvm.py +21 -0
- jolt/pkgs/spirv_tools.py +24 -0
- jolt/pkgs/sqlite.py +83 -0
- jolt/pkgs/ssl.py +12 -0
- jolt/pkgs/texinfo.py +15 -0
- jolt/pkgs/tomlplusplus.py +22 -0
- jolt/pkgs/wayland.py +26 -0
- jolt/pkgs/x11.py +58 -0
- jolt/pkgs/xerces_c.py +20 -0
- jolt/pkgs/xorg.py +360 -0
- jolt/pkgs/xz.py +29 -0
- jolt/pkgs/yamlcpp.py +30 -0
- jolt/pkgs/zeromq.py +47 -0
- jolt/pkgs/zlib.py +69 -0
- jolt/pkgs/zstd.py +33 -0
- jolt/plugins/alias.py +3 -0
- jolt/plugins/allure.py +5 -2
- jolt/plugins/autotools.py +66 -0
- jolt/plugins/cache.py +133 -0
- jolt/plugins/cmake.py +74 -6
- jolt/plugins/conan.py +238 -0
- jolt/plugins/cxx.py +698 -0
- jolt/plugins/cxxinfo.py +7 -0
- jolt/plugins/dashboard.py +1 -1
- jolt/plugins/docker.py +91 -23
- jolt/plugins/email.py +5 -2
- jolt/plugins/email.xslt +144 -101
- jolt/plugins/environ.py +11 -0
- jolt/plugins/fetch.py +141 -0
- jolt/plugins/gdb.py +44 -21
- jolt/plugins/gerrit.py +1 -14
- jolt/plugins/git.py +316 -101
- jolt/plugins/googletest.py +522 -1
- jolt/plugins/http.py +36 -38
- jolt/plugins/libtool.py +63 -0
- jolt/plugins/linux.py +990 -0
- jolt/plugins/logstash.py +4 -4
- jolt/plugins/meson.py +61 -0
- jolt/plugins/ninja-compdb.py +107 -31
- jolt/plugins/ninja.py +929 -134
- jolt/plugins/paths.py +11 -1
- jolt/plugins/pkgconfig.py +219 -0
- jolt/plugins/podman.py +148 -91
- jolt/plugins/python.py +137 -0
- jolt/plugins/remote_execution/__init__.py +0 -0
- jolt/plugins/remote_execution/administration_pb2.py +46 -0
- jolt/plugins/remote_execution/administration_pb2_grpc.py +170 -0
- jolt/plugins/remote_execution/log_pb2.py +32 -0
- jolt/plugins/remote_execution/log_pb2_grpc.py +68 -0
- jolt/plugins/remote_execution/scheduler_pb2.py +41 -0
- jolt/plugins/remote_execution/scheduler_pb2_grpc.py +141 -0
- jolt/plugins/remote_execution/worker_pb2.py +38 -0
- jolt/plugins/remote_execution/worker_pb2_grpc.py +112 -0
- jolt/plugins/report.py +12 -2
- jolt/plugins/rust.py +25 -0
- jolt/plugins/scheduler.py +710 -0
- jolt/plugins/selfdeploy/setup.py +9 -4
- jolt/plugins/selfdeploy.py +138 -88
- jolt/plugins/strings.py +35 -22
- jolt/plugins/symlinks.py +26 -11
- jolt/plugins/telemetry.py +5 -2
- jolt/plugins/timeline.py +13 -3
- jolt/plugins/volume.py +46 -48
- jolt/scheduler.py +591 -191
- jolt/tasks.py +1783 -245
- jolt/templates/export.sh.template +12 -6
- jolt/templates/timeline.html.template +44 -47
- jolt/timer.py +22 -0
- jolt/tools.py +749 -302
- jolt/utils.py +245 -18
- jolt/version.py +1 -1
- jolt/version_utils.py +2 -2
- jolt/xmldom.py +12 -2
- {jolt-0.9.76.dist-info → jolt-0.9.429.dist-info}/METADATA +98 -38
- jolt-0.9.429.dist-info/RECORD +207 -0
- {jolt-0.9.76.dist-info → jolt-0.9.429.dist-info}/WHEEL +1 -1
- jolt/plugins/amqp.py +0 -834
- jolt/plugins/debian.py +0 -338
- jolt/plugins/ftp.py +0 -181
- jolt/plugins/ninja-cache.py +0 -64
- jolt/plugins/ninjacli.py +0 -271
- jolt/plugins/repo.py +0 -253
- jolt-0.9.76.dist-info/RECORD +0 -79
- {jolt-0.9.76.dist-info → jolt-0.9.429.dist-info}/entry_points.txt +0 -0
- {jolt-0.9.76.dist-info → jolt-0.9.429.dist-info}/top_level.txt +0 -0
jolt/plugins/fetch.py
ADDED
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import hashlib
|
|
2
|
+
from jolt import BooleanParameter, Parameter
|
|
3
|
+
from jolt.plugins.git import ErrorDict
|
|
4
|
+
from jolt.tasks import Resource, TaskRegistry
|
|
5
|
+
from jolt import filesystem as fs
|
|
6
|
+
from jolt import utils
|
|
7
|
+
from jolt.error import raise_error_if
|
|
8
|
+
from jolt.loader import JoltLoader
|
|
9
|
+
from jolt.tools import SUPPORTED_ARCHIVE_TYPES
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class Fetch(Resource):
|
|
13
|
+
"""
|
|
14
|
+
Fetch a file from a URL and extract it.
|
|
15
|
+
|
|
16
|
+
By default, the fetched file is extracted if it is a supported archive type.
|
|
17
|
+
Extraction may be disable by assigning the `extract` parameter to false.
|
|
18
|
+
|
|
19
|
+
The fetched content is placed in a build directory named after the resource.
|
|
20
|
+
The `path` parameter can be used to specify a different location relative to
|
|
21
|
+
the workspace root.
|
|
22
|
+
|
|
23
|
+
The path of the fetched content is made available to consuming tasks through
|
|
24
|
+
the `fetch` attribute. The `fetch` attribute is a dictionary where the key
|
|
25
|
+
is the name of the fetched file and the value is a path relative to the
|
|
26
|
+
workspace root. You can specify an alias for the filename / key through the
|
|
27
|
+
`alias` parameter.
|
|
28
|
+
|
|
29
|
+
The plugin must be loaded before it can be used. This is done by importing
|
|
30
|
+
the module, or by adding the following line to the configuration file:
|
|
31
|
+
|
|
32
|
+
.. code-block:: ini
|
|
33
|
+
|
|
34
|
+
[fetch]
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
Example:
|
|
38
|
+
|
|
39
|
+
.. code-block:: python
|
|
40
|
+
|
|
41
|
+
from jolt.plugins import fetch
|
|
42
|
+
|
|
43
|
+
class Example(Task):
|
|
44
|
+
requires = ["fetch:alias=zlib,url=https://zlib.net/zlib-1.3.1.tar.gz"]
|
|
45
|
+
|
|
46
|
+
def run(self, deps, tools):
|
|
47
|
+
self.info("The source tree is located at: {fetch[zlib]}")
|
|
48
|
+
with tools.cwd(self.fetch["zlib"]):
|
|
49
|
+
tools.run("make")
|
|
50
|
+
|
|
51
|
+
"""
|
|
52
|
+
|
|
53
|
+
name = "fetch"
|
|
54
|
+
alias = Parameter(required=False, help="Name of the task used when referencing content. Defaults to the filename of the fetched file.")
|
|
55
|
+
extract = BooleanParameter(default=True, help="Whether to extract the fetched file.")
|
|
56
|
+
path = Parameter(required=False, help="Destination directory.")
|
|
57
|
+
url = Parameter(help="URL to fetch from.")
|
|
58
|
+
md5 = Parameter(required=False, help="Expected MD5 hash of the fetched file.")
|
|
59
|
+
sha256 = Parameter(required=False, help="Expected SHA256 hash of the fetched file.")
|
|
60
|
+
|
|
61
|
+
def __init__(self, *args, **kwargs):
|
|
62
|
+
super().__init__(*args, **kwargs)
|
|
63
|
+
self.joltdir = JoltLoader.get().joltdir
|
|
64
|
+
|
|
65
|
+
# Set the path to the extraction directory
|
|
66
|
+
if self.path.is_unset():
|
|
67
|
+
self.abspath = self.tools.builddir(utils.canonical(self.short_qualified_name), incremental="always", unique=False)
|
|
68
|
+
if not self._extract():
|
|
69
|
+
# Join with filename if not extracting
|
|
70
|
+
self.abspath = fs.path.join(self.abspath, self._get_filename())
|
|
71
|
+
else:
|
|
72
|
+
self.abspath = fs.path.join(self.joltdir, str(self.path) or self._get_name())
|
|
73
|
+
|
|
74
|
+
self.relpath = fs.path.relpath(self.abspath, self.tools.wsroot)
|
|
75
|
+
|
|
76
|
+
def _extract(self):
|
|
77
|
+
""" Check if the fetched file should/can be extracted. """
|
|
78
|
+
filename = self._get_filename()
|
|
79
|
+
|
|
80
|
+
if not any([filename.endswith(ext) for ext in SUPPORTED_ARCHIVE_TYPES]):
|
|
81
|
+
return False
|
|
82
|
+
|
|
83
|
+
return bool(self.extract)
|
|
84
|
+
|
|
85
|
+
def _acquire_ws(self):
|
|
86
|
+
# Create the destination directory if it does not exist
|
|
87
|
+
self.tools.rmtree(self.abspath, ignore_errors=True)
|
|
88
|
+
self.tools.mkdir(fs.path.dirname(self.abspath), recursively=True)
|
|
89
|
+
|
|
90
|
+
if self._extract():
|
|
91
|
+
with self.tools.tmpdir() as tmpdir, self.tools.cwd(tmpdir):
|
|
92
|
+
filename = self._get_filename()
|
|
93
|
+
self.tools.download(self.url, filename)
|
|
94
|
+
self._verify_sha256(filename)
|
|
95
|
+
self.tools.extract(filename, self.abspath)
|
|
96
|
+
else:
|
|
97
|
+
self.tools.download(self.url, self.abspath)
|
|
98
|
+
self._verify_sha256(self.abspath)
|
|
99
|
+
|
|
100
|
+
def acquire(self, artifact, deps, tools, owner):
|
|
101
|
+
self._acquire_ws()
|
|
102
|
+
self._assign_fetch(owner)
|
|
103
|
+
artifact.worktree = fs.path.relpath(self.abspath, owner.joltdir)
|
|
104
|
+
|
|
105
|
+
def _assign_fetch(self, task, none=False):
|
|
106
|
+
if not hasattr(task, "fetch"):
|
|
107
|
+
task.fetch = ErrorDict(self)
|
|
108
|
+
if none:
|
|
109
|
+
# None means the git repo is not cloned or checked out
|
|
110
|
+
# and should not be included in the git dictionary
|
|
111
|
+
# of the consuming task yet. If the consuming task
|
|
112
|
+
# requires the git repo for its influence collection,
|
|
113
|
+
# the dict will raise an error. The solution is to
|
|
114
|
+
# assign hash=true to the git requirement which
|
|
115
|
+
# will cause the git repo to be cloned and checked out
|
|
116
|
+
# before the influence collection is performed.
|
|
117
|
+
task.fetch[self._get_name()] = None
|
|
118
|
+
else:
|
|
119
|
+
# Assign the git repo to the consuming task.
|
|
120
|
+
# The git repo is cloned and checked out before
|
|
121
|
+
# any influence collection is performed.
|
|
122
|
+
task.fetch[self._get_name()] = fs.path.relpath(self.abspath, task.joltdir)
|
|
123
|
+
|
|
124
|
+
def _get_name(self):
|
|
125
|
+
return str(self.alias) if self.alias.is_set() else self._get_filename()
|
|
126
|
+
|
|
127
|
+
def _get_filename(self):
|
|
128
|
+
return fs.path.basename(str(self.url))
|
|
129
|
+
|
|
130
|
+
def _verify_sha256(self, filepath):
|
|
131
|
+
if not self.sha256.is_set():
|
|
132
|
+
return
|
|
133
|
+
actual_hash = self.tools.checksum_file(filepath, hashfn=hashlib.sha256)
|
|
134
|
+
expected_hash = str(self.sha256)
|
|
135
|
+
raise_error_if(
|
|
136
|
+
actual_hash != expected_hash,
|
|
137
|
+
f"SHA256 hash mismatch for fetched file '{filepath}': expected {expected_hash}, got {actual_hash}"
|
|
138
|
+
)
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
TaskRegistry.get().add_task_class(Fetch)
|
jolt/plugins/gdb.py
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import click
|
|
2
2
|
import os
|
|
3
3
|
import sys
|
|
4
|
-
import subprocess
|
|
5
4
|
|
|
6
5
|
from jolt import cache
|
|
7
6
|
from jolt import cli
|
|
@@ -9,6 +8,7 @@ from jolt import filesystem as fs
|
|
|
9
8
|
from jolt import graph
|
|
10
9
|
from jolt import log
|
|
11
10
|
from jolt import scheduler
|
|
11
|
+
from jolt.error import raise_error
|
|
12
12
|
from jolt.error import raise_task_error_if
|
|
13
13
|
from jolt.hooks import TaskHookRegistry
|
|
14
14
|
from jolt.options import JoltOptions
|
|
@@ -25,10 +25,11 @@ def stage_artifacts(artifacts, tools):
|
|
|
25
25
|
tools.sandbox(artifact, incremental=True, reflect=fs.has_symlinks())
|
|
26
26
|
|
|
27
27
|
|
|
28
|
-
def get_task_artifacts(task
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
def get_task_artifacts(task):
|
|
29
|
+
artifacts = []
|
|
30
|
+
for dep in task.children:
|
|
31
|
+
artifacts.extend(dep.artifacts)
|
|
32
|
+
return task.artifacts, artifacts
|
|
32
33
|
|
|
33
34
|
|
|
34
35
|
@cli.cli.command(name="gdb", context_settings={"ignore_unknown_options": True})
|
|
@@ -36,8 +37,10 @@ def get_task_artifacts(task, artifact=None):
|
|
|
36
37
|
@click.argument("gdb-args", type=str, nargs=-1, required=False)
|
|
37
38
|
@click.option("-d", "--default", type=str, multiple=True, help="Override default parameter values.")
|
|
38
39
|
@click.option("-mi", "--machine-interface", is_flag=True, help="Enable the machine interface for use within an IDE.")
|
|
40
|
+
@click.option("-nb", "--no-binary", is_flag=True,
|
|
41
|
+
help="Don't load symbols from binary. Shortens startup time in IDEs where binaries are loaded through the machine interface.")
|
|
39
42
|
@click.pass_context
|
|
40
|
-
def gdb(ctx, task, default, machine_interface, gdb_args):
|
|
43
|
+
def gdb(ctx, task, default, machine_interface, no_binary, gdb_args):
|
|
41
44
|
"""
|
|
42
45
|
Launch gdb with an executable from a task artifact.
|
|
43
46
|
|
|
@@ -67,36 +70,44 @@ def gdb(ctx, task, default, machine_interface, gdb_args):
|
|
|
67
70
|
if machine_interface:
|
|
68
71
|
log.enable_gdb()
|
|
69
72
|
|
|
70
|
-
manifest = ctx.obj["manifest"]
|
|
71
73
|
options = JoltOptions(default=default)
|
|
72
74
|
acache = cache.ArtifactCache.get(options)
|
|
73
75
|
TaskHookRegistry.get(options)
|
|
74
76
|
executors = scheduler.ExecutorRegistry.get(options)
|
|
75
77
|
registry = TaskRegistry.get()
|
|
76
78
|
strategy = scheduler.DownloadStrategy(executors, acache)
|
|
77
|
-
queue = scheduler.TaskQueue(
|
|
79
|
+
queue = scheduler.TaskQueue()
|
|
78
80
|
|
|
79
81
|
for params in default:
|
|
80
82
|
registry.set_default_parameters(params)
|
|
81
83
|
|
|
82
|
-
gb = graph.GraphBuilder(registry,
|
|
84
|
+
gb = graph.GraphBuilder(registry, acache, options, progress=True)
|
|
83
85
|
dag = gb.build([task])
|
|
84
86
|
|
|
85
87
|
try:
|
|
86
88
|
with log.progress("Progress", dag.number_of_tasks(), " tasks", estimates=False, debug=False) as p:
|
|
87
|
-
|
|
88
|
-
|
|
89
|
+
in_progress = set()
|
|
90
|
+
|
|
91
|
+
while dag.has_tasks() or not queue.empty():
|
|
92
|
+
leafs = dag.select(lambda graph, task: task.is_ready() and task not in in_progress)
|
|
89
93
|
|
|
90
94
|
while leafs:
|
|
91
95
|
task = leafs.pop()
|
|
92
|
-
|
|
96
|
+
executor = strategy.create_executor({}, task)
|
|
97
|
+
queue.submit(executor)
|
|
98
|
+
in_progress.add(task)
|
|
93
99
|
|
|
94
|
-
task,
|
|
100
|
+
task, _ = queue.wait()
|
|
95
101
|
|
|
96
102
|
# Materialize workspace resources so that
|
|
97
103
|
# source code is available to the debugger.
|
|
98
104
|
if isinstance(task.task, WorkspaceResource):
|
|
99
|
-
task.task.
|
|
105
|
+
task.task.acquire_ws()
|
|
106
|
+
|
|
107
|
+
# Unpack the task if it is not a resource task and has a custom unpack method
|
|
108
|
+
if not task.is_resource():
|
|
109
|
+
if task.is_unpackable():
|
|
110
|
+
task.unpack()
|
|
100
111
|
|
|
101
112
|
p.update(1)
|
|
102
113
|
|
|
@@ -105,27 +116,37 @@ def gdb(ctx, task, default, machine_interface, gdb_args):
|
|
|
105
116
|
log.warning("Interrupted by user")
|
|
106
117
|
try:
|
|
107
118
|
queue.abort()
|
|
119
|
+
executors.shutdown()
|
|
108
120
|
sys.exit(1)
|
|
109
121
|
except KeyboardInterrupt:
|
|
110
122
|
print()
|
|
111
123
|
log.warning("Interrupted again, exiting")
|
|
112
124
|
os._exit(1)
|
|
125
|
+
|
|
113
126
|
except Exception as e:
|
|
114
127
|
log.set_interactive(True)
|
|
115
128
|
raise e
|
|
116
129
|
|
|
130
|
+
finally:
|
|
131
|
+
queue.shutdown()
|
|
132
|
+
|
|
117
133
|
assert len(dag.goals), "Too many tasks, can only debug one executable at a time"
|
|
118
134
|
|
|
119
135
|
for goal in dag.goals:
|
|
120
|
-
|
|
121
|
-
stage_artifacts(
|
|
136
|
+
main, deps = get_task_artifacts(goal)
|
|
137
|
+
stage_artifacts(main + deps, goal.tools)
|
|
122
138
|
|
|
139
|
+
# Find an artifact with an executable
|
|
140
|
+
main = [artifact for artifact in main if artifact.strings.executable]
|
|
123
141
|
raise_task_error_if(
|
|
124
|
-
|
|
125
|
-
|
|
142
|
+
not main, goal, "No executable found in task artifact")
|
|
143
|
+
main = main[0]
|
|
126
144
|
|
|
127
145
|
with acache.get_context(goal):
|
|
128
146
|
gdb = goal.tools.getenv("GDB", "gdb")
|
|
147
|
+
gdb = goal.tools.which(gdb)
|
|
148
|
+
if not gdb:
|
|
149
|
+
raise_error("GDB not found in PATH")
|
|
129
150
|
cmd = [gdb]
|
|
130
151
|
sysroot = goal.tools.getenv("SDKTARGETSYSROOT", goal.tools.getenv("SYSROOT"))
|
|
131
152
|
if sysroot:
|
|
@@ -138,13 +159,15 @@ def gdb(ctx, task, default, machine_interface, gdb_args):
|
|
|
138
159
|
cmd += ["-ex", "set print asm-demangle"]
|
|
139
160
|
cmd += ["-ex", "set print thread-events off"]
|
|
140
161
|
cmd += ["-ex", "handle SIG32 nostop noprint"]
|
|
141
|
-
|
|
162
|
+
if not no_binary:
|
|
163
|
+
cmd += [os.path.join(main.path, str(main.strings.executable))]
|
|
142
164
|
cmd += gdb_args
|
|
143
165
|
|
|
144
166
|
if isinstance(goal.task, ninja.CXXProject):
|
|
145
|
-
cwd = goal.tools.
|
|
167
|
+
cwd = goal.tools.wsroot
|
|
146
168
|
else:
|
|
147
169
|
cwd = goal.task.joltdir
|
|
148
170
|
|
|
149
171
|
with goal.tools.environ() as env:
|
|
150
|
-
|
|
172
|
+
os.chdir(cwd)
|
|
173
|
+
os.execve(cmd[0], cmd, env)
|
jolt/plugins/gerrit.py
CHANGED
|
@@ -7,18 +7,6 @@ from jolt.plugins import git
|
|
|
7
7
|
log.verbose("[Gerrit] Loaded")
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
class GerritSrc(git.GitSrc):
|
|
11
|
-
name = "gerrit-src"
|
|
12
|
-
url = Parameter(help="URL to the Gerrit git repo to be cloned. Required.")
|
|
13
|
-
sha = Parameter(required=False, help="Specific commit or tag to be checked out. Optional.")
|
|
14
|
-
path = Parameter(required=False, help="Local path where the repository should be cloned.")
|
|
15
|
-
_revision = Export(value=lambda self: self._get_revision() or self.git.head())
|
|
16
|
-
|
|
17
|
-
def __init__(self, *args, **kwargs):
|
|
18
|
-
refspec1 = '+refs/changes/*:refs/remotes/origin/changes/*'
|
|
19
|
-
super(GerritSrc, self).__init__(*args, refspecs=[refspec1], **kwargs)
|
|
20
|
-
|
|
21
|
-
|
|
22
10
|
class Gerrit(git.Git):
|
|
23
11
|
name = "gerrit"
|
|
24
12
|
url = Parameter(help="URL to the Gerrit git repo to be cloned. Required.")
|
|
@@ -28,8 +16,7 @@ class Gerrit(git.Git):
|
|
|
28
16
|
|
|
29
17
|
def __init__(self, *args, **kwargs):
|
|
30
18
|
refspec1 = '+refs/changes/*:refs/remotes/origin/changes/*'
|
|
31
|
-
super(
|
|
19
|
+
super().__init__(*args, refspecs=[refspec1], **kwargs)
|
|
32
20
|
|
|
33
21
|
|
|
34
|
-
TaskRegistry.get().add_task_class(GerritSrc)
|
|
35
22
|
TaskRegistry.get().add_task_class(Gerrit)
|