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.8 KiB
Matlab
56 lines
1.8 KiB
Matlab
// This test checks that we're reporting module maps affecting the compilation by describing excluded headers.
|
|
|
|
// RUN: rm -rf %t
|
|
// RUN: split-file %s %t
|
|
|
|
//--- frameworks/X.framework/Modules/module.modulemap
|
|
framework module X {
|
|
umbrella header "X.h"
|
|
exclude header "Excluded.h"
|
|
}
|
|
//--- frameworks/X.framework/Headers/X.h
|
|
//--- frameworks/X.framework/Headers/Excluded.h
|
|
|
|
//--- mod/module.modulemap
|
|
module Mod { header "Mod.h" }
|
|
//--- mod/Mod.h
|
|
#include <X/Excluded.h>
|
|
|
|
//--- tu.m
|
|
@import Mod;
|
|
|
|
//--- cdb.json.template
|
|
[{
|
|
"file": "DIR/tu.m",
|
|
"directory": "DIR",
|
|
"command": "clang -fmodules -fmodules-cache-path=DIR/cache -I DIR/mod -F DIR/frameworks -Werror=non-modular-include-in-module -c DIR/tu.m -o DIR/tu.m"
|
|
}]
|
|
|
|
// RUN: sed -e "s|DIR|%/t|g" %t/cdb.json.template > %t/cdb.json
|
|
// RUN: clang-scan-deps -compilation-database %t/cdb.json -format experimental-full > %t/result.json
|
|
// RUN: cat %t/result.json | sed 's:\\\\\?:/:g' | FileCheck %s -DPREFIX=%/t
|
|
|
|
// CHECK: {
|
|
// CHECK-NEXT: "modules": [
|
|
// CHECK-NEXT: {
|
|
// CHECK-NEXT: "clang-module-deps": [],
|
|
// CHECK-NEXT: "clang-modulemap-file": "[[PREFIX]]/mod/module.modulemap",
|
|
// CHECK-NEXT: "command-line": [
|
|
// CHECK: "-fmodule-map-file=[[PREFIX]]/frameworks/X.framework/Modules/module.modulemap"
|
|
// CHECK-NOT: "-fmodule-file={{.*}}"
|
|
// CHECK: ],
|
|
// CHECK-NEXT: "context-hash": "{{.*}}",
|
|
// CHECK-NEXT: "file-deps": [
|
|
// CHECK: ],
|
|
// CHECK-NEXT: "link-libraries": [],
|
|
// CHECK-NEXT: "name": "Mod"
|
|
// CHECK-NEXT: }
|
|
// CHECK-NEXT: ]
|
|
// CHECK: }
|
|
|
|
// RUN: %deps-to-rsp %t/result.json --module-name=Mod > %t/Mod.cc1.rsp
|
|
// RUN: %deps-to-rsp %t/result.json --tu-index=0 > %t/tu.rsp
|
|
|
|
// RUN: %clang @%t/Mod.cc1.rsp
|
|
// RUN: %clang @%t/tu.rsp
|