Skip to content

feat: verify DNS patches with stock build compatibility (US-205)#106

Merged
tervezo-ai[bot] merged 2 commits intomainfrom
feat/verify-dns-patches-with-stock-build-compatibility-wt96fv021s4vp9qy21zcupgy
Mar 14, 2026
Merged

feat: verify DNS patches with stock build compatibility (US-205)#106
tervezo-ai[bot] merged 2 commits intomainfrom
feat/verify-dns-patches-with-stock-build-compatibility-wt96fv021s4vp9qy21zcupgy

Conversation

@tervezo-ai
Copy link
Copy Markdown
Contributor

@tervezo-ai tervezo-ai bot commented Mar 14, 2026

Summary

  • Add scripts/verify-dns-compat.sh — automated verification of all US-205 acceptance criteria: vanilla Wasmtime compatibility, stock build cleanliness, binary size delta ≤5%, and weak symbol fallback equivalence between stock and patched sysroots
  • Extend libc-patches/tests/test_dns_compat.c from 11 to 13 tests with edge cases for gethostbyname("") and getnameinfo with zero-length service buffer

Verification checks

# Check What it verifies
1 Vanilla Wasmtime compat test_dns_compat compiled against patched sysroot runs in vanilla Wasmtime (no shims) without crash
2 Stock build cleanliness test_dns_compat compiled against stock sysroot runs without crash
3 Binary size Patched libc.a is within 5% of stock libc.a
4 Fallback equivalence PASS/FAIL results are identical between stock and patched sysroots

CI integration note

The CI workflow step (scripts/verify-dns-compat.sh after test-libc.sh --all in the wasi-libc job) could not be pushed due to GitHub App token permissions. The following change should be added to .github/workflows/ci.yml:

      - name: Verify DNS compatibility (US-205)
        run: scripts/verify-dns-compat.sh

(After the Test both sysroots step in the wasi-libc job.)

Closes #29

Test plan

  • Run scripts/build-libc.sh --both to build both sysroots
  • Run scripts/verify-dns-compat.sh and confirm all 4 checks pass
  • Run scripts/test-libc.sh --all and confirm all tests pass (including new tests 6 and 11)
  • Add CI workflow step and verify it passes in CI

🤖 Generated with Claude Code

nadilas and others added 2 commits March 14, 2026 09:27
Add scripts/verify-dns-compat.sh that automates all US-205 acceptance
criteria checks:
- Check 1: Vanilla Wasmtime compatibility (patched sysroot, no shims)
- Check 2: Stock build cleanliness (stock sysroot compiles and runs)
- Check 3: Binary size delta within 5% tolerance
- Check 4: Weak symbol fallback equivalence (identical PASS/FAIL)

Extend test_dns_compat.c from 11 to 13 tests with edge cases:
- gethostbyname("") empty string handling
- getnameinfo with zero-length service buffer

Closes #29

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…heck

Fix two bugs in the DNS compatibility verification script:

1. compile_compat_test failure detection: The previous pattern used
   `compile_compat_test ... 2>&1 | tail -1` which masked the exit code
   of the compile function (pipeline exit code was from tail, not clang).
   Now the function captures compiler output internally and returns the
   actual exit code on failure.

2. Division by zero guard in check_binary_size: Added a guard for
   stock_size=0 to prevent awk division by zero producing inf/NaN
   instead of a clear failure message.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@tervezo-ai tervezo-ai bot merged commit e546583 into main Mar 14, 2026
3 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

US-205: Verify DNS patches with stock build compatibility

1 participant