From d0e604fc05dd13ddf614a9cacef8b2c8786bfd63 Mon Sep 17 00:00:00 2001 From: sunrisepeak Date: Fri, 11 Sep 2026 15:26:02 +0800 Subject: [PATCH] fix(mysql-connector-cpp): a CN mirror, and a success path that says so MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit TWO SMALL THINGS, both found while this package kept turning up in the middle of something else. CN MIRROR The url was a plain upstream string, which docs/cn-mirror.md describes as the fallback for when nobody has `mcpp-res` write access -- CN users reach GitHub directly and wait. This package sits on the path of anything that touches the graphics or database members, and a 4.8 MB tarball with no mirror was a recurring tax on exactly the runs where something else was being diagnosed. `mcpp-res/mysql-connector-cpp@26.7.0` now carries the same bytes: CN http=200 size=4792083 GLOBAL sha b2299862eefc33fd71c0aac68328305671805fc955e6bd2578ef205c10f98550 CN sha b2299862eefc33fd71c0aac68328305671805fc955e6bd2578ef205c10f98550 Same sha as the descriptor already declared, so no version's hash moves. `return true` ON THE SUCCESS PATH `install()` wraps its work in a pcall and returns whatever that yields. Every failure path says `return false`; the success path ended on an `io.writefile` and yielded `nil`. So a WORKING install has been logging install() result=nil all along. In a hook log that is otherwise a list of failures, that reads like one — and it did: during the huxerui work it was taken for the cause of a failure whose real origin was an mcpp scanner regression three layers away. The value was never wrong; it just never said it was right. --- pkgs/c/compat.mysql-connector-cpp.lua | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/pkgs/c/compat.mysql-connector-cpp.lua b/pkgs/c/compat.mysql-connector-cpp.lua index b613bc43..a65608ed 100644 --- a/pkgs/c/compat.mysql-connector-cpp.lua +++ b/pkgs/c/compat.mysql-connector-cpp.lua @@ -17,7 +17,10 @@ package = { "xim:make@latest", }, ["26.7.0"] = { - url = "https://github.com/mysql/mysql-connector-cpp/archive/refs/tags/26.7.0.tar.gz", + url = { + GLOBAL = "https://github.com/mysql/mysql-connector-cpp/archive/refs/tags/26.7.0.tar.gz", + CN = "https://gitcode.com/mcpp-res/mysql-connector-cpp/releases/download/26.7.0/mysql-connector-cpp-26.7.0.tar.gz", + }, sha256 = "b2299862eefc33fd71c0aac68328305671805fc955e6bd2578ef205c10f98550", }, }, @@ -28,7 +31,10 @@ package = { "xim:cmake@latest", }, ["26.7.0"] = { - url = "https://github.com/mysql/mysql-connector-cpp/archive/refs/tags/26.7.0.tar.gz", + url = { + GLOBAL = "https://github.com/mysql/mysql-connector-cpp/archive/refs/tags/26.7.0.tar.gz", + CN = "https://gitcode.com/mcpp-res/mysql-connector-cpp/releases/download/26.7.0/mysql-connector-cpp-26.7.0.tar.gz", + }, sha256 = "b2299862eefc33fd71c0aac68328305671805fc955e6bd2578ef205c10f98550", }, }, @@ -318,6 +324,14 @@ function install() io.writefile(path.join(prefix, "mcpp_mysql_connector_cpp_anchor.c"), "int mcpp_compat_mysql_connector_cpp_anchor(void) { return 0; }\n") + + -- EXPLICIT, because the last statement above is not a return and the + -- pcall would otherwise hand `nil` back as the success value. Every + -- failure path here says `return false`; success said nothing, so + -- `install() result=nil` is what a WORKING install has been logging all + -- along. In a log that is mostly failures that reads like one, and it + -- cost a wrong diagnosis once already. + return true end) if not ok then hook_log("UNCAUGHT Lua error: " .. tostring(result))