Skip to content

Curl prepack#358

Merged
HenryNdubuaku merged 42 commits intocactus-compute:mainfrom
BruinAI:curl_prepack
Feb 17, 2026
Merged

Curl prepack#358
HenryNdubuaku merged 42 commits intocactus-compute:mainfrom
BruinAI:curl_prepack

Conversation

@kar-m
Copy link
Copy Markdown
Collaborator

@kar-m kar-m commented Feb 16, 2026

No description provided.

justinl66 and others added 30 commits February 7, 2026 01:08
Signed-off-by: justinl66 <[email protected]>
Signed-off-by: justinl66 <[email protected]>
Signed-off-by: justinl66 <[email protected]>
Signed-off-by: justinl66 <[email protected]>
Signed-off-by: justinl66 <[email protected]>
Signed-off-by: justinl66 <[email protected]>
Signed-off-by: justinl66 <[email protected]>
Signed-off-by: justinl66 <[email protected]>
Signed-off-by: Karen Mosoyan <[email protected]>
Signed-off-by: Karen Mosoyan <[email protected]>
Signed-off-by: Karen Mosoyan <[email protected]>
@kar-m kar-m marked this pull request as ready for review February 16, 2026 17:36
Copilot AI review requested due to automatic review settings February 16, 2026 17:36
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR “prepacks” (vendors) libcurl artifacts and wires them into Cactus builds/tests across Apple and Android, while adding curl smoke tests and updating the default transcription model.

Changes:

  • Vendor libcurl headers and add build/script support for linking against vendored static libcurl on macOS/iOS/Android.
  • Add curl runtime/smoke tests to validate curl availability and basic API calls.
  • Switch default transcription model to openai/whisper-small in test scripts and the Python CLI.

Reviewed changes

Copilot reviewed 31 out of 36 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
tests/test_engine.cpp Adds curl header detection and a curl runtime smoke test executed from the engine test runner.
tests/test_curl.cpp New standalone curl API smoke-test executable (version info / easy init / setopt).
tests/run.sh Updates default transcribe model and fixes minor script formatting.
tests/ios/run.sh Exports CACTUS_CURL_ROOT for iOS test configuration.
tests/ios/configure_xcode.rb Adds configurable log level and optional vendored curl include/link + required frameworks.
tests/android/run.sh Exports CACTUS_CURL_ROOT for Android test runs.
tests/android/CMakeLists.txt Conditionally includes/links vendored libcurl for Android test binaries.
tests/CMakeLists.txt Requires vendored curl for macOS tests and links additional Apple networking/security frameworks.
python/src/cli.py Links vendored libcurl on macOS builds and updates default ASR/transcribe model to whisper-small.
libs/curl/include/curl/websockets.h Vendored libcurl header.
libs/curl/include/curl/urlapi.h Vendored libcurl header.
libs/curl/include/curl/typecheck-gcc.h Vendored libcurl header.
libs/curl/include/curl/system.h Vendored libcurl header.
libs/curl/include/curl/stdcheaders.h Vendored libcurl header.
libs/curl/include/curl/options.h Vendored libcurl header.
libs/curl/include/curl/multi.h Vendored libcurl header.
libs/curl/include/curl/mprintf.h Vendored libcurl header.
libs/curl/include/curl/header.h Vendored libcurl header.
libs/curl/include/curl/easy.h Vendored libcurl header.
libs/curl/include/curl/curlver.h Vendored libcurl version header.
libs/curl/include/curl/Makefile.in Vendored libcurl build-system file.
libs/curl/include/curl/Makefile.am Vendored libcurl build-system file.
libs/curl/include/Makefile.in Vendored libcurl build-system file.
libs/curl/include/Makefile.am Vendored libcurl build-system file.
cactus/CMakeLists.txt Requires/links vendored curl on Apple builds and defines CACTUS_USE_CURL.
apple/build.sh Plumbs CACTUS_CURL_ROOT through to CMake for Apple builds.
apple/README.md Documents the vendored curl artifact layout and override env var.
apple/CmakeLists.txt Switches Apple builds to vendored curl and links required Apple frameworks.
android/build.sh Plumbs CACTUS_CURL_ROOT through to CMake for Android builds.
android/README.md Documents the vendored curl artifact layout for Android.
android/CMakeLists.txt Optionally links vendored curl per-ABI when present.
.gitignore Stops ignoring libs/curl/**/*.a while keeping the global *.a ignore.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

set(CACTUS_LIB ${ANDROID_BUILD_DIR}/libcactus_static.a)
set(CACTUS_CURL_ROOT "$ENV{CACTUS_CURL_ROOT}")
set(CACTUS_CURL_INCLUDE_DIR "${CACTUS_CURL_ROOT}/include")
set(CACTUS_CURL_LIBRARY "${CACTUS_CURL_ROOT}/android/arm64-v8a/libcurl.a")
Copy link

Copilot AI Feb 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The vendored curl library path is hard-coded to android/arm64-v8a/libcurl.a. This prevents linking curl when building/running tests for other ABIs (e.g., x86_64 emulator) even if the appropriate artifacts exist. Consider using ${ANDROID_ABI} (or another configurable variable) in the path, similar to android/CMakeLists.txt.

Suggested change
set(CACTUS_CURL_LIBRARY "${CACTUS_CURL_ROOT}/android/arm64-v8a/libcurl.a")
set(CACTUS_CURL_LIBRARY "${CACTUS_CURL_ROOT}/android/${ANDROID_ABI}/libcurl.a")

Copilot uses AI. Check for mistakes.
/* - CURLMNWC_CLEAR_DNS tells libcurl to prevent further reuse of existing
connections. Connections that are idle will be closed. Ongoing transfers
will continue with the connection they have. */
#define CURLMNWC_CLEAR_DNS (1L << 0)
Copy link

Copilot AI Feb 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These two bitmask constants are both defined as (1L << 0), which makes it impossible to distinguish CURLMNWC_CLEAR_CONNS from CURLMNWC_CLEAR_DNS. If this header is intended to match upstream libcurl, CURLMNWC_CLEAR_DNS should use a different bit so callers can combine flags correctly.

Suggested change
#define CURLMNWC_CLEAR_DNS (1L << 0)
#define CURLMNWC_CLEAR_DNS (1L << 1)

Copilot uses AI. Check for mistakes.
Comment on lines +27 to +33
#include <sys/types.h>

size_t fread(void *, size_t, size_t, FILE *);
size_t fwrite(const void *, size_t, size_t, FILE *);

int strcasecmp(const char *, const char *);
int strncasecmp(const char *, const char *, size_t);
Copy link

Copilot AI Feb 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This header declares fread/fwrite using FILE* but does not include <stdio.h> (or otherwise provide a declaration for FILE). Including this header in isolation will not compile. Consider including <stdio.h> here (as is typical for headers that reference FILE) or ensuring FILE is defined before these prototypes.

Copilot uses AI. Check for mistakes.
Comment on lines 83 to +87
if(APPLE)
target_link_libraries(${TEST_NAME} PRIVATE ${COREML_FRAMEWORK} ${FOUNDATION_FRAMEWORK})
target_link_libraries(${TEST_NAME} PRIVATE ${CACTUS_CURL_LIBRARY_MACOS})
target_include_directories(${TEST_NAME} PRIVATE ${CACTUS_CURL_INCLUDE_DIR})
message(STATUS "Test ${TEST_NAME} will link with libcurl")
endif()
Copy link

Copilot AI Feb 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On non-Apple platforms the tests now compile curl-dependent sources (e.g., test_engine.cpp/test_curl.cpp include <curl/curl.h> via _has_include), but the CMake config only links libcurl on APPLE. If system curl headers are present (common on Linux), this will produce link-time undefined symbols for curl* APIs. Consider adding find_package(CURL) for non-APPLE and linking ${CURL_LIBRARIES} when found, or driving compilation via a build-system define (e.g., CACTUS_USE_CURL) instead of a header-only check.

Copilot uses AI. Check for mistakes.
Comment on lines +12 to +17
#if __has_include(<curl/curl.h>)
#include <curl/curl.h>
#define CACTUS_ENGINE_TEST_HAS_CURL 1
#else
#define CACTUS_ENGINE_TEST_HAS_CURL 0
#endif
Copy link

Copilot AI Feb 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The preprocessor builtin __has_include is not available on all compilers unless guarded. Using #if __has_include(...) can fail to compile on toolchains that don't implement it. Consider wrapping with #if defined(__has_include) && __has_include(<curl/curl.h>) (or using a CMake-provided feature macro) so tests remain portable.

Copilot uses AI. Check for mistakes.
Comment on lines +45 to +52
static bool test_curl_runtime() {
#if !CACTUS_ENGINE_TEST_HAS_CURL
std::cout << "⊘ SKIP │ curl/curl.h not available\n";
return true;
#else
if (curl_global_init(CURL_GLOBAL_DEFAULT) != CURLE_OK) {
return false;
}
Copy link

Copilot AI Feb 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CACTUS_ENGINE_TEST_HAS_CURL is derived solely from header availability, but calling curl_* APIs also requires the test target to link against libcurl. If <curl/curl.h> is present in the include path but libcurl isn't linked, this test will compile and then fail at link time. Consider basing this feature flag on a build-system define (set only when linking curl) rather than on __has_include alone.

Copilot uses AI. Check for mistakes.
Comment on lines +6 to +11
#if __has_include(<curl/curl.h>)
#include <curl/curl.h>
#define CACTUS_TEST_HAS_CURL 1
#else
#define CACTUS_TEST_HAS_CURL 0
#endif
Copy link

Copilot AI Feb 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same portability issue as in test_engine.cpp: #if __has_include(<curl/curl.h>) can fail on compilers where __has_include is not defined. Consider guarding with defined(__has_include) or driving this via a CMake-provided compile definition so the test file compiles on more toolchains.

Copilot uses AI. Check for mistakes.
@HenryNdubuaku HenryNdubuaku merged commit b1d86d3 into cactus-compute:main Feb 17, 2026
1 of 2 checks passed
ncylich pushed a commit that referenced this pull request Feb 24, 2026
* Add basic telemetry setup

Signed-off-by: justinl66 <[email protected]>

* Add init error logging

Signed-off-by: justinl66 <[email protected]>

* Update device + project ID

Signed-off-by: justinl66 <[email protected]>

* Align telemetry POSTs to supabase schema

Signed-off-by: justinl66 <[email protected]>

* Fixing 35-char UUID format bug to make it the correct 36

Signed-off-by: Roman Shemet <[email protected]>

* Update telemetry

Signed-off-by: justinl66 <[email protected]>

* Fix transcription telemetry event

Signed-off-by: justinl66 <[email protected]>

* Update telemetry to work with new RLS policy

Signed-off-by: justinl66 <[email protected]>

* Update response time logging

Signed-off-by: justinl66 <[email protected]>

* Fix transcribe events

Signed-off-by: justinl66 <[email protected]>

* Fix init error logging

Signed-off-by: justinl66 <[email protected]>

* Fix token double count during stream transcription

Signed-off-by: justinl66 <[email protected]>

* Update telemetry with embedding logs

Signed-off-by: justinl66 <[email protected]>

* Fix streaming transcription telemetry

Signed-off-by: justinl66 <[email protected]>

* Remove stray third_party folder

Signed-off-by: justinl66 <[email protected]>

* Remove duplicate telemetry recording, Point to main DB

Signed-off-by: justinl66 <[email protected]>

* Remove stray third party repos

Signed-off-by: justinl66 <[email protected]>

* Remove unneeded telemetry

Signed-off-by: justinl66 <[email protected]>

* Add proper NULL logging

Signed-off-by: justinl66 <[email protected]>

* Add init NULL logging

Signed-off-by: justinl66 <[email protected]>

* Remove dropped columns from payload

Signed-off-by: justinl66 <[email protected]>

* adding curl lib

Signed-off-by: Karen Mosoyan <[email protected]>

* tested and finalized binaries for curl

Signed-off-by: Karen Mosoyan <[email protected]>

* Revert generated iOS AppDelegate artifact

Signed-off-by: Karen Mosoyan <[email protected]>

* Set whisper-small as default transcribe model

Signed-off-by: Karen Mosoyan <[email protected]>

* added https support, actual connection test

Signed-off-by: Karen Mosoyan <[email protected]>

* made curl test more robust, made ssl verification for transcribe endpoint optional

Signed-off-by: Karen Mosoyan <[email protected]>

* tiny cleanup

Signed-off-by: Karen Mosoyan <[email protected]>

* vendored curl/mbedtls for mobile + device transcribe flows

Signed-off-by: Karen Mosoyan <[email protected]>

* Update json parsing and fix session metrics

Signed-off-by: justinl66 <[email protected]>

* Make cactus clean clear cactus cache folder

Signed-off-by: justinl66 <[email protected]>

* some warnings stuff

Signed-off-by: Karen Mosoyan <[email protected]>

---------

Signed-off-by: justinl66 <[email protected]>
Signed-off-by: Roman Shemet <[email protected]>
Signed-off-by: Karen Mosoyan <[email protected]>
Co-authored-by: justinl66 <[email protected]>
Co-authored-by: Roman Shemet <[email protected]>
Co-authored-by: Henry Ndubuaku <[email protected]>
cattermelon1234 pushed a commit to cattermelon1234/cactus that referenced this pull request Feb 28, 2026
* Add basic telemetry setup

Signed-off-by: justinl66 <[email protected]>

* Add init error logging

Signed-off-by: justinl66 <[email protected]>

* Update device + project ID

Signed-off-by: justinl66 <[email protected]>

* Align telemetry POSTs to supabase schema

Signed-off-by: justinl66 <[email protected]>

* Fixing 35-char UUID format bug to make it the correct 36

Signed-off-by: Roman Shemet <[email protected]>

* Update telemetry

Signed-off-by: justinl66 <[email protected]>

* Fix transcription telemetry event

Signed-off-by: justinl66 <[email protected]>

* Update telemetry to work with new RLS policy

Signed-off-by: justinl66 <[email protected]>

* Update response time logging

Signed-off-by: justinl66 <[email protected]>

* Fix transcribe events

Signed-off-by: justinl66 <[email protected]>

* Fix init error logging

Signed-off-by: justinl66 <[email protected]>

* Fix token double count during stream transcription

Signed-off-by: justinl66 <[email protected]>

* Update telemetry with embedding logs

Signed-off-by: justinl66 <[email protected]>

* Fix streaming transcription telemetry

Signed-off-by: justinl66 <[email protected]>

* Remove stray third_party folder

Signed-off-by: justinl66 <[email protected]>

* Remove duplicate telemetry recording, Point to main DB

Signed-off-by: justinl66 <[email protected]>

* Remove stray third party repos

Signed-off-by: justinl66 <[email protected]>

* Remove unneeded telemetry

Signed-off-by: justinl66 <[email protected]>

* Add proper NULL logging

Signed-off-by: justinl66 <[email protected]>

* Add init NULL logging

Signed-off-by: justinl66 <[email protected]>

* Remove dropped columns from payload

Signed-off-by: justinl66 <[email protected]>

* adding curl lib

Signed-off-by: Karen Mosoyan <[email protected]>

* tested and finalized binaries for curl

Signed-off-by: Karen Mosoyan <[email protected]>

* Revert generated iOS AppDelegate artifact

Signed-off-by: Karen Mosoyan <[email protected]>

* Set whisper-small as default transcribe model

Signed-off-by: Karen Mosoyan <[email protected]>

* added https support, actual connection test

Signed-off-by: Karen Mosoyan <[email protected]>

* made curl test more robust, made ssl verification for transcribe endpoint optional

Signed-off-by: Karen Mosoyan <[email protected]>

* tiny cleanup

Signed-off-by: Karen Mosoyan <[email protected]>

* vendored curl/mbedtls for mobile + device transcribe flows

Signed-off-by: Karen Mosoyan <[email protected]>

* Update json parsing and fix session metrics

Signed-off-by: justinl66 <[email protected]>

* Make cactus clean clear cactus cache folder

Signed-off-by: justinl66 <[email protected]>

* some warnings stuff

Signed-off-by: Karen Mosoyan <[email protected]>

---------

Signed-off-by: justinl66 <[email protected]>
Signed-off-by: Roman Shemet <[email protected]>
Signed-off-by: Karen Mosoyan <[email protected]>
Co-authored-by: justinl66 <[email protected]>
Co-authored-by: Roman Shemet <[email protected]>
Co-authored-by: Henry Ndubuaku <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants