diff --git a/docs/superpowers/plans/2026-08-17-openssl-windows-followups.md b/docs/superpowers/plans/2026-08-17-openssl-windows-followups.md new file mode 100644 index 00000000..849970b8 --- /dev/null +++ b/docs/superpowers/plans/2026-08-17-openssl-windows-followups.md @@ -0,0 +1,276 @@ +# OpenSSL Windows Follow-ups Implementation Plan + +> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. + +**Goal:** Make the existing Asio SSL and libmysqlclient consumer tests execute on Windows with real OpenSSL-backed builds, using the repaired `libmysqlclient@8.4.6` source tag and preserving Unix behavior. + +**Architecture:** The Asio descriptor already has a Windows archive and an `ssl` feature that depends on `compat.openssl`; only its consumer member is incorrectly Unix-gated. The repaired libmysqlclient `8.4.6` Form A archive contains the Windows build recipe and vendors OpenSSL 3.5.1's `ms/applink.c` at the include path expected by its Windows configuration. The index publishes that single effective version under `xpm.windows` and enables the current behavior test. Connector/C++ and gRPC remain outside this plan. + +**Tech Stack:** Lua xpkg descriptors, mcpp workspace manifests, C++23 consumer tests, Lua repository lints, mcpp `2026.8.10.3`, GitHub Actions Windows x64 with MSVC ABI and LLVM consumer toolchain. + +--- + +## File Map + +| File | Responsibility in this plan | +| --- | --- | +| `tests/examples/asio-ssl/mcpp.toml` | Resolve the Asio `ssl` feature and set the consumer assertion flag on all declared platforms. | +| `tests/examples/asio-ssl/tests/ssl.cpp` | Run the TLS loopback handshake; fail compilation if the feature gate is accidentally absent instead of compiling a no-op. | +| `pkgs/c/compat.libmysqlclient.lua` | Publish the repaired `8.4.6` Form A archive for Windows. | +| `tests/examples/libmysqlclient/mcpp.toml` | Resolve `libmysqlclient@8.4.6` and set the consumer assertion flag on Windows. | +| `tests/examples/libmysqlclient/tests/client.cpp` | Assert the client ABI and usable `mysql_init` handle; fail compilation if the dependency gate is absent. | +| `tests/member-timings.tsv` | Do not edit before measured Windows CI output exists; update only if the live timing workflow produces a materially different ranking. | + +## Task 1: Enable the real Asio SSL Windows test + +**Files:** +- Modify: `tests/examples/asio-ssl/mcpp.toml` +- Modify: `tests/examples/asio-ssl/tests/ssl.cpp` + +- [x] **Step 1: Make the test fail loudly when the feature is not wired.** + +Keep the existing `#ifdef HAVE_ASIO_SSL` body and replace the no-op fallback at +the end of `tests/examples/asio-ssl/tests/ssl.cpp` with a compile-time failure: + +```cpp +#else +#error "HAVE_ASIO_SSL must be enabled for every declared asio-ssl test platform" +#endif +``` + +Update the file comments to remove the claim that Windows has no OpenSSL +dependency and explain in Chinese that the macro is owned by this consumer: + +```cpp +// HAVE_ASIO_SSL 由本测试成员自己的构建配置定义;所有已声明平台都必须运行真实 TLS 测试。 +``` + +Run the focused source check: + +```bash +rg -n "no-op|no openssl dep|HAVE_ASIO_SSL must|HAVE_ASIO_SSL" tests/examples/asio-ssl/tests/ssl.cpp tests/examples/asio-ssl/mcpp.toml +``` + +Expected: the stale Windows/no-op wording is absent, the consumer-owned macro +comment is present, and the `#error` fallback is present. + +- [x] **Step 2: Add the Windows dependency and consumer flag.** + +Append the Windows sections to `tests/examples/asio-ssl/mcpp.toml`, matching the +Linux and macOS dependency and build flag exactly: + +```toml +[target.'cfg(windows)'.dependencies.chriskohlhoff] +asio = { version = "1.38.1", features = ["ssl"] } + +[target.'cfg(windows)'.build] +cxxflags = ["-DHAVE_ASIO_SSL=1"] +``` + +Update the preceding platform comment so it says Linux, macOS, and Windows all +run the real TLS test. Do not add a second `[indices]` table: this member must +continue inheriting the root `compat` path while resolving Asio remotely. + +- [x] **Step 3: Run the Asio static and Unix regression checks.** + +Run the exact checks that can be proved on the current host: + +```bash +git diff --check +MCPP_HOME="$(mktemp -d)" MCPP_BUILD_CACHE=local MCPP_INDEX_MIRROR=GLOBAL mcpp test -p asio-ssl +``` + +`mcpp test` is the parser for the TOML manifest; do not pass the TOML file to +Lua's `loadfile`. Expected: the manifest parses, the diff is clean, and the +macOS/Linux-host test executes the existing TLS handshake and exits +successfully. Record that this does not prove Windows ABI behavior. + +- [x] **Step 4: Commit the Asio change independently.** + +```bash +git add tests/examples/asio-ssl/mcpp.toml tests/examples/asio-ssl/tests/ssl.cpp +git commit -m "test(asio-ssl): exercise Windows TLS support" +``` + +## Task 2: Publish libmysqlclient for Windows and run its real test + +**Files:** +- Modify: `pkgs/c/compat.libmysqlclient.lua` +- Modify: `tests/examples/libmysqlclient/mcpp.toml` +- Modify: `tests/examples/libmysqlclient/tests/client.cpp` + +- [x] **Step 1: Make the consumer test fail loudly when its dependency gate is absent.** + +Replace the no-op fallback in `tests/examples/libmysqlclient/tests/client.cpp` +with: + +```cpp +#else +#error "HAVE_LIBMYSQLCLIENT must be enabled for every declared libmysqlclient test platform" +#endif +``` + +Add a concise Chinese comment above the assertion block explaining that the +test checks both the published client ABI and a usable runtime handle. Keep +the existing `MYSQL_VERSION_ID == 80406`, `mysql_get_client_version()`, and +`mysql_init` assertions unchanged. + +Run: + +```bash +rg -n "no-op|HAVE_LIBMYSQLCLIENT must|MYSQL_VERSION_ID|mysql_init" tests/examples/libmysqlclient/tests/client.cpp +``` + +Expected: no no-op fallback remains and all three runtime assertions are still +present. + +- [x] **Step 2: Publish the repaired `8.4.6` source in `xpm.windows`.** + +Add the repaired archive to the Windows block in +`pkgs/c/compat.libmysqlclient.lua`: + +```lua + windows = { + ["8.4.6"] = { + url = "https://github.com/wellwei/libmysqlclient/archive/refs/tags/8.4.6.tar.gz", + sha256 = "0c2d4b1b25d828bc40f760c50f7d49a3b6377073ac352ed5a52c2de45c7a2cad", + }, + }, +``` + +The SHA is taken from the current `8.4.6` tag, which resolves to source commit +`52a26090e360817850dd41e88056c98599fda6b7`. The superseded `8.4.6.1` tag is +retired rather than retained as a second package revision. + +- [x] **Step 3: Enable the Windows consumer dependency.** + +Append to `tests/examples/libmysqlclient/mcpp.toml`: + +```toml +# Windows 也必须执行真实客户端 ABI 和运行时句柄断言。 +[target.'cfg(windows)'.dependencies.compat] +libmysqlclient = "8.4.6" + +[target.'cfg(windows)'.build] +cxxflags = ["-DHAVE_LIBMYSQLCLIENT=1"] +``` + +Update the platform comment from Linux/macOS-only to Linux/macOS/Windows. +Do not modify the archive's embedded Form A manifest in this task; it is the +source of the Windows compile and link recipe. + +- [x] **Step 4: Run descriptor and parity checks before building.** + +```bash +LUA_BIN="$(command -v lua5.4 || command -v lua5.5 || command -v lua)" +"$LUA_BIN" -e "assert(loadfile('pkgs/c/compat.libmysqlclient.lua', 't'))" +"$LUA_BIN" tests/check_mirror_urls.lua pkgs/c/compat.libmysqlclient.lua +"$LUA_BIN" tests/check_package_name.lua pkgs/c/compat.libmysqlclient.lua +"$LUA_BIN" tests/check_platform_version_parity.lua pkgs/c/compat.libmysqlclient.lua +git diff --check +``` + +Expected: all commands exit 0. The parity check must see the repaired `8.4.6` +entry in Linux, macOS, and Windows. + +- [x] **Step 5: Parse the changed descriptor with the workflow-pinned client.** + +Use the same release pin as `.github/workflows/validate.yml`: + +```bash +MCPP_VERSION=2026.8.10.3 +case "$(uname -s)" in + Darwin) MCPP_ARCHIVE="mcpp-${MCPP_VERSION}-macosx-arm64.tar.gz"; MCPP_ROOT="mcpp-${MCPP_VERSION}-macosx-arm64" ;; + Linux) MCPP_ARCHIVE="mcpp-${MCPP_VERSION}-linux-x86_64.tar.gz"; MCPP_ROOT="mcpp-${MCPP_VERSION}-linux-x86_64" ;; + *) echo "Use the matching workflow asset for this host before running xpkg parse" >&2; exit 2 ;; +esac +curl -L -fsS -o "$MCPP_ARCHIVE" "https://github.com/mcpp-community/mcpp/releases/download/v${MCPP_VERSION}/${MCPP_ARCHIVE}" +tar -xzf "$MCPP_ARCHIVE" +"$PWD/$MCPP_ROOT/bin/mcpp" xpkg parse pkgs/c/compat.libmysqlclient.lua +``` + +Expected: `xpkg parse` exits 0 using `2026.8.10.3`, independent of the newer +developer-installed mcpp on the host. + +- [x] **Step 6: Run the libmysqlclient Unix regression test from a cold cache.** + +```bash +MCPP_HOME="$(mktemp -d)" MCPP_BUILD_CACHE=local MCPP_INDEX_MIRROR=GLOBAL mcpp test -p libmysqlclient +``` + +Expected: the test compiles against `mysql.h`, observes client version `80406`, +obtains a non-null `MYSQL*`, calls `mysql_close`, and exits 0. Record any +OpenSSL/system-library failure separately from an index resolution failure. + +- [x] **Step 7: Commit the libmysqlclient change independently.** + +```bash +git add pkgs/c/compat.libmysqlclient.lua tests/examples/libmysqlclient/mcpp.toml tests/examples/libmysqlclient/tests/client.cpp +git commit -m "feat(libmysqlclient): publish Windows package entries" +``` + +## Task 3: Cross-platform validation and handoff + +- [x] **Step 1: Run the repository-wide cheap checks.** + +```bash +LUA_BIN="$(command -v lua5.4 || command -v lua5.5 || command -v lua)" +"$LUA_BIN" tests/check_cross_package_refs.lua pkgs/*/*.lua +"$LUA_BIN" tests/check_platform_version_parity.lua pkgs/*/*.lua +git diff --check +git status --short --branch +``` + +Expected: cross-package references and platform parity exit 0; the working tree +contains only the two feature commits (or later verification-only artifacts +that are ignored by Git). + +- [x] **Step 2: Verify the affected members are registered.** + +```bash +rg -n 'tests/examples/(asio-ssl|libmysqlclient)' mcpp.toml +``` + +Expected: both members remain listed exactly once in the root workspace. + +- [ ] **Step 3: Obtain Windows CI evidence before claiming completion.** + +The Windows workflow must show, for both `asio-ssl` and `libmysqlclient`, a +real package resolution, OpenSSL-backed compile/link, and a test executable +that returns success. A green selector or a member that only compiles the new +`#error`-guarded fallback is insufficient. Do not edit `tests/member-timings.tsv` +unless the workflow's measured artifact proves a material ranking change. + +Current status: pending an authorized push or pull request run. Local macOS +tests and Linux/macOS descriptor checks cannot prove the Windows ABI. + +- [x] **Step 4: Record the final boundary.** + +Document the exact commands, client version, observed assertions, and Windows +CI job URL in the task handoff. State explicitly that Connector/C++ Windows +hook design and gRPC remain deferred. + +### Local Wine evidence (2026-08-17) + +- The authoritative mcpp release was queried from `xlings-res/mcpp` with + `gh api repos/xlings-res/mcpp/releases/tags/2026.8.17.1`: tag + `2026.8.17.1`, published `2026-08-16T22:02:47Z`. The downloaded Windows + asset `mcpp-2026.8.17.1-windows-x86_64.zip` matched both the GitHub asset + digest and its `.sha256` file: + `35520f09b4c87d855711e172390ea0ecd0a7fd58c739e9a17d329d0fb6335c08`. +- Under Wine `11.14`, the Windows binary reported `mcpp 2026.8.17.1` and, + with an isolated `MCPP_HOME` plus the simulated VS/SDK paths, resolved + `llvm@20.1.7` as `x86_64-pc-windows-msvc`. The initial unisolated run + correctly exposed the MinGW fallback separately: GNU ld cannot consume the + MSVC-style `-llibssl/-llibcrypto` names. +- A cold `asio-ssl` project reached the Windows `compat.openssl` install hook, + but Wine's MSVC wrapper stalled OpenSSL `Configure` while probing + `cl -dM -E -x c /dev/null`; no `libssl.lib` or `libcrypto.lib` was produced. + Strawberry Perl `5.40.4.1` was independently verified under Wine with + `Locale::Maketext::Simple` and the required core modules, so Perl discovery + was not the remaining blocker. +- A cold `libmysqlclient` project reached the same OpenSSL hook and stopped at + the same Wine compiler-probe boundary, before the Form A client archive + could compile or link. Therefore both local Windows results are **blocked**, + not passes or package regressions; native Windows CI is still required for + final ABI and runtime evidence. diff --git a/docs/superpowers/specs/2026-08-17-openssl-windows-followups-design.md b/docs/superpowers/specs/2026-08-17-openssl-windows-followups-design.md new file mode 100644 index 00000000..3415fdf1 --- /dev/null +++ b/docs/superpowers/specs/2026-08-17-openssl-windows-followups-design.md @@ -0,0 +1,132 @@ +# OpenSSL Windows Follow-ups: Asio SSL and libmysqlclient + +> Created: 2026-08-17 +> Status: design +> Repository: `mcpplibs/mcpp-index` +> Branch: `codex/windows-openssl-followups` + +## 1. Goal + +Extend the Windows support that landed for `compat.openssl@3.5.1` to the two +downstream packages that can be completed within `mcpp-index` in this round: + +1. `chriskohlhoff.asio@1.38.1` with its opt-in `ssl` feature. +2. `compat.libmysqlclient@8.4.6`, using the repaired source tag as the sole + effective package revision. + +The result is complete only when Windows resolves the package, builds the +consumer, links the expected static libraries, and runs a non-trivial test. +Selecting a member while compiling a no-op test is not support evidence. + +## 2. Scope + +### In scope + +- Enable the existing Asio SSL consumer test on `cfg(windows)`. +- Publish the repaired `libmysqlclient@8.4.6` archive on Windows. +- Enable the existing libmysqlclient consumer test on `cfg(windows)`. +- Keep the client ABI and Unix build behavior unchanged. The source tag was + explicitly reissued after the Windows configuration repair; the superseded + `8.4.6.1` tag is no longer valid. +- Validate descriptor grammar, platform-version parity, cold resolution, and + real consumer behavior with the workflow-pinned mcpp client. + +### Out of scope + +- `compat.mysql-connector-cpp`: its Unix-only install hook needs a separate + Windows build design and is intentionally deferred. +- gRPC and the external `mcpplibs/grpc-m` repository. +- `compat.curl` or `compat.eui-neo` TLS behavior, which intentionally uses + Schannel on Windows. +- Windows ARM64, MinGW/GCC, shared OpenSSL, or NASM-accelerated builds. +- Publishing, pushing, opening, or merging a remote PR without authorization. + +## 3. Current evidence and constraints + +- PR #211 is merged at `upstream/main` and adds Windows x64 OpenSSL 3.5.1 + built by `VC-WIN64A` plus `cl`/`nmake`, consumed by the Windows LLVM toolchain. +- The Asio descriptor already has a Windows archive and an `ssl` feature whose + dependency is `compat.openssl`; only the test member is Unix-gated. +- The libmysqlclient Form A archive contains Windows source, flags, + system-library, and OpenSSL dependency data. Its Windows configuration + enables `HAVE_OPENSSL_APPLINK_C`; the repaired source archive now carries the + OpenSSL 3.5.1 `ms/applink.c` implementation at `include/openssl/applink.c`, + because the static OpenSSL package does not install that source file. +- The repaired `8.4.6` archive has SHA-256 + `0c2d4b1b25d828bc40f760c50f7d49a3b6377073ac352ed5a52c2de45c7a2cad` and + resolves to source commit `52a26090e360817850dd41e88056c98599fda6b7`. + +## 4. Design + +### 4.1 Asio SSL + +Change only `tests/examples/asio-ssl/mcpp.toml` and stale test comments in +`tests/examples/asio-ssl/tests/ssl.cpp`: + +- Add the same `chriskohlhoff.asio` feature dependency under + `cfg(windows)` as under Linux and macOS. +- Add the same `HAVE_ASIO_SSL=1` build flag under `cfg(windows)`. +- Remove wording that describes Windows as a no-op or as lacking OpenSSL. +- Keep the TLS loopback handshake test unchanged in behavior. It must continue + to assert certificate loading, handshake, encrypted write/read, and timeout + handling on every declared platform. + +No change is needed to the Asio descriptor or its `ssl` feature. + +### 4.2 libmysqlclient + +Change `pkgs/c/compat.libmysqlclient.lua` and +`tests/examples/libmysqlclient/mcpp.toml`: + +- Add the repaired `8.4.6` source archive to `xpm.windows`. +- Use the reissued tag URL and its verified SHA-256. The old `8.4.6.1` tag and + index entry are intentionally retired by explicit maintainer direction. +- Keep the vendored `include/openssl/applink.c` byte-identical to OpenSSL + 3.5.1 `ms/applink.c`; `tools/check-layout.sh` guards this required layout. +- Add the `8.4.6` dependency and `HAVE_LIBMYSQLCLIENT=1` flag under + `cfg(windows)`. +- Update the test comment so it describes all three declared platforms. +- Keep the behavior assertion in `tests/client.cpp`: the client version must + be `80406`, `mysql_init` must return a usable handle, and `mysql_close` must + succeed. This catches missing headers, wrong library selection, and a link + that only contains an empty anchor. + +The archive's own Form A `mcpp.toml` remains the source of the Windows build +recipe. The index descriptor only publishes the platform/version mapping. + +## 5. Verification contract + +Run the cheapest checks first, then the affected members: + +1. Lua syntax, descriptor-name, mirror, and platform-version parity checks. +2. Parse changed descriptors with mcpp `2026.8.10.3` or the exact pin from the + live workflow. +3. Run the Asio SSL and libmysqlclient members from a cold package/build cache + where the host permits it. +4. On Windows CI, confirm the logs show OpenSSL and libmysqlclient materialized, + compiled, linked, and the test executable returned success. A selected + member with a no-op executable is a failure of the test contract. +5. Run `git diff --check` and preserve command output and the observed test + assertions in the task progress record. + +Local macOS validation can prove descriptor parsing and the existing Unix +regressions, but it cannot prove Windows ABI or runner-tool availability. + +## 6. Change grouping + +Implement and verify the two packages independently: + +1. Asio SSL test gate and comments. +2. libmysqlclient Windows publication and test gate. + +If the Windows build exposes an archive-specific defect, stop and report it as +an upstream Form A recipe issue rather than silently changing the index shape. + +## 7. Acceptance criteria + +- No no-op Windows path remains in either affected consumer test. +- Windows platform parity passes for `compat.libmysqlclient`. +- Existing Linux and macOS tests remain unchanged and pass. +- Windows CI provides actual build/link/run evidence for both tests. +- Connector/C++ and gRPC remain untouched and are explicitly reported as + deferred. diff --git a/pkgs/c/compat.libmysqlclient.lua b/pkgs/c/compat.libmysqlclient.lua index 17de3a71..308b798a 100644 --- a/pkgs/c/compat.libmysqlclient.lua +++ b/pkgs/c/compat.libmysqlclient.lua @@ -12,21 +12,19 @@ package = { linux = { ["8.4.6"] = { url = "https://github.com/wellwei/libmysqlclient/archive/refs/tags/8.4.6.tar.gz", - sha256 = "27decd6716591d84a6f765a3d63fcd24031373841c684369445b83a840b38bea", - }, - ["8.4.6.1"] = { - url = "https://github.com/wellwei/libmysqlclient/archive/refs/tags/8.4.6.1.tar.gz", - sha256 = "e50e5da37baa26fff56952d85bd8e33b577be7a534e67df0b8e10a5cc8507af8", + sha256 = "0c2d4b1b25d828bc40f760c50f7d49a3b6377073ac352ed5a52c2de45c7a2cad", }, }, macosx = { ["8.4.6"] = { url = "https://github.com/wellwei/libmysqlclient/archive/refs/tags/8.4.6.tar.gz", - sha256 = "27decd6716591d84a6f765a3d63fcd24031373841c684369445b83a840b38bea", + sha256 = "0c2d4b1b25d828bc40f760c50f7d49a3b6377073ac352ed5a52c2de45c7a2cad", }, - ["8.4.6.1"] = { - url = "https://github.com/wellwei/libmysqlclient/archive/refs/tags/8.4.6.1.tar.gz", - sha256 = "e50e5da37baa26fff56952d85bd8e33b577be7a534e67df0b8e10a5cc8507af8", + }, + windows = { + ["8.4.6"] = { + url = "https://github.com/wellwei/libmysqlclient/archive/refs/tags/8.4.6.tar.gz", + sha256 = "0c2d4b1b25d828bc40f760c50f7d49a3b6377073ac352ed5a52c2de45c7a2cad", }, }, }, diff --git a/pkgs/c/compat.mysql-connector-cpp.lua b/pkgs/c/compat.mysql-connector-cpp.lua index ae6e84c4..b613bc43 100644 --- a/pkgs/c/compat.mysql-connector-cpp.lua +++ b/pkgs/c/compat.mysql-connector-cpp.lua @@ -11,7 +11,7 @@ package = { xpm = { linux = { deps = { - "compat:libmysqlclient@8.4.6.1", + "compat:libmysqlclient@8.4.6", "compat:openssl@3.5.1", "xim:cmake@latest", "xim:make@latest", @@ -23,7 +23,7 @@ package = { }, macosx = { deps = { - "compat:libmysqlclient@8.4.6.1", + "compat:libmysqlclient@8.4.6", "compat:openssl@3.5.1", "xim:cmake@latest", }, @@ -41,7 +41,7 @@ package = { include_dirs = { "include" }, targets = { ["mysql_connector_cpp"] = { kind = "lib" } }, deps = { - ["compat.libmysqlclient"] = "8.4.6.1", + ["compat.libmysqlclient"] = "8.4.6", ["compat.openssl"] = "3.5.1", }, @@ -141,7 +141,7 @@ local function find_source_root() end local function find_mysql_source_root(prefix) - local direct = path.join(prefix, "libmysqlclient-8.4.6.1") + local direct = path.join(prefix, "libmysqlclient-8.4.6") if os.isfile(path.join(direct, "mcpp.toml")) then return direct end for _, manifest in ipairs(os.files(path.join(prefix, "**", "mcpp.toml")) or {}) do local root = path.directory(manifest) @@ -198,7 +198,7 @@ function install() .. " deps=" .. tostring(pkginfo.deps_list())) local ok, result = pcall(function() local srcroot = find_source_root() - local mysql = find_dep_install_dir("compat:libmysqlclient", "8.4.6.1") + local mysql = find_dep_install_dir("compat:libmysqlclient", "8.4.6") local openssl = find_dep_install_dir("compat:openssl", "3.5.1") hook_log("srcroot=" .. tostring(srcroot) .. " mysql=" .. tostring(mysql) .. " openssl=" .. tostring(openssl)) diff --git a/tests/examples/asio-ssl/mcpp.toml b/tests/examples/asio-ssl/mcpp.toml index 7f9ef408..ac79efc8 100644 --- a/tests/examples/asio-ssl/mcpp.toml +++ b/tests/examples/asio-ssl/mcpp.toml @@ -21,9 +21,8 @@ # is configured for ITS namespace, so an unmerged compat descriptor can be # exercised through a published consumer that activates it. # -# linux + macOS only: compat.openssl has no windows xpm entry (prebuilt MSVC -# archives not yet published), so on windows the member carries no dependency -# and tests/ssl.cpp compiles to a no-op main(). +# Linux, macOS, and Windows all resolve compat.openssl and execute the real +# TLS handshake below. A selected member must always execute the real test. [package] name = "asio-ssl-tests" version = "0.1.0" @@ -39,3 +38,10 @@ asio = { version = "1.38.1", features = ["ssl"] } [target.'cfg(macos)'.build] cxxflags = ["-DHAVE_ASIO_SSL=1"] + +# Windows 也必须执行真实 TLS 测试;OpenSSL 的 Windows 构建由包描述负责。 +[target.'cfg(windows)'.dependencies.chriskohlhoff] +asio = { version = "1.38.1", features = ["ssl"] } + +[target.'cfg(windows)'.build] +cxxflags = ["-DHAVE_ASIO_SSL=1"] diff --git a/tests/examples/asio-ssl/tests/ssl.cpp b/tests/examples/asio-ssl/tests/ssl.cpp index be157c7a..bb55c9d9 100644 --- a/tests/examples/asio-ssl/tests/ssl.cpp +++ b/tests/examples/asio-ssl/tests/ssl.cpp @@ -10,9 +10,7 @@ // cxxflags, not by the package's feature. A feature's `defines` apply to the // package's own translation units; a consumer that keys its source off one has // to declare it itself (same shape as the openblas member's HAVE_OPENBLAS). -// Getting that backwards is how the previous version of this file passed while -// compiling to nothing. Windows has no openssl dep yet, so there the whole -// body drops out and main() is a no-op. +// HAVE_ASIO_SSL 由本测试成员自己的构建配置定义;所有已声明平台都必须运行真实 TLS 测试。 #ifdef HAVE_ASIO_SSL import std; import asio; @@ -153,5 +151,5 @@ int main() { return failure ? failure : (client_done ? 0 : 8); } #else -int main() { return 0; } // ssl feature inactive (windows); no-op +#error "HAVE_ASIO_SSL must be enabled for every declared asio-ssl test platform" #endif diff --git a/tests/examples/libmysqlclient/mcpp.toml b/tests/examples/libmysqlclient/mcpp.toml index 4128c8cd..f0fdfa3c 100644 --- a/tests/examples/libmysqlclient/mcpp.toml +++ b/tests/examples/libmysqlclient/mcpp.toml @@ -2,15 +2,22 @@ name = "libmysqlclient-tests" version = "0.1.0" -# libmysqlclient 的 mcpp 源码构建目前只验证 Linux/macOS。 +# libmysqlclient 的源码构建在 Linux、macOS 和 Windows 上都执行真实断言。 [target.'cfg(linux)'.dependencies.compat] -libmysqlclient = "8.4.6.1" +libmysqlclient = "8.4.6" [target.'cfg(linux)'.build] cxxflags = ["-DHAVE_LIBMYSQLCLIENT=1"] [target.'cfg(macos)'.dependencies.compat] -libmysqlclient = "8.4.6.1" +libmysqlclient = "8.4.6" [target.'cfg(macos)'.build] cxxflags = ["-DHAVE_LIBMYSQLCLIENT=1"] + +# Windows 也必须执行真实客户端 ABI 和运行时句柄断言。 +[target.'cfg(windows)'.dependencies.compat] +libmysqlclient = "8.4.6" + +[target.'cfg(windows)'.build] +cxxflags = ["-DHAVE_LIBMYSQLCLIENT=1"] diff --git a/tests/examples/libmysqlclient/tests/client.cpp b/tests/examples/libmysqlclient/tests/client.cpp index 67d212d4..1ff026ee 100644 --- a/tests/examples/libmysqlclient/tests/client.cpp +++ b/tests/examples/libmysqlclient/tests/client.cpp @@ -1,6 +1,7 @@ #ifdef HAVE_LIBMYSQLCLIENT #include +// 断言客户端 ABI 版本,并确认初始化得到可用的运行时句柄。 int main() { static_assert(MYSQL_VERSION_ID == 80406); if (mysql_get_client_version() != 80406) return 1; @@ -11,5 +12,5 @@ int main() { return 0; } #else -int main() { return 0; } +#error "HAVE_LIBMYSQLCLIENT must be enabled for every declared libmysqlclient test platform" #endif