File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -40,6 +40,22 @@ xxhash-rust = { git = "https://github.com/dontpanic92/xxhash-rust", branch = "ya
4040# harmless "patch was not used" warning on other hosts. Keep it for LoongArch.
4141cty = { git = " https://github.com/amazingfate/cty" , branch = " loongarch" }
4242
43+ # Workaround: build the `lua50-32-sys` C library (Lua 5.0.3) unoptimized.
44+ #
45+ # Root cause: MSVC toolset 14.51.36231 (VS 18 / 2026) has a code-generation
46+ # bug that miscompiles Lua 5.0.3 at `/O2` on x86_64 — it corrupts a `Table`'s
47+ # `array`/`sizearray` pair, so the very first `luaopen_base` faults with an
48+ # access violation (hit when constructing a Lua VM, e.g. PAL5/SWD5 story
49+ # directors, in a *release* build). Verified A/B: lua built with toolset 14.44
50+ # at `/O2` runs fine; only 14.51 crashes. Debug (`-O0`) is unaffected.
51+ #
52+ # Disabling optimization for just this (tiny, perf-irrelevant) crate sidesteps
53+ # the bug independently of which MSVC toolset compiles it, keeping release
54+ # builds working on CI and any machine. The override is global because Cargo
55+ # profile overrides cannot be gated by target.
56+ [profile .release .package .lua50-32-sys ]
57+ opt-level = 0
58+
4359[profile .release-with-symbol ]
4460inherits = " release"
4561debug = true
You can’t perform that action at this time.
0 commit comments