Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ jobs:
- script: linux-checks/check-formatting
image: rocstreaming/env-ubuntu

- script: linux-checks/check-doctests
- script: linux-checks/check-scons
image: rocstreaming/env-ubuntu

- script: linux-checks/pulseaudio-versions
Expand Down
5 changes: 2 additions & 3 deletions 3rdparty/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -222,10 +222,9 @@ elif 'openssl' in system_dependencies:
conf = Configure(env, custom_tests=env.CustomTests)

if not conf.AddPkgConfigDependency('libssl', '--cflags --libs', add_prefix=ossl_prefix):
conf.env.AddManualDependency(libs=['ssl', 'crypto'], prefix=ossl_prefix)
conf.env.AddManualDependency(libs=['ssl'], prefix=ossl_prefix)

if not conf.CheckLibWithHeaderExt('ssl', 'openssl/rand.h', 'C', run=not is_crosscompiling) or \
not conf.CheckLibWithHeaderExt('crypto', 'openssl/crypto.h', 'C', run=not is_crosscompiling):
if not conf.CheckLibWithHeaderExt('ssl', 'openssl/rand.h', 'C', run=not is_crosscompiling):
env.Die("OpenSSL not found (see 'config.log' for details)")

env = conf.Finish()
Expand Down
33 changes: 10 additions & 23 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ AddOption('--enable-tests',
AddOption('--enable-benchmarks',
dest='enable_benchmarks',
action='store_true',
help='enable benchmarks building and running (requires Google Benchmark)')
help='enable bechmarks building and running (requires Google Benchmark)')

AddOption('--enable-examples',
dest='enable_examples',
Expand Down Expand Up @@ -273,7 +273,7 @@ AddOption('--macos-arch',
" comma-separated list, supported values: {}".format(
', '.join(["'{}'".format(s) for s in supported_macos_archs])) +
" (default is current OS arch, pass multiple values"
" or 'all' for universal binaries)"))
" or 'all' for univeral binaries)"))

AddOption('--build-3rdparty',
dest='build_3rdparty',
Expand Down Expand Up @@ -407,12 +407,12 @@ for p in ['bin',
clean_all += [env.DeleteFile(f)]

env.AlwaysBuild(env.Alias('clean', [], clean_all))
env.AlwaysBuild(env.Alias('clean_build', [], clean_build))
env.AlwaysBuild(env.Alias('clean_docs', [], clean_doc))
env.AlwaysBuild(env.Alias('cleanbuild', [], clean_build))
env.AlwaysBuild(env.Alias('cleandocs', [], clean_doc))

if set(COMMAND_LINE_TARGETS).intersection(['clean', 'clean_build', 'clean_docs']) or \
if set(COMMAND_LINE_TARGETS).intersection(['clean', 'cleanbuild', 'cleandocs']) or \
env.GetOption('clean'):
if set(COMMAND_LINE_TARGETS) - set(['clean', 'clean_build', 'clean_docs']):
if set(COMMAND_LINE_TARGETS) - set(['clean', 'cleanbuild', 'cleandocs']):
env.Die("combining 'clean*' targets with other targets is not allowed")
if env.GetOption('clean'):
if clean_all:
Expand Down Expand Up @@ -444,13 +444,13 @@ doc_env = env.DeepClone()
doc_env.SConscript('docs/SConscript',
duplicate=0, exports='doc_env')

# run python doctests
env.AlwaysBuild(env.Alias('doctest', [], [
env.DocTest('#scripts/scons_helpers/build-3rdparty.py'),
# run scons self-test
env.AlwaysBuild(env.Alias('selftest', [], [
env.SelfTest(),
]))

# exit early if there is nothing to build
non_build_targets = ['fmt', 'docs', 'sphinx', 'doxygen', 'doctest']
non_build_targets = ['fmt', 'docs', 'sphinx', 'doxygen', 'selftest']
if set(COMMAND_LINE_TARGETS) \
and set(COMMAND_LINE_TARGETS).intersection(non_build_targets) == set(COMMAND_LINE_TARGETS):
Return()
Expand Down Expand Up @@ -522,15 +522,6 @@ if not meta.compiler_ver:
env.Die("can't detect compiler version for compiler '{}'",
'-'.join([s for s in [meta.toolchain, meta.compiler] if s]))

if GetOption('compiler') and env.HasArgument('CXX'):
detected_compiler = env.ParseCompilerType(env['CXX'])
if detected_compiler and detected_compiler != meta.compiler:
env.Warn("forcing compiler '{}-{}' from '--compiler={}' option,"+
" but detected compiler '{}' from 'CXX={}' variable",
meta.compiler, '.'.join(map(str, meta.compiler_ver)),
GetOption('compiler'),
detected_compiler, env['CXX'])

conf = Configure(env, custom_tests=env.CustomTests)

if meta.compiler == 'clang':
Expand Down Expand Up @@ -670,10 +661,6 @@ if meta.platform == 'darwin':
conf.FindTool('LIPO', [''], [('lipo', None)], required=False)
conf.FindTool('INSTALL_NAME_TOOL', [''], [('install_name_tool', None)], required=False)

if meta.compiler == 'gcc' or meta.compiler == 'clang':
if conf.CheckLib('atomic'):
env.AddManualDependency(libs=['atomic']) # explicitly needed by libcrypto (openssl)

meta.c11_support = False
if not GetOption('disable_c11'):
if meta.compiler == 'gcc':
Expand Down
4 changes: 2 additions & 2 deletions docs/man/roc-copy.1
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.TH "ROC-COPY" "1" "2025" "Roc Toolkit 0.4" "Roc Toolkit"
.TH "ROC-COPY" "1" "2024" "Roc Toolkit 0.4" "Roc Toolkit"
.SH NAME
roc-copy \- copy local audio
.SH SYNOPSIS
Expand Down Expand Up @@ -235,6 +235,6 @@ Please report any bugs found via GitHub (\fI\%https://github.com/roc\-streaming/
.sp
See authors page on the website for a list of maintainers and contributors (\fI\%https://roc\-streaming.org/toolkit/docs/about_project/authors.html\fP).
.SH COPYRIGHT
2025, Roc Streaming authors
2024, Roc Streaming authors
.\" Generated by docutils manpage writer.
.
4 changes: 2 additions & 2 deletions docs/man/roc-recv.1
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.TH "ROC-RECV" "1" "2025" "Roc Toolkit 0.4" "Roc Toolkit"
.TH "ROC-RECV" "1" "2024" "Roc Toolkit 0.4" "Roc Toolkit"
.SH NAME
roc-recv \- receive real-time audio
.SH SYNOPSIS
Expand Down Expand Up @@ -828,6 +828,6 @@ Please report any bugs found via GitHub (\fI\%https://github.com/roc\-streaming/
.sp
See authors page on the website for a list of maintainers and contributors (\fI\%https://roc\-streaming.org/toolkit/docs/about_project/authors.html\fP).
.SH COPYRIGHT
2025, Roc Streaming authors
2024, Roc Streaming authors
.\" Generated by docutils manpage writer.
.
4 changes: 2 additions & 2 deletions docs/man/roc-send.1
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.TH "ROC-SEND" "1" "2025" "Roc Toolkit 0.4" "Roc Toolkit"
.TH "ROC-SEND" "1" "2024" "Roc Toolkit 0.4" "Roc Toolkit"
.SH NAME
roc-send \- send real-time audio
.SH SYNOPSIS
Expand Down Expand Up @@ -760,6 +760,6 @@ Please report any bugs found via GitHub (\fI\%https://github.com/roc\-streaming/
.sp
See authors page on the website for a list of maintainers and contributors (\fI\%https://roc\-streaming.org/toolkit/docs/about_project/authors.html\fP).
.SH COPYRIGHT
2025, Roc Streaming authors
2024, Roc Streaming authors
.\" Generated by docutils manpage writer.
.
4 changes: 2 additions & 2 deletions docs/sphinx/building/developer_cookbook.rst
Original file line number Diff line number Diff line change
Expand Up @@ -261,10 +261,10 @@ Clean build results except third-parties and documentation:

.. code::

$ scons -Q clean_build
$ scons -Q cleanbuild

Clean only built documentation:

.. code::

$ scons -Q clean_docs
$ scons -Q cleandocs
116 changes: 45 additions & 71 deletions docs/sphinx/building/scons_options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,67 +38,44 @@ Options
-n dry run
-j N, --jobs=N allow N parallel jobs at once

--prefix=PREFIX installation prefix, '/usr' by default
--bindir=BINDIR path to the binary installation directory (where to install Roc command-line
tools), '<prefix>/bin' by default
--libdir=LIBDIR path to the library installation directory (where to install Roc library),
auto-detected by default
--incdir=INCDIR path to the headers installation directory (where to install Roc headers),
'<prefix>/include' by default
--mandir=MANDIR path to the manuals installation directory (where to install Roc manual
pages), '<prefix>/share/man/man1' by default
--build=BUILD system name where Roc is being compiled, e.g. 'x86_64-pc-linux-gnu',
auto-detected by default
--host=HOST system name where Roc will run, e.g. 'arm-linux-gnueabihf', auto-detected by
default
--platform=PLATFORM platform name where Roc will run, supported values: empty (detect from host),
'linux', 'unix', 'darwin', 'android'
--compiler=COMPILER compiler name and optional version, e.g. 'gcc-4.9', supported names:
empty (detect what available), 'clang', 'gcc', 'cc'
--compiler-launcher=COMPILER_LAUNCHER
optional launching tool for c and c++ compilers, e.g. 'ccache'
--sanitizers=SANITIZERS list of gcc/clang sanitizers, supported names: empty (no sanitizers),
'all', 'undefined', 'address'
--enable-debug enable debug build for Roc
--enable-debug-3rdparty enable debug build for 3rdparty libraries
--enable-werror treat warnings as errors
--enable-static enable building static library
--disable-shared disable building shared library
--disable-tools disable tools building
--enable-tests enable tests building and running (requires CppUTest)
--enable-benchmarks enable benchmarks building and running (requires Google Benchmark)
--enable-examples enable examples building
--enable-doxygen enable Doxygen documentation generation
--enable-sphinx enable Sphinx documentation generation
--disable-c11 disable C11 support
--disable-soversion don't write version into the shared library and don't create version symlinks
--disable-openfec disable OpenFEC support required for FEC codes
--disable-speexdsp disable SpeexDSP support for resampling
--disable-sox disable SoX support in tools
--disable-sndfile disable sndfile support in tools
--disable-openssl disable OpenSSL support required for DTLS and SRTP
--disable-libunwind disable libunwind support required for printing backtrace
--disable-libuuid disable libuuid support for reliable UUID generation
--disable-alsa disable ALSA support in tools
--disable-pulseaudio disable PulseAudio support in tools
--with-openfec-includes=WITH_OPENFEC_INCLUDES
path to the directory with OpenFEC headers (it should contain lib_common and
lib_stable subdirectories)
--with-includes=WITH_INCLUDES
additional include search path, may be used multiple times
--with-libraries=WITH_LIBRARIES
additional library search path, may be used multiple times
--macos-platform=MACOS_PLATFORM
macOS target platform, e.g. 10.12, (default is current OS version)
--macos-arch=MACOS_ARCH macOS target architecture(s), comma-separated list, supported values: 'all',
'x86_64', 'arm64' (default is current OS arch, pass multiple values or
'all' for universal binaries)
--build-3rdparty=BUILD_3RDPARTY
download and build specified 3rdparty libraries, comma-separated list of
library names and optional versions, e.g. 'libuv:1.4.2,openfec'
--override-targets=OVERRIDE_TARGETS
override targets to use, pass a comma-separated list of target names, e.g.
'pc,posix,posix_ext,gnu,libuv,openfec,...'
--prefix=PREFIX installation prefix, '/usr' by default
--bindir=BINDIR path to the binary installation directory (where to install Roc command-line tools), '<prefix>/bin' by default
--libdir=LIBDIR path to the library installation directory (where to install Roc library), auto-detected by default
--incdir=INCDIR path to the headers installation directory (where to install Roc headers), '<prefix>/include' by default
--mandir=MANDIR path to the manuals installation directory (where to install Roc manual pages), '<prefix>/share/man/man1' by default
--build=BUILD system name where Roc is being compiled, e.g. 'x86_64-pc-linux-gnu', auto-detected by default
--host=HOST system name where Roc will run, e.g. 'arm-linux-gnueabihf', auto-detected by default
--platform=PLATFORM platform name where Roc will run, supported values: empty (detect from host), 'linux', 'unix', 'darwin', 'android'
--compiler=COMPILER compiler name and optional version, e.g. 'gcc-4.9', supported names: empty (detect what available), 'clang', 'gcc', 'cc'
--compiler-launcher=COMPILER_LAUNCHER optional launching tool for c and c++ compilers, e.g. 'ccache'
--sanitizers=SANITIZERS list of gcc/clang sanitizers, supported names: empty (no sanitizers), 'all', 'undefined', 'address'
--enable-debug enable debug build for Roc
--enable-debug-3rdparty enable debug build for 3rdparty libraries
--enable-werror treat warnings as errors
--enable-static enable building static library
--disable-shared disable building shared library
--disable-tools disable tools building
--enable-tests enable tests building and running (requires CppUTest)
--enable-benchmarks enable bechmarks building and running (requires Google Benchmark)
--enable-examples enable examples building
--enable-doxygen enable Doxygen documentation generation
--enable-sphinx enable Sphinx documentation generation
--disable-c11 disable C11 support
--disable-soversion don't write version into the shared library and don't create version symlinks
--disable-openfec disable OpenFEC support required for FEC codes
--disable-speexdsp disable SpeexDSP support for resampling
--disable-sox disable SoX support in tools
--disable-openssl disable OpenSSL support required for DTLS and SRTP
--disable-libunwind disable libunwind support required for printing backtrace
--disable-alsa disable ALSA support in tools
--disable-pulseaudio disable PulseAudio support in tools
--with-openfec-includes=WITH_OPENFEC_INCLUDES path to the directory with OpenFEC headers (it should contain lib_common and lib_stable subdirectories)
--with-includes=WITH_INCLUDES additional include search path, may be used multiple times
--with-libraries=WITH_LIBRARIES additional library search path, may be used multiple times
--macos-platform=MACOS_PLATFORM macOS target platform, e.g. 10.12, (default is current OS version)
--macos-arch=MACOS_ARCH macOS target architecture(s), comma-separated list, supported values: 'all', 'x86_64', 'arm64' (default is current OS arch, pass multiple values or 'all' for univeral binaries)
--build-3rdparty=BUILD_3RDPARTY download and build specified 3rdparty libraries, comma-separated list of library names and optional versions, e.g. 'libuv:1.4.2,openfec'
--override-targets=OVERRIDE_TARGETS override targets to use, pass a comma-separated list of target names, e.g. 'pc,posix,posix_ext,gnu,libuv,openfec,...'

Variables
=========
Expand Down Expand Up @@ -131,14 +108,14 @@ Variables
Targets
=======

`omitted` or ``.``
build everything (including documentation, see ``docs`` target)
`omitted`
build everything

``test``
build everything, then run tests
build everything and run tests

``bench``
build everything, then run benchmarks
build everything and run benchmarks

``clean``
full clean, including build results, downloaded third-parties, generated documentation, and scons database
Expand All @@ -150,26 +127,23 @@ Targets
remove only generated documentation

``install``
install build results into the system or ``DESTDIR``
install build results into the system

``uninstall``
remove build results from the system or ``DESTDIR``
remove build results from the system

``fmt``
format source code (requires clang-format)

``docs``
build documentation, includes ``doxygen`` target if enabled with ``--enable-doxygen`` and ``sphinx`` target if enabled with ``--enable-sphinx``
build website (includes ``doxygen`` and ``sphinx`` targets)

``doxygen``
build doxygen documentation (requires doxygen and graphviz)

``sphinx``
build sphinx documentation (requires doxygen, sphinx-build, and breathe-apidoc)

``doctest``
run python doctests from scripts (useful when you're updating scripts)

``{module}``
build specific module, e.g. ``roc_pipeline``

Expand Down
16 changes: 2 additions & 14 deletions scripts/ci_checks/docker.sh
Original file line number Diff line number Diff line change
@@ -1,27 +1,15 @@
#!/usr/bin/env bash
#
# This script can be run locally by user 'bob' like this:
#
# DOCKER_UID="$(id -u bob)" DOCKER_GID="$(id -g bob)" ./scripts/ci_checks/docker.sh ...
#
# (the full command line with exact arguments to docker.sh can be taken from CI)

set -eux -o pipefail
set -euxo pipefail

if [ -z "${CI:-}" ]; then
opts=-ti
else
opts=-t
fi

user="${DOCKER_UID:-"$UID"}"
if [ -n "${DOCKER_GID:-}" ]; then
user="$user:$DOCKER_GID"
fi

docker run --rm ${opts} \
--cap-add SYS_PTRACE \
-u "$user" \
-u "${UID}" \
-v "$(pwd)":/opt/roc \
-w /opt/roc \
-e CI="${CI:-}" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

set -euo pipefail

scons -Q doctest
scons -Q selftest
Loading
Loading