Repository navigation
curl: ask for brotli again where the decoder is pinned (#2211) - #2906
Conversation
|
Follow-up filed as #2907 (record the macOS system libcurl's Brotli version, with the acceptance being either dropping the Apple branch or keeping it as the record). The CI: waiting on the PR run; the two cmocka binaries are in the Linux Tier 2 set. |
|
The first push failed |
66819cc to
b670432
Compare
|
CI on The Windows lane's one red is |
|
Rebased onto The single red is the Windows lane, and it is not this diff. Filed as a P0 with the run/job ids, the passing Everything else is green: So: this PR is waiting on #2912, not on its own code. Not marking ready / enabling auto-merge while a required lane is red; the rebase + stamp happen once the Windows lane is green. |
b670432 to
84b7ea7
Compare
|
Rebased onto |
RED: the shared helper still returns "gzip, deflate" on every platform, so the two cases here and the wire assertion in test_file_updater_failure fail with the calls not advertising br while the linked Brotli is one this repo pins (the AppImage's 1.2.1, and Windows links none at all).
GREEN: obs_curl_accept_encoding_for() returns curl's "" (every coding the linked libcurl decodes) on every platform whose Brotli this repo pins or does not link -- the AppImage's 1.2.1, and Windows, which links none -- and keeps gzip/deflate on the Apple frontend, whose OS libcurl carries an unpinned Brotli. The stop-gap's other rule survives: no gzip on a libcurl without zlib (#2453).
…al (#2211) The platform-ifdef ratchet (#847) rejects a host #if in shared C, so the Apple half of obs_curl_accept_encoding() is a build definition now: OS_MACOS adds OBS_CURL_ACCEPT_ENCODING_UNPINNED_BROTLI=1 and the header defaults it to 0. uv run python -m unittest ci/test_platform_ifdef_ratchet.py is 38/38 OK and gersemi -c is clean on CMakeLists.txt.
84b7ea7 to
5c1f1e6
Compare
|
Rebased onto master The Windows Tier 2 red this PR was waiting on is fixed on master: #2910 → #2911 ( This run ( |
|
Green on the rebased head |
Fixes #2211.
What changed
obs_curl_accept_encoding()no longer unconditionally pinsAccept-Encoding: gzip, deflate. It returns curl's""— every coding the linked libcurl decodes,brincluded — on the platforms whose Brotli this repo pins or does not link, and keeps the stop-gap only where the decoder is not ours to know.manylinuximage,deps.lock.json)""→bradvertised""→ nobrpossible/usr/lib/libcurl.4.dylib, version not pinned or measured heregzip, deflate(oridentitywhen that libcurl has no zlib)The three call sites already share the header (
shared/file-updater/file-updater/curl-accept-encoding.h, #2213), so this is the header plus its tests. The split isobs_curl_accept_encoding_for(info, macos_libcurl), which lets both branches be unit-tested from a Linux runner;obs_curl_accept_encoding()passes the platform constant.The other rule from #2453 survives untouched: a libcurl without zlib is never asked for gzip.
""cannot break it — curl advertises only what it was built with — but the Apple branch keeps the explicitidentitybecause that path still names codings by hand.RED
54a308c65—test(curl): expect brotli on outgoing calls again (#2211). The two cases intest/cmocka/test_curl_accept_encoding.cand the wire assertion intest/cmocka/test_file_updater_failure.cexpect""/ br on a non-Apple build; against the old helper they fail, because it returnsgzip, deflatethere.Replayed here without libcurl headers on the host (the shim is
<curl/curl.h>with justfeatures, so the header logic compiles and runs):GREEN
301ff6f50—curl: ask for brotli again where the decoder is pinned (#2211):clang-format --dry-run --Werroris clean on the three touched C files.Tests
test_curl_accept_encoding—pinned_brotli_asks_for_every_coding,this_platform_asks_for_every_coding(non-Apple),apple_libcurl_keeps_the_stop_gap,no_zlib_without_a_pinned_brotli_asks_for_identity;this_platform_gets_its_codingasserts the value the call sites actually get on the platform the binary was built for.test_file_updater_failure— the wire assertion now reads the linked libcurl's features: br must be offered when this libcurl has Brotli, must not be when it does not, and must never be offered on Apple.Both run in the Linux Tier 2 lane; the Apple branch of the header is exercised by
-D__APPLE__only in review, since this checkout cannot build for macOS.Left open, filed as its own issue
The Apple carve-out needs an expiry date: someone with a Mac has to record the system libcurl's Brotli version and the VERSION feature list. I will file that as a follow-up and link it here rather than leaving the carve-out undocumented.