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).
24 lines
1.0 KiB
C
24 lines
1.0 KiB
C
// RUN: rm -rf %t
|
|
// RUN: mkdir -p %t
|
|
// RUN: cd %t
|
|
// RUN: %clang_profgen -o %t/binary %s
|
|
//
|
|
// Check that a dir separator is appended after %t is subsituted.
|
|
// RUN: env TMPDIR="%t" LLVM_PROFILE_FILE="%%traw1.profraw" %run %t/binary
|
|
// RUN: llvm-profdata show ./raw1.profraw | FileCheck %s -check-prefix TMPDIR
|
|
//
|
|
// Check that substitution works even if a redundant dir separator is added.
|
|
// RUN: env TMPDIR="%t" LLVM_PROFILE_FILE="%%t/raw2.profraw" %run %t/binary
|
|
// RUN: llvm-profdata show ./raw2.profraw | FileCheck %s -check-prefix TMPDIR
|
|
//
|
|
// Check that we fall back to the default path if TMPDIR is missing.
|
|
// RUN: %if system-aix %{ unset TMPDIR %}
|
|
// RUN: env %if !system-aix %{ -u TMPDIR %} LLVM_PROFILE_FILE="%%t/raw3.profraw" %run %t/binary 2>&1 | FileCheck %s -check-prefix MISSING
|
|
// RUN: llvm-profdata show ./default.profraw | FileCheck %s -check-prefix TMPDIR
|
|
|
|
// TMPDIR: Maximum function count: 1
|
|
|
|
// MISSING: Unable to get the TMPDIR environment variable, referenced in {{.*}}raw3.profraw. Using the default path.
|
|
|
|
int main() { return 0; }
|