Skip to content

Commit

Permalink
let's try now
Browse files Browse the repository at this point in the history
  • Loading branch information
ibc committed Feb 21, 2024
1 parent 947b682 commit f9778a0
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions worker/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import inspect;
import shutil;
# We import this from a custom location and pylint doesn't know.
from invoke import task; # pylint: disable=import-error
from invoke import task, call; # pylint: disable=import-error

MEDIASOUP_BUILDTYPE = os.getenv('MEDIASOUP_BUILDTYPE') or 'Release';
WORKER_DIR = os.path.dirname(os.path.abspath(
Expand Down Expand Up @@ -135,30 +135,30 @@ def meson_ninja(ctx):


@task(pre=[meson_ninja])
def setup(ctx):
def setup(ctx, meson_args=MESON_ARGS):
"""
Run meson setup
"""
if MEDIASOUP_BUILDTYPE == 'Release':
with ctx.cd(f'"{WORKER_DIR}"'):
ctx.run(
f'"{MESON}" setup --prefix "{MEDIASOUP_INSTALL_DIR}" --bindir "" --libdir "" --buildtype release -Db_ndebug=true {MESON_ARGS} "{BUILD_DIR}"',
f'"{MESON}" setup --prefix "{MEDIASOUP_INSTALL_DIR}" --bindir "" --libdir "" --buildtype release -Db_ndebug=true {meson_args} "{BUILD_DIR}"',
echo=True,
pty=PTY_SUPPORTED,
shell=SHELL
);
elif MEDIASOUP_BUILDTYPE == 'Debug':
with ctx.cd(f'"{WORKER_DIR}"'):
ctx.run(
f'"{MESON}" setup --prefix "{MEDIASOUP_INSTALL_DIR}" --bindir "" --libdir "" --buildtype debug {MESON_ARGS} "{BUILD_DIR}"',
f'"{MESON}" setup --prefix "{MEDIASOUP_INSTALL_DIR}" --bindir "" --libdir "" --buildtype debug {meson_args} "{BUILD_DIR}"',
echo=True,
pty=PTY_SUPPORTED,
shell=SHELL
);
else:
with ctx.cd(f'"{WORKER_DIR}"'):
ctx.run(
f'"{MESON}" setup --prefix "{MEDIASOUP_INSTALL_DIR}" --bindir "" --libdir "" --buildtype {MEDIASOUP_BUILDTYPE} -Db_ndebug=if-release {MESON_ARGS} "{BUILD_DIR}"',
f'"{MESON}" setup --prefix "{MEDIASOUP_INSTALL_DIR}" --bindir "" --libdir "" --buildtype {MEDIASOUP_BUILDTYPE} -Db_ndebug=if-release {meson_args} "{BUILD_DIR}"',
echo=True,
pty=PTY_SUPPORTED,
shell=SHELL
Expand Down Expand Up @@ -464,18 +464,18 @@ def tidy(ctx):
);


@task(pre=[setup, flatc])
@task(pre=[call(setup, meson_args=MESON_ARGS + ' -Db_sanitize=address'), flatc])
def fuzzer(ctx):
"""
Build the mediasoup-worker-fuzzer binary (which uses libFuzzer)
"""

# NOTE: We need to pass '-Db_sanitize=address' to enable fuzzer in all Meson
# subprojects.
# subprojects, so we pass it to the setup() task.

with ctx.cd(f'"{WORKER_DIR}"'):
ctx.run(
f'"{MESON}" compile -C "{BUILD_DIR}" -j {NUM_CORES} -Db_sanitize=address mediasoup-worker-fuzzer',
f'"{MESON}" compile -C "{BUILD_DIR}" -j {NUM_CORES} mediasoup-worker-fuzzer',
echo=True,
pty=PTY_SUPPORTED,
shell=SHELL
Expand Down

0 comments on commit f9778a0

Please sign in to comment.