Files
jak-project/third-party/curl/tests/data/test1664
T
Alexander J. Semenuk 5d5e35fb9b fix: Windows toolchain compatibility (curl 8.21 re-vendor, endless reconfigure loop) (#4355)
## Problem

Windows builds break with a current local toolchain (Scoop LLVM 22.1.8,
CMake 4.4.0, VS 2026), in two independent ways:

1. The build stops at curl's deliberate guard: `#error "no non-blocking
method was found/used/set"` in `third-party/curl/lib/nonblock.c`.
2. From the second configure onward, `cmake --build` re-runs CMake in an
endless loop (observed 42 consecutive reconfigure cycles in a single
build). Likely the same mechanism behind the "endlessly building" VS
2026 note in `docs/setup/dev/vs.md`.

## Root cause

1. `third-party/curl/CMake/CurlTests.c` passes `int *` to
`ioctlsocket()`, whose third parameter is `u_long *`. Clang 22 promotes
`-Wincompatible-pointer-types` to a hard error in C, so the
`HAVE_IOCTLSOCKET_FIONBIO` try_compile silently fails and
`curl_config.h` never defines it. Upstream CI does not see this because
the windows-2022 runner image ships an older LLVM. GCC 14 promotes the
same warning to a hard error, which is very likely the `CurlTests.c.obj`
failure reported from MSYS2 in open-goal/jak-project#3551. Upstream curl
hit the identical problem with GCC 14 and fixed the probe in curl 8.8.0
(curl/curl#13578).
2. The root CMakeLists copies the build tree's `compile_commands.json`
into `<src>/build/` for clangd using `configure_file()`, which registers
its input as a configure dependency. CMake rewrites
`compile_commands.json` late in every generation, after
`CTestTestfile.cmake` and `cmake_install.cmake` (outputs of the same
Ninja regen rule), so once the dependency is registered the rule is
deterministically dirty and every `ninja` invocation re-runs CMake. A
pristine first configure is safe (the file does not exist yet, so the
`if(EXISTS ...)` guard skips the copy), which is why the loop looks
machine- or IDE-specific.

## Fix

1. Per review, re-vendor `third-party/curl` at the `curl-8_21_0` tag
(previously `curl-8_3_0`), which carries the upstream probe fix plus two
years of upstream development; `vendor.yaml` updated to match.
Adjustments the version jump forced:
- curl 8.15 removed the native macOS Secure Transport backend
(`CURL_USE_SECTRANSP`), so macOS now builds curl against OpenSSL like
Linux. The two macOS workflows install Homebrew `openssl@3` and export
`OPENSSL_ROOT_DIR` (keg-only), and the macOS setup docs gained the same
two lines.
- `CURL_BROTLI` / `CURL_ZSTD` switched to AUTO-detection in curl 8.10;
pinned OFF to keep the previous no-compression behavior and avoid
silently linking whatever the CI images happen to have.
- curl's new top-level `BUILD_EXAMPLES` cache option (default ON) leaked
into discord-rpc's identically named option and broke configure at a
nonexistent `examples/send-presence` directory; pinned OFF ahead of the
third-party subdirectories.

The diff is dominated by the mechanical tag-tree swap under
`third-party/curl` (linguist-vendored, collapsed in review). The
hand-written changes are `CMakeLists.txt`, the two macOS workflows,
`docs/setup/system/macos.md`, and `vendor.yaml`.
2. Swap `configure_file()` for `file(COPY ...)`: the same clangd copy
with no configure dependency registered. (`file(COPY_FILE ...
ONLY_IF_DIFFERENT)` would be cleaner still but requires CMake 3.21,
above the declared `cmake_minimum_required(VERSION 3.10)`.)

## Test plan

- [x] Fresh `cmake --preset Release-windows-clang` (LLVM 22, no cache
seeding) completes and logs `Enabled SSL backends: Schannel`; the
FIONBIO probe passes without the previous `#error`
- [x] Full Windows Release build from scratch in the branch worktree
(all 1422 targets)
- [x] goalc-test suite: 1509 passed, 0 failed
- [x] Second consecutive configure with `compile_commands.json` present:
the regen rule in `build.ninja` has no `compile_commands.json` input;
`<src>/build/compile_commands.json` is still refreshed for clangd
- [x] Repeated `ninja` invocations after a full build no longer re-run
CMake
- [x] macOS Intel and ARM CI green (first exercise of the OpenSSL
backend switch)

---

I work off a self-hosted forge, so this GitHub account is quiet; the
configure logs and ninja dirty-node traces from the investigation are
available if anyone wants the raw data.

(AI-assisted)
2026-07-27 19:19:18 -04:00

243 lines
7.3 KiB
XML
Vendored
Generated

<?xml version="1.0" encoding="US-ASCII"?>
<testcase>
<info>
<keywords>
unittest
strparse
</keywords>
</info>
# Client-side
<client>
<features>
unittest
large-size
</features>
<name>
unit tests for strparse.c string parsing functions
</name>
</client>
<verify>
<stdout>
curlx_str_word
0: ("word") 0, "word" [4], line 4
1: ("word ") 0, "word" [4], line 4
2: (" word ") 2, "" [0], line 0
3: ("wo rd") 0, "wo" [2], line 2
4: ("word(") 0, "word(" [5], line 5
5: ("wor(d") 0, "wor(d" [5], line 5
6: ("perfect") 0, "perfect" [7], line 7
7: ("") 2, "" [0], line 0
8: ("longerth") 1, "" [0], line 0
curlx_str_until
0: ("word") 0, "wor" [3], line 3
1: ("word ") 0, "wor" [3], line 3
2: (" word ") 0, " wor" [4], line 4
3: ("wo rd") 0, "wo r" [4], line 4
4: ("word(") 0, "wor" [3], line 3
5: ("wor(d") 0, "wor(" [4], line 4
6: ("perfect") 0, "perfect" [7], line 7
7: ("") 2, "" [0], line 0
8: ("longerth") 1, "" [0], line 0
curlx_str_quotedword
0: (""word"") 0, "word" [4], line 6
1: (""word") 4, "" [0], line 0
2: ("word"") 3, "" [0], line 0
3: (""word""") 0, "word" [4], line 6
4: (""word" ") 0, "word" [4], line 6
5: (" "word"") 3, "" [0], line 0
6: (""perfect"") 0, "perfect" [7], line 9
7: (""p r e t"") 0, "p r e t" [7], line 9
8: (""perfec\"") 1, "" [0], line 0
9: (""trail\""") 0, "trail\"" [7], line 9
10: (""trail2\""") 1, "" [0], line 0
11: (""trail33\""") 1, "" [0], line 0
12: (""0\\\\\\"") 0, "0\\\\\\" [7], line 9
13: (""1\\\\\\\"") 1, "" [0], line 0
14: ("""") 0, "" [0], line 2
15: ("") 3, "" [0], line 0
16: (""longerth"") 1, "" [0], line 0
curlx_str_single
0: ("a") 0, line 1
1: ("aa") 0, line 1
2: ("A") 5, line 0
3: ("b") 5, line 0
4: ("\") 5, line 0
5: (" ") 5, line 0
6: ("") 5, line 0
curlx_str_singlespace
0: ("a") 5, line 0
1: ("aa") 5, line 0
2: ("A") 5, line 0
3: ("b") 5, line 0
4: ("\") 5, line 0
5: (" ") 0, line 1
6: ("%TAB") 5, line 0
7: ("
") 5, line 0
8: ("") 5, line 0
curlx_str_single
0: ("a") 0, line 1
1: ("aa") 0, line 1
2: ("A") 5, line 0
3: ("b") 5, line 0
4: ("\") 5, line 0
5: (" ") 5, line 0
6: ("") 5, line 0
curlx_str_number
0: ("1") 0, [1] line 1
1: ("10000") 7, [0] line 0
2: ("1234") 0, [1234] line 4
3: ("1235") 0, [1235] line 4
4: ("1236") 7, [0] line 0
5: ("01234") 0, [1234] line 5
6: ("00000000000000000000000000001234") 0, [1234] line 32
7: ("0123 345") 0, [123] line 4
8: ("0123O345") 0, [123] line 4
9: ("-12") 8, [0] line 0
10: (" 123") 8, [0] line 0
11: ("") 8, [0] line 0
curlx_str_number varying max
0: ("00") max 8 == 0, [0]
1: ("1") max 8 == 0, [1]
2: ("1") max 1 == 0, [1]
3: ("2") max 1 == 7, [0]
4: ("2") max 2 == 0, [2]
5: ("5") max 6 == 0, [5]
6: ("000000000000000000000006") max 6 == 0, [6]
7: ("7") max 6 == 7, [0]
8: ("8") max 6 == 7, [0]
9: ("9") max 8 == 7, [0]
10: ("10") max 10 == 0, [10]
11: ("11") max 10 == 7, [0]
12: ("12") max 10 == 7, [0]
curlx_str_hex varying max
0: ("00") max 8 == 0, [0]
1: ("1") max 8 == 0, [1]
2: ("1") max 1 == 0, [1]
3: ("2") max 1 == 7, [0]
4: ("2") max 2 == 0, [2]
5: ("5") max 6 == 0, [5]
6: ("000000000000000000000006") max 6 == 0, [6]
7: ("7") max 6 == 7, [0]
8: ("8") max 6 == 7, [0]
9: ("9") max 8 == 7, [0]
10: ("a") max 14 == 0, [10]
11: ("b") max 14 == 0, [11]
12: ("c") max 14 == 0, [12]
13: ("d") max 14 == 0, [13]
14: ("e") max 14 == 0, [14]
15: ("f") max 14 == 7, [0]
16: ("f") max 15 == 0, [15]
17: ("10") max 16 == 0, [16]
18: ("11") max 16 == 7, [0]
19: ("12") max 16 == 7, [0]
curlx_str_octal varying max
0: ("00") max 4 == 0, [0]
1: ("1") max 4 == 0, [1]
2: ("1") max 4 == 0, [1]
3: ("2") max 4 == 0, [2]
4: ("3") max 4 == 0, [3]
5: ("4") max 4 == 0, [4]
6: ("5") max 4 == 7, [0]
7: ("000000000000000000000006") max 6 == 0, [6]
8: ("7") max 7 == 0, [7]
9: ("10") max 8 == 0, [8]
10: ("11") max 8 == 7, [0]
11: ("11") max 9 == 0, [9]
12: ("12") max 9 == 7, [0]
13: ("13") max 9 == 7, [0]
14: ("8") max 10 == 8, [0]
curlx_str_number / max
0: ("9223372036854775807") 0, [9223372036854775807] line 19
1: ("9223372036854775808") 7, [0] line 0
2: ("18446744073709551615") 7, [0] line 0
3: ("18446744073709551616") 7, [0] line 0
4: ("18446744073709551617") 7, [0] line 0
5: ("0123456799a") 0, [123456799] line 10
6: ("0123456789") 0, [123456789] line 10
7: ("123498760b") 0, [123498760] line 9
8: ("1234987607611298232") 0, [1234987607611298232] line 19
9: ("1111111111111111111") 0, [1111111111111111111] line 19
10: ("2222222222222222222") 0, [2222222222222222222] line 19
11: ("00000000000000000000000000000009223372036854775807") 0, [9223372036854775807] line 50
12: ("3333333333333333333") 0, [3333333333333333333] line 19
13: ("4444444444444444444") 0, [4444444444444444444] line 19
14: ("5555555555555555555") 0, [5555555555555555555] line 19
15: ("6666666666666666666") 0, [6666666666666666666] line 19
16: ("7777777777777777777") 0, [7777777777777777777] line 19
17: ("8888888888888888888") 0, [8888888888888888888] line 19
18: ("999999999999999999") 0, [999999999999999999] line 18
curlx_str_newline
0: (%61) 6, line 0
1: (%61) 6, line 0
2: (%41) 6, line 0
3: (%62) 6, line 0
4: (%5c) 6, line 0
5: (%20) 6, line 0
6: (%0a) 0, line 1
7: (%0d) 0, line 1
8: (%0d) 0, line 1
9: (%0c) 6, line 0
10: (%00) 6, line 0
curlx_str_hex
0: ("1") 0, [1] line 1
1: ("1000") 0, [4096] line 4
2: ("1234") 0, [4660] line 4
3: ("1235") 0, [4661] line 4
4: ("1236") 7, [0] line 0
5: ("01234") 0, [4660] line 5
6: ("00000000000000000000000000001234") 0, [4660] line 32
7: ("0123 345") 0, [291] line 4
8: ("0123O345") 0, [291] line 4
9: ("-12") 8, [0] line 0
10: (" 123") 8, [0] line 0
11: ("") 8, [0] line 0
curlx_str_octal
0: ("1") 0, [1] line 1
1: ("1000") 0, [512] line 4
2: ("1234") 0, [668] line 4
3: ("1235") 0, [669] line 4
4: ("1236") 7, [0] line 0
5: ("01234") 0, [668] line 5
6: ("00000000000000000000000000001234") 0, [668] line 32
7: ("0123 345") 0, [83] line 4
8: ("0123O345") 0, [83] line 4
9: ("-12") 8, [0] line 0
10: (" 123") 8, [0] line 0
11: ("") 8, [0] line 0
curlx_str_octal / max
0: ("777777777777777777777") 0, [9223372036854775807] line 21
1: ("1000000000000000000000") 7, [0] line 0
2: ("111111111111111111111") 0, [1317624576693539401] line 21
3: ("222222222222222222222") 0, [2635249153387078802] line 21
4: ("333333333333333333333") 0, [3952873730080618203] line 21
5: ("444444444444444444444") 0, [5270498306774157604] line 21
6: ("555555555555555555555") 0, [6588122883467697005] line 21
7: ("666666666666666666666") 0, [7905747460161236406] line 21
curlx_str_hex / max
0: ("7FFFFFFFFFFFFFFF") 0, [9223372036854775807] line 16
1: ("8000000000000000") 7, [0] line 0
2: ("1111111111111111") 0, [1229782938247303441] line 16
3: ("2222222222222222") 0, [2459565876494606882] line 16
4: ("3333333333333333") 0, [3689348814741910323] line 16
5: ("4444444444444444") 0, [4919131752989213764] line 16
6: ("5555555555555555") 0, [6148914691236517205] line 16
7: ("6666666666666666") 0, [7378697629483820646] line 16
8: ("7777777777777777") 0, [8608480567731124087] line 16
9: ("888888888888888") 0, [614891469123651720] line 15
10: ("999999999999999") 0, [691752902764108185] line 15
11: ("aaaaaaaaAAAAAAA") 0, [768614336404564650] line 15
12: ("bbbbbbbbBBBBBBB") 0, [845475770045021115] line 15
13: ("BBBBBBBBbbbbbbb") 0, [845475770045021115] line 15
14: ("ccccccccCCCCCCC") 0, [922337203685477580] line 15
15: ("ddddddddDDDDDDD") 0, [999198637325934045] line 15
16: ("eeeeeeeeEEEEEEE") 0, [1076060070966390510] line 15
17: ("ffffffffFFFFFFF") 0, [1152921504606846975] line 15
18: ("abcdef") 0, [11259375] line 6
19: ("ABCDEF") 0, [11259375] line 6
</stdout>
</verify>
</testcase>