jolt 0.9.123__py3-none-any.whl → 0.9.435__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 +80 -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 +832 -362
- jolt/chroot.py +156 -0
- jolt/cli.py +281 -162
- jolt/common_pb2.py +63 -0
- jolt/common_pb2_grpc.py +4 -0
- jolt/config.py +98 -41
- jolt/error.py +19 -4
- jolt/filesystem.py +2 -6
- jolt/graph.py +705 -117
- jolt/hooks.py +43 -0
- jolt/influence.py +122 -3
- 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 +24 -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 +87 -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 +80 -23
- jolt/plugins/email.py +2 -2
- jolt/plugins/email.xslt +144 -101
- jolt/plugins/environ.py +11 -0
- jolt/plugins/fetch.py +141 -0
- jolt/plugins/gdb.py +39 -19
- jolt/plugins/gerrit.py +1 -14
- jolt/plugins/git.py +283 -85
- jolt/plugins/googletest.py +2 -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 +99 -30
- jolt/plugins/ninja.py +468 -166
- jolt/plugins/paths.py +11 -1
- jolt/plugins/pkgconfig.py +219 -0
- jolt/plugins/podman.py +136 -92
- 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 +8 -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 +589 -192
- jolt/tasks.py +625 -121
- jolt/templates/timeline.html.template +44 -47
- jolt/timer.py +22 -0
- jolt/tools.py +638 -282
- jolt/utils.py +211 -7
- jolt/version.py +1 -1
- jolt/xmldom.py +12 -2
- {jolt-0.9.123.dist-info → jolt-0.9.435.dist-info}/METADATA +97 -38
- jolt-0.9.435.dist-info/RECORD +207 -0
- {jolt-0.9.123.dist-info → jolt-0.9.435.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/repo.py +0 -253
- jolt-0.9.123.dist-info/RECORD +0 -77
- {jolt-0.9.123.dist-info → jolt-0.9.435.dist-info}/entry_points.txt +0 -0
- {jolt-0.9.123.dist-info → jolt-0.9.435.dist-info}/top_level.txt +0 -0
jolt/plugins/debian.py
DELETED
|
@@ -1,338 +0,0 @@
|
|
|
1
|
-
from jolt import BooleanParameter, Parameter, Task
|
|
2
|
-
from jolt import attributes, filesystem as fs, loader
|
|
3
|
-
from jolt.tasks import TaskRegistry
|
|
4
|
-
|
|
5
|
-
from jolt.cache import ArtifactListAttribute
|
|
6
|
-
from jolt.cache import ArtifactAttributeSet
|
|
7
|
-
from jolt.cache import ArtifactAttributeSetProvider
|
|
8
|
-
|
|
9
|
-
import contextlib
|
|
10
|
-
import os
|
|
11
|
-
import platform
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
class DebianListVariable(ArtifactListAttribute):
|
|
15
|
-
pass
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
class DebianAttributeSet(ArtifactAttributeSet):
|
|
19
|
-
def __init__(self, artifact):
|
|
20
|
-
super(DebianAttributeSet, self).__init__()
|
|
21
|
-
super(ArtifactAttributeSet, self).__setattr__("_artifact", artifact)
|
|
22
|
-
|
|
23
|
-
def create(self, name):
|
|
24
|
-
if name == "chroot":
|
|
25
|
-
return DebianListVariable(self._artifact, "chroot")
|
|
26
|
-
assert False, "No such debian attribute: {0}".format(name)
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
@ArtifactAttributeSetProvider.Register
|
|
30
|
-
class DebianAttributeProvider(ArtifactAttributeSetProvider):
|
|
31
|
-
def create(self, artifact):
|
|
32
|
-
setattr(artifact, "debian", DebianAttributeSet(artifact))
|
|
33
|
-
|
|
34
|
-
def parse(self, artifact, content):
|
|
35
|
-
if "debian" not in content:
|
|
36
|
-
return
|
|
37
|
-
for key, value in content["debian"].items():
|
|
38
|
-
getattr(artifact.debian, key).set_value(value, expand=False)
|
|
39
|
-
|
|
40
|
-
def format(self, artifact, content):
|
|
41
|
-
if "debian" not in content:
|
|
42
|
-
content["debian"] = {}
|
|
43
|
-
for key, attrib in artifact.debian.items():
|
|
44
|
-
content["debian"][key] = attrib.get_value()
|
|
45
|
-
|
|
46
|
-
def apply_deps(self, task, deps):
|
|
47
|
-
lowerdirs = []
|
|
48
|
-
for _, artifact in deps.items():
|
|
49
|
-
lowerdirs += [
|
|
50
|
-
fs.path.join(artifact.path, item)
|
|
51
|
-
for item in artifact.debian.chroot.items()
|
|
52
|
-
]
|
|
53
|
-
if lowerdirs:
|
|
54
|
-
task.__chroot = task.tools.builddir("chroot")
|
|
55
|
-
with task.tools.cwd(task.__chroot):
|
|
56
|
-
task.tools.mkdir("work")
|
|
57
|
-
task.tools.mkdir("uppr")
|
|
58
|
-
task.tools.mkdir("root")
|
|
59
|
-
task.tools.run("fuse-overlayfs -o lowerdir={},upperdir=uppr,workdir=work root",
|
|
60
|
-
":".join(lowerdirs))
|
|
61
|
-
task.__unshare = contextlib.ExitStack()
|
|
62
|
-
task.__unshare.enter_context(
|
|
63
|
-
task.tools.chroot(chroot=fs.path.join(task.__chroot, "root")))
|
|
64
|
-
|
|
65
|
-
def unapply_deps(self, task, deps):
|
|
66
|
-
try:
|
|
67
|
-
task.__unshare.close()
|
|
68
|
-
with task.tools.cwd(task.__chroot):
|
|
69
|
-
task.tools.run("fusermount -u root")
|
|
70
|
-
except Exception:
|
|
71
|
-
pass
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
class Debian(Task):
|
|
75
|
-
abstract = False
|
|
76
|
-
|
|
77
|
-
packages = []
|
|
78
|
-
""" List of packages to install, in addition to those included by variant. """
|
|
79
|
-
|
|
80
|
-
mode = "unshare"
|
|
81
|
-
"""
|
|
82
|
-
Mode of operation when creating Debian chroot.
|
|
83
|
-
|
|
84
|
-
Valid modes are:
|
|
85
|
-
|
|
86
|
-
- fakeroot
|
|
87
|
-
- proot
|
|
88
|
-
- unshare
|
|
89
|
-
|
|
90
|
-
The default mode is fakeroot. See mmdebstrap documentation
|
|
91
|
-
for details. Note that Jolt does not permit any mode that requires
|
|
92
|
-
root privileges.
|
|
93
|
-
"""
|
|
94
|
-
|
|
95
|
-
mirrors = []
|
|
96
|
-
""" List of mirrors """
|
|
97
|
-
|
|
98
|
-
suite = "bullseye"
|
|
99
|
-
"""
|
|
100
|
-
Debian release codename.
|
|
101
|
-
|
|
102
|
-
The suite may be a valid release code name (eg, sid, stretch, jessie)
|
|
103
|
-
or a symbolic name (eg, unstable, testing, stable, oldstable).
|
|
104
|
-
Any suite name that works with apt on the given mirror will work.
|
|
105
|
-
"""
|
|
106
|
-
|
|
107
|
-
target = "rootfs.tar"
|
|
108
|
-
""" Target """
|
|
109
|
-
|
|
110
|
-
variant = "extract"
|
|
111
|
-
"""
|
|
112
|
-
Choose which package set to install.
|
|
113
|
-
|
|
114
|
-
Valid variant names are:
|
|
115
|
-
- extract
|
|
116
|
-
- custom
|
|
117
|
-
- essential
|
|
118
|
-
- apt
|
|
119
|
-
- required
|
|
120
|
-
- minbase
|
|
121
|
-
- buildd
|
|
122
|
-
- important
|
|
123
|
-
- debootstrap
|
|
124
|
-
- standard
|
|
125
|
-
|
|
126
|
-
The default variant is extract where only packages listed in ``packages``
|
|
127
|
-
are downloaded and extracted, but not installed.
|
|
128
|
-
|
|
129
|
-
See mmdebstrab documentation for details.
|
|
130
|
-
"""
|
|
131
|
-
|
|
132
|
-
def run(self, deps, tools):
|
|
133
|
-
with tools.cwd(tools.builddir()):
|
|
134
|
-
packages = "--include={}".format(",".join(self.packages)) if self.packages else ""
|
|
135
|
-
tools.run(
|
|
136
|
-
"mmdebstrap {} --mode={mode} --variant={variant} {suite} {target}",
|
|
137
|
-
packages,
|
|
138
|
-
)
|
|
139
|
-
|
|
140
|
-
def publish(self, artifact, tools):
|
|
141
|
-
with tools.cwd(tools.builddir()):
|
|
142
|
-
artifact.collect("*", symlinks=True)
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
class DebianPkgBase(Debian):
|
|
146
|
-
abstract = True
|
|
147
|
-
|
|
148
|
-
include = ["."]
|
|
149
|
-
exclude = []
|
|
150
|
-
|
|
151
|
-
def run(self, deps, tools):
|
|
152
|
-
super().run(deps, tools)
|
|
153
|
-
with tools.cwd(tools.builddir()):
|
|
154
|
-
include = " ".join(self.include)
|
|
155
|
-
exclude = " ".join(["--exclude=" + i for i in self.exclude])
|
|
156
|
-
tools.run("tar --exclude=./dev {} -xf {target} {}", exclude, include)
|
|
157
|
-
tools.unlink(self.target)
|
|
158
|
-
|
|
159
|
-
def publish(self, artifact, tools):
|
|
160
|
-
super().publish(artifact, tools)
|
|
161
|
-
|
|
162
|
-
with tools.cwd(artifact.path):
|
|
163
|
-
for bindir in ["bin", "sbin", "usr/bin", "usr/sbin"]:
|
|
164
|
-
if os.path.exists(tools.expand_path(bindir)):
|
|
165
|
-
artifact.environ.PATH.append(bindir)
|
|
166
|
-
|
|
167
|
-
for incdir in ["usr/include"]:
|
|
168
|
-
if os.path.exists(tools.expand_path(incdir)):
|
|
169
|
-
pass # artifact.cxxinfo.incpaths.append(incdir)
|
|
170
|
-
|
|
171
|
-
for libdir in ["lib", "usr/lib"]:
|
|
172
|
-
if os.path.exists(tools.expand_path(libdir)):
|
|
173
|
-
pass # artifact.cxxinfo.libpaths.append(libdir)
|
|
174
|
-
artifact.environ.LD_LIBRARY_PATH.append(libdir)
|
|
175
|
-
|
|
176
|
-
for pkgdir in ["usr/share/pkgconfig"]:
|
|
177
|
-
if os.path.exists(tools.expand_path(pkgdir)):
|
|
178
|
-
artifact.environ.PKG_CONFIG_PATH.append(pkgdir)
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
@attributes.method("run", "run_{download[download,build]}")
|
|
182
|
-
class MMDebstrap(DebianPkgBase):
|
|
183
|
-
"""
|
|
184
|
-
Provides the tools required to build Debian tools and filesystems.
|
|
185
|
-
"""
|
|
186
|
-
|
|
187
|
-
name = "debian/mmdebstrap"
|
|
188
|
-
packages = [
|
|
189
|
-
"bash",
|
|
190
|
-
"bubblewrap",
|
|
191
|
-
"coreutils",
|
|
192
|
-
"dash",
|
|
193
|
-
"fakechroot",
|
|
194
|
-
"fakeroot",
|
|
195
|
-
"fuse-overlayfs",
|
|
196
|
-
"mmdebstrap",
|
|
197
|
-
"proot",
|
|
198
|
-
"qemu-user",
|
|
199
|
-
"util-linux",
|
|
200
|
-
]
|
|
201
|
-
mode = "unshare"
|
|
202
|
-
suite = "bullseye"
|
|
203
|
-
variant = "essential"
|
|
204
|
-
|
|
205
|
-
download = BooleanParameter(True, help="Download files from Github, or build from scratch.")
|
|
206
|
-
url = "https://github.com/srand/jolt/releases/download/v0.9.35/mmdebstrap.tgz"
|
|
207
|
-
|
|
208
|
-
@property
|
|
209
|
-
def joltdir(self):
|
|
210
|
-
return loader.JoltLoader.get().joltdir
|
|
211
|
-
|
|
212
|
-
def run_build(self, deps, tools):
|
|
213
|
-
super().run(deps, tools)
|
|
214
|
-
|
|
215
|
-
def run_download(self, deps, tools):
|
|
216
|
-
with tools.cwd(tools.builddir()):
|
|
217
|
-
assert tools.download(self.url, "debstrap.tgz"), "Failed to download mmdebstrap"
|
|
218
|
-
tools.extract("debstrap.tgz", ".")
|
|
219
|
-
tools.unlink("debstrap.tgz")
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
TaskRegistry.get().add_task_class(MMDebstrap)
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
class DebianPkg(DebianPkgBase):
|
|
226
|
-
abstract = True
|
|
227
|
-
requires = ["debian/mmdebstrap"]
|
|
228
|
-
|
|
229
|
-
def publish(self, artifact, tools):
|
|
230
|
-
super().publish(artifact, tools)
|
|
231
|
-
artifact.debian.chroot.append(".")
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
class DebianEssential(DebianPkg):
|
|
235
|
-
name = "debian/essential"
|
|
236
|
-
variant = "essential"
|
|
237
|
-
|
|
238
|
-
@property
|
|
239
|
-
def joltdir(self):
|
|
240
|
-
return loader.JoltLoader.get().joltdir
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
TaskRegistry.get().add_task_class(DebianEssential)
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
def _host():
|
|
247
|
-
m = platform.machine()
|
|
248
|
-
if m == "x86_64":
|
|
249
|
-
return "amd64"
|
|
250
|
-
return m
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
@attributes.attribute("packages", "packages_{host}_{arch}")
|
|
254
|
-
@attributes.method("publish", "publish_{host}_{arch}")
|
|
255
|
-
class GCC(DebianPkg):
|
|
256
|
-
name = "debian/gcc"
|
|
257
|
-
|
|
258
|
-
host = Parameter(_host(), values=["amd64"], const=True)
|
|
259
|
-
arch = Parameter(_host(), values=["amd64", "armel", "armhf", "arm64"], help="Target architecture.")
|
|
260
|
-
|
|
261
|
-
packages_amd64_amd64 = ["gcc", "g++"]
|
|
262
|
-
packages_amd64_armhf = ["crossbuild-essential-armhf"]
|
|
263
|
-
packages_amd64_armel = ["crossbuild-essential-armel"]
|
|
264
|
-
packages_amd64_arm64 = ["crossbuild-essential-arm64"]
|
|
265
|
-
|
|
266
|
-
@property
|
|
267
|
-
def joltdir(self):
|
|
268
|
-
return loader.JoltLoader.get().joltdir
|
|
269
|
-
|
|
270
|
-
def publish_amd64_amd64(self, artifact, tools):
|
|
271
|
-
super().publish(artifact, tools)
|
|
272
|
-
artifact.environ.AR = "ar"
|
|
273
|
-
artifact.environ.CC = "gcc"
|
|
274
|
-
artifact.environ.CONFIGURE_FLAGS = ""
|
|
275
|
-
artifact.environ.CPP = "cpp"
|
|
276
|
-
artifact.environ.CROSS_COMPILE = ""
|
|
277
|
-
artifact.environ.CXX = "g++"
|
|
278
|
-
artifact.environ.LD = "ld"
|
|
279
|
-
artifact.environ.OBJCOPY = "objcopy"
|
|
280
|
-
artifact.environ.OBJDUMP = "objdump"
|
|
281
|
-
artifact.environ.PKG_CONFIG = "pkg-config"
|
|
282
|
-
artifact.environ.RANLIB = "ranlib"
|
|
283
|
-
artifact.environ.STRIP = "strip"
|
|
284
|
-
artifact.environ.TARGET_PREFIX = ""
|
|
285
|
-
|
|
286
|
-
def publish_amd64_armel(self, artifact, tools):
|
|
287
|
-
super().publish(artifact, tools)
|
|
288
|
-
artifact.environ.AR = "arm-linux-gnueabi-ar"
|
|
289
|
-
artifact.environ.CC = "arm-linux-gnueabi-gcc"
|
|
290
|
-
artifact.environ.CONFIGURE_FLAGS = "--target arm-linux-gnueabi --host arm-linux-gnueabi --build x86_64-linux-gnu"
|
|
291
|
-
artifact.environ.CPP = "arm-linux-gnueabi-cpp"
|
|
292
|
-
artifact.environ.CROSS_COMPILE = "arm-linux-gnueabi-"
|
|
293
|
-
artifact.environ.CXX = "arm-linux-gnueabi-g++"
|
|
294
|
-
artifact.environ.LD = "arm-linux-gnueabi-ld"
|
|
295
|
-
artifact.environ.NM = "arm-linux-gnueabi-nm"
|
|
296
|
-
artifact.environ.OBJCOPY = "arm-linux-gnueabi-objcopy"
|
|
297
|
-
artifact.environ.OBJDUMP = "arm-linux-gnueabi-objdump"
|
|
298
|
-
artifact.environ.PKG_CONFIG = "arm-linux-gnueabi-pkg-config"
|
|
299
|
-
artifact.environ.RANLIB = "arm-linux-gnueabi-ranlib"
|
|
300
|
-
artifact.environ.STRIP = "arm-linux-gnueabi-strip"
|
|
301
|
-
artifact.environ.TARGET_PREFIX = "arm-linux-gnueabi-"
|
|
302
|
-
|
|
303
|
-
def publish_amd64_armhf(self, artifact, tools):
|
|
304
|
-
super().publish(artifact, tools)
|
|
305
|
-
artifact.environ.AR = "arm-linux-gnueabihf-ar"
|
|
306
|
-
artifact.environ.CC = "arm-linux-gnueabihf-gcc"
|
|
307
|
-
artifact.environ.CONFIGURE_FLAGS = "--target arm-linux-gnueabihf --host arm-linux-gnueabihf --build x86_64-linux-gnu"
|
|
308
|
-
artifact.environ.CPP = "arm-linux-gnueabihf-cpp"
|
|
309
|
-
artifact.environ.CROSS_COMPILE = "arm-linux-gnueabihf-"
|
|
310
|
-
artifact.environ.CXX = "arm-linux-gnueabihf-g++"
|
|
311
|
-
artifact.environ.LD = "arm-linux-gnueabihf-ld"
|
|
312
|
-
artifact.environ.NM = "arm-linux-gnueabihf-nm"
|
|
313
|
-
artifact.environ.OBJCOPY = "arm-linux-gnueabihf-objcopy"
|
|
314
|
-
artifact.environ.OBJDUMP = "arm-linux-gnueabihf-objdump"
|
|
315
|
-
artifact.environ.PKG_CONFIG = "arm-linux-gnueabihf-pkg-config"
|
|
316
|
-
artifact.environ.RANLIB = "arm-linux-gnueabihf-ranlib"
|
|
317
|
-
artifact.environ.STRIP = "arm-linux-gnueabihf-strip"
|
|
318
|
-
artifact.environ.TARGET_PREFIX = "arm-linux-gnueabihf-"
|
|
319
|
-
|
|
320
|
-
def publish_amd64_arm64(self, artifact, tools):
|
|
321
|
-
super().publish(artifact, tools)
|
|
322
|
-
artifact.environ.AR = "aarch64-linux-gnu-ar"
|
|
323
|
-
artifact.environ.CC = "aarch64-linux-gnu-gcc"
|
|
324
|
-
artifact.environ.CONFIGURE_FLAGS = "--target aarch64-linux-gnu --host aarch64-linux-gnu --build x86_64-linux-gnu"
|
|
325
|
-
artifact.environ.CPP = "aarch64-linux-gnu-cpp"
|
|
326
|
-
artifact.environ.CROSS_COMPILE = "aarch64-linux-gnu-"
|
|
327
|
-
artifact.environ.CXX = "aarch64-linux-gnu-g++"
|
|
328
|
-
artifact.environ.LD = "aarch64-linux-gnu-ld"
|
|
329
|
-
artifact.environ.NM = "aarch64-linux-gnu-nm"
|
|
330
|
-
artifact.environ.OBJCOPY = "aarch64-linux-gnu-objcopy"
|
|
331
|
-
artifact.environ.OBJDUMP = "aarch64-linux-gnu-objdump"
|
|
332
|
-
artifact.environ.PKG_CONFIG = "aarch64-linux-gnu-pkg-config"
|
|
333
|
-
artifact.environ.RANLIB = "aarch64-linux-gnu-ranlib"
|
|
334
|
-
artifact.environ.STRIP = "aarch64-linux-gnu-strip"
|
|
335
|
-
artifact.environ.TARGET_PREFIX = "aarch64-linux-gnu-"
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
TaskRegistry.get().add_task_class(GCC)
|
jolt/plugins/ftp.py
DELETED
|
@@ -1,181 +0,0 @@
|
|
|
1
|
-
import keyring
|
|
2
|
-
import getpass
|
|
3
|
-
from ftplib import FTP, FTP_TLS
|
|
4
|
-
from requests.exceptions import RequestException
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
from jolt import utils
|
|
8
|
-
from jolt import cache
|
|
9
|
-
from jolt import log
|
|
10
|
-
from jolt import config
|
|
11
|
-
from jolt import filesystem as fs
|
|
12
|
-
from jolt.tools import Tools
|
|
13
|
-
from jolt.error import raise_error_if
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
NAME = "ftp"
|
|
17
|
-
CONNECT_TIMEOUT = 3.5
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
def catch(func, *args, **kwargs):
|
|
21
|
-
try:
|
|
22
|
-
val = func(*args, **kwargs)
|
|
23
|
-
return val if val is not None else True
|
|
24
|
-
except Exception:
|
|
25
|
-
log.exception()
|
|
26
|
-
return False
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
class FtpStorage(cache.StorageProvider):
|
|
30
|
-
def __init__(self, cache):
|
|
31
|
-
super(FtpStorage, self).__init__()
|
|
32
|
-
self._cache = cache
|
|
33
|
-
self._uri = config.get(NAME, "host")
|
|
34
|
-
raise_error_if(not self._uri, "ftp URI not configured")
|
|
35
|
-
self._path = config.get(NAME, "path", "")
|
|
36
|
-
self._upload = config.getboolean(NAME, "upload", True)
|
|
37
|
-
self._download = config.getboolean(NAME, "download", True)
|
|
38
|
-
self._tls = config.getboolean(NAME, "tls", False)
|
|
39
|
-
self._disabled = False
|
|
40
|
-
|
|
41
|
-
def _get_auth(self):
|
|
42
|
-
service = config.get(NAME, "keyring.service")
|
|
43
|
-
if not service:
|
|
44
|
-
return None, None
|
|
45
|
-
|
|
46
|
-
username = config.get(NAME, "keyring.username")
|
|
47
|
-
if not username:
|
|
48
|
-
username = input(NAME + " username: ")
|
|
49
|
-
raise_error_if(not username, "no username configured for " + NAME)
|
|
50
|
-
config.set(NAME, "keyring.username", username)
|
|
51
|
-
config.save()
|
|
52
|
-
|
|
53
|
-
password = config.get(NAME, "keyring.password") or keyring.get_password(NAME, username)
|
|
54
|
-
if not password:
|
|
55
|
-
password = getpass.getpass(NAME + " password: ")
|
|
56
|
-
raise_error_if(not password, "no password in keyring for " + NAME)
|
|
57
|
-
keyring.set_password(service, username, password)
|
|
58
|
-
return username, password
|
|
59
|
-
|
|
60
|
-
def _get_ftp(self):
|
|
61
|
-
try:
|
|
62
|
-
username, password = self._get_auth()
|
|
63
|
-
if self._tls:
|
|
64
|
-
ftp = FTP_TLS(self._uri, timeout=CONNECT_TIMEOUT)
|
|
65
|
-
else:
|
|
66
|
-
ftp = FTP(self._uri, timeout=CONNECT_TIMEOUT)
|
|
67
|
-
ftp.login(username, password)
|
|
68
|
-
if self._tls:
|
|
69
|
-
ftp.prot_d()
|
|
70
|
-
if not catch(ftp.cwd, self._path):
|
|
71
|
-
if self._path.startswith("/"):
|
|
72
|
-
ftp.cwd("/")
|
|
73
|
-
components = self._path.split("/")
|
|
74
|
-
for component in components:
|
|
75
|
-
if not catch(ftp.cwd, component):
|
|
76
|
-
ftp.mkd(component)
|
|
77
|
-
ftp.cwd(component)
|
|
78
|
-
return ftp
|
|
79
|
-
except Exception:
|
|
80
|
-
log.exception()
|
|
81
|
-
log.warning("[FTP] failed to establish server connection, disabled")
|
|
82
|
-
self._disabled = True
|
|
83
|
-
return None
|
|
84
|
-
|
|
85
|
-
@utils.retried.on_exception((RequestException))
|
|
86
|
-
def download(self, node, force=False):
|
|
87
|
-
if self._disabled:
|
|
88
|
-
return False
|
|
89
|
-
if not self._download and not force:
|
|
90
|
-
return False
|
|
91
|
-
with self._cache.get_artifact(node) as artifact:
|
|
92
|
-
ftp = self._get_ftp()
|
|
93
|
-
if ftp is None:
|
|
94
|
-
return False
|
|
95
|
-
pathname = artifact.get_archive_path()
|
|
96
|
-
name = fs.path.basename(pathname)
|
|
97
|
-
try:
|
|
98
|
-
ftp.cwd(node.canonical_name)
|
|
99
|
-
size = ftp.size(name)
|
|
100
|
-
except Exception:
|
|
101
|
-
return False
|
|
102
|
-
with log.progress("Downloading {0}".format(name), size, "B") as pbar:
|
|
103
|
-
with open(pathname, 'wb') as out_file:
|
|
104
|
-
def _write(block):
|
|
105
|
-
out_file.write(block)
|
|
106
|
-
pbar.update(len(block))
|
|
107
|
-
return catch(ftp.retrbinary,
|
|
108
|
-
"RETR {filename}".format(filename=name),
|
|
109
|
-
callback=_write)
|
|
110
|
-
return False
|
|
111
|
-
|
|
112
|
-
def download_enabled(self):
|
|
113
|
-
return not self._disabled and self._download
|
|
114
|
-
|
|
115
|
-
@utils.retried.on_exception((RequestException))
|
|
116
|
-
def upload(self, node, force=False):
|
|
117
|
-
if self._disabled:
|
|
118
|
-
return True
|
|
119
|
-
if not self._upload and not force:
|
|
120
|
-
return True
|
|
121
|
-
with self._cache.get_artifact(node) as artifact:
|
|
122
|
-
ftp = self._get_ftp()
|
|
123
|
-
if ftp is None:
|
|
124
|
-
return False
|
|
125
|
-
pathname = artifact.get_archive_path()
|
|
126
|
-
name = fs.path.basename(pathname)
|
|
127
|
-
size = Tools().file_size(pathname)
|
|
128
|
-
with log.progress("Uploading {0}".format(name), size, "B") as pbar:
|
|
129
|
-
with open(pathname, 'rb') as in_file:
|
|
130
|
-
if not catch(ftp.cwd, node.canonical_name):
|
|
131
|
-
if not catch(ftp.mkd, node.canonical_name):
|
|
132
|
-
return False
|
|
133
|
-
if not catch(ftp.cwd, node.canonical_name):
|
|
134
|
-
return False
|
|
135
|
-
|
|
136
|
-
catch(ftp.delete, name)
|
|
137
|
-
|
|
138
|
-
return catch(ftp.storbinary,
|
|
139
|
-
"STOR {filename}".format(filename=name),
|
|
140
|
-
in_file,
|
|
141
|
-
callback=lambda b: pbar.update(len(b)))
|
|
142
|
-
return False
|
|
143
|
-
|
|
144
|
-
def upload_enabled(self):
|
|
145
|
-
return not self._disabled and self._upload
|
|
146
|
-
|
|
147
|
-
@utils.retried.on_exception((RequestException))
|
|
148
|
-
def location(self, node):
|
|
149
|
-
if self._disabled:
|
|
150
|
-
return False
|
|
151
|
-
with self._cache.get_artifact(node) as artifact:
|
|
152
|
-
ftp = self._get_ftp()
|
|
153
|
-
if ftp is None:
|
|
154
|
-
return False
|
|
155
|
-
username, _ = self._get_auth()
|
|
156
|
-
username = username + "@" if username is not None else ""
|
|
157
|
-
pathname = artifact.get_archive_path()
|
|
158
|
-
name = fs.path.basename(pathname)
|
|
159
|
-
if not catch(ftp.cwd, node.canonical_name):
|
|
160
|
-
return False
|
|
161
|
-
try:
|
|
162
|
-
if ftp.size(name) is not None:
|
|
163
|
-
url = "ftp://{user}{uri}/{path}/{taskname}/{archive}".format(
|
|
164
|
-
user=username,
|
|
165
|
-
uri=self._uri,
|
|
166
|
-
path=self._path,
|
|
167
|
-
taskname=node.canonical_name,
|
|
168
|
-
archive=name)
|
|
169
|
-
log.debug("[FTP] {0}", url)
|
|
170
|
-
return url
|
|
171
|
-
except Exception:
|
|
172
|
-
return False
|
|
173
|
-
return False
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
@cache.RegisterStorage
|
|
177
|
-
class FtpStorageFactory(cache.StorageProviderFactory):
|
|
178
|
-
@staticmethod
|
|
179
|
-
def create(cache):
|
|
180
|
-
log.verbose("[Ftp] Loaded")
|
|
181
|
-
return FtpStorage(cache)
|