mediasoup 3.20.1 → 3.20.2
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.
- package/node/lib/DataConsumer.d.ts +2 -3
- package/node/lib/DataConsumer.d.ts.map +1 -1
- package/node/lib/DataConsumer.js +8 -6
- package/node/lib/DataConsumerTypes.d.ts +5 -4
- package/node/lib/DataConsumerTypes.d.ts.map +1 -1
- package/node/lib/fbs/data-consumer/send-response.d.ts +21 -0
- package/node/lib/fbs/data-consumer/send-response.d.ts.map +1 -0
- package/node/lib/fbs/data-consumer/send-response.js +91 -0
- package/node/lib/fbs/data-consumer.d.ts +1 -0
- package/node/lib/fbs/data-consumer.d.ts.map +1 -1
- package/node/lib/fbs/data-consumer.js +4 -1
- package/node/lib/fbs/response/body.d.ts +7 -5
- package/node/lib/fbs/response/body.d.ts.map +1 -1
- package/node/lib/fbs/response/body.js +7 -3
- package/node/lib/fbs/response/response.d.ts +3 -2
- package/node/lib/fbs/response/response.d.ts.map +1 -1
- package/node/lib/test/test-DataConsumer.js +6 -0
- package/node/lib/test/test-werift-sctp.js +7 -0
- package/package.json +4 -4
- package/worker/Makefile +5 -1
- package/worker/fbs/dataConsumer.fbs +4 -0
- package/worker/fbs/response.fbs +1 -0
- package/worker/include/RTC/PortManager.hpp +91 -11
- package/worker/include/RTC/TcpServer.hpp +3 -2
- package/worker/include/RTC/UdpSocket.hpp +3 -2
- package/worker/meson.build +1 -0
- package/worker/src/RTC/DataConsumer.cpp +12 -2
- package/worker/src/RTC/PipeTransport.cpp +5 -4
- package/worker/src/RTC/PlainTransport.cpp +9 -8
- package/worker/src/RTC/PortManager.cpp +174 -114
- package/worker/src/RTC/SCTP/association/Association.cpp +17 -14
- package/worker/src/RTC/TcpServer.cpp +4 -4
- package/worker/src/RTC/Transport.cpp +33 -10
- package/worker/src/RTC/UdpSocket.cpp +4 -4
- package/worker/src/RTC/WebRtcServer.cpp +8 -8
- package/worker/src/RTC/WebRtcTransport.cpp +9 -8
- package/worker/tasks.py +293 -196
- package/worker/test/src/RTC/TestNackGenerator.cpp +1 -1
- package/worker/test/src/RTC/TestPortManager.cpp +126 -0
- package/worker/test/src/RTC/TestTransportTuple.cpp +3 -2
package/worker/tasks.py
CHANGED
|
@@ -1,96 +1,98 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
import inspect;
|
|
24
|
-
import shutil;
|
|
25
|
-
from contextlib import contextmanager;
|
|
26
|
-
# We import this from a custom location and pylint doesn't know.
|
|
27
|
-
from invoke import task, call; # pylint: disable=import-error
|
|
28
|
-
|
|
29
|
-
MEDIASOUP_BUILDTYPE = os.getenv('MEDIASOUP_BUILDTYPE') or 'Release';
|
|
30
|
-
WORKER_DIR = os.path.dirname(os.path.abspath(
|
|
31
|
-
inspect.getframeinfo(inspect.currentframe()).filename
|
|
32
|
-
));
|
|
1
|
+
"""
|
|
2
|
+
tasks.py for the Python `invoke` package: https://docs.pyinvoke.org/.
|
|
3
|
+
|
|
4
|
+
It's a replacement of our Makefile with same tasks.
|
|
5
|
+
|
|
6
|
+
Usage:
|
|
7
|
+
pip install invoke
|
|
8
|
+
invoke --list
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
import inspect
|
|
12
|
+
import os
|
|
13
|
+
import shutil
|
|
14
|
+
import sys
|
|
15
|
+
from contextlib import contextmanager, suppress
|
|
16
|
+
|
|
17
|
+
from invoke import call, task
|
|
18
|
+
|
|
19
|
+
MEDIASOUP_BUILDTYPE = os.getenv("MEDIASOUP_BUILDTYPE") or "Release"
|
|
20
|
+
WORKER_DIR = os.path.dirname(
|
|
21
|
+
os.path.abspath(inspect.getframeinfo(inspect.currentframe()).filename)
|
|
22
|
+
)
|
|
33
23
|
# NOTE: MEDIASOUP_OUT_DIR is overrided by build.rs.
|
|
34
|
-
MEDIASOUP_OUT_DIR = os.getenv(
|
|
35
|
-
MEDIASOUP_INSTALL_DIR =
|
|
36
|
-
|
|
24
|
+
MEDIASOUP_OUT_DIR = os.getenv("MEDIASOUP_OUT_DIR") or f"{WORKER_DIR}/out"
|
|
25
|
+
MEDIASOUP_INSTALL_DIR = (
|
|
26
|
+
os.getenv("MEDIASOUP_INSTALL_DIR") or f"{MEDIASOUP_OUT_DIR}/{MEDIASOUP_BUILDTYPE}"
|
|
27
|
+
)
|
|
28
|
+
BUILD_DIR = os.getenv("BUILD_DIR") or f"{MEDIASOUP_INSTALL_DIR}/build"
|
|
37
29
|
# Custom pip folder for invoke package.
|
|
38
30
|
# NOTE: We invoke `pip install` always with `--no-user` to make it not complain
|
|
39
31
|
# about "can not combine --user and --target".
|
|
40
|
-
PIP_INVOKE_DIR = f
|
|
32
|
+
PIP_INVOKE_DIR = f"{MEDIASOUP_OUT_DIR}/pip_invoke"
|
|
41
33
|
# Custom pip folder for meson and ninja packages.
|
|
42
|
-
PIP_MESON_NINJA_DIR = f
|
|
43
|
-
# Custom pip folder for
|
|
44
|
-
|
|
45
|
-
# supported and a latter invokation entirely replaces the bin folder.
|
|
46
|
-
PIP_PYLINT_DIR = f'{MEDIASOUP_OUT_DIR}/pip_pylint';
|
|
34
|
+
PIP_MESON_NINJA_DIR = f"{MEDIASOUP_OUT_DIR}/pip_meson_ninja"
|
|
35
|
+
# Custom pip folder for ruff package.
|
|
36
|
+
PIP_RUFF_DIR = f"{MEDIASOUP_OUT_DIR}/pip_ruff"
|
|
47
37
|
# If available (only on some *nix systems), os.sched_getaffinity(0) gets set of
|
|
48
38
|
# CPUs the calling thread is restricted to. Instead, os.cpu_count() returns the
|
|
49
39
|
# total number of CPUs in a system (it doesn't take into account how many of them
|
|
50
40
|
# the calling thread can use).
|
|
51
|
-
NUM_CORES =
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
41
|
+
NUM_CORES = (
|
|
42
|
+
len(os.sched_getaffinity(0)) if hasattr(os, "sched_getaffinity") else os.cpu_count()
|
|
43
|
+
)
|
|
44
|
+
PYTHON = os.getenv("PYTHON") or sys.executable
|
|
45
|
+
MESON = os.getenv("MESON") or f"{PIP_MESON_NINJA_DIR}/bin/meson"
|
|
46
|
+
MESON_VERSION = os.getenv("MESON_VERSION") or "1.9.1"
|
|
55
47
|
# MESON_ARGS can be used to provide extra configuration parameters to meson,
|
|
56
48
|
# such as adding defines or changing optimization options. For instance, use
|
|
57
49
|
# `MESON_ARGS="-Dms_log_trace=true -Dms_log_file_line=true" npm i` to compile
|
|
58
50
|
# worker with tracing and enabled.
|
|
59
51
|
# NOTE: On Windows make sure to add `--vsenv` or have MSVS environment already
|
|
60
52
|
# active if you override this parameter.
|
|
61
|
-
MESON_ARGS =
|
|
53
|
+
MESON_ARGS = (
|
|
54
|
+
os.getenv("MESON_ARGS")
|
|
55
|
+
if os.getenv("MESON_ARGS")
|
|
56
|
+
else "--vsenv"
|
|
57
|
+
if os.name == "nt"
|
|
58
|
+
else ""
|
|
59
|
+
)
|
|
62
60
|
# Let's use a specific version of ninja to avoid buggy version 1.11.1:
|
|
63
61
|
# https://mediasoup.discourse.group/t/partly-solved-could-not-detect-ninja-v1-8-2-or-newer/
|
|
64
62
|
# https://github.com/ninja-build/ninja/issues/2211
|
|
65
|
-
NINJA_VERSION = os.getenv(
|
|
66
|
-
|
|
67
|
-
NPM = os.getenv(
|
|
68
|
-
DOCKER = os.getenv(
|
|
63
|
+
NINJA_VERSION = os.getenv("NINJA_VERSION") or "1.10.2.4"
|
|
64
|
+
RUFF_VERSION = os.getenv("RUFF_VERSION") or "0.15.15"
|
|
65
|
+
NPM = os.getenv("NPM") or "npm"
|
|
66
|
+
DOCKER = os.getenv("DOCKER") or "docker"
|
|
69
67
|
# pty=True in ctx.run() is not available on Windows so if stdout is not a TTY
|
|
70
68
|
# let's assume PTY is not supported. Related issue in invoke project:
|
|
71
69
|
# https://github.com/pyinvoke/invoke/issues/561
|
|
72
|
-
PTY_SUPPORTED =
|
|
70
|
+
PTY_SUPPORTED = os.name != "nt" and sys.stdout.isatty()
|
|
73
71
|
# Use sh (widely supported, more than bash) if not in Windows.
|
|
74
|
-
SHELL =
|
|
72
|
+
SHELL = "/bin/sh" if os.name != "nt" else None
|
|
75
73
|
|
|
76
74
|
# Disable `*.pyc` files creation.
|
|
77
|
-
os.environ[
|
|
75
|
+
os.environ["PYTHONDONTWRITEBYTECODE"] = "true"
|
|
78
76
|
|
|
79
77
|
# Instruct meson where to look for ninja binary.
|
|
80
|
-
if os.name ==
|
|
78
|
+
if os.name == "nt":
|
|
81
79
|
# Windows is, of course, special.
|
|
82
|
-
os.environ[
|
|
80
|
+
os.environ["NINJA"] = f"{PIP_MESON_NINJA_DIR}/bin/ninja.exe"
|
|
83
81
|
else:
|
|
84
|
-
os.environ[
|
|
82
|
+
os.environ["NINJA"] = f"{PIP_MESON_NINJA_DIR}/bin/ninja"
|
|
85
83
|
|
|
86
84
|
# Instruct Python where to look for modules it needs, such that meson actually
|
|
87
85
|
# runs from installed location.
|
|
88
|
-
# NOTE: On Windows we must use ; instead of : to separate paths.
|
|
89
|
-
PYTHONPATH = os.getenv(
|
|
90
|
-
if os.name ==
|
|
91
|
-
os.environ[
|
|
86
|
+
# NOTE: On Windows we must use ";" instead of ":"" to separate paths.
|
|
87
|
+
PYTHONPATH = os.getenv("PYTHONPATH") or ""
|
|
88
|
+
if os.name == "nt":
|
|
89
|
+
os.environ["PYTHONPATH"] = (
|
|
90
|
+
f"{PIP_INVOKE_DIR};{PIP_MESON_NINJA_DIR};{PIP_RUFF_DIR};{PYTHONPATH}"
|
|
91
|
+
)
|
|
92
92
|
else:
|
|
93
|
-
os.environ[
|
|
93
|
+
os.environ["PYTHONPATH"] = (
|
|
94
|
+
f"{PIP_INVOKE_DIR}:{PIP_MESON_NINJA_DIR}:{PIP_RUFF_DIR}:{PYTHONPATH}"
|
|
95
|
+
)
|
|
94
96
|
|
|
95
97
|
|
|
96
98
|
@contextmanager
|
|
@@ -98,6 +100,7 @@ def cd_worker():
|
|
|
98
100
|
"""
|
|
99
101
|
Context manager to change to worker/ folder the safe way
|
|
100
102
|
"""
|
|
103
|
+
|
|
101
104
|
original_dir = os.getcwd()
|
|
102
105
|
os.chdir(WORKER_DIR)
|
|
103
106
|
try:
|
|
@@ -105,13 +108,15 @@ def cd_worker():
|
|
|
105
108
|
finally:
|
|
106
109
|
os.chdir(original_dir)
|
|
107
110
|
|
|
111
|
+
|
|
108
112
|
@task
|
|
109
113
|
def meson_ninja(ctx):
|
|
110
114
|
"""
|
|
111
115
|
Install meson and ninja (also update Python pip and setuptools packages)
|
|
112
116
|
"""
|
|
117
|
+
|
|
113
118
|
if os.path.isfile(MESON):
|
|
114
|
-
return
|
|
119
|
+
return
|
|
115
120
|
|
|
116
121
|
# Updated pip and setuptools are needed for meson.
|
|
117
122
|
# `--system` is not present everywhere and is only needed as workaround for
|
|
@@ -122,19 +127,23 @@ def meson_ninja(ctx):
|
|
|
122
127
|
f'"{PYTHON}" -m pip install --system --upgrade --no-user --target "{PIP_MESON_NINJA_DIR}" pip setuptools',
|
|
123
128
|
echo=True,
|
|
124
129
|
hide=True,
|
|
125
|
-
shell=SHELL
|
|
126
|
-
)
|
|
127
|
-
except:
|
|
130
|
+
shell=SHELL,
|
|
131
|
+
)
|
|
132
|
+
except Exception:
|
|
128
133
|
ctx.run(
|
|
129
134
|
f'"{PYTHON}" -m pip install --upgrade --no-user --target "{PIP_MESON_NINJA_DIR}" pip setuptools',
|
|
130
135
|
echo=True,
|
|
131
136
|
pty=PTY_SUPPORTED,
|
|
132
|
-
shell=SHELL
|
|
133
|
-
)
|
|
137
|
+
shell=SHELL,
|
|
138
|
+
)
|
|
134
139
|
|
|
135
140
|
# Workaround for NixOS and Guix that don't work with pre-built binaries, see:
|
|
136
141
|
# https://github.com/NixOS/nixpkgs/issues/142383.
|
|
137
|
-
pip_build_binaries =
|
|
142
|
+
pip_build_binaries = (
|
|
143
|
+
"--no-binary :all:"
|
|
144
|
+
if os.path.isfile("/etc/NIXOS") or os.path.isdir("/etc/guix")
|
|
145
|
+
else ""
|
|
146
|
+
)
|
|
138
147
|
|
|
139
148
|
# Install meson and ninja using pip into our custom location, so we don't
|
|
140
149
|
# depend on system-wide installation.
|
|
@@ -142,8 +151,8 @@ def meson_ninja(ctx):
|
|
|
142
151
|
f'"{PYTHON}" -m pip install --upgrade --no-user --target "{PIP_MESON_NINJA_DIR}" {pip_build_binaries} meson=={MESON_VERSION} ninja=={NINJA_VERSION}',
|
|
143
152
|
echo=True,
|
|
144
153
|
pty=PTY_SUPPORTED,
|
|
145
|
-
shell=SHELL
|
|
146
|
-
)
|
|
154
|
+
shell=SHELL,
|
|
155
|
+
)
|
|
147
156
|
|
|
148
157
|
|
|
149
158
|
@task(pre=[meson_ninja])
|
|
@@ -151,55 +160,59 @@ def setup(ctx, meson_args=MESON_ARGS):
|
|
|
151
160
|
"""
|
|
152
161
|
Run meson setup
|
|
153
162
|
"""
|
|
154
|
-
|
|
163
|
+
|
|
164
|
+
if MEDIASOUP_BUILDTYPE == "Release":
|
|
155
165
|
with cd_worker():
|
|
156
166
|
ctx.run(
|
|
157
167
|
f'"{MESON}" setup --prefix "{MEDIASOUP_INSTALL_DIR}" --bindir "" --libdir "" --buildtype release -Db_ndebug=true {meson_args} "{BUILD_DIR}"',
|
|
158
168
|
echo=True,
|
|
159
169
|
pty=PTY_SUPPORTED,
|
|
160
|
-
shell=SHELL
|
|
161
|
-
)
|
|
162
|
-
elif MEDIASOUP_BUILDTYPE ==
|
|
170
|
+
shell=SHELL,
|
|
171
|
+
)
|
|
172
|
+
elif MEDIASOUP_BUILDTYPE == "Debug":
|
|
163
173
|
with cd_worker():
|
|
164
174
|
ctx.run(
|
|
165
175
|
f'"{MESON}" setup --prefix "{MEDIASOUP_INSTALL_DIR}" --bindir "" --libdir "" --buildtype debug {meson_args} "{BUILD_DIR}"',
|
|
166
176
|
echo=True,
|
|
167
177
|
pty=PTY_SUPPORTED,
|
|
168
|
-
shell=SHELL
|
|
169
|
-
)
|
|
178
|
+
shell=SHELL,
|
|
179
|
+
)
|
|
170
180
|
else:
|
|
171
181
|
with cd_worker():
|
|
172
182
|
ctx.run(
|
|
173
183
|
f'"{MESON}" setup --prefix "{MEDIASOUP_INSTALL_DIR}" --bindir "" --libdir "" --buildtype {MEDIASOUP_BUILDTYPE} -Db_ndebug=if-release {meson_args} "{BUILD_DIR}"',
|
|
174
184
|
echo=True,
|
|
175
185
|
pty=PTY_SUPPORTED,
|
|
176
|
-
shell=SHELL
|
|
177
|
-
)
|
|
186
|
+
shell=SHELL,
|
|
187
|
+
)
|
|
178
188
|
|
|
179
189
|
|
|
180
190
|
@task
|
|
181
|
-
def clean(ctx):
|
|
191
|
+
def clean(ctx):
|
|
182
192
|
"""
|
|
183
193
|
Clean the installation directory
|
|
184
194
|
"""
|
|
185
|
-
|
|
195
|
+
|
|
196
|
+
shutil.rmtree(MEDIASOUP_INSTALL_DIR, ignore_errors=True)
|
|
186
197
|
|
|
187
198
|
|
|
188
199
|
@task
|
|
189
|
-
def clean_build(ctx):
|
|
200
|
+
def clean_build(ctx):
|
|
190
201
|
"""
|
|
191
202
|
Clean the build directory
|
|
192
203
|
"""
|
|
193
|
-
|
|
204
|
+
|
|
205
|
+
shutil.rmtree(BUILD_DIR, ignore_errors=True)
|
|
194
206
|
|
|
195
207
|
|
|
196
208
|
@task
|
|
197
|
-
def clean_pip(ctx):
|
|
209
|
+
def clean_pip(ctx):
|
|
198
210
|
"""
|
|
199
211
|
Clean the local pip setup
|
|
200
212
|
"""
|
|
201
|
-
|
|
202
|
-
shutil.rmtree(
|
|
213
|
+
|
|
214
|
+
shutil.rmtree(PIP_MESON_NINJA_DIR, ignore_errors=True)
|
|
215
|
+
shutil.rmtree(PIP_RUFF_DIR, ignore_errors=True)
|
|
203
216
|
|
|
204
217
|
|
|
205
218
|
@task(pre=[meson_ninja])
|
|
@@ -207,13 +220,14 @@ def clean_subprojects(ctx):
|
|
|
207
220
|
"""
|
|
208
221
|
Clean meson subprojects
|
|
209
222
|
"""
|
|
223
|
+
|
|
210
224
|
with cd_worker():
|
|
211
225
|
ctx.run(
|
|
212
226
|
f'"{MESON}" subprojects purge --include-cache --confirm',
|
|
213
227
|
echo=True,
|
|
214
228
|
pty=PTY_SUPPORTED,
|
|
215
|
-
shell=SHELL
|
|
216
|
-
)
|
|
229
|
+
shell=SHELL,
|
|
230
|
+
)
|
|
217
231
|
|
|
218
232
|
|
|
219
233
|
@task
|
|
@@ -221,19 +235,28 @@ def clean_all(ctx):
|
|
|
221
235
|
"""
|
|
222
236
|
Clean meson subprojects and all installed/built artificats
|
|
223
237
|
"""
|
|
238
|
+
|
|
224
239
|
with cd_worker():
|
|
225
|
-
|
|
240
|
+
with suppress(Exception):
|
|
226
241
|
ctx.run(
|
|
227
242
|
f'"{MESON}" subprojects purge --include-cache --confirm',
|
|
228
243
|
echo=True,
|
|
229
244
|
pty=PTY_SUPPORTED,
|
|
230
|
-
shell=SHELL
|
|
231
|
-
)
|
|
232
|
-
except:
|
|
233
|
-
pass;
|
|
245
|
+
shell=SHELL,
|
|
246
|
+
)
|
|
234
247
|
|
|
235
|
-
shutil.rmtree(MEDIASOUP_OUT_DIR, ignore_errors=True)
|
|
236
|
-
shutil.rmtree(
|
|
248
|
+
shutil.rmtree(MEDIASOUP_OUT_DIR, ignore_errors=True)
|
|
249
|
+
shutil.rmtree("include/FBS", ignore_errors=True)
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
@task(pre=[meson_ninja])
|
|
253
|
+
def check_wrap_status(ctx):
|
|
254
|
+
"""
|
|
255
|
+
Check status of subprojects
|
|
256
|
+
"""
|
|
257
|
+
|
|
258
|
+
with cd_worker():
|
|
259
|
+
ctx.run(f'"{MESON}" wrap status', echo=True, pty=PTY_SUPPORTED, shell=SHELL)
|
|
237
260
|
|
|
238
261
|
|
|
239
262
|
@task(pre=[meson_ninja])
|
|
@@ -241,13 +264,14 @@ def update_wrap_file(ctx, subproject):
|
|
|
241
264
|
"""
|
|
242
265
|
Update the wrap file of a subproject
|
|
243
266
|
"""
|
|
267
|
+
|
|
244
268
|
with cd_worker():
|
|
245
269
|
ctx.run(
|
|
246
270
|
f'"{MESON}" subprojects update --reset {subproject}',
|
|
247
271
|
echo=True,
|
|
248
272
|
pty=PTY_SUPPORTED,
|
|
249
|
-
shell=SHELL
|
|
250
|
-
)
|
|
273
|
+
shell=SHELL,
|
|
274
|
+
)
|
|
251
275
|
|
|
252
276
|
|
|
253
277
|
@task(pre=[setup])
|
|
@@ -255,13 +279,14 @@ def flatc(ctx):
|
|
|
255
279
|
"""
|
|
256
280
|
Compile FlatBuffers FBS files
|
|
257
281
|
"""
|
|
282
|
+
|
|
258
283
|
with cd_worker():
|
|
259
284
|
ctx.run(
|
|
260
285
|
f'"{MESON}" compile -C "{BUILD_DIR}" flatbuffers-generator',
|
|
261
286
|
echo=True,
|
|
262
287
|
pty=PTY_SUPPORTED,
|
|
263
|
-
shell=SHELL
|
|
264
|
-
)
|
|
288
|
+
shell=SHELL,
|
|
289
|
+
)
|
|
265
290
|
|
|
266
291
|
|
|
267
292
|
@task(pre=[setup, flatc], default=True)
|
|
@@ -269,24 +294,27 @@ def mediasoup_worker(ctx):
|
|
|
269
294
|
"""
|
|
270
295
|
Compile mediasoup-worker binary
|
|
271
296
|
"""
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
297
|
+
|
|
298
|
+
if os.getenv("MEDIASOUP_WORKER_BIN"):
|
|
299
|
+
print(
|
|
300
|
+
"skipping mediasoup-worker compilation due to the existence of the MEDIASOUP_WORKER_BIN environment variable"
|
|
301
|
+
)
|
|
302
|
+
return
|
|
275
303
|
|
|
276
304
|
with cd_worker():
|
|
277
305
|
ctx.run(
|
|
278
306
|
f'"{MESON}" compile -C "{BUILD_DIR}" -j {NUM_CORES} mediasoup-worker',
|
|
279
307
|
echo=True,
|
|
280
308
|
pty=PTY_SUPPORTED,
|
|
281
|
-
shell=SHELL
|
|
282
|
-
)
|
|
309
|
+
shell=SHELL,
|
|
310
|
+
)
|
|
283
311
|
with cd_worker():
|
|
284
312
|
ctx.run(
|
|
285
313
|
f'"{MESON}" install -C "{BUILD_DIR}" --no-rebuild --tags mediasoup-worker',
|
|
286
314
|
echo=True,
|
|
287
315
|
pty=PTY_SUPPORTED,
|
|
288
|
-
shell=SHELL
|
|
289
|
-
)
|
|
316
|
+
shell=SHELL,
|
|
317
|
+
)
|
|
290
318
|
|
|
291
319
|
|
|
292
320
|
@task(pre=[setup, flatc])
|
|
@@ -294,20 +322,21 @@ def libmediasoup_worker(ctx):
|
|
|
294
322
|
"""
|
|
295
323
|
Compile libmediasoup-worker library
|
|
296
324
|
"""
|
|
325
|
+
|
|
297
326
|
with cd_worker():
|
|
298
327
|
ctx.run(
|
|
299
328
|
f'"{MESON}" compile -C "{BUILD_DIR}" -j {NUM_CORES} libmediasoup-worker',
|
|
300
329
|
echo=True,
|
|
301
330
|
pty=PTY_SUPPORTED,
|
|
302
|
-
shell=SHELL
|
|
303
|
-
)
|
|
331
|
+
shell=SHELL,
|
|
332
|
+
)
|
|
304
333
|
with cd_worker():
|
|
305
334
|
ctx.run(
|
|
306
335
|
f'"{MESON}" install -C "{BUILD_DIR}" --no-rebuild --tags libmediasoup-worker',
|
|
307
336
|
echo=True,
|
|
308
337
|
pty=PTY_SUPPORTED,
|
|
309
|
-
shell=SHELL
|
|
310
|
-
)
|
|
338
|
+
shell=SHELL,
|
|
339
|
+
)
|
|
311
340
|
|
|
312
341
|
|
|
313
342
|
@task(pre=[setup, flatc])
|
|
@@ -315,142 +344,178 @@ def xcode(ctx):
|
|
|
315
344
|
"""
|
|
316
345
|
Setup Xcode project
|
|
317
346
|
"""
|
|
347
|
+
|
|
318
348
|
with cd_worker():
|
|
319
349
|
ctx.run(
|
|
320
350
|
f'"{MESON}" setup --buildtype {MEDIASOUP_BUILDTYPE.lower()} --backend xcode "{MEDIASOUP_OUT_DIR}/xcode"',
|
|
321
351
|
echo=True,
|
|
322
352
|
pty=PTY_SUPPORTED,
|
|
323
|
-
shell=SHELL
|
|
324
|
-
)
|
|
353
|
+
shell=SHELL,
|
|
354
|
+
)
|
|
355
|
+
|
|
356
|
+
|
|
357
|
+
def _install_ruff(ctx):
|
|
358
|
+
"""
|
|
359
|
+
Install ruff via pip into our custom location.
|
|
360
|
+
"""
|
|
361
|
+
|
|
362
|
+
if os.path.isdir(PIP_RUFF_DIR):
|
|
363
|
+
return
|
|
364
|
+
|
|
365
|
+
ctx.run(
|
|
366
|
+
f'"{PYTHON}" -m pip install --upgrade --no-user --target="{PIP_RUFF_DIR}" ruff=={RUFF_VERSION}',
|
|
367
|
+
echo=True,
|
|
368
|
+
pty=PTY_SUPPORTED,
|
|
369
|
+
shell=SHELL,
|
|
370
|
+
)
|
|
325
371
|
|
|
326
372
|
|
|
327
373
|
@task
|
|
328
374
|
def lint(ctx):
|
|
329
375
|
"""
|
|
330
|
-
Lint source code
|
|
376
|
+
Lint C++ and Python source code
|
|
331
377
|
"""
|
|
378
|
+
|
|
332
379
|
with cd_worker():
|
|
333
380
|
ctx.run(
|
|
334
381
|
f'"{NPM}" run lint --prefix scripts/',
|
|
335
382
|
echo=True,
|
|
336
383
|
pty=PTY_SUPPORTED,
|
|
337
|
-
shell=SHELL
|
|
338
|
-
)
|
|
384
|
+
shell=SHELL,
|
|
385
|
+
)
|
|
339
386
|
|
|
340
|
-
|
|
341
|
-
# Install pylint using pip into our custom location.
|
|
342
|
-
ctx.run(
|
|
343
|
-
f'"{PYTHON}" -m pip install --upgrade --no-user --target="{PIP_PYLINT_DIR}" pylint=={PYLINT_VERSION}',
|
|
344
|
-
echo=True,
|
|
345
|
-
pty=PTY_SUPPORTED,
|
|
346
|
-
shell=SHELL
|
|
347
|
-
);
|
|
387
|
+
_install_ruff(ctx)
|
|
348
388
|
|
|
349
389
|
with cd_worker():
|
|
390
|
+
ctx.run(f'"{PYTHON}" -m ruff check', echo=True, pty=PTY_SUPPORTED, shell=SHELL)
|
|
350
391
|
ctx.run(
|
|
351
|
-
f'"{PYTHON}" -m
|
|
392
|
+
f'"{PYTHON}" -m ruff format --check',
|
|
352
393
|
echo=True,
|
|
353
394
|
pty=PTY_SUPPORTED,
|
|
354
|
-
shell=SHELL
|
|
355
|
-
)
|
|
395
|
+
shell=SHELL,
|
|
396
|
+
)
|
|
356
397
|
|
|
357
398
|
|
|
358
399
|
@task
|
|
359
400
|
def format(ctx):
|
|
360
401
|
"""
|
|
361
|
-
Format source code according to lint rules
|
|
402
|
+
Format C++ and Python source code according to lint rules
|
|
362
403
|
"""
|
|
404
|
+
|
|
363
405
|
with cd_worker():
|
|
364
406
|
ctx.run(
|
|
365
407
|
f'"{NPM}" run format --prefix scripts/',
|
|
366
408
|
echo=True,
|
|
367
409
|
pty=PTY_SUPPORTED,
|
|
368
|
-
shell=SHELL
|
|
369
|
-
)
|
|
410
|
+
shell=SHELL,
|
|
411
|
+
)
|
|
412
|
+
|
|
413
|
+
_install_ruff(ctx)
|
|
414
|
+
|
|
415
|
+
with cd_worker():
|
|
416
|
+
ctx.run(
|
|
417
|
+
f'"{PYTHON}" -m ruff check --fix', echo=True, pty=PTY_SUPPORTED, shell=SHELL
|
|
418
|
+
)
|
|
419
|
+
ctx.run(f'"{PYTHON}" -m ruff format', echo=True, pty=PTY_SUPPORTED, shell=SHELL)
|
|
370
420
|
|
|
371
421
|
|
|
372
|
-
@task(pre=[call(setup, meson_args=MESON_ARGS +
|
|
422
|
+
@task(pre=[call(setup, meson_args=MESON_ARGS + " -Dms_build_tests=true"), flatc])
|
|
373
423
|
def tidy(ctx):
|
|
374
424
|
"""
|
|
375
425
|
Performs C++ code checks according to `worker/.clang-tidy` rules
|
|
376
426
|
"""
|
|
427
|
+
|
|
377
428
|
with cd_worker():
|
|
378
429
|
ctx.run(
|
|
379
430
|
f'"{NPM}" run tidy --prefix scripts/',
|
|
380
431
|
echo=True,
|
|
381
432
|
pty=PTY_SUPPORTED,
|
|
382
|
-
shell=SHELL
|
|
383
|
-
)
|
|
433
|
+
shell=SHELL,
|
|
434
|
+
)
|
|
384
435
|
|
|
385
436
|
|
|
386
|
-
@task(pre=[call(setup, meson_args=MESON_ARGS +
|
|
437
|
+
@task(pre=[call(setup, meson_args=MESON_ARGS + " -Dms_build_tests=true"), flatc])
|
|
387
438
|
def tidy_fix(ctx):
|
|
388
439
|
"""
|
|
389
440
|
Performs C++ code checks according to `worker/.clang-tidy` rules and applies
|
|
390
441
|
fixes
|
|
391
442
|
"""
|
|
443
|
+
|
|
392
444
|
with cd_worker():
|
|
393
445
|
ctx.run(
|
|
394
446
|
f'"{NPM}" run tidy:fix --prefix scripts/',
|
|
395
447
|
echo=True,
|
|
396
448
|
pty=PTY_SUPPORTED,
|
|
397
|
-
shell=SHELL
|
|
398
|
-
)
|
|
449
|
+
shell=SHELL,
|
|
450
|
+
)
|
|
399
451
|
|
|
400
452
|
|
|
401
|
-
@task(pre=[call(setup, meson_args=MESON_ARGS +
|
|
453
|
+
@task(pre=[call(setup, meson_args=MESON_ARGS + " -Dms_build_tests=true"), flatc])
|
|
402
454
|
def test(ctx):
|
|
403
455
|
"""
|
|
404
456
|
Run worker tests
|
|
405
457
|
"""
|
|
458
|
+
|
|
406
459
|
with cd_worker():
|
|
407
460
|
ctx.run(
|
|
408
461
|
f'"{MESON}" compile -C "{BUILD_DIR}" -j {NUM_CORES} mediasoup-worker-test',
|
|
409
462
|
echo=True,
|
|
410
463
|
pty=PTY_SUPPORTED,
|
|
411
|
-
shell=SHELL
|
|
412
|
-
)
|
|
464
|
+
shell=SHELL,
|
|
465
|
+
)
|
|
413
466
|
with cd_worker():
|
|
414
467
|
ctx.run(
|
|
415
468
|
f'"{MESON}" install -C "{BUILD_DIR}" --no-rebuild --tags mediasoup-worker-test',
|
|
416
469
|
echo=True,
|
|
417
470
|
pty=PTY_SUPPORTED,
|
|
418
|
-
shell=SHELL
|
|
419
|
-
)
|
|
471
|
+
shell=SHELL,
|
|
472
|
+
)
|
|
420
473
|
|
|
421
|
-
mediasoup_worker_test =
|
|
422
|
-
|
|
474
|
+
mediasoup_worker_test = (
|
|
475
|
+
"mediasoup-worker-test.exe" if os.name == "nt" else "mediasoup-worker-test"
|
|
476
|
+
)
|
|
477
|
+
mediasoup_test_tags = os.getenv("MEDIASOUP_TEST_TAGS") or ""
|
|
423
478
|
|
|
424
479
|
with cd_worker():
|
|
425
480
|
ctx.run(
|
|
426
481
|
f'"{BUILD_DIR}/{mediasoup_worker_test}" --invisibles --colour-mode=ansi {mediasoup_test_tags}',
|
|
427
482
|
echo=True,
|
|
428
483
|
pty=PTY_SUPPORTED,
|
|
429
|
-
shell=SHELL
|
|
430
|
-
)
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
@task(
|
|
484
|
+
shell=SHELL,
|
|
485
|
+
)
|
|
486
|
+
|
|
487
|
+
|
|
488
|
+
@task(
|
|
489
|
+
pre=[
|
|
490
|
+
call(
|
|
491
|
+
setup,
|
|
492
|
+
meson_args=MESON_ARGS
|
|
493
|
+
+ " -Dms_build_tests=true -Db_sanitize=address -Db_lundef=false",
|
|
494
|
+
),
|
|
495
|
+
flatc,
|
|
496
|
+
]
|
|
497
|
+
)
|
|
434
498
|
def test_asan_address(ctx):
|
|
435
499
|
"""
|
|
436
500
|
Run worker test with Address Sanitizer with '-fsanitize=address'
|
|
437
501
|
"""
|
|
502
|
+
|
|
438
503
|
with cd_worker():
|
|
439
504
|
ctx.run(
|
|
440
505
|
f'"{MESON}" compile -C "{BUILD_DIR}" -j {NUM_CORES} mediasoup-worker-test-asan-address',
|
|
441
506
|
echo=True,
|
|
442
507
|
pty=PTY_SUPPORTED,
|
|
443
|
-
shell=SHELL
|
|
444
|
-
)
|
|
508
|
+
shell=SHELL,
|
|
509
|
+
)
|
|
445
510
|
with cd_worker():
|
|
446
511
|
ctx.run(
|
|
447
512
|
f'"{MESON}" install -C "{BUILD_DIR}" --no-rebuild --tags mediasoup-worker-test-asan-address',
|
|
448
513
|
echo=True,
|
|
449
514
|
pty=PTY_SUPPORTED,
|
|
450
|
-
shell=SHELL
|
|
451
|
-
)
|
|
515
|
+
shell=SHELL,
|
|
516
|
+
)
|
|
452
517
|
|
|
453
|
-
mediasoup_test_tags = os.getenv(
|
|
518
|
+
mediasoup_test_tags = os.getenv("MEDIASOUP_TEST_TAGS") or ""
|
|
454
519
|
|
|
455
520
|
with cd_worker():
|
|
456
521
|
ctx.run(
|
|
@@ -458,31 +523,44 @@ def test_asan_address(ctx):
|
|
|
458
523
|
echo=True,
|
|
459
524
|
pty=PTY_SUPPORTED,
|
|
460
525
|
shell=SHELL,
|
|
461
|
-
env={
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
526
|
+
env={
|
|
527
|
+
**os.environ,
|
|
528
|
+
"ASAN_OPTIONS": "halt_on_error=1:print_stacktrace=1:detect_leaks=1:symbolize=1:detect_stack_use_after_return=1:strict_init_order=1:check_initialization_order=1:detect_container_overflow=1",
|
|
529
|
+
},
|
|
530
|
+
)
|
|
531
|
+
|
|
532
|
+
|
|
533
|
+
@task(
|
|
534
|
+
pre=[
|
|
535
|
+
call(
|
|
536
|
+
setup,
|
|
537
|
+
meson_args=MESON_ARGS
|
|
538
|
+
+ " -Dms_build_tests=true -Db_sanitize=undefined -Db_lundef=false",
|
|
539
|
+
),
|
|
540
|
+
flatc,
|
|
541
|
+
]
|
|
542
|
+
)
|
|
466
543
|
def test_asan_undefined(ctx):
|
|
467
544
|
"""
|
|
468
545
|
Run worker test with undefined Sanitizer with -fsanitize=undefined
|
|
469
546
|
"""
|
|
547
|
+
|
|
470
548
|
with cd_worker():
|
|
471
549
|
ctx.run(
|
|
472
550
|
f'"{MESON}" compile -C "{BUILD_DIR}" -j {NUM_CORES} mediasoup-worker-test-asan-undefined',
|
|
473
551
|
echo=True,
|
|
474
552
|
pty=PTY_SUPPORTED,
|
|
475
|
-
shell=SHELL
|
|
476
|
-
)
|
|
553
|
+
shell=SHELL,
|
|
554
|
+
)
|
|
477
555
|
with cd_worker():
|
|
478
556
|
ctx.run(
|
|
479
557
|
f'"{MESON}" install -C "{BUILD_DIR}" --no-rebuild --tags mediasoup-worker-test-asan-undefined',
|
|
480
558
|
echo=True,
|
|
481
559
|
pty=PTY_SUPPORTED,
|
|
482
|
-
shell=SHELL
|
|
483
|
-
)
|
|
560
|
+
shell=SHELL,
|
|
561
|
+
)
|
|
484
562
|
|
|
485
|
-
mediasoup_test_tags = os.getenv(
|
|
563
|
+
mediasoup_test_tags = os.getenv("MEDIASOUP_TEST_TAGS") or ""
|
|
486
564
|
|
|
487
565
|
with cd_worker():
|
|
488
566
|
ctx.run(
|
|
@@ -492,11 +570,23 @@ def test_asan_undefined(ctx):
|
|
|
492
570
|
shell=SHELL,
|
|
493
571
|
# Exit with error if there are issues.
|
|
494
572
|
# NOTE: Ignore well known UBSan errors in OpenSSL.
|
|
495
|
-
env={
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
573
|
+
env={
|
|
574
|
+
**os.environ,
|
|
575
|
+
"UBSAN_OPTIONS": "halt_on_error=1:print_stacktrace=1:suppressions=ubsan_suppressions.txt",
|
|
576
|
+
},
|
|
577
|
+
)
|
|
578
|
+
|
|
579
|
+
|
|
580
|
+
@task(
|
|
581
|
+
pre=[
|
|
582
|
+
call(
|
|
583
|
+
setup,
|
|
584
|
+
meson_args=MESON_ARGS
|
|
585
|
+
+ " -Dms_build_fuzzer=true -Db_sanitize=address -Db_lundef=false",
|
|
586
|
+
),
|
|
587
|
+
flatc,
|
|
588
|
+
]
|
|
589
|
+
)
|
|
500
590
|
def fuzzer(ctx):
|
|
501
591
|
"""
|
|
502
592
|
Build the mediasoup-worker-fuzzer binary (which uses libFuzzer)
|
|
@@ -510,15 +600,15 @@ def fuzzer(ctx):
|
|
|
510
600
|
f'"{MESON}" compile -C "{BUILD_DIR}" -j {NUM_CORES} mediasoup-worker-fuzzer',
|
|
511
601
|
echo=True,
|
|
512
602
|
pty=PTY_SUPPORTED,
|
|
513
|
-
shell=SHELL
|
|
514
|
-
)
|
|
603
|
+
shell=SHELL,
|
|
604
|
+
)
|
|
515
605
|
with cd_worker():
|
|
516
606
|
ctx.run(
|
|
517
607
|
f'"{MESON}" install -C "{BUILD_DIR}" --no-rebuild --tags mediasoup-worker-fuzzer',
|
|
518
608
|
echo=True,
|
|
519
609
|
pty=PTY_SUPPORTED,
|
|
520
|
-
shell=SHELL
|
|
521
|
-
)
|
|
610
|
+
shell=SHELL,
|
|
611
|
+
)
|
|
522
612
|
|
|
523
613
|
|
|
524
614
|
@task
|
|
@@ -526,13 +616,14 @@ def fuzzer_run_all(ctx):
|
|
|
526
616
|
"""
|
|
527
617
|
Run all fuzzer cases
|
|
528
618
|
"""
|
|
619
|
+
|
|
529
620
|
with cd_worker():
|
|
530
621
|
ctx.run(
|
|
531
622
|
f'LSAN_OPTIONS=verbosity=1:log_threads=1 "{BUILD_DIR}/mediasoup-worker-fuzzer" -artifact_prefix=fuzzer/reports/ -max_len=1400 fuzzer/new-corpus deps/webrtc-fuzzer-corpora/corpora/stun-corpus deps/webrtc-fuzzer-corpora/corpora/rtp-corpus deps/webrtc-fuzzer-corpora/corpora/rtcp-corpus',
|
|
532
623
|
echo=True,
|
|
533
624
|
pty=PTY_SUPPORTED,
|
|
534
|
-
shell=SHELL
|
|
535
|
-
)
|
|
625
|
+
shell=SHELL,
|
|
626
|
+
)
|
|
536
627
|
|
|
537
628
|
|
|
538
629
|
@task
|
|
@@ -540,22 +631,23 @@ def docker(ctx):
|
|
|
540
631
|
"""
|
|
541
632
|
Build a Linux Ubuntu Docker image with fuzzer capable clang++
|
|
542
633
|
"""
|
|
543
|
-
|
|
634
|
+
|
|
635
|
+
if os.getenv("DOCKER_NO_CACHE") == "true":
|
|
544
636
|
with cd_worker():
|
|
545
637
|
ctx.run(
|
|
546
638
|
f'"{DOCKER}" build -f Dockerfile --no-cache --tag mediasoup/docker:latest .',
|
|
547
639
|
echo=True,
|
|
548
640
|
pty=PTY_SUPPORTED,
|
|
549
|
-
shell=SHELL
|
|
550
|
-
)
|
|
641
|
+
shell=SHELL,
|
|
642
|
+
)
|
|
551
643
|
else:
|
|
552
644
|
with cd_worker():
|
|
553
645
|
ctx.run(
|
|
554
646
|
f'"{DOCKER}" build -f Dockerfile --tag mediasoup/docker:latest .',
|
|
555
647
|
echo=True,
|
|
556
648
|
pty=PTY_SUPPORTED,
|
|
557
|
-
shell=SHELL
|
|
558
|
-
)
|
|
649
|
+
shell=SHELL,
|
|
650
|
+
)
|
|
559
651
|
|
|
560
652
|
|
|
561
653
|
@task
|
|
@@ -563,13 +655,14 @@ def docker_run(ctx):
|
|
|
563
655
|
"""
|
|
564
656
|
Run a container of the Ubuntu Docker image created in the docker task
|
|
565
657
|
"""
|
|
658
|
+
|
|
566
659
|
with cd_worker():
|
|
567
660
|
ctx.run(
|
|
568
661
|
f'"{DOCKER}" run --name=mediasoupDocker -it --rm --privileged --cap-add SYS_PTRACE -v "{WORKER_DIR}/../:/foo bar/mediasoup" mediasoup/docker:latest',
|
|
569
662
|
echo=True,
|
|
570
|
-
pty=True,
|
|
571
|
-
shell=SHELL
|
|
572
|
-
)
|
|
663
|
+
pty=True, # NOTE: Needed to enter the terminal of the Docker image.
|
|
664
|
+
shell=SHELL,
|
|
665
|
+
)
|
|
573
666
|
|
|
574
667
|
|
|
575
668
|
@task
|
|
@@ -577,22 +670,23 @@ def docker_alpine(ctx):
|
|
|
577
670
|
"""
|
|
578
671
|
Build a Linux Alpine Docker image
|
|
579
672
|
"""
|
|
580
|
-
|
|
673
|
+
|
|
674
|
+
if os.getenv("DOCKER_NO_CACHE") == "true":
|
|
581
675
|
with cd_worker():
|
|
582
676
|
ctx.run(
|
|
583
677
|
f'"{DOCKER}" build -f Dockerfile.alpine --no-cache --tag mediasoup/docker-alpine:latest .',
|
|
584
678
|
echo=True,
|
|
585
679
|
pty=PTY_SUPPORTED,
|
|
586
|
-
shell=SHELL
|
|
587
|
-
)
|
|
680
|
+
shell=SHELL,
|
|
681
|
+
)
|
|
588
682
|
else:
|
|
589
683
|
with cd_worker():
|
|
590
684
|
ctx.run(
|
|
591
685
|
f'"{DOCKER}" build -f Dockerfile.alpine --tag mediasoup/docker-alpine:latest .',
|
|
592
686
|
echo=True,
|
|
593
687
|
pty=PTY_SUPPORTED,
|
|
594
|
-
shell=SHELL
|
|
595
|
-
)
|
|
688
|
+
shell=SHELL,
|
|
689
|
+
)
|
|
596
690
|
|
|
597
691
|
|
|
598
692
|
@task
|
|
@@ -600,13 +694,14 @@ def docker_alpine_run(ctx):
|
|
|
600
694
|
"""
|
|
601
695
|
Run a container of the Alpine Docker image created in the docker_alpine task
|
|
602
696
|
"""
|
|
697
|
+
|
|
603
698
|
with cd_worker():
|
|
604
699
|
ctx.run(
|
|
605
700
|
f'"{DOCKER}" run --name=mediasoupDockerAlpine -it --rm --privileged --cap-add SYS_PTRACE -v "{WORKER_DIR}/../:/foo bar/mediasoup" mediasoup/docker-alpine:latest',
|
|
606
701
|
echo=True,
|
|
607
|
-
pty=True,
|
|
608
|
-
shell=SHELL
|
|
609
|
-
)
|
|
702
|
+
pty=True, # NOTE: Needed to enter the terminal of the Docker image.
|
|
703
|
+
shell=SHELL,
|
|
704
|
+
)
|
|
610
705
|
|
|
611
706
|
|
|
612
707
|
@task
|
|
@@ -614,22 +709,23 @@ def docker_386(ctx):
|
|
|
614
709
|
"""
|
|
615
710
|
Build a 386 Linux Debian (32 bits arch) Docker image
|
|
616
711
|
"""
|
|
617
|
-
|
|
712
|
+
|
|
713
|
+
if os.getenv("DOCKER_NO_CACHE") == "true":
|
|
618
714
|
with cd_worker():
|
|
619
715
|
ctx.run(
|
|
620
716
|
f'"{DOCKER}" build --platform linux/386 -f Dockerfile.386 --no-cache --tag mediasoup/docker-386:latest .',
|
|
621
717
|
echo=True,
|
|
622
718
|
pty=PTY_SUPPORTED,
|
|
623
|
-
shell=SHELL
|
|
624
|
-
)
|
|
719
|
+
shell=SHELL,
|
|
720
|
+
)
|
|
625
721
|
else:
|
|
626
722
|
with cd_worker():
|
|
627
723
|
ctx.run(
|
|
628
724
|
f'"{DOCKER}" build --platform linux/386 -f Dockerfile.386 --tag mediasoup/docker-386:latest .',
|
|
629
725
|
echo=True,
|
|
630
726
|
pty=PTY_SUPPORTED,
|
|
631
|
-
shell=SHELL
|
|
632
|
-
)
|
|
727
|
+
shell=SHELL,
|
|
728
|
+
)
|
|
633
729
|
|
|
634
730
|
|
|
635
731
|
@task
|
|
@@ -638,10 +734,11 @@ def docker_386_run(ctx):
|
|
|
638
734
|
Run a container of the 386 Linux Debian (32 bits arch) Docker image created
|
|
639
735
|
in the docker_386 task
|
|
640
736
|
"""
|
|
737
|
+
|
|
641
738
|
with cd_worker():
|
|
642
739
|
ctx.run(
|
|
643
740
|
f'"{DOCKER}" run --name=mediasoupDocker386 -it --rm --privileged --cap-add SYS_PTRACE -v "{WORKER_DIR}/../:/foo bar/mediasoup" mediasoup/docker-386:latest',
|
|
644
741
|
echo=True,
|
|
645
|
-
pty=True,
|
|
646
|
-
shell=SHELL
|
|
647
|
-
)
|
|
742
|
+
pty=True, # NOTE: Needed to enter the terminal of the Docker image.
|
|
743
|
+
shell=SHELL,
|
|
744
|
+
)
|