mediasoup 3.13.4 → 3.13.6

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/npm-scripts.mjs CHANGED
@@ -2,15 +2,16 @@ import process from 'node:process';
2
2
  import os from 'node:os';
3
3
  import fs from 'node:fs';
4
4
  import path from 'node:path';
5
- import { execSync, spawnSync } from 'node:child_process';
5
+ import { execSync } from 'node:child_process';
6
6
  import fetch from 'node-fetch';
7
7
  import tar from 'tar';
8
8
 
9
9
  const PKG = JSON.parse(fs.readFileSync('./package.json').toString());
10
- const IS_FREEBSD = os.platform() === 'freebsd';
11
10
  const IS_WINDOWS = os.platform() === 'win32';
12
11
  const MAYOR_VERSION = PKG.version.split('.')[0];
13
- const MAKE = process.env.MAKE || (IS_FREEBSD ? 'gmake' : 'make');
12
+ const PYTHON = getPython();
13
+ const PIP_INVOKE_DIR = path.resolve('worker/pip_invoke');
14
+ const INVOKE_VERSION = process.env.INVOKE_VERSION ?? '2.2.0';
14
15
  const FLATBUFFERS_VERSION = '23.3.3';
15
16
  const WORKER_RELEASE_DIR = 'worker/out/Release';
16
17
  const WORKER_RELEASE_BIN = IS_WINDOWS ? 'mediasoup-worker.exe' : 'mediasoup-worker';
@@ -23,12 +24,37 @@ const GH_REPO = 'mediasoup';
23
24
 
24
25
  const task = process.argv.slice(2).join(' ');
25
26
 
27
+ // PYTHONPATH env must be updated now so all invoke calls below will find the
28
+ // pip invoke module.
29
+ if (process.env.PYTHONPATH)
30
+ {
31
+ if (IS_WINDOWS)
32
+ {
33
+ process.env.PYTHONPATH = `${PIP_INVOKE_DIR};${process.env.PYTHONPATH}`;
34
+ }
35
+ else
36
+ {
37
+ process.env.PYTHONPATH = `${PIP_INVOKE_DIR}:${process.env.PYTHONPATH}`;
38
+ }
39
+ }
40
+ else
41
+ {
42
+ process.env.PYTHONPATH = PIP_INVOKE_DIR;
43
+ }
44
+
26
45
  run();
27
46
 
28
47
  async function run()
29
48
  {
30
49
  switch (task)
31
50
  {
51
+ case 'preinstall':
52
+ {
53
+ installInvoke();
54
+
55
+ break;
56
+ }
57
+
32
58
  // As per NPM documentation (https://docs.npmjs.com/cli/v9/using-npm/scripts)
33
59
  // `prepare` script:
34
60
  //
@@ -142,7 +168,7 @@ async function run()
142
168
 
143
169
  case 'format:worker':
144
170
  {
145
- executeCmd(`${MAKE} format -C worker`);
171
+ executeCmd(`"${PYTHON}" -m invoke -r worker format`);
146
172
 
147
173
  break;
148
174
  }
@@ -185,20 +211,6 @@ async function run()
185
211
  break;
186
212
  }
187
213
 
188
- case 'install-deps:node':
189
- {
190
- installNodeDeps();
191
-
192
- break;
193
- }
194
-
195
- case 'install-worker-dev-tools':
196
- {
197
- executeCmd('npm ci --prefix worker/scripts');
198
-
199
- break;
200
- }
201
-
202
214
  case 'release:check':
203
215
  {
204
216
  checkRelease();
@@ -274,6 +286,42 @@ async function run()
274
286
  }
275
287
  }
276
288
 
289
+ function getPython()
290
+ {
291
+ let python = process.env.PYTHON;
292
+
293
+ if (!python)
294
+ {
295
+ try
296
+ {
297
+ execSync('python3 --version', { stdio: [ 'ignore', 'ignore', 'ignore' ] });
298
+ python = 'python3';
299
+ }
300
+ catch (error)
301
+ {
302
+ python = 'python';
303
+ }
304
+ }
305
+
306
+ return python;
307
+ }
308
+
309
+ function installInvoke()
310
+ {
311
+ if (fs.existsSync(PIP_INVOKE_DIR))
312
+ {
313
+ return;
314
+ }
315
+
316
+ logInfo('installInvoke()');
317
+
318
+ // Install pip invoke into custom location, so we don't depend on system-wide
319
+ // installation.
320
+ executeCmd(
321
+ `"${PYTHON}" -m pip install --upgrade --target="${PIP_INVOKE_DIR}" invoke==${INVOKE_VERSION}`, /* exitOnError */ true
322
+ );
323
+ }
324
+
277
325
  function deleteNodeLib()
278
326
  {
279
327
  if (!fs.existsSync('node/lib'))
@@ -311,22 +359,7 @@ function buildWorker()
311
359
  {
312
360
  logInfo('buildWorker()');
313
361
 
314
- if (IS_WINDOWS)
315
- {
316
- if (!fs.existsSync('worker/out/msys/bin/make.exe'))
317
- {
318
- installMsysMake();
319
- }
320
-
321
- const msysPath = `${process.cwd()}\\worker\\out\\msys\\bin`;
322
-
323
- if (!process.env.PATH.includes(msysPath))
324
- {
325
- process.env.PATH = `${msysPath};${process.env.PATH}`;
326
- }
327
- }
328
-
329
- executeCmd(`${MAKE} -C worker`);
362
+ executeCmd(`"${PYTHON}" -m invoke -r worker mediasoup-worker`);
330
363
  }
331
364
 
332
365
  function cleanWorkerArtifacts()
@@ -334,19 +367,11 @@ function cleanWorkerArtifacts()
334
367
  logInfo('cleanWorkerArtifacts()');
335
368
 
336
369
  // Clean build artifacts except `mediasoup-worker`.
337
- executeCmd(`${MAKE} clean-build -C worker`);
370
+ executeCmd(`"${PYTHON}" -m invoke -r worker clean-build`);
338
371
  // Clean downloaded dependencies.
339
- executeCmd(`${MAKE} clean-subprojects -C worker`);
372
+ executeCmd(`"${PYTHON}" -m invoke -r worker clean-subprojects`);
340
373
  // Clean PIP/Meson/Ninja.
341
- executeCmd(`${MAKE} clean-pip -C worker`);
342
-
343
- if (IS_WINDOWS)
344
- {
345
- if (fs.existsSync('worker/out/msys'))
346
- {
347
- executeCmd('rd /s /q worker\\out\\msys');
348
- }
349
- }
374
+ executeCmd(`"${PYTHON}" -m invoke -r worker clean-pip`);
350
375
  }
351
376
 
352
377
  function lintNode()
@@ -360,7 +385,7 @@ function lintWorker()
360
385
  {
361
386
  logInfo('lintWorker()');
362
387
 
363
- executeCmd(`${MAKE} lint -C worker`);
388
+ executeCmd(`"${PYTHON}" -m invoke -r worker lint`);
364
389
  }
365
390
 
366
391
  function flatcNode()
@@ -368,24 +393,24 @@ function flatcNode()
368
393
  logInfo('flatcNode()');
369
394
 
370
395
  // Build flatc if needed.
371
- executeCmd(`${MAKE} -C worker flatc`);
396
+ executeCmd(`"${PYTHON}" -m invoke -r worker flatc`);
372
397
 
373
398
  const buildType = process.env.MEDIASOUP_BUILDTYPE || 'Release';
374
399
  const extension = IS_WINDOWS ? '.exe' : '';
375
400
  const flatc = path.resolve(path.join(
376
401
  'worker', 'out', buildType, 'build', 'subprojects', `flatbuffers-${FLATBUFFERS_VERSION}`, `flatc${extension}`));
377
- const src = path.resolve(path.join('worker', 'fbs', '*.fbs'));
378
402
  const out = path.resolve(path.join('node', 'src'));
379
- const options = '--ts-no-import-ext --gen-object-api';
380
- const command = `${flatc} --ts ${options} -o ${out} `;
381
403
 
382
- if (IS_WINDOWS)
404
+ for (const dirent of fs.readdirSync(path.join('worker', 'fbs'), { withFileTypes: true }))
383
405
  {
384
- executeCmd(`for %f in (${src}) do ${command} %f`);
385
- }
386
- else
387
- {
388
- executeCmd(`for file in ${src}; do ${command} \$\{file\}; done`);
406
+ if (!dirent.isFile() || path.parse(dirent.name).ext !== '.fbs')
407
+ {
408
+ continue;
409
+ }
410
+
411
+ const filePath = path.resolve(path.join('worker', 'fbs', dirent.name));
412
+
413
+ executeCmd(`"${flatc}" --ts --ts-no-import-ext --gen-object-api -o "${out}" "${filePath}"`);
389
414
  }
390
415
  }
391
416
 
@@ -393,7 +418,7 @@ function flatcWorker()
393
418
  {
394
419
  logInfo('flatcWorker()');
395
420
 
396
- executeCmd(`${MAKE} -C worker flatc`);
421
+ executeCmd(`"${PYTHON}" -m invoke -r worker flatc`);
397
422
  }
398
423
 
399
424
  function testNode()
@@ -406,7 +431,7 @@ function testNode()
406
431
  }
407
432
  else
408
433
  {
409
- executeCmd(`jest --testPathPattern ${process.env.TEST_FILE}`);
434
+ executeCmd(`jest --testPathPattern "${process.env.TEST_FILE}"`);
410
435
  }
411
436
  }
412
437
 
@@ -414,7 +439,7 @@ function testWorker()
414
439
  {
415
440
  logInfo('testWorker()');
416
441
 
417
- executeCmd(`${MAKE} test -C worker`);
442
+ executeCmd(`"${PYTHON}" -m invoke -r worker test`);
418
443
  }
419
444
 
420
445
  function installNodeDeps()
@@ -441,42 +466,6 @@ function checkRelease()
441
466
  testWorker();
442
467
  }
443
468
 
444
- function installMsysMake()
445
- {
446
- logInfo('installMsysMake()');
447
-
448
- let pythonPath;
449
-
450
- // If PYTHON environment variable is given, use it.
451
- if (process.env.PYTHON)
452
- {
453
- pythonPath = process.env.PYTHON;
454
- }
455
- // Otherwise ensure python3.exe is available in the PATH.
456
- else
457
- {
458
- let res = spawnSync('where', [ 'python3.exe' ]);
459
-
460
- if (res.status !== 0)
461
- {
462
- res = spawnSync('where', [ 'python.exe' ]);
463
-
464
- if (res.status !== 0)
465
- {
466
- logError('`installMsysMake() | cannot find Python executable');
467
-
468
- exitWithError();
469
- }
470
- }
471
-
472
- pythonPath = String(res.stdout).trim();
473
- }
474
-
475
- const dir = path.resolve('worker/out/msys');
476
-
477
- executeCmd(`${pythonPath} worker\\scripts\\getmake.py --dir="${dir}"`);
478
- }
479
-
480
469
  function ensureDir(dir)
481
470
  {
482
471
  logInfo(`ensureDir() [dir:${dir}]`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mediasoup",
3
- "version": "3.13.4",
3
+ "version": "3.13.6",
4
4
  "description": "Cutting Edge WebRTC Video Conferencing",
5
5
  "contributors": [
6
6
  "Iñaki Baz Castillo <ibc@aliax.net> (https://inakibaz.me)",
@@ -21,19 +21,20 @@
21
21
  "types": "node/lib/index.d.ts",
22
22
  "files": [
23
23
  "node/lib",
24
- "worker/deps/libwebrtc",
24
+ "worker/src",
25
+ "worker/include",
25
26
  "worker/fbs",
26
- "worker/fuzzer/include",
27
+ "worker/test/src",
28
+ "worker/test/include",
27
29
  "worker/fuzzer/src",
28
- "worker/include",
30
+ "worker/fuzzer/include",
29
31
  "worker/scripts/*.mjs",
30
32
  "worker/scripts/*.json",
31
33
  "worker/scripts/*.py",
32
34
  "worker/scripts/*.sh",
33
- "worker/src",
34
35
  "worker/subprojects/*.wrap",
35
- "worker/test/include",
36
- "worker/test/src",
36
+ "worker/deps/libwebrtc",
37
+ "worker/tasks.py",
37
38
  "worker/Makefile",
38
39
  "worker/meson.build",
39
40
  "worker/meson_options.txt",
@@ -49,6 +50,7 @@
49
50
  "nodejs"
50
51
  ],
51
52
  "scripts": {
53
+ "preinstall": "node npm-scripts.mjs preinstall",
52
54
  "prepare": "node npm-scripts.mjs prepare",
53
55
  "postinstall": "node npm-scripts.mjs postinstall",
54
56
  "typescript:build": "node npm-scripts.mjs typescript:build",
@@ -66,8 +68,6 @@
66
68
  "test:node": "node npm-scripts.mjs test:node",
67
69
  "test:worker": "node npm-scripts.mjs test:worker",
68
70
  "coverage:node": "node npm-scripts.mjs coverage:node",
69
- "install-deps:node": "node npm-scripts.mjs install-deps:node",
70
- "install-worker-dev-tools": "node npm-scripts.mjs install-worker-dev-tools",
71
71
  "release:check": "node npm-scripts.mjs release:check",
72
72
  "release": "node npm-scripts.mjs release",
73
73
  "release:upload-mac-arm-prebuilt-worker": "node npm-scripts.mjs release:upload-mac-arm-prebuilt-worker"
@@ -105,8 +105,8 @@
105
105
  "devDependencies": {
106
106
  "@octokit/rest": "^20.0.2",
107
107
  "@types/debug": "^4.1.12",
108
- "@types/jest": "^29.5.9",
109
- "@types/node": "^20.9.3",
108
+ "@types/jest": "^29.5.10",
109
+ "@types/node": "^20.10.0",
110
110
  "@typescript-eslint/eslint-plugin": "^6.12.0",
111
111
  "@typescript-eslint/parser": "^6.12.0",
112
112
  "eslint": "^8.54.0",
package/worker/Makefile CHANGED
@@ -1,72 +1,23 @@
1
1
  #
2
2
  # make tasks for mediasoup-worker.
3
3
  #
4
-
5
- # We need Python 3 here.
6
- PYTHON ?= $(shell command -v python3 2> /dev/null || echo python)
7
- ROOT_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
8
- CORES ?= $(shell ${ROOT_DIR}/scripts/cpu_cores.sh || echo 4)
9
- MEDIASOUP_OUT_DIR ?= $(shell pwd)/out
10
- # Controls build types, `Release` and `Debug` are presets optimized for those
11
- # use cases. Other build types are possible too, but they are not presets and
12
- # will require `MESON_ARGS` use to customize build configuration.
13
- # Check the meaning of useful macros in the `worker/include/Logger.hpp` header
14
- # file if you want to enable tracing or other debug information.
15
- MEDIASOUP_BUILDTYPE ?= Release
16
- LCOV = ./deps/lcov/bin/lcov
17
- DOCKER ?= docker
18
- PIP_DIR = $(MEDIASOUP_OUT_DIR)/pip
19
- INSTALL_DIR ?= $(MEDIASOUP_OUT_DIR)/$(MEDIASOUP_BUILDTYPE)
20
- BUILD_DIR ?= $(INSTALL_DIR)/build
21
- MESON ?= $(PIP_DIR)/bin/meson
22
- MESON_VERSION ?= 1.2.1
23
- # `MESON_ARGS` can be used to provide extra configuration parameters to Meson,
24
- # such as adding defines or changing optimization options. For instance, use
25
- # `MESON_ARGS="-Dms_log_trace=true -Dms_log_file_line=true" npm i` to compile
26
- # worker with tracing and enabled.
4
+ # NOTE: This Makefile is a proxy to pip invoke commands (see tasks.py).
27
5
  #
28
- # NOTE: On Windows make sure to add `--vsenv` or have MSVS environment already
29
- # active if you override this parameter.
30
- MESON_ARGS ?= ""
31
- # Workaround for NixOS and Guix that don't work with pre-built binaries, see:
32
- # https://github.com/NixOS/nixpkgs/issues/142383.
33
- PIP_BUILD_BINARIES = $(shell [ -f /etc/NIXOS -o -d /etc/guix ] && echo "--no-binary :all:")
34
- # Let's use a specific version of ninja to avoid buggy version 1.11.1:
35
- # https://mediasoup.discourse.group/t/partly-solved-could-not-detect-ninja-v1-8-2-or-newer/
36
- # https://github.com/ninja-build/ninja/issues/2211
37
- # https://github.com/ninja-build/ninja/issues/2212
38
- NINJA_VERSION ?= 1.10.2.4
39
- NPM ?= npm
40
6
 
41
- # Disable `*.pyc` files creation.
42
- export PYTHONDONTWRITEBYTECODE = 1
43
- # Instruct `meson` where to look for ninja binary.
44
- ifeq ($(OS),Windows_NT)
45
- # Windows is, of course, special.
46
- export NINJA = $(PIP_DIR)/bin/ninja.exe
47
- else
48
- export NINJA = $(PIP_DIR)/bin/ninja
49
- endif
7
+ PYTHON ?= $(shell command -v python3 2> /dev/null || echo python)
8
+ PIP_INVOKE_DIR = $(shell pwd)/pip_invoke
9
+ INVOKE_VERSION ?= 2.2.0
50
10
 
51
- # Instruct Python where to look for modules it needs, such that `meson` actually
52
- # runs from installed location.
53
- #
54
- # NOTE: For some reason on Windows adding `:${PYTHONPATH}` breaks things.
11
+ # Instruct Python where to look for invoke module.
55
12
  ifeq ($(OS),Windows_NT)
56
- export PYTHONPATH := $(PIP_DIR)
13
+ export PYTHONPATH := $(PIP_INVOKE_DIR);${PYTHONPATH}
57
14
  else
58
- export PYTHONPATH := $(PIP_DIR):${PYTHONPATH}
59
- endif
60
-
61
- # Activate VS environment on Windows by default.
62
- ifeq ($(OS),Windows_NT)
63
- ifeq ($(MESON_ARGS),"")
64
- MESON_ARGS = $(subst $\",,"--vsenv")
65
- endif
15
+ export PYTHONPATH := $(PIP_INVOKE_DIR):${PYTHONPATH}
66
16
  endif
67
17
 
68
18
  .PHONY: \
69
19
  default \
20
+ invoke \
70
21
  meson-ninja \
71
22
  setup \
72
23
  clean \
@@ -93,195 +44,79 @@ endif
93
44
 
94
45
  default: mediasoup-worker
95
46
 
96
- meson-ninja:
97
- ifeq ($(wildcard $(PIP_DIR)),)
98
- # Updated pip and setuptools are needed for meson.
99
- # `--system` is not present everywhere and is only needed as workaround for
100
- # Debian-specific issue (copied from https://github.com/gluster/gstatus/pull/33),
101
- # fallback to command without `--system` if the first one fails.
102
- $(PYTHON) -m pip install --system --target=$(PIP_DIR) pip setuptools || \
103
- $(PYTHON) -m pip install --target=$(PIP_DIR) pip setuptools || \
104
- echo "Installation failed, likely because PIP is unavailable, if you are on Debian/Ubuntu or derivative please install the python3-pip package"
105
- # Install `meson` and `ninja` using `pip` into custom location, so we don't
106
- # depend on system-wide installation.
107
- $(PYTHON) -m pip install --upgrade --target=$(PIP_DIR) $(PIP_BUILD_BINARIES) meson==$(MESON_VERSION) ninja==$(NINJA_VERSION)
47
+ invoke:
48
+ ifeq ($(wildcard $(PIP_INVOKE_DIR)),)
49
+ # Install pip invoke into custom location, so we don't depend on system-wide
50
+ # installation.
51
+ $(PYTHON) -m pip install --upgrade --target="$(PIP_INVOKE_DIR)" invoke==$(INVOKE_VERSION)
108
52
  endif
109
53
 
110
- setup: meson-ninja
111
- # We try to call `--reconfigure` first as a workaround for this issue:
112
- # https://github.com/ninja-build/ninja/issues/1997
113
- ifeq ($(MEDIASOUP_BUILDTYPE),Release)
114
- $(MESON) setup \
115
- --prefix $(INSTALL_DIR) \
116
- --bindir '' \
117
- --libdir '' \
118
- --buildtype release \
119
- -Db_ndebug=true \
120
- -Db_pie=true \
121
- -Db_staticpic=true \
122
- --reconfigure \
123
- $(MESON_ARGS) \
124
- $(BUILD_DIR) || \
125
- $(MESON) setup \
126
- --prefix $(INSTALL_DIR) \
127
- --bindir '' \
128
- --libdir '' \
129
- --buildtype release \
130
- -Db_ndebug=true \
131
- -Db_pie=true \
132
- -Db_staticpic=true \
133
- $(MESON_ARGS) \
134
- $(BUILD_DIR)
135
- else
136
- ifeq ($(MEDIASOUP_BUILDTYPE),Debug)
137
- $(MESON) setup \
138
- --prefix $(INSTALL_DIR) \
139
- --bindir '' \
140
- --libdir '' \
141
- --buildtype debug \
142
- -Db_pie=true \
143
- -Db_staticpic=true \
144
- --reconfigure \
145
- $(MESON_ARGS) \
146
- $(BUILD_DIR) || \
147
- $(MESON) setup \
148
- --prefix $(INSTALL_DIR) \
149
- --bindir '' \
150
- --libdir '' \
151
- --buildtype debug \
152
- -Db_pie=true \
153
- -Db_staticpic=true \
154
- $(MESON_ARGS) \
155
- $(BUILD_DIR)
156
- else
157
- $(MESON) setup \
158
- --prefix $(INSTALL_DIR) \
159
- --bindir '' \
160
- --libdir '' \
161
- --buildtype $(MEDIASOUP_BUILDTYPE) \
162
- -Db_ndebug=if-release \
163
- -Db_pie=true \
164
- -Db_staticpic=true \
165
- --reconfigure \
166
- $(MESON_ARGS) \
167
- $(BUILD_DIR) || \
168
- $(MESON) setup \
169
- --prefix $(INSTALL_DIR) \
170
- --bindir '' \
171
- --libdir '' \
172
- --buildtype $(MEDIASOUP_BUILDTYPE) \
173
- -Db_ndebug=if-release \
174
- -Db_pie=true \
175
- -Db_staticpic=true \
176
- $(MESON_ARGS) \
177
- $(BUILD_DIR)
178
- endif
179
- endif
54
+ meson-ninja: invoke
55
+ $(PYTHON) -m invoke meson-ninja
180
56
 
181
- clean:
182
- $(RM) -rf $(INSTALL_DIR)
57
+ setup: invoke
58
+ $(PYTHON) -m invoke setup
183
59
 
184
- clean-build:
185
- $(RM) -rf $(BUILD_DIR)
60
+ clean: invoke
61
+ $(PYTHON) -m invoke clean
186
62
 
187
- clean-pip:
188
- $(RM) -rf $(PIP_DIR)
63
+ clean-build: invoke
64
+ $(PYTHON) -m invoke clean-build
189
65
 
190
- clean-subprojects: meson-ninja
191
- $(MESON) subprojects purge --include-cache --confirm
66
+ clean-pip: invoke
67
+ $(PYTHON) -m invoke clean-pip
192
68
 
193
- # Clean subprojects (ignore if it fails) and delete out dir.
194
- clean-all:
195
- -$(MESON) subprojects purge --include-cache --confirm
196
- $(RM) -rf $(MEDIASOUP_OUT_DIR)
69
+ clean-subprojects: invoke
70
+ $(PYTHON) -m invoke clean-subprojects
197
71
 
198
- # Update the wrap file of a subproject. Usage example:
199
- # make update-wrap-file SUBPROJECT=openssl
200
- update-wrap-file: meson-ninja
201
- $(MESON) subprojects update --reset $(SUBPROJECT)
72
+ clean-all: invoke
73
+ $(PYTHON) -m invoke clean-all
202
74
 
203
- mediasoup-worker: setup flatc
204
- ifeq ($(MEDIASOUP_WORKER_BIN),)
205
- $(MESON) compile -C $(BUILD_DIR) -j $(CORES) mediasoup-worker
206
- $(MESON) install -C $(BUILD_DIR) --no-rebuild --tags mediasoup-worker
207
- endif
75
+ # It requires the SUBPROJECT environment variable.
76
+ update-wrap-file: invoke
77
+ $(PYTHON) -m invoke subprojects $(SUBPROJECT)
208
78
 
209
- libmediasoup-worker: setup flatc
210
- $(MESON) compile -C $(BUILD_DIR) -j $(CORES) libmediasoup-worker
211
- $(MESON) install -C $(BUILD_DIR) --no-rebuild --tags libmediasoup-worker
79
+ mediasoup-worker: invoke
80
+ $(PYTHON) -m invoke mediasoup-worker
212
81
 
213
- flatc: setup
214
- $(MESON) compile -C $(BUILD_DIR) flatbuffers-generator
82
+ libmediasoup-worker: invoke
83
+ $(PYTHON) -m invoke libmediasoup-worker
215
84
 
216
- xcode: setup flatc
217
- $(MESON) setup --buildtype debug --backend xcode $(MEDIASOUP_OUT_DIR)/xcode
85
+ flatc: invoke
86
+ $(PYTHON) -m invoke flatc
218
87
 
219
- lint:
220
- $(NPM) run lint --prefix scripts/
88
+ xcode: invoke
89
+ $(PYTHON) -m invoke xcode
221
90
 
222
- format:
223
- $(NPM) run format --prefix scripts/
91
+ lint: invoke
92
+ $(PYTHON) -m invoke lint
224
93
 
225
- test: setup flatc
226
- $(MESON) compile -C $(BUILD_DIR) -j $(CORES) mediasoup-worker-test
227
- $(MESON) install -C $(BUILD_DIR) --no-rebuild --tags mediasoup-worker-test
228
- ifeq ($(OS),Windows_NT)
229
- # On Windows lcov doesn't work (at least not yet) and we need to add `.exe` to
230
- # the binary path.
231
- $(BUILD_DIR)/mediasoup-worker-test.exe --invisibles --use-colour=yes $(MEDIASOUP_TEST_TAGS)
232
- else
233
- $(LCOV) --directory ./ --zerocounters
234
- $(BUILD_DIR)/mediasoup-worker-test --invisibles --use-colour=yes $(MEDIASOUP_TEST_TAGS)
235
- endif
94
+ format: invoke
95
+ $(PYTHON) -m invoke format
236
96
 
237
- test-asan: setup flatc
238
- $(MESON) compile -C $(BUILD_DIR) -j $(CORES) mediasoup-worker-test-asan
239
- $(MESON) install -C $(BUILD_DIR) --no-rebuild --tags mediasoup-worker-test-asan
240
- ASAN_OPTIONS=detect_leaks=1 $(BUILD_DIR)/mediasoup-worker-test-asan --invisibles --use-colour=yes $(MEDIASOUP_TEST_TAGS)
97
+ test: invoke
98
+ $(PYTHON) -m invoke test
241
99
 
242
- tidy:
243
- $(PYTHON) ./scripts/clang-tidy.py \
244
- -clang-tidy-binary=./scripts/node_modules/.bin/clang-tidy \
245
- -clang-apply-replacements-binary=./scripts/node_modules/.bin/clang-apply-replacements \
246
- -header-filter='(Channel/**/*.hpp|DepLibSRTP.hpp|DepLibUV.hpp|DepLibWebRTC.hpp|DepOpenSSL.hpp|DepUsrSCTP.hpp|LogLevel.hpp|Logger.hpp|MediaSoupError.hpp|RTC/**/*.hpp|Settings.hpp|Utils.hpp|Worker.hpp|common.hpp|handles/**/*.hpp)' \
247
- -p=$(BUILD_DIR) \
248
- -j=$(CORES) \
249
- -checks=$(MEDIASOUP_TIDY_CHECKS) \
250
- -quiet
100
+ test-asan: invoke
101
+ $(PYTHON) -m invoke test-asan
251
102
 
252
- fuzzer: setup flatc
253
- $(MESON) compile -C $(BUILD_DIR) -j $(CORES) mediasoup-worker-fuzzer
254
- $(MESON) install -C $(BUILD_DIR) --no-rebuild --tags mediasoup-worker-fuzzer
103
+ tidy: invoke
104
+ $(PYTHON) -m invoke tidy
255
105
 
256
- fuzzer-run-all:
257
- 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
106
+ fuzzer: invoke
107
+ $(PYTHON) -m invoke fuzzer
258
108
 
259
- docker:
260
- ifeq ($(DOCKER_NO_CACHE),true)
261
- $(DOCKER) build -f Dockerfile --no-cache --tag mediasoup/docker:latest .
262
- else
263
- $(DOCKER) build -f Dockerfile --tag mediasoup/docker:latest .
264
- endif
109
+ fuzzer-run-all: invoke
110
+ $(PYTHON) -m invoke fuzzer-run-all
265
111
 
266
- docker-run:
267
- $(DOCKER) run \
268
- --name=mediasoupDocker -it --rm \
269
- --privileged \
270
- --cap-add SYS_PTRACE \
271
- -v $(shell pwd)/../:/mediasoup \
272
- mediasoup/docker:latest
112
+ docker: invoke
113
+ $(PYTHON) -m invoke docker
273
114
 
274
- docker-alpine:
275
- ifeq ($(DOCKER_NO_CACHE),true)
276
- $(DOCKER) build -f Dockerfile.alpine --no-cache --tag mediasoup/docker-alpine:latest .
277
- else
278
- $(DOCKER) build -f Dockerfile.alpine --tag mediasoup/docker-alpine:latest .
279
- endif
115
+ docker-run: invoke
116
+ $(PYTHON) -m invoke docker-run
117
+
118
+ docker-alpine: invoke
119
+ $(PYTHON) -m invoke docker-alpine
280
120
 
281
- docker-alpine-run:
282
- $(DOCKER) run \
283
- --name=mediasoupDockerAlpine -it --rm \
284
- --privileged \
285
- --cap-add SYS_PTRACE \
286
- -v $(shell pwd)/../:/mediasoup \
287
- mediasoup/docker-alpine:latest
121
+ docker-alpine-run: invoke
122
+ $(PYTHON) -m invoke docker-alpine-run