Skip to content

Update libcurl to 8.23.0 and remove legacy workarounds - #1952

Open
AustinBenoit wants to merge 1 commit into
mainfrom
update-libcurl
Open

AustinBenoit wants to merge 1 commit into
mainfrom
update-libcurl

Conversation

@AustinBenoit

@AustinBenoit AustinBenoit commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Updates the bundled libcurl dependency from 7.73.0 (7_73_0) to the latest release 8.23.0 (8_23_0) and removes legacy curl workarounds.

Changes

  • External dependency (cmake/external/curl.cmake):
    • Bump version from 7_73_0 to 8_23_0 with explicit DOWNLOAD_NAME and URL_HASH (SHA256).
  • CMake configuration (CMakeLists.txt, app/rest/CMakeLists.txt):
    • Replace removed HTTP_ONLY option with explicit CURL_DISABLE_* protocol flags so only http and https are built.
    • Update renamed CMake options (CURL_USE_SCHANNEL, CURL_USE_LIBSSH2).
    • Disable optional third-party libraries (CURL_USE_LIBPSL, USE_NGHTTP2, USE_LIBIDN2, and cache-forced CURL_ZLIB, CURL_BROTLI, CURL_ZSTD), docs/manpages, and install/CPack rules (CURL_DISABLE_INSTALL).
    • Enable USE_APPLE_SECTRUST and set _curl_stdlib_cxx="c++" on Apple platforms for native certificate verification and static BoringSSL + libc++ linking.
    • Remove the obsolete macOS cross-compiling CMAKE_TOOLCHAIN_FILE=/dev/null workaround (fixed upstream in curl).
    • Unset curl-specific BUILD_STATIC_LIBS and BUILD_EXAMPLES after add_external_library(curl) so they do not linger in root directory scope.
    • Pack libcurl_static in app/rest/CMakeLists.txt (since libcurl is an ALIAS target in curl 8.23.0) and add required Windows system libraries (bcrypt, iphlpapi, secur32).
  • C++ API migration (app/rest/transport_curl.cc):
    • Replace deprecated CURLOPT_PROTOCOLS with CURLOPT_PROTOCOLS_STR ("http,https").
    • Replace deprecated double-based CURLINFO_CONTENT_LENGTH_* and CURLINFO_SIZE_* selectors with curl_off_t-based CURLINFO_*_T.
    • Add #pragma comment(lib, ...) directives on MSVC for Windows system libraries required by static libcurl.
  • New platform system library / framework requirements:
    • macOS (-framework SystemConfiguration): In libcurl 8.x (lib/macos.c), Curl_macos_init() (called from curl_global_init() when IPv6 is enabled without c-ares) calls SCDynamicStoreCopyProxies(NULL) from Apple's SystemConfiguration.framework to initialize Darwin's dynamic store on the main thread before threaded getaddrinfo() lookups run.
    • Windows (bcrypt, iphlpapi, secur32):
      • bcrypt (bcrypt.lib): libcurl 8.x (lib/rand.c) uses Windows CNG BCryptGenRandom() for random number generation (replacing legacy CryptGenRandom from advapi32).
      • iphlpapi (iphlpapi.lib): libcurl 8.x calls if_nametoindex() from the IP Helper API to resolve IPv6 scope/zone IDs.
      • secur32 (secur32.lib): libcurl 8.x (lib/curl_sspi.c) links directly against InitSecurityInterface() in secur32.lib for Windows SSPI/Schannel instead of dynamically loading secur32.dll via LoadLibrary() at runtime as in 7.73.0.
      • Note: For MSVC consumers of the prebuilt firebase_app.lib, #pragma comment(lib, ...) directives embedded in transport_curl.cc automatically link these Windows system libraries without requiring manual project file changes.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates the bundled libcurl dependency from version 7.73.0 to 8.2.1 (mistakenly specified as 8.23.0). It updates CMake configurations and integration tests to include new platform-specific system library dependencies, such as bcrypt, iphlpapi, and secur32 on Windows, and SystemConfiguration on macOS. Additionally, it updates transport_curl.cc to use modern curl options like CURLOPT_PROTOCOLS_STR and curl_off_t transfer info types. The review feedback points out a critical build issue where the curl version is incorrectly set to 8_23_0 instead of 8_2_1, which will cause a 404 download failure.

Comment thread cmake/external/curl.cmake
endif()

set(version 7_73_0)
set(version 8_23_0)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

critical

The version 8_23_0 (curl 8.23.0) does not exist. The SHA256 hash d0605d5883124ef5ae64c6d2b307e1417c482b362583b57491fdf37d9a99a792 corresponds to curl version 8.2.1 (8_2_1). Using 8_23_0 will cause the download URL to return a 404 Not Found error, which will break the build. Please update the version to 8_2_1.

set(version 8_2_1)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

- Update curl version in cmake/external/curl.cmake from 7_73_0 to 8_23_0
  with SHA-256 verification and explicit DOWNLOAD_NAME.
- Update CMake configuration options in CMakeLists.txt for curl 8.23.0:
  - Replace removed HTTP_ONLY option with explicit CURL_DISABLE_* protocol
    flags so only HTTP/HTTPS are enabled.
  - Replace renamed CMAKE_USE_SCHANNEL / CMAKE_USE_LIBSSH2 options with
    CURL_USE_SCHANNEL / CURL_USE_LIBSSH2.
  - Disable optional third-party libraries (libpsl, nghttp2, libidn2, and
    cache-forced CURL_ZLIB, CURL_BROTLI, CURL_ZSTD), docs/manpages, and
    install/CPack rules (CURL_DISABLE_INSTALL).
  - Enable USE_APPLE_SECTRUST and set _curl_stdlib_cxx="c++" on Apple
    platforms for native certificate verification and static BoringSSL +
    libc++ linking.
  - Remove obsolete APPLE cross-compiling CMAKE_TOOLCHAIN_FILE=/dev/null
    workaround (fixed upstream in curl).
  - Unset curl-specific BUILD_STATIC_LIBS and BUILD_EXAMPLES after
    add_external_library(curl) so they do not linger in root directory scope.
- Update app/rest/CMakeLists.txt to pack libcurl_static (since libcurl is
  now an ALIAS target) and link required Windows system libraries
  (bcrypt, iphlpapi, secur32).
- Update app/rest/transport_curl.cc to use CURLOPT_PROTOCOLS_STR instead
  of deprecated CURLOPT_PROTOCOLS, CURLINFO_*_T (curl_off_t) instead of
  deprecated double-based CURLINFO_CONTENT_LENGTH_* and CURLINFO_SIZE_*,
  and #pragma comment(lib) directives for MSVC static library consumers.
- Update consumer-facing documentation (release_build_files/readme.md,
  AGENTS.md), third-party notices (release_build_files/NOTICES), and
  integration test CMakeLists.txt files for the new macOS
  SystemConfiguration.framework and Windows (bcrypt, iphlpapi, secur32)
  link requirements.
@AustinBenoit AustinBenoit added the tests-requested: full Trigger a FULL set of integration tests (uses expanded test matrix). label Oct 27, 2026
@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Integration test with FLAKINESS (succeeded after retry)

Requested by @AustinBenoit on commit 67379e8
Last updated: Tue Oct 27 16:05 PDT 2026
View integration test log & download artifacts

Failures Configs
firestore [TEST] [FLAKINESS] [Android] [1/3 os: macos] [1/4 android_device: android_latest]
(1 failed tests)  CRASH/TIMEOUT
installations [TEST] [FLAKINESS] [Android] [1/3 os: ubuntu] [1/4 android_device: emulator_ftl_latest]
(1 failed tests)  FirebaseInstallationsTest.TestGetTokenForceRefresh

Add flaky tests to go/fpl-cpp-flake-tracker

@github-actions github-actions Bot added the tests: succeeded This PR's integration tests succeeded. label Oct 27, 2026

@a-maurice a-maurice left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If you haven't yet, it'd be good to run the Unity tests against this. Will also need to update this page: https://firebase.google.com/docs/cpp/setup?platform=ios#additional-info-desktop

@AustinBenoit

Copy link
Copy Markdown
Contributor Author

Unity run:
https://github.com/firebase/firebase-unity-sdk/actions/runs/40934467318

I have the internal docs updates ready

@AustinBenoit

Copy link
Copy Markdown
Contributor Author

Firebase Unity SDK Verification (firebase_cpp_sdk_version=update-libcurl)

  • Unity SDK Build & Packaging: ✅ Passed across all platforms (Windows, macOS, Linux, Android, iOS, tvOS) — Run #40934467318
  • Unity Integration Tests: 🔄 Running against the packaged SDK (packaged_sdk_run_id=40934467318) — Run #40944806125
    • test-2022-windows-2022-Playmode: ✅ Passed
    • build-2022-windows-2022-Windows,macOS,Linux-NA: ✅ Passed
    • Mobile testapp builds & standalone test execution: In progress

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tests: succeeded This PR's integration tests succeeded. tests-requested: full Trigger a FULL set of integration tests (uses expanded test matrix).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants