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

196 lines
3.3 KiB
XML
Vendored
Generated

<?xml version="1.0" encoding="US-ASCII"?>
<testcase>
<info>
<keywords>
FTP
</keywords>
</info>
# Server-side
<reply>
<data>
many parts there are
</data>
</reply>
# Client-side
<client>
<server>
ftp
</server>
<name>
FTP URL with 150 dir levels
</name>
<command>
ftp://%HOSTIP:%FTPPORT/part1/part2/part3/part4/part5/part6/part7/part8/part9/part10/part11/part12/part13/part14/part15/part16/part17/part18/part19/part20/part21/part22/part23/part24/part25/part26/part27/part28/part29/part30/part31/part32/part33/part34/part35/part36/part37/part38/part39/part40/part41/part42/part43/part44/part45/part46/part47/part48/part49/part50/part51/part52/part53/part54/part55/part56/part57/part58/part59/part60/part61/part62/part63/part64/part65/part66/part67/part68/part69/part70/part71/part72/part73/part74/part75/part76/part77/part78/part79/part80/part81/part82/part83/part84/part85/part86/part87/part88/part89/part90/part91/part92/part93/part94/part95/part96/part97/part98/part99/part100/part101/part102/part103/part104/part105/part106/part107/part108/part109/part110/part111/part112/part113/part114/part115/part116/part117/part118/part119/part120/part121/part122/part123/part124/part125/part126/part127/part128/part129/part130/part131/part132/part133/part134/part135/part136/part137/part138/part139/part140/part141/part142/part143/part144/part145/part146/part147/part148/part149/part150/%TESTNUMBER
</command>
</client>
# Verify data after the test has been "shot"
<verify>
<protocol crlf="yes">
USER anonymous
PASS ftp@example.com
PWD
CWD part1
CWD part2
CWD part3
CWD part4
CWD part5
CWD part6
CWD part7
CWD part8
CWD part9
CWD part10
CWD part11
CWD part12
CWD part13
CWD part14
CWD part15
CWD part16
CWD part17
CWD part18
CWD part19
CWD part20
CWD part21
CWD part22
CWD part23
CWD part24
CWD part25
CWD part26
CWD part27
CWD part28
CWD part29
CWD part30
CWD part31
CWD part32
CWD part33
CWD part34
CWD part35
CWD part36
CWD part37
CWD part38
CWD part39
CWD part40
CWD part41
CWD part42
CWD part43
CWD part44
CWD part45
CWD part46
CWD part47
CWD part48
CWD part49
CWD part50
CWD part51
CWD part52
CWD part53
CWD part54
CWD part55
CWD part56
CWD part57
CWD part58
CWD part59
CWD part60
CWD part61
CWD part62
CWD part63
CWD part64
CWD part65
CWD part66
CWD part67
CWD part68
CWD part69
CWD part70
CWD part71
CWD part72
CWD part73
CWD part74
CWD part75
CWD part76
CWD part77
CWD part78
CWD part79
CWD part80
CWD part81
CWD part82
CWD part83
CWD part84
CWD part85
CWD part86
CWD part87
CWD part88
CWD part89
CWD part90
CWD part91
CWD part92
CWD part93
CWD part94
CWD part95
CWD part96
CWD part97
CWD part98
CWD part99
CWD part100
CWD part101
CWD part102
CWD part103
CWD part104
CWD part105
CWD part106
CWD part107
CWD part108
CWD part109
CWD part110
CWD part111
CWD part112
CWD part113
CWD part114
CWD part115
CWD part116
CWD part117
CWD part118
CWD part119
CWD part120
CWD part121
CWD part122
CWD part123
CWD part124
CWD part125
CWD part126
CWD part127
CWD part128
CWD part129
CWD part130
CWD part131
CWD part132
CWD part133
CWD part134
CWD part135
CWD part136
CWD part137
CWD part138
CWD part139
CWD part140
CWD part141
CWD part142
CWD part143
CWD part144
CWD part145
CWD part146
CWD part147
CWD part148
CWD part149
CWD part150
EPSV
TYPE I
SIZE %TESTNUMBER
RETR %TESTNUMBER
QUIT
</protocol>
<limits>
Allocations: 180
Maximum allocated: 150000
</limits>
</verify>
</testcase>