cb424d7448
verify-patch-sanity.py validates every active recipe .patch has internally- consistent hunk line counts — catching the 'malformed patch at line N' failure at commit/CI/preflight time instead of hours into a cook. This cycle hit that class three times (qtwaylandscanner, sddm, xwayland), each only discovered when cookbook tried to apply the patch. Running it across the repo found 29 latent malformed patches (validated against GNU patch: e.g. relibc/P3-sysv-ipc reproduces 'malformed patch at line 22'). They were harmless only because they sit in vendored recipes (baked, not re- applied) — but would fail on any version-bump re-derivation. --fix recounts the hunk headers (body untouched) and repaired all 29. Wired into build-preflight.sh (Phase 1.0D) and redbear-ci.yml, with a unit test (test-patch-sanity.sh). Skips archived/legacy trees and unvalidatable formats (empty placeholders, bare-@@ git hunks).
42 lines
1.2 KiB
Plaintext
42 lines
1.2 KiB
Plaintext
REQUIRES: x86
|
|
RUN: split-file %s %t.dir && cd %t.dir
|
|
|
|
RUN: llvm-mc -filetype=obj -triple=x86_64-windows test.s -o test.obj
|
|
RUN: llvm-mc -filetype=obj -triple=x86_64-windows sym2.s -o sym2.obj
|
|
RUN: llvm-mc -filetype=obj -triple=x86_64-windows def.s -o def.obj
|
|
|
|
RUN: not lld-link -machine:amd64 -dll -noentry -out:test.dll test.obj sym2.obj 2>&1 | FileCheck -check-prefix=ERR %s
|
|
|
|
ERR: error: undefined symbol: testsym
|
|
ERR-NEXT: >>> referenced by test.obj
|
|
ERR-EMPTY:
|
|
ERR-NEXT: error: undefined symbol: sym1
|
|
ERR-NEXT: >>> referenced by test.obj
|
|
ERR-NEXT: >>> referenced by sym2.obj
|
|
ERR-EMPTY:
|
|
ERR-NEXT: error: undefined symbol: sym2
|
|
ERR-NEXT: >>> referenced by test.obj
|
|
ERR-NEXT: >>> referenced by sym2.obj
|
|
|
|
Depending on symbol processing order, we may have temporary weak reference cycles:
|
|
|
|
RUN: lld-link -machine:amd64 -dll -noentry -out:test.dll test.obj sym2.obj def.obj
|
|
RUN: lld-link -machine:amd64 -dll -noentry -out:test.dll test.obj def.obj sym2.obj
|
|
RUN: lld-link -machine:amd64 -dll -noentry -out:test.dll def.obj test.obj sym2.obj
|
|
|
|
#--- test.s
|
|
.weak testsym
|
|
.set testsym, sym1
|
|
.weak sym1
|
|
.set sym1, sym2
|
|
|
|
#--- sym2.s
|
|
.weak sym2
|
|
.set sym2, sym1
|
|
|
|
#--- def.s
|
|
.globl sym1
|
|
.data
|
|
sym1:
|
|
.word 0
|