Skip to content

Commit

Permalink
Merge branch 'master' into noiseIK_2023_PR
Browse files Browse the repository at this point in the history
  • Loading branch information
iphydf committed Nov 12, 2024
2 parents cea8d45 + 41fb183 commit 341e150
Show file tree
Hide file tree
Showing 107 changed files with 1,397 additions and 1,187 deletions.
12 changes: 8 additions & 4 deletions .cirrus.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
---
bazel-opt_task:
timeout_in: 5m
container:
image: toxchat/toktok-stack:latest-release
cpu: 2
memory: 2G
configure_script:
- git submodule update --init --recursive
- /src/workspace/tools/inject-repo c-toxcore
- sed -i -e 's/build --config=remote/#&/' /src/workspace/.bazelrc.local
test_all_script:
- cd /src/workspace && bazel test -k
--remote_cache=http://$CIRRUS_HTTP_CACHE_HOST
--build_tag_filters=-haskell
--test_tag_filters=-haskell
--
//c-toxcore/...
-//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 @@ -26,32 +28,34 @@ bazel-dbg_task:
- /src/workspace/tools/inject-repo c-toxcore
test_all_script:
- cd /src/workspace && bazel 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 # Cirrus doesn't allow external network connections.

cimple_task:
timeout_in: 5m
container:
image: toxchat/toktok-stack:latest-release
cpu: 2
memory: 4G
configure_script:
- git submodule update --init --recursive
- /src/workspace/tools/inject-repo c-toxcore
- sed -i -e 's/build --config=remote/#&/' /src/workspace/.bazelrc.local
test_all_script:
- cd /src/workspace && bazel test -k
--remote_cache=http://$CIRRUS_HTTP_CACHE_HOST
--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 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
3 changes: 0 additions & 3 deletions .github/scripts/flags-clang.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ 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.
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
12 changes: 12 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: release

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

jobs:
release:
uses: TokTok/ci-tools/.github/workflows/release-drafter.yml@master
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "third_party/cmp"]
path = third_party/cmp
url = https://github.com/camgunz/cmp
url = https://github.com/TokTok/cmp
32 changes: 32 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,35 @@


## v0.2.20

### Merged PRs:

- [#2788](https://github.com/TokTok/c-toxcore/pull/2788) fix: Add missing free in dht_get_nodes_response event.
- [#2786](https://github.com/TokTok/c-toxcore/pull/2786) cleanup: Fix all `-Wsign-compare` warnings.
- [#2785](https://github.com/TokTok/c-toxcore/pull/2785) fix: wrong comment for closelist
- [#2784](https://github.com/TokTok/c-toxcore/pull/2784) chore: lower cirrus ci timeout drastically
- [#2783](https://github.com/TokTok/c-toxcore/pull/2783) fix: Return an error instead of crashing on nullptr args in NGC.
- [#2782](https://github.com/TokTok/c-toxcore/pull/2782) fix(toxav): pass video bit rate as kbit
- [#2780](https://github.com/TokTok/c-toxcore/pull/2780) chore: Add release-drafter github action.
- [#2779](https://github.com/TokTok/c-toxcore/pull/2779) chore: Use toktok's cmp instead of upstream.
- [#2778](https://github.com/TokTok/c-toxcore/pull/2778) cleanup: Sort apk/apt install commands in Dockerfiles.
- [#2777](https://github.com/TokTok/c-toxcore/pull/2777) chore: Upgrade to FreeBSD 14.1 in cirrus build.
- [#2772](https://github.com/TokTok/c-toxcore/pull/2772) fix: friend_connections leak on allocation failure.
- [#2771](https://github.com/TokTok/c-toxcore/pull/2771) fix: events leak that can occur if allocation fails
- [#2769](https://github.com/TokTok/c-toxcore/pull/2769) chore(ci): new minimum for all android versions is 21
- [#2768](https://github.com/TokTok/c-toxcore/pull/2768) fix: toxav rtp temp buffer allocation size was too large
- [#2762](https://github.com/TokTok/c-toxcore/pull/2762) chore(cmake): set options changes as cache and with force
- [#2761](https://github.com/TokTok/c-toxcore/pull/2761) chore: Fix CI
- [#2757](https://github.com/TokTok/c-toxcore/pull/2757) fix: Use Opus in the CBR mode
- [#2755](https://github.com/TokTok/c-toxcore/pull/2755) chore: Fix Circle CI build failing
- [#2754](https://github.com/TokTok/c-toxcore/pull/2754) docs(toxav): fix docs of toxav.h
- [#2751](https://github.com/TokTok/c-toxcore/pull/2751) chore(deps): bump golang.org/x/net from 0.17.0 to 0.23.0 in /other/bootstrap_daemon/websocket/websockify
- [#2747](https://github.com/TokTok/c-toxcore/pull/2747) fix: Memory leak in the bootstrap daemon
- [#2745](https://github.com/TokTok/c-toxcore/pull/2745) chore: Fix GitHub actions deprecation warnings
- [#2717](https://github.com/TokTok/c-toxcore/pull/2717) cleanup: Remove useless if clause
- [#2692](https://github.com/TokTok/c-toxcore/pull/2692) refactor: Make tox-bootstrapd use bool instead of int
- [#2651](https://github.com/TokTok/c-toxcore/pull/2651) refactor: Make ToxAV independent of toxcore internals.

## v0.2.19

### Merged PRs:
Expand Down Expand Up @@ -30,6 +60,7 @@
- [#2697](https://github.com/TokTok/c-toxcore/pull/2697) test: Build toxcore on NetBSD (VM).
- [#2696](https://github.com/TokTok/c-toxcore/pull/2696) fix: save_compatibility_test failing on big-endian systems
- [#2695](https://github.com/TokTok/c-toxcore/pull/2695) fix: Don't serve files from websockify.
- [#2691](https://github.com/TokTok/c-toxcore/pull/2691) chore: Release 0.2.19
- [#2689](https://github.com/TokTok/c-toxcore/pull/2689) fix: Correctly pass extended public keys to group moderation code.
- [#2686](https://github.com/TokTok/c-toxcore/pull/2686) chore: Compile libsodium reference implementation with compcert.
- [#2685](https://github.com/TokTok/c-toxcore/pull/2685) cleanup: correct a few nullable annotations
Expand Down Expand Up @@ -252,6 +283,7 @@
- [#2739](https://github.com/TokTok/c-toxcore/issues/2739) Tox_Options.operating_system is not clear about it being an experimental option
- [#2734](https://github.com/TokTok/c-toxcore/issues/2734) error compiling on fedora
- [#2649](https://github.com/TokTok/c-toxcore/issues/2649) create_extended_keypair should use Random and be made deterministic for fuzzing
- [#2462](https://github.com/TokTok/c-toxcore/issues/2462) Fix code scanning alert - Uncontrolled data used in path expression
- [#2358](https://github.com/TokTok/c-toxcore/issues/2358) resolve_bootstrap_node assert hit
- [#2352](https://github.com/TokTok/c-toxcore/issues/2352) SEGV after infinite loop retrying proxy_socks5_read_connection_response
- [#2335](https://github.com/TokTok/c-toxcore/issues/2335) ipv6 disabled on kernel cmdline disrupts Tox = most tests fail
Expand Down
12 changes: 7 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ set_source_files_properties(
# versions in a synchronised way.
set(PROJECT_VERSION_MAJOR "0")
set(PROJECT_VERSION_MINOR "2")
set(PROJECT_VERSION_PATCH "19")
set(PROJECT_VERSION_PATCH "20")
set(PROJECT_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")

# set .so library version / following libtool scheme
Expand Down Expand Up @@ -161,7 +161,7 @@ option(DHT_BOOTSTRAP "Enable building of DHT_bootstrap" ON)
option(BOOTSTRAP_DAEMON "Enable building of tox-bootstrapd" ON)
if(BOOTSTRAP_DAEMON AND WIN32)
message(WARNING "Building tox-bootstrapd for Windows is not supported, disabling")
set(BOOTSTRAP_DAEMON OFF)
set(BOOTSTRAP_DAEMON OFF CACHE BOOL "" FORCE)
endif()

option(BUILD_FUZZ_TESTS "Build fuzzing harnesses" OFF)
Expand All @@ -177,18 +177,19 @@ include(Dependencies)

if(MUST_BUILD_TOXAV)
set(NO_TOXAV_ERROR_TYPE SEND_ERROR)
set(BUILD_TOXAV ON CACHE BOOL "" FORCE)
else()
set(NO_TOXAV_ERROR_TYPE WARNING)
endif()

if(BUILD_TOXAV)
if(NOT OPUS_FOUND)
message(${NO_TOXAV_ERROR_TYPE} "Option BUILD_TOXAV is enabled but required library OPUS was not found.")
set(BUILD_TOXAV OFF)
set(BUILD_TOXAV OFF CACHE BOOL "" FORCE)
endif()
if(NOT VPX_FOUND)
message(${NO_TOXAV_ERROR_TYPE} "Option BUILD_TOXAV is enabled but required library VPX was not found.")
set(BUILD_TOXAV OFF)
set(BUILD_TOXAV OFF CACHE BOOL "" FORCE)
endif()
endif()

Expand Down Expand Up @@ -391,6 +392,7 @@ if(BUILD_TOXAV)
toxav/rtp.h
toxav/toxav.c
toxav/toxav.h
toxav/toxav_hacks.h
toxav/toxav_old.c
toxav/video.c
toxav/video.h)
Expand Down Expand Up @@ -597,7 +599,7 @@ if(BOOTSTRAP_DAEMON)
add_subdirectory(other/bootstrap_daemon)
else()
message(WARNING "Option BOOTSTRAP_DAEMON is enabled but required library LIBCONFIG was not found.")
set(BOOTSTRAP_DAEMON OFF)
set(BOOTSTRAP_DAEMON OFF CACHE BOOL "" FORCE)
endif()
endif()

Expand Down
2 changes: 1 addition & 1 deletion auto_tests/conference_av_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ static void test_groupav(AutoTox *autotoxes)
tox_events_callback_conference_connected(autotoxes[i].dispatch, handle_conference_connected);
}

ck_assert_msg(toxav_add_av_groupchat(autotoxes[0].tox, audio_callback, &autotoxes[0]) != UINT32_MAX,
ck_assert_msg(toxav_add_av_groupchat(autotoxes[0].tox, audio_callback, &autotoxes[0]) != -1,
"failed to create group");
printf("tox #%u: inviting its first friend\n", autotoxes[0].index);
ck_assert_msg(tox_conference_invite(autotoxes[0].tox, 0, 0, nullptr) != 0, "failed to invite friend");
Expand Down
2 changes: 1 addition & 1 deletion auto_tests/conference_double_invite_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ static void handle_conference_invite(

ck_assert_msg(!state->joined, "invitation callback generated for already joined conference");

if (friend_number != -1) {
if (friend_number != UINT32_MAX) {
Tox_Err_Conference_Join err;
state->conference = tox_conference_join(autotox->tox, friend_number, cookie, length, &err);
ck_assert_msg(err == TOX_ERR_CONFERENCE_JOIN_OK,
Expand Down
2 changes: 1 addition & 1 deletion auto_tests/conference_invite_merge_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ static void handle_conference_invite(
const uint8_t *cookie = tox_event_conference_invite_get_cookie(event);
const size_t length = tox_event_conference_invite_get_cookie_length(event);

if (friend_number != -1) {
if (friend_number != UINT32_MAX) {
Tox_Err_Conference_Join err;
state->conference = tox_conference_join(autotox->tox, friend_number, cookie, length, &err);
ck_assert_msg(err == TOX_ERR_CONFERENCE_JOIN_OK,
Expand Down
14 changes: 9 additions & 5 deletions auto_tests/toxav_many_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,29 +168,33 @@ static void test_av_three_calls(void)
Time_Data time_data;
pthread_mutex_init(&time_data.lock, nullptr);
{
Tox_Options *opts = tox_options_new(nullptr);
ck_assert(opts != nullptr);
tox_options_set_experimental_thread_safety(opts, true);
Tox_Err_New error;

bootstrap = tox_new_log(nullptr, &error, &index[0]);
bootstrap = tox_new_log(opts, &error, &index[0]);
ck_assert(error == TOX_ERR_NEW_OK);

time_data.clock = current_time_monotonic(bootstrap->mono_time);
set_current_time_callback(bootstrap, &time_data);

alice = tox_new_log(nullptr, &error, &index[1]);
alice = tox_new_log(opts, &error, &index[1]);
ck_assert(error == TOX_ERR_NEW_OK);
set_current_time_callback(alice, &time_data);

bobs[0] = tox_new_log(nullptr, &error, &index[2]);
bobs[0] = tox_new_log(opts, &error, &index[2]);
ck_assert(error == TOX_ERR_NEW_OK);
set_current_time_callback(bobs[0], &time_data);

bobs[1] = tox_new_log(nullptr, &error, &index[3]);
bobs[1] = tox_new_log(opts, &error, &index[3]);
ck_assert(error == TOX_ERR_NEW_OK);
set_current_time_callback(bobs[1], &time_data);

bobs[2] = tox_new_log(nullptr, &error, &index[4]);
bobs[2] = tox_new_log(opts, &error, &index[4]);
ck_assert(error == TOX_ERR_NEW_OK);
set_current_time_callback(bobs[2], &time_data);
tox_options_free(opts);
}

printf("Created 5 instances of Tox\n");
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.

AC_PREREQ([2.65])
AC_INIT([tox], [0.2.19])
AC_INIT([tox], [0.2.20])
AC_CONFIG_AUX_DIR(configure_aux)
AC_CONFIG_SRCDIR([toxcore/net_crypto.c])
AM_INIT_AUTOMAKE([foreign 1.10 -Wall -Werror subdir-objects tar-ustar])
Expand Down
1 change: 0 additions & 1 deletion other/analysis/run-clang
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ run() {
-Wno-missing-noreturn \
-Wno-old-style-cast \
-Wno-padded \
-Wno-sign-compare \
-Wno-switch-default \
-Wno-tautological-pointer-compare \
-Wno-unreachable-code-return \
Expand Down
2 changes: 0 additions & 2 deletions other/analysis/run-cppcheck
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ CPPCHECK+=("--suppress=knownConditionTrueFalse")
CPPCHECK+=("--suppress=missingIncludeSystem")
# TODO(iphydf): Maybe fix?
CPPCHECK+=("--suppress=signConversion")
# TODO(iphydf): Fixed in the toxav refactor PR.
CPPCHECK+=("--suppress=redundantAssignment")

# We use this for VLAs.
CPPCHECK_CXX+=("--suppress=allocaCalled")
Expand Down
2 changes: 1 addition & 1 deletion other/bootstrap_daemon/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ FROM alpine:3.19.0 AS build
RUN ["apk", "--no-cache", "add",\
"clang",\
"cmake",\
"linux-headers",\
"libconfig-dev",\
"libconfig-static",\
"libsodium-dev",\
"libsodium-static",\
"linux-headers",\
"musl-dev",\
"ninja",\
"python3"]
Expand Down
2 changes: 1 addition & 1 deletion other/bootstrap_daemon/docker/tox-bootstrapd.sha256
Original file line number Diff line number Diff line change
@@ -1 +1 @@
e96f03a89051c5df12c28d0d6941184da2b92742d248bd4c57d31189a0052844 /usr/local/bin/tox-bootstrapd
9ec2993a28988bd147bf8f4f21a824c2fc5dbf7255e391b3ce517d337ebce5c1 /usr/local/bin/tox-bootstrapd
Loading

0 comments on commit 341e150

Please sign in to comment.