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.
Potentially problematic release.
This version of jolt might be problematic. Click here for more details.
- 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/chroot.py
ADDED
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Helper module that sets up a mount and user namespace before executing
|
|
3
|
+
a command. The helper primarily bypasses the restriction on creating
|
|
4
|
+
namespaces from multithreaded applications (which Jolt is).
|
|
5
|
+
"""
|
|
6
|
+
import argparse
|
|
7
|
+
from ctypes import CDLL, c_char_p
|
|
8
|
+
import multiprocessing
|
|
9
|
+
import os
|
|
10
|
+
import shutil
|
|
11
|
+
import sys
|
|
12
|
+
|
|
13
|
+
libc = CDLL("libc.so.6")
|
|
14
|
+
|
|
15
|
+
CLONE_NEWNS = 0x00020000
|
|
16
|
+
CLONE_NEWUSER = 0x10000000
|
|
17
|
+
|
|
18
|
+
MS_RDONLY = 1
|
|
19
|
+
MS_BIND = 4096
|
|
20
|
+
MS_REC = 16384
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def prepare_bind(root, src):
|
|
24
|
+
src = os.path.normpath(src)
|
|
25
|
+
dst = os.path.normpath(os.path.join(root, src.lstrip("/")))
|
|
26
|
+
|
|
27
|
+
if os.path.isdir(src):
|
|
28
|
+
os.makedirs(dst, exist_ok=True)
|
|
29
|
+
else:
|
|
30
|
+
os.makedirs(os.path.dirname(dst), exist_ok=True)
|
|
31
|
+
with open(dst, "w"):
|
|
32
|
+
pass
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def mount_bind(src, dst, ro=False):
|
|
36
|
+
src = os.path.normpath(src)
|
|
37
|
+
dst = os.path.normpath(dst)
|
|
38
|
+
|
|
39
|
+
assert libc.mount(
|
|
40
|
+
c_char_p(src.encode("utf-8")),
|
|
41
|
+
c_char_p(dst.encode("utf-8")),
|
|
42
|
+
None,
|
|
43
|
+
MS_BIND | MS_REC | (MS_RDONLY if ro else 0),
|
|
44
|
+
None) == 0, f"Failed to bind mount {src}"
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def mount_overlay(src, binds, dst, temp):
|
|
48
|
+
src = os.path.normpath(src)
|
|
49
|
+
dst = os.path.normpath(dst)
|
|
50
|
+
|
|
51
|
+
upper = os.path.join(temp, "upper")
|
|
52
|
+
work = os.path.join(temp, "work")
|
|
53
|
+
os.makedirs(upper, exist_ok=True)
|
|
54
|
+
os.makedirs(work, exist_ok=True)
|
|
55
|
+
|
|
56
|
+
return libc.mount(
|
|
57
|
+
c_char_p("none".encode("utf-8")),
|
|
58
|
+
c_char_p(dst.encode("utf-8")),
|
|
59
|
+
c_char_p("overlay".encode("utf-8")),
|
|
60
|
+
0,
|
|
61
|
+
f"lowerdir={src}:{binds},upperdir={upper},workdir={work}".encode("utf-8")) == 0
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
def mount_tmpfs(path):
|
|
65
|
+
assert libc.mount(
|
|
66
|
+
c_char_p("none".encode("utf-8")),
|
|
67
|
+
c_char_p(path.encode("utf-8")),
|
|
68
|
+
c_char_p("tmpfs".encode("utf-8")),
|
|
69
|
+
0, None) == 0, f"Failed to mount tmpfs at '{path}'"
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
def main():
|
|
73
|
+
parser = argparse.ArgumentParser(
|
|
74
|
+
prog='chroot',
|
|
75
|
+
description='Runs a command in a chroot using linux namespaces')
|
|
76
|
+
parser.add_argument('command', nargs='+')
|
|
77
|
+
parser.add_argument('-b', '--bind', nargs="*")
|
|
78
|
+
parser.add_argument('-t', '--temp', required=True)
|
|
79
|
+
parser.add_argument('-c', '--chroot', required=True)
|
|
80
|
+
parser.add_argument('-d', '--chdir')
|
|
81
|
+
parser.add_argument('--shell', default="True")
|
|
82
|
+
args = parser.parse_args()
|
|
83
|
+
|
|
84
|
+
# Prepare bind mount targets outside userns
|
|
85
|
+
for path in args.bind or []:
|
|
86
|
+
prepare_bind(args.temp, path)
|
|
87
|
+
|
|
88
|
+
cwd = os.getcwd()
|
|
89
|
+
gid = os.getegid()
|
|
90
|
+
uid = os.geteuid()
|
|
91
|
+
gidmap = [gid, gid, 1]
|
|
92
|
+
uidmap = [uid, uid, 1]
|
|
93
|
+
gidmap = [str(i) for i in gidmap]
|
|
94
|
+
uidmap = [str(i) for i in uidmap]
|
|
95
|
+
|
|
96
|
+
newgidmap = shutil.which("newgidmap") or shutil.which("/usr/bin/newgidmap")
|
|
97
|
+
newuidmap = shutil.which("newuidmap") or shutil.which("/usr/bin/newuidmap")
|
|
98
|
+
|
|
99
|
+
sem = multiprocessing.Semaphore(0)
|
|
100
|
+
parent = os.getpid()
|
|
101
|
+
child = os.fork()
|
|
102
|
+
if child == 0:
|
|
103
|
+
sem.acquire()
|
|
104
|
+
pid = os.fork()
|
|
105
|
+
if pid == 0:
|
|
106
|
+
os.execve(newuidmap, [newuidmap, str(parent)] + uidmap, {})
|
|
107
|
+
os._exit(1)
|
|
108
|
+
_, status = os.waitpid(pid, 0)
|
|
109
|
+
assert status == 0, f"Failed to map UIDs: newuidmap exit status: {status}"
|
|
110
|
+
os.execve(newgidmap, [newgidmap, str(parent)] + gidmap, {})
|
|
111
|
+
os._exit(1)
|
|
112
|
+
|
|
113
|
+
assert libc.unshare(CLONE_NEWNS | CLONE_NEWUSER) == 0
|
|
114
|
+
sem.release()
|
|
115
|
+
_, status = os.waitpid(child, 0)
|
|
116
|
+
assert status == 0, f"Failed to map GIDs: newgidmap exit status: {status}"
|
|
117
|
+
|
|
118
|
+
mount_tmpfs("/mnt")
|
|
119
|
+
if not mount_overlay(args.chroot, args.temp, "/mnt", "/mnt"):
|
|
120
|
+
mount_bind(args.chroot, "/mnt", True)
|
|
121
|
+
mount_bind("/proc", "/mnt/proc", True)
|
|
122
|
+
|
|
123
|
+
for path in args.bind or []:
|
|
124
|
+
mount_bind(path, os.path.join("/mnt", os.path.relpath(path, "/")))
|
|
125
|
+
|
|
126
|
+
os.chroot("/mnt")
|
|
127
|
+
os.chdir(args.chdir or cwd)
|
|
128
|
+
|
|
129
|
+
# Adjust PATH to include standard paths, if missing
|
|
130
|
+
path = os.environ.get("PATH", None)
|
|
131
|
+
if path is None:
|
|
132
|
+
path = "/usr/local/bin:/usr/bin:/bin"
|
|
133
|
+
else:
|
|
134
|
+
path = path.split(os.pathsep)
|
|
135
|
+
if "/usr/local/bin" not in path:
|
|
136
|
+
path.append("/usr/local/bin")
|
|
137
|
+
if "/usr/bin" not in path:
|
|
138
|
+
path.append("/usr/bin")
|
|
139
|
+
if "/bin" not in path:
|
|
140
|
+
path.append("/bin")
|
|
141
|
+
path = os.pathsep.join(path)
|
|
142
|
+
os.environ["PATH"] = path
|
|
143
|
+
|
|
144
|
+
if args.shell in ["True", "true"]:
|
|
145
|
+
os.execve("/bin/sh", ["sh", "-c", " ".join(args.command)], os.environ)
|
|
146
|
+
else:
|
|
147
|
+
exe = shutil.which(args.command[0])
|
|
148
|
+
os.execve(exe, args.command, os.environ)
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
if __name__ == "__main__":
|
|
152
|
+
try:
|
|
153
|
+
main()
|
|
154
|
+
except Exception as e:
|
|
155
|
+
print(f"{type(e).__name__}: {e}", file=sys.stderr)
|
|
156
|
+
os._exit(1)
|