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).
56 lines
1.3 KiB
C++
56 lines
1.3 KiB
C++
// UNSUPPORTED: system-windows
|
|
// RUN: rm -rf %t
|
|
// RUN: split-file %s %t
|
|
// RUN: cd %t
|
|
//
|
|
// RUN: %hmaptool write a.hmap.json hmap
|
|
//
|
|
// RUN: %clang -Rmodule-build -fmodules -fimplicit-modules -fimplicit-module-maps -fmodule-map-file=module.modulemap -fsyntax-only -I hmap -fmodules-cache-path=%t test.cpp
|
|
//
|
|
// RUN: cd %T
|
|
// RUN: rm -rf %t
|
|
// RUN: split-file %s %t
|
|
// RUN: cd %t
|
|
//
|
|
// RUN: sed -e "s|OUTPUTS_DIR|%t|g" b.hmap.json > hmap.json
|
|
// RUN: %hmaptool write hmap.json hmap
|
|
//
|
|
// RUN: %clang -Rmodule-build -fmodules -fimplicit-modules -fimplicit-module-maps -fmodule-map-file=module.modulemap -fsyntax-only -I hmap -fmodules-cache-path=%t test.cpp
|
|
|
|
//--- After/Mapping.h
|
|
#ifdef FOO
|
|
#error foo
|
|
#endif
|
|
|
|
//--- a.hmap.json
|
|
{
|
|
"mappings" :
|
|
{
|
|
"Before/Mapping.h" : "After/Mapping.h",
|
|
"After/Mapping.h" : "After/Mapping.h"
|
|
}
|
|
}
|
|
|
|
//--- b.hmap.json
|
|
{
|
|
"mappings" :
|
|
{
|
|
"Before/Mapping.h" : "OUTPUTS_DIR/After/Mapping.h"
|
|
}
|
|
}
|
|
|
|
//--- module.modulemap
|
|
module a {
|
|
header "After/Mapping.h"
|
|
}
|
|
|
|
|
|
//--- test.cpp
|
|
#define FOO
|
|
// This include will fail if:
|
|
// 1) modules are't used, as the `FOO` define will propagate into the included
|
|
// header and trip a `#error`, or
|
|
// 2) header maps aren't used, as the header name doesn't exist and relies on
|
|
// the header map to remap it to the real header.
|
|
#include "Before/Mapping.h"
|