Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add back the tox_loop implementation for low latency. #1

Open
wants to merge 75 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
b03b571
fix: flaky tcp test
Green-Sky Jan 4, 2023
2457125
cleanup: align group send err enum order
Green-Sky Mar 8, 2024
aebbfab
cleanup: event length naming inconsistencies
Green-Sky Mar 8, 2024
0199c0f
cleanup: apply the same scheme to types
Green-Sky Mar 8, 2024
3e05824
refactor: Rename `out` parameters to `out_$something`.
iphydf Mar 6, 2024
ad4921d
cleanup: A more descriptive error for group invite accept function
JFreegman Mar 11, 2024
5c8aa65
docs: Update user data API explanation
nurupo Mar 10, 2024
419d783
docs: Public headers, tox -> Tox
nurupo Mar 10, 2024
be8a82a
docs: Public headers, null -> NULL
nurupo Mar 10, 2024
4c90295
docs: Public headers, 80 column width comments
nurupo Mar 10, 2024
be085db
docs: Public headers, spellcheck
nurupo Mar 10, 2024
8175189
docs: Public headers, NULL-terminated -> NUL-terminated
nurupo Mar 10, 2024
f78d0f3
docs: Public headers, events_alloc -> internal
nurupo Mar 10, 2024
a3d1b85
docs: Public headers, Core/toxcore -> Tox/the Tox library
nurupo Mar 10, 2024
0ec4978
refactor: Don't expose Tox_System in the public API
nurupo Mar 17, 2024
9e9ed77
docs: Add missing param docs for callbacks.
iphydf Mar 26, 2024
7df3f99
docs: Document that group topic lock is default on.
iphydf Mar 26, 2024
f904179
chore: Add cmake flag to disable unit tests.
iphydf Mar 25, 2024
da43876
chore: Release 0.2.19
robinlinden Mar 26, 2024
7572888
chore: Fix GitHub actions deprecation warnings
robinlinden Mar 26, 2024
fa20168
cleanup: Remove useless if clause
JFreegman Feb 28, 2024
5344d7f
fix: Memory leak in the bootstrap daemon
nurupo Apr 4, 2024
719041e
chore: Fix Circle CI failing on a missing clang lib
nurupo Apr 27, 2024
3485b5f
chore: Disable -Wswitch-default and -Wunsafe-buffer-usage
nurupo Apr 27, 2024
cc9515d
chore: Fix cpplint failing to install
nurupo Apr 27, 2024
102a1fa
chore: Fix -Werror=maybe-uninitialized in a test
nurupo Apr 27, 2024
cab1f7d
chore: Update WineHQ's apt key hash
nurupo Jul 13, 2024
51b24d1
chore: Run CompCert on the stable branch of libsodium
nurupo Jul 13, 2024
d369c93
chore: Fix Emscripten build failing with no host specified
nurupo Jul 13, 2024
258148b
chore(ci): new minimum for all android versions is 21
Green-Sky Sep 17, 2024
671b1f9
fix: toxav rtp temp buffer allocation size was too large
Green-Sky Sep 17, 2024
03e9fbf
fix: Use Opus in the CBR mode
nurupo May 10, 2024
e9076f4
chore(cmake): set options changes as cache and with force
Green-Sky Jul 16, 2024
ddb9d32
chore: Upgrade to FreeBSD 14.1 in cirrus build.
iphydf Nov 6, 2024
8c1bda5
chore(deps): bump golang.org/x/net
dependabot[bot] Nov 6, 2024
350c0ba
cleanup: Sort apk/apt install commands in Dockerfiles.
iphydf Nov 6, 2024
03fd7a6
chore: Use toktok's cmp instead of upstream.
iphydf Nov 6, 2024
df67578
chore: Add release-drafter github action.
iphydf Nov 6, 2024
5752fc2
refactor: Make tox-bootstrapd use bool instead of int
nurupo Feb 16, 2024
a57c2c8
refactor: Make ToxAV independent of toxcore internals.
zoff99 Feb 7, 2024
9610ac3
fix: Return an error instead of crashing on nullptr args in NGC.
iphydf Nov 8, 2024
4067628
fix: events leak that can occur if allocation fails
Green-Sky Oct 9, 2024
4d4251c
chore: lower cirrus ci timeout drastically
Green-Sky Nov 8, 2024
ce4f29e
cleanup: Fix all `-Wsign-compare` warnings.
iphydf Nov 8, 2024
6d27a1a
fix: wrong comment for closelist
Green-Sky Nov 8, 2024
5f88a08
fix: friend_connections leak on allocation failure
Green-Sky Oct 10, 2024
7e57328
docs(toxav): fix docs of toxav.h
Green-Sky Apr 27, 2024
55752a2
fix(toxav): pass video bit rate as kbit
Green-Sky Nov 8, 2024
3acef4b
fix: Add missing free in dht_get_nodes_response event.
iphydf Nov 9, 2024
934a830
chore: Release 0.2.20
robinlinden Nov 10, 2024
41fb183
chore: Add check to ensure version numbers agree.
iphydf Nov 10, 2024
2e94da6
feat(net): add missing connect to network struct
Green-Sky Oct 16, 2024
b396c06
chore(deps): bump third_party/cmp from `2ac6bca` to `52bfcfa`
dependabot[bot] Nov 13, 2024
bdd17c1
cleanup: Allocate logger using tox memory allocator.
iphydf Nov 9, 2024
14d8231
chore: Migrate to conan 2.
iphydf Nov 19, 2024
1dc399b
chore: Use vcpkg instead of conan in the MSVC build.
iphydf Nov 21, 2024
7d2811d
chore(ci): make bazel server shutdown faster
Green-Sky Nov 12, 2024
0ac23ce
fix: windows use of REUSEADDR
Green-Sky Nov 10, 2024
819aa2b
feat: Add option to disable DNS lookups in toxcore.
iphydf Feb 17, 2024
93aafd7
fix: friend requests with very long messages are no longer dropped
JFreegman Mar 2, 2024
29d1043
test: friend request test now tests min/max message sizes
JFreegman Nov 28, 2024
ac81287
feat: implement the last 2 missing network struct functions
Green-Sky Oct 11, 2024
df2211e
refactor: Use tox memory allocator for temporary buffers in crypto.
iphydf Nov 27, 2024
0204db6
cleanup: Fix layering check warnings.
iphydf Dec 4, 2024
c660bbe
test: Fix crypto_test to initialise its plain text buffer.
iphydf Dec 4, 2024
6460c25
refactor: Use `merge_sort` instead of `qsort` for sorting.
iphydf Feb 3, 2024
4f09f4e
chore: Fix tsan build by moving it to GitHub CI.
iphydf Dec 11, 2024
11ab1d2
fix: reduce memory usage in group chats by 75%
Green-Sky Apr 27, 2024
fc06506
fix: Allow peers to reconnect to group chats using a password
JFreegman Dec 20, 2024
2a6dc64
chore: Upgrade dependencies for websockify.
iphydf Dec 20, 2024
d55d0e4
cleanup: Remove redundant code for checking if group exists
JFreegman Dec 23, 2024
2bbfb35
docs: Output the error code string instead of int. in toxav logging
iphydf Dec 25, 2024
8a96816
chore: Add dispatch/events headers to bazel export.
iphydf Dec 28, 2024
2f62f3d
refactor: Use tox Memory for group allocations.
iphydf Dec 28, 2024
8a0c9a4
feat: Add back the `tox_loop` implementation for low latency.
iphydf Dec 29, 2021
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
1 change: 1 addition & 0 deletions .circleci/cmake-tsan
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ cmake -B_build -H. -GNinja \
-DSTRICT_ABI=ON \
-DTEST_TIMEOUT_SECONDS=120 \
-DUSE_IPV6=OFF \
-DUSE_LIBEV=ON \
-DAUTOTEST=ON

cd _build
Expand Down
100 changes: 29 additions & 71 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,14 @@ version: 2

workflows:
version: 2
program-analysis:
circleci:
jobs:
# Dynamic analysis in the Bazel build
- bazel-asan
- bazel-msan
- bazel-tsan
# Dynamic analysis with CMake
- asan
- tsan
- ubsan
# Static analysis
- clang-analyze
- cpplint
- static-analysis
- cimplefmt
- generate-events

jobs:
bazel-asan:
Expand All @@ -29,31 +23,7 @@ jobs:
- run: .circleci/bazel-test
//c-toxcore/...

bazel-tsan:
working_directory: /tmp/cirrus-ci-build
docker:
- image: toxchat/toktok-stack:latest-tsan

steps:
- checkout
- run: .circleci/bazel-test
//c-toxcore/...
-//c-toxcore/auto_tests:conference_av_test
-//c-toxcore/auto_tests:conference_test
-//c-toxcore/auto_tests:onion_test
-//c-toxcore/auto_tests:tox_many_test

bazel-msan:
working_directory: /tmp/cirrus-ci-build
docker:
- image: toxchat/toktok-stack:latest-msan

steps:
- checkout
- run: .circleci/bazel-test
//c-toxcore/auto_tests:lossless_packet_test

asan:
static-analysis:
working_directory: ~/work
docker:
- image: ubuntu
Expand All @@ -62,12 +32,14 @@ jobs:
- run: &apt_install
apt-get update &&
DEBIAN_FRONTEND=noninteractive
apt-get install -y --no-install-recommends
apt-get install -y
ca-certificates
clang
cmake
git
libbenchmark-dev
libconfig-dev
libev-dev
libgmock-dev
libgtest-dev
libopus-dev
Expand All @@ -76,39 +48,6 @@ jobs:
llvm-dev
ninja-build
pkg-config
- checkout
- run: git submodule update --init --recursive
- run: CC=clang .circleci/cmake-asan

tsan:
working_directory: ~/work
docker:
- image: ubuntu

steps:
- run: *apt_install
- checkout
- run: git submodule update --init --recursive
- run: CC=clang .circleci/cmake-tsan

ubsan:
working_directory: ~/work
docker:
- image: ubuntu

steps:
- run: *apt_install
- checkout
- run: git submodule update --init --recursive
- run: CC=clang .circleci/cmake-ubsan

static-analysis:
working_directory: ~/work
docker:
- image: ubuntu

steps:
- run: *apt_install
- run:
apt-get install -y --no-install-recommends
ca-certificates
Expand All @@ -120,6 +59,8 @@ jobs:
- run: other/analysis/check_logger_levels
- run: other/analysis/run-clang
- run: other/analysis/run-gcc
- run: other/analysis/run-cppcheck
- run: other/analysis/run-clang-analyze

clang-analyze:
working_directory: ~/work
Expand All @@ -141,9 +82,26 @@ jobs:
- run: *apt_install
- run:
apt-get install -y --no-install-recommends
ca-certificates
python3-pip
cpplint
- checkout
- run: git submodule update --init --recursive
- run: pip install cpplint
- run: other/analysis/run-cpplint

cimplefmt:
working_directory: ~/work
machine: { image: ubuntu-2204:current }

steps:
- checkout
- run: git submodule update --init --recursive
- run: other/docker/cimplefmt/run -u $(find tox* -name "*.[ch]")

generate-events:
working_directory: ~/work
machine: { image: ubuntu-2204:current }

steps:
- checkout
- run: git submodule update --init --recursive
- run: other/event_tooling/run
- run: git diff --exit-code
43 changes: 35 additions & 8 deletions .cirrus.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
bazel-opt_task:
timeout_in: 5m
container:
image: toxchat/toktok-stack:latest-release
cpu: 2
Expand All @@ -8,14 +9,17 @@ bazel-opt_task:
- git submodule update --init --recursive
- /src/workspace/tools/inject-repo c-toxcore
test_all_script:
- cd /src/workspace && bazel test -k
- cd /src/workspace && bazel
--max_idle_secs=5
test -k
--build_tag_filters=-haskell
--test_tag_filters=-haskell
--
//c-toxcore/...
-//c-toxcore/auto_tests:tcp_relay_test # TODO(robinlinden): Why does this pass locally but not in Cirrus?
-//c-toxcore/auto_tests:tcp_relay_test # Cirrus doesn't allow external network connections.

bazel-dbg_task:
timeout_in: 5m
container:
image: toxchat/toktok-stack:latest-debug
cpu: 2
Expand All @@ -24,15 +28,35 @@ bazel-dbg_task:
- git submodule update --init --recursive
- /src/workspace/tools/inject-repo c-toxcore
test_all_script:
- cd /src/workspace && bazel test -k
- cd /src/workspace && bazel
--max_idle_secs=5
test -k
--remote_cache=http://$CIRRUS_HTTP_CACHE_HOST
--build_tag_filters=-haskell
--test_tag_filters=-haskell
--remote_http_cache=http://$CIRRUS_HTTP_CACHE_HOST
--
//c-toxcore/...
-//c-toxcore/auto_tests:tcp_relay_test # TODO(robinlinden): Why does this pass locally but not in Cirrus?
-//c-toxcore/auto_tests:tcp_relay_test # Cirrus doesn't allow external network connections.

bazel-msan_task:
timeout_in: 5m
container:
image: toxchat/toktok-stack:latest-msan
cpu: 2
memory: 2G
configure_script:
- git submodule update --init --recursive
- /src/workspace/tools/inject-repo c-toxcore
test_all_script:
- cd /src/workspace && bazel
--max_idle_secs=5
test -k
--remote_cache=http://$CIRRUS_HTTP_CACHE_HOST
--
//c-toxcore/auto_tests:lossless_packet_test

cimple_task:
timeout_in: 5m
container:
image: toxchat/toktok-stack:latest-release
cpu: 2
Expand All @@ -41,15 +65,18 @@ cimple_task:
- git submodule update --init --recursive
- /src/workspace/tools/inject-repo c-toxcore
test_all_script:
- cd /src/workspace && bazel test -k
- cd /src/workspace && bazel
--max_idle_secs=5
test -k
--build_tag_filters=haskell
--test_tag_filters=haskell
--
//c-toxcore/...

freebsd_task:
timeout_in: 5m
freebsd_instance:
image_family: freebsd-14-0
image_family: freebsd-14-1
configure_script:
- PAGER=cat ASSUME_ALWAYS_YES=YES pkg install
cmake
Expand All @@ -69,7 +96,7 @@ freebsd_task:
cmake . \
-DMIN_LOGGER_LEVEL=TRACE \
-DMUST_BUILD_TOXAV=ON \
-DNON_HERMETIC_TESTS=ON \
-DNON_HERMETIC_TESTS=OFF \
-DTEST_TIMEOUT_SECONDS=50 \
-DUSE_IPV6=OFF \
-DAUTOTEST=ON
Expand Down
4 changes: 2 additions & 2 deletions .github/scripts/cmake-android
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ ABI=${1:-"armeabi-v7a"}
case $ABI in
armeabi-v7a)
TARGET=armv7a-linux-androideabi
NDK_API=19
NDK_API=21
;;
arm64-v8a)
TARGET=aarch64-linux-android
NDK_API=21
;;
x86)
TARGET=i686-linux-android
NDK_API=19
NDK_API=21
;;
x86_64)
TARGET=x86_64-linux-android
Expand Down
8 changes: 5 additions & 3 deletions .github/scripts/flags-clang.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,17 @@ add_flag -Wno-padded
# This warns on things like _XOPEN_SOURCE, which we currently need (we
# probably won't need these in the future).
add_flag -Wno-reserved-id-macro
# TODO(iphydf): Clean these up. They are likely not bugs, but still
# potential issues and probably confusing.
add_flag -Wno-sign-compare
# We don't want to have default cases, we want to explicitly define all cases
add_flag -Wno-switch-default
# __attribute__((nonnull)) causes this warning on defensive null checks.
add_flag -Wno-tautological-pointer-compare
# Our use of mutexes results in a false positive, see 1bbe446.
add_flag -Wno-thread-safety-analysis
# File transfer code has this.
add_flag -Wno-type-limits
# Generates false positives in toxcore similar to
# https://github.com/llvm/llvm-project/issues/64646
add_flag -Wno-unsafe-buffer-usage
# Callbacks often don't use all their parameters.
add_flag -Wno-unused-parameter
# cimple does this better
Expand Down
3 changes: 1 addition & 2 deletions .github/scripts/flags-gcc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ add_flag -Wunused-value

# struct Foo foo = {0}; is a common idiom.
add_flag -Wno-missing-field-initializers
# TODO(iphydf): Clean these up. They are likely not bugs, but still
# potential issues and probably confusing.
# Checked by clang, but gcc is warning when it's not necessary.
add_flag -Wno-sign-compare
# File transfer code has this.
add_flag -Wno-type-limits
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: checks

on:
pull_request:
branches: [master]
types: [opened, reopened, synchronize, milestoned]
pull_request_target:
branches: [master]

jobs:
checks:
uses: TokTok/ci-tools/.github/workflows/check-release.yml@master
Loading