Repository navigation
ci: 适配 runner 镜像漂移(ubuntu-24.04 / macOS openssl@3 / MinGW bcrypt / CMake 4.5) - #77
Merged
Merged
Conversation
…ake 4.5) 2026-11 起 `ubuntu-latest` 漂到 26.04、Homebrew 的 `openssl` 别名漂到 4.x、 MSYS2 的 OpenSSL 改用 BCryptGenRandom —— 一批与代码无关的红: - **Linux**:三个 job 统一钉 `ubuntu-24.04`。26.04 镜像的 CMake 是 4.5 (FindOpenSSL 会给 OpenSSL::Crypto 的 link interface 挂 `ZLIB::ZLIB`), 且不再随镜像提供 `libmongoc-dev` ⇒ db-servers / config-contract 在配置期红。 - **macOS**:所有带 TLS 的格显式 `brew install openssl@3` 并传 `-DOPENSSL_ROOT_DIR=$(brew --prefix openssl@3)`。`openssl` 别名已是 4.1.0, hostname 用例与 QUIC 腿在 4.x 上行为不一致(实测:STRICT+localhost 握手 失败、h3/quic 用例全部 Subprocess aborted)。 - **MinGW**:静态 libcrypto 现在引用 `BCryptGenRandom` —— 给四个 uvcpp 目标 的 Windows 链接行补 `bcrypt crypt32`(MSVC 上同样无害)。 - **CMake 4.5**:取源码那条 zlib 支路补 `ZLIB::ZLIB` 别名;只开 QUIC、 web 关掉的树上在 `find_package(OpenSSL)` 之前补一次 `find_package(ZLIB QUIET)`。 CMakeLists 插行撞飞的文档/脚本行号(含 workflows 里的 `CMakeLists.txt:NNNN` 引用)按 `check_doc_lines.py --update` 全部重排;`check_doc_lines` / `check_docs` / `check_doc_versions` / `check_ci_layout` 全绿。 本地 `build-all` 重新 configure + 编 `uvcpp` 通过。
- `full` 那一格也要 `-DOPENSSL_ROOT_DIR=openssl@3`(上一笔只覆盖了 ssl/h2,
而 full 同样带 TLS;日志里它仍然加载 4.1.0)。
- **bcrypt 必须排在 libcrypto 之后**:静态归档的解析是"从左到右、后满足前",
上一笔把 `bcrypt crypt32` 加在 ws2_32 那一组(在 SSL 之前展开),所以 MinGW
仍然报 `undefined reference to BCryptGenRandom`。挪到 `${UVCPP_SSL_LIBS}` 后面。
- macOS 26 镜像自带 Homebrew 的 ngtcp2/nghttp3 头;让 FetchContent 源码树里
那一份**前置**(`BEFORE`),否则 `ngtcp2_settings` 的布局与静态库版本对不上
—— 运行期每格 QUIC 用例都在 `ngtcp2_settingslen_version: Unreachable` 上 abort。
这一条才是 quic/http3 两格红的真因,和 OpenSSL 版本无关(3.5.9 也一样红)。
行号锁随 CMake 插行重排;`check_doc_lines` 全绿,本地 configure + 编 `uvcpp` 通过。
上一笔把 `bcrypt` 补在 uvcpp 目标的 `${UVCPP_SSL_LIBS}` 之后,共享库
(libuvcpp.dll)已经链得过;但功能用例里带 `web_ssl_` 的那些**直接**再挂一次
`${UVCPP_SSL_LIBS}`(它们要用 `SSL_ERROR_*` 常量),链接行上出现在
`uvcpp_a` 的传递依赖**之后** ⇒ `bcrypt` 又跑到 libcrypto 前面,MinGW 上
`test_web_ssl_*.exe` 全部 `undefined reference to BCryptGenRandom`。
在测试这一处再补一次(排在 SSL 之后),顺序才对。
(只影响 MinGW 静态 OpenSSL;MSVC 不敏感。)
OpenSSL 4.1(MSYS2 与 macOS 26 的 runner 都已升到它)起,主机名校验不再回落到 subject CN;本函数只写 CN,于是 `PEER_STRICT` 下连 `localhost` 都握不上 —— MinGW 与 macOS 两格同时在 `test_web_ssl_hostname_func` 上红,报 -4046 (UV_EPROTO): [FAIL] 1 STRICT + 名字相同(localhost)必须连得上:期望握手成功,实际 status=-4046 改法:CN 不变,**同时**给"看起来像 DNS 名"的 CN 写一条同名 `dNSName` SAN (纯数字/点分与含 `:` 的不写 —— IP 字面量的正确表示是 `iPAddress` SAN, 本函数的 `cn` 参数没有那个信息,不替调用方猜)。旧版 OpenSSL 上 SAN 优先于 CN,行为不变;4.1 上恢复按主机名校验。 用例里的两处注释("只有 CN")与 `ssl-guide.md` 的同一句说法一起更正;文档行号 引用随源码插行重排(这一处 8 条按内容逐条核对后改号)。本地 OpenSSL 3.6.5 上 `test_web_ssl_hostname_func` 全绿、162/162。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
2026-11 起 runner 镜像与包管理器漂移,导致与代码无关的一批红;这个 PR 只修这些环境面。
现象与归因
Linux / config-contractFindOpenSSL.cmake: The link interface of target "OpenSSL::Crypto" contains ZLIB::ZLIB but the target was not foundubuntu-latest漂到 26.04,镜像 CMake 4.5 的 FindOpenSSL 会给 OpenSSL target 挂ZLIB::ZLIB;而本项目取源码 zlib 那条支路只建zlib/zlibstaticLinux / db-serversdb: MongoDB 后端开缺席(找不到mongoc/mongoc.h)libmongoc-devmacOS / ssl,h2,fulltest_web_ssl_hostname_func:STRICT + localhost 握手失败openssl别名已是 4.1.0,行为与本树支持的 3.x 不同macOS / quic,http3test_quic_*/test_http3_*全部 Subprocess abortedMinGW-w64 / mingw64libuvcpp.dll:undefined reference to BCryptGenRandom-lbcrypt改动
ubuntu-24.04(不再用ubuntu-latest),并在工作流头部写明"升级镜像时改这一处并重跑全矩阵"。openssl@3,传-DOPENSSL_ROOT_DIR=$(brew --prefix openssl@3)。bcrypt crypt32(四个 uvcpp 目标;静态 libcrypto 的 Cert*/BCrypt 符号)。ZLIB::ZLIB别名;find_package(OpenSSL)之前补一次find_package(ZLIB QUIET)(web 关、只开 QUIC 的树)。CMakeLists.txt:NNNN引用)按check_doc_lines.py --update重排。验证
build-all重新 configure + 编uvcpp通过;check_doc_lines/check_docs/check_doc_versions/check_ci_layout全绿;(#76 的异步事务 PR 会在这个 PR 合入后 rebase,届时它的 CI 才可判。)