From c80a8a8afdcac9ff4118615e38baa84bb71d263b Mon Sep 17 00:00:00 2001 From: Richard Wheeler Date: Sun, 12 Apr 2026 14:06:09 -0400 Subject: [PATCH] ci: fix vtcc int(0x8000_0000) overflow; document discord.v disable (#26858) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * ci: fix vtcc int overflow and disable discord.v until upstream is fixed vtcc (felipensp/vtcc stable branch) has `const shf_private = int(0x8000_0000)` in src/tccelf.v. The value 0x8000_0000 = 2147483648 overflows V's `int` (max 2147483647). V already emits a warning for this; it will become a hard error soon. TCC then rejects the generated C with "invalid operand types for binary operation" at the overflowed value site. Fix: patch the source in-place with sed before compiling vtcc, changing `int` to `u32`. Upstream issue: felipensp/vtcc#6. discord.v: add an early-exit to compile_discordv.sh explaining why the step is disabled (uses deprecated json2.raw_decode). The yml step was already guarded with `${{ false && ... }}`; this comment makes the intent clear in the script itself too. Upstream issue: vcv88/discord.v#21. Both failures are tracked at vlang/v#26853. Co-Authored-By: Claude Sonnet 4.6 * ci: address Codex review — remove exit 0 from compile_discordv.sh The YAML step is already guarded with `${{ false && ... }}`, which is the authoritative disable mechanism. Having `exit 0` in the script itself created a false-green path: if someone later re-enabled the YAML condition without reading the script, CI would silently skip all tests. Replace with a comment block explaining *why* the yml step is disabled and what needs to happen for it to be re-enabled, keeping the original test logic intact. Addresses: chatgpt-codex-connector review on vlang/v#26858 Co-Authored-By: Claude Sonnet 4.6 --------- Co-authored-by: Richard Wheeler <18647491+PythonWillRule@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.6 --- .github/workflows/compile_discordv.sh | 6 ++++++ .github/workflows/compile_v_with_vtcc.sh | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/.github/workflows/compile_discordv.sh b/.github/workflows/compile_discordv.sh index f22bb1238..f8af36d2d 100755 --- a/.github/workflows/compile_discordv.sh +++ b/.github/workflows/compile_discordv.sh @@ -6,6 +6,12 @@ function show() { printf "\u001b[35m$1\u001b[0m\n" } +## NOTE: this step is disabled in v_apps_and_modules_compile_ci.yml via `${{ false && ... }}`. +## Reason: discord.v uses x.json2.raw_decode which was deprecated-as-error in V on 2025-10-10. +## The upstream repo (vcv88/discord.v) has not been updated since Dec 2024. +## Re-enable both the yml step and this script once vcv88/discord.v#21 is resolved. +## Track: https://github.com/vlang/v/issues/26853 + rm -rf discord/ show "Clone https://github.com/vcv88/discord.v" diff --git a/.github/workflows/compile_v_with_vtcc.sh b/.github/workflows/compile_v_with_vtcc.sh index 9a68ba162..0f3957374 100755 --- a/.github/workflows/compile_v_with_vtcc.sh +++ b/.github/workflows/compile_v_with_vtcc.sh @@ -13,6 +13,11 @@ show "Clone vtcc" .github/workflows/retry.sh git clone https://github.com/felipensp/vtcc --branch stable --quiet vtcc/ du -s vtcc/ ## TODO: just `./v vtcc`, later will cause V, to detect the compiler as tcc (which it is), and add `-fwrapv`, which causes the vtcc compiler to panic currently +show "Patch vtcc: fix int(0x8000_0000) overflow (felipensp/vtcc#6 / vlang/v#26853)" +## 0x8000_0000 = 2147483648 overflows V's int (max 2147483647). +## This causes a V warning (soon: hard error) and TCC rejects the generated C. +sed -i 's/const shf_private = int(0x8000_0000)/const shf_private = u32(0x8000_0000)/' vtcc/src/tccelf.v + show "Compile vtcc" cd vtcc/ v run make.vsh -- 2.39.5