Files
jak-project/third-party/curl/tests/data/test1636
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

162 lines
4.2 KiB
XML
Vendored
Generated

<?xml version="1.0" encoding="US-ASCII"?>
<testcase>
<info>
<keywords>
unittest
time2str
max6out
</keywords>
</info>
<client>
<features>
unittest
</features>
<name>
time2str and max6out
</name>
<command>
%LOGDIR/%TESTNUMBER
</command>
</client>
<verify>
<stdout mode="text">
time2str
0 - %SP%SP%SP%SP%SP%SP%SP
1 - 00:01
3 - 00:03
7 - 00:07
15 - 00:15
31 - 00:31
63 - 01:03
127 - 02:07
255 - 04:15
511 - 08:31
1023 - 17:03
2047 - 34:07
4095 - 1:08:15
8191 - 2:16:31
16383 - 4:33:03
32767 - 9:06:07
65535 - 18h 12m
131071 - 36h 24m
262143 - 72h 49m
524287 - 6d 01h
1048575 - 12d 03h
2097151 - 24d 06h
4194303 - 48d 13h
8388607 - 97d 02h
16777215 - 194d
33554431 - 388d
67108863 - 776d
134217727 - 51m
268435455 - 103m
536870911 - 207m
1073741823 - 414m
2147483647 - 828m
4294967295 - 136y
8589934591 - 272y
17179869183 - 544y
34359738367 - 1089y
68719476735 - 2179y
137438953471 - 4358y
274877906943 - 8716y
549755813887 - 17432y
1099511627775 - 34865y
2199023255551 - 69730y
4398046511103 - >99999y
8796093022207 - >99999y
17592186044415 - >99999y
35184372088831 - >99999y
70368744177663 - >99999y
140737488355327 - >99999y
281474976710655 - >99999y
562949953421311 - >99999y
1125899906842623 - >99999y
2251799813685247 - >99999y
4503599627370495 - >99999y
9007199254740991 - >99999y
18014398509481983 - >99999y
36028797018963967 - >99999y
72057594037927935 - >99999y
144115188075855871 - >99999y
288230376151711743 - >99999y
576460752303423487 - >99999y
1152921504606846975 - >99999y
2305843009213693951 - >99999y
4611686018427387903 - >99999y
max6out
0 - 0
1 - 1
3 - 3
7 - 7
15 - 15
31 - 31
63 - 63
127 - 127
255 - 255
511 - 511
1023 - 1023
2047 - 2047
4095 - 4095
8191 - 8191
16383 - 16383
32767 - 32767
65535 - 65535
131071 - 127.9k
262143 - 255.9k
524287 - 511.9k
1048575 - 0.99M
2097151 - 1.99M
4194303 - 3.99M
8388607 - 7.99M
16777215 - 15.99M
33554431 - 31.99M
67108863 - 63.99M
134217727 - 127.9M
268435455 - 255.9M
536870911 - 511.9M
1073741823 - 0.99G
2147483647 - 1.99G
4294967295 - 3.99G
8589934591 - 7.99G
17179869183 - 15.99G
34359738367 - 31.99G
68719476735 - 63.99G
137438953471 - 127.9G
274877906943 - 255.9G
549755813887 - 511.9G
1099511627775 - 0.99T
2199023255551 - 1.99T
4398046511103 - 3.99T
8796093022207 - 7.99T
17592186044415 - 15.99T
35184372088831 - 31.99T
70368744177663 - 63.99T
140737488355327 - 127.9T
281474976710655 - 255.9T
562949953421311 - 511.9T
1125899906842623 - 0.99P
2251799813685247 - 1.99P
4503599627370495 - 3.99P
9007199254740991 - 7.99P
18014398509481983 - 15.99P
36028797018963967 - 31.99P
72057594037927935 - 63.99P
144115188075855871 - 127.9P
288230376151711743 - 255.9P
576460752303423487 - 511.9P
1152921504606846975 - 0.99E
2305843009213693951 - 1.99E
4611686018427387903 - 3.99E
131072 - 128.0k
12645826 - 12.05M
1073741824 - 1.00G
12938588979 - 12.04G
1099445657078333 - 999.9T
</stdout>
</verify>
</testcase>