Files
jak-project/third-party/curl/projects/vms/curlmsg.msg
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

135 lines
6.2 KiB
Plaintext
Vendored
Generated

!***************************************************************************
! _ _ ____ _
! Project ___| | | | _ \| |
! / __| | | | |_) | |
! | (__| |_| | _ <| |___
! \___|\___/|_| \_\_____|
!
! Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
!
! This software is licensed as described in the file COPYING, which
! you should have received as part of this distribution. The terms
! are also available at https://curl.se/docs/copyright.html.
!
! You may opt to use, copy, modify, merge, publish, distribute and/or sell
! copies of the Software, and permit persons to whom the Software is
! furnished to do so, under the terms of the COPYING file.
!
! This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
! KIND, either express or implied.
!
! SPDX-License-Identifier: curl
!
!##########################################################################
!
! These VMS error codes are generated by taking apart the curl.h
! file and putting all the CURLE_* enum stuff into this file,
! CURLMSG.MSG. An .SDL file is created from this file with
! MESSAGE/SDL. The .H file is created using the freeware SDL tool
! against the .SDL file with SDL/ALPHA/LANG=CC command.
!
! With the exception of CURLE_OK, all of the messages are at
! the error severity level. With the exception of
! PEER_FAILED_VERIF, which is a shortened form of
! PEER_FAILED_VERIFICATION, these are the same names as the
! CURLE_ ones in include/curl.h. The Message Utility manual states
! "The combined length of the prefix and the message symbol name cannot
! exceed 31 characters." With a prefix of five that leaves us with 26
! for the message name.
!
! If you update this file also update curlmsg_vms.h so that they are in sync
!
.TITLE CURLMSG Message files
.FACILITY CURL,1793 /PREFIX=CURL_
.BASE 1
.SEVERITY SUCCESS
OK <normal successful completion>
.SEVERITY ERROR
UNSUPPORTED_PROTOCOL <unsupported protocol>
FAILED_INIT <failed init>
URL_MALFORMAT <URL malformat>
OBSOLETE4 <obsolete error code>
COULDNT_RESOLVE_PROXY <could not resolve proxy>
COULDNT_RESOLVE_HOST <could not resolve host>
COULDNT_CONNECT <could not connect>
WEIRD_SERVER_REPLY <weird server reply>
FTP_ACCESS_DENIED <FTP access denied>
OBSOLETE10 <obsolete error code>
FTP_WEIRD_PASS_REPLY <FTP weird PASS reply>
OBSOLETE12 <obsolete error code>
FTP_WEIRD_PASV_REPLY <FTP weird PASV reply>
FTP_WEIRD_227_FORMAT <FTP weird 227 format>
FTP_CANT_GET_HOST <FTP can not get host>
OBSOLETE16 <obsolete error code>
FTP_COULDNT_SET_TYPE <FTP could not set type>
PARTIAL_FILE <partial file>
FTP_COULDNT_RETR_FILE <FTP could not RETR file>
OBSOLETE20 <obsolete error code>
QUOTE_ERROR <quote command error>
HTTP_RETURNED_ERROR <HTTP returned error>
WRITE_ERROR <write error>
OBSOLETE24 <obsolete error code>
UPLOAD_FAILED <failed upload command>
READ_ERROR <read error, could not open/read file>
OUT_OF_MEMORY <out of memory>
OPERATION_TIMEOUTED <operation timed out, timeout time was reached>
OBSOLETE29 <obsolete error code>
FTP_PORT_FAILED <FTP PORT operation failed>
FTP_COULDNT_USE_REST <FTP REST command failed>
OBSOLETE32 <obsolete error code>
RANGE_ERROR <RANGE command error>
HTTP_POST_ERROR <HTTP POST error>
SSL_CONNECT_ERROR <SSL connect error>
BAD_DOWNLOAD_RESUME <bad download resume>
FILE_COULDNT_READ_FILE <FILE could not read file>
LDAP_CANNOT_BIND <LDAP cannot bind>
LDAP_SEARCH_FAILED <LDAP search failed>
OBSOLETE40 <obsolete error code>
FUNCTION_NOT_FOUND <function not found>
ABORTED_BY_CALLBACK <aborted by callback>
BAD_FUNCTION_ARGUMENT <bad function argument>
OBSOLETE44 <obsolete error code>
INTERFACE_FAILED <CURLOPT_INTERFACE failed>
OBSOLETE46 <obsolete error code>
TOO_MANY_REDIRECTS <too many redirects>
UNKNOWN_TELNET_OPTION <unknown TELNET option>
TELNET_OPTION_SYNTAX <malformed TELNET option syntax>
OBSOLETE50 <obsolete error code>
PEER_FAILED_VERIF <peer certificate or fingerprint failed>
GOT_NOTHING <got nothing>
SSL_ENGINE_NOTFOUND <SSL crypto engine not found>
SSL_ENGINE_SETFAILED <SSL can not set SSL crypto engine as default>
SEND_ERROR <SEND error, failure sending network data>
RECV_ERROR <RECV error, failure receiving network data>
OBSOLETE57 <obsolete error code>
SSL_CERTPROBLEM <SSL problem with the local certificate>
SSL_CIPHER <SSL CIPHER, could not use specified cipher>
SSL_CACERT <SSL CACERT, problem with the CA cert (path?)>
BAD_CONTENT_ENCODING <unrecognized transfer encoding>
LDAP_INVALID_URL <LDAP invalid url>
FILESIZE_EXCEEDED <maximum file size exceeded>
USE_SSL_FAILED <requested FTP SSL level failed>
SEND_FAIL_REWIND <sending data requires a rewind that failed>
SSL_ENGINE_INITFAILED <failed to initialize ENGINE>
LOGIN_DENIED <user or password not accepted. failed to login>
TFTP_NOTFOUND <file not found on server>
TFTP_PERM <permission problem on server>
REMOTE_DISK_FULL <out of disk space on server>
TFTP_ILLEGAL <illegal TFTP operation>
TFTP_UNKNOWNID <unknown transfer ID>
REMOTE_FILE_EXISTS <file already exists>
TFTP_NOSUCHUSER <no such user>
CONV_FAILED <conversion failed>
CONV_REQD <caller must register conversion callbacks>
SSL_CACERT_BADFILE <could not load CACERT file>
REMOTE_FILE_NOT_FOUND <remote file not found>
SSH <unspecified error from the SSH layer>
SSL_SHUTDOWN_FAILED <failed to shut down the SSL connection>
AGAIN <socket not ready, wait and try again>
SSL_CRL_BADFILE <could not load CRL file, missing or wrong format>
SSL_ISSUER_ERROR <issuer check failed>
CURL_LAST <CURLMSG.MSG is out of sync with the source code>
.END