Skip to content

Commit c80a8a8

Browse files
quaesitor-scientiamPythonWillRuleclaude
authored
ci: fix vtcc int(0x8000_0000) overflow; document discord.v disable (#26858)
* 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 #26853. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * 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 #26858 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Richard Wheeler <18647491+PythonWillRule@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 9f0ef6c commit c80a8a8

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

.github/workflows/compile_discordv.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ function show() {
66
printf "\u001b[35m$1\u001b[0m\n"
77
}
88

9+
## NOTE: this step is disabled in v_apps_and_modules_compile_ci.yml via `${{ false && ... }}`.
10+
## Reason: discord.v uses x.json2.raw_decode which was deprecated-as-error in V on 2025-10-10.
11+
## The upstream repo (vcv88/discord.v) has not been updated since Dec 2024.
12+
## Re-enable both the yml step and this script once vcv88/discord.v#21 is resolved.
13+
## Track: https://github.com/vlang/v/issues/26853
14+
915
rm -rf discord/
1016

1117
show "Clone https://github.com/vcv88/discord.v"

.github/workflows/compile_v_with_vtcc.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ show "Clone vtcc"
1313
.github/workflows/retry.sh git clone https://github.com/felipensp/vtcc --branch stable --quiet vtcc/
1414
du -s vtcc/
1515
## 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
16+
show "Patch vtcc: fix int(0x8000_0000) overflow (felipensp/vtcc#6 / vlang/v#26853)"
17+
## 0x8000_0000 = 2147483648 overflows V's int (max 2147483647).
18+
## This causes a V warning (soon: hard error) and TCC rejects the generated C.
19+
sed -i 's/const shf_private = int(0x8000_0000)/const shf_private = u32(0x8000_0000)/' vtcc/src/tccelf.v
20+
1621
show "Compile vtcc"
1722
cd vtcc/
1823
v run make.vsh

0 commit comments

Comments
 (0)