Skip to content

Commit d0e604f

Browse files
committed
fix(mysql-connector-cpp): a CN mirror, and a success path that says so
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.
1 parent 18dfa0b commit d0e604f

1 file changed

Lines changed: 16 additions & 2 deletions

File tree

pkgs/c/compat.mysql-connector-cpp.lua

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ package = {
1717
"xim:make@latest",
1818
},
1919
["26.7.0"] = {
20-
url = "https://github.com/mysql/mysql-connector-cpp/archive/refs/tags/26.7.0.tar.gz",
20+
url = {
21+
GLOBAL = "https://github.com/mysql/mysql-connector-cpp/archive/refs/tags/26.7.0.tar.gz",
22+
CN = "https://gitcode.com/mcpp-res/mysql-connector-cpp/releases/download/26.7.0/mysql-connector-cpp-26.7.0.tar.gz",
23+
},
2124
sha256 = "b2299862eefc33fd71c0aac68328305671805fc955e6bd2578ef205c10f98550",
2225
},
2326
},
@@ -28,7 +31,10 @@ package = {
2831
"xim:cmake@latest",
2932
},
3033
["26.7.0"] = {
31-
url = "https://github.com/mysql/mysql-connector-cpp/archive/refs/tags/26.7.0.tar.gz",
34+
url = {
35+
GLOBAL = "https://github.com/mysql/mysql-connector-cpp/archive/refs/tags/26.7.0.tar.gz",
36+
CN = "https://gitcode.com/mcpp-res/mysql-connector-cpp/releases/download/26.7.0/mysql-connector-cpp-26.7.0.tar.gz",
37+
},
3238
sha256 = "b2299862eefc33fd71c0aac68328305671805fc955e6bd2578ef205c10f98550",
3339
},
3440
},
@@ -318,6 +324,14 @@ function install()
318324

319325
io.writefile(path.join(prefix, "mcpp_mysql_connector_cpp_anchor.c"),
320326
"int mcpp_compat_mysql_connector_cpp_anchor(void) { return 0; }\n")
327+
328+
-- EXPLICIT, because the last statement above is not a return and the
329+
-- pcall would otherwise hand `nil` back as the success value. Every
330+
-- failure path here says `return false`; success said nothing, so
331+
-- `install() result=nil` is what a WORKING install has been logging all
332+
-- along. In a log that is mostly failures that reads like one, and it
333+
-- cost a wrong diagnosis once already.
334+
return true
321335
end)
322336
if not ok then
323337
hook_log("UNCAUGHT Lua error: " .. tostring(result))

0 commit comments

Comments
 (0)