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).
44 lines
2.3 KiB
Plaintext
44 lines
2.3 KiB
Plaintext
// RUN: cd %S
|
|
// RUN: rm -rf %t
|
|
//
|
|
// RUN: %clang_cc1 -I. -x c++ -fmodule-name=test -fmodules -emit-module -fno-validate-pch -fmodules-strict-decluse %s -dependency-file - -MT implicit.pcm -o %t/implicit.pcm -fmodules-cache-path=%t -fmodule-map-file-home-is-cwd -fmodule-map-file=%S/Inputs/dependency-gen-base.modulemap | FileCheck %s --check-prefix=IMPLICIT
|
|
//
|
|
// RUN: %clang_cc1 -I. -x c++ -fmodule-name=test-base -fmodules -emit-module -fno-validate-pch -fmodules-strict-decluse Inputs/dependency-gen-base.modulemap -o %t/base.pcm -fmodule-map-file-home-is-cwd -fmodule-map-file=%S/Inputs/dependency-gen-base.modulemap
|
|
// RUN: %clang_cc1 -I. -x c++ -fmodule-name=test -fmodules -emit-module -fno-validate-pch -fmodules-strict-decluse -fmodule-file=%t/base.pcm %s -dependency-file - -MT explicit.pcm -o %t/explicit.pcm -fmodules-cache-path=%t -fmodule-map-file-home-is-cwd | FileCheck %s --check-prefix=EXPLICIT
|
|
//
|
|
// RUN: %clang_cc1 -I. -x c++ -fmodules -include Inputs/dependency-gen.h -x c++ /dev/null -fmodule-file=%t/explicit.pcm -MT main.o -fsyntax-only -dependency-file - | FileCheck %s --check-prefix=EXPLICIT-USE
|
|
module "test" {
|
|
export *
|
|
header "Inputs/dependency-gen.h"
|
|
use "test-base"
|
|
use "test-base2"
|
|
}
|
|
|
|
// For implicit use of a module via the module cache, the input files
|
|
// referenced by the .pcm are also dependencies of this build.
|
|
//
|
|
// IMPLICIT-DAG: {{[/\\]}}dependency-gen.modulemap
|
|
// IMPLICIT-DAG: {{ |\.[/\\]}}Inputs{{[/\\]}}dependency-gen-base.modulemap
|
|
// IMPLICIT-DAG: {{ |\.[/\\]}}Inputs{{[/\\]}}dependency-gen-base2.modulemap
|
|
// IMPLICIT-DAG: {{ |\.[/\\]}}Inputs{{[/\\]}}dependency-gen.h
|
|
// IMPLICIT-DAG: {{ |\.[/\\]}}Inputs{{[/\\]}}dependency-gen-included.h
|
|
// IMPLICIT-DAG: {{ |\.[/\\]}}Inputs{{[/\\]}}dependency-gen-included2.h
|
|
|
|
// For an explicit use of a module via -fmodule-file=, the other module maps
|
|
// and included headers are not dependencies of this target (they are instead
|
|
// dependencies of the explicitly-specified .pcm input).
|
|
//
|
|
// EXPLICIT: {{^}}explicit.pcm:
|
|
// EXPLICIT-NOT: dependency-gen-
|
|
// EXPLICIT: {{.*[/\\]}}dependency-gen.modulemap
|
|
// EXPLICIT-NOT: dependency-gen-
|
|
// EXPLICIT: base.pcm
|
|
// EXPLICIT-NOT: dependency-gen-
|
|
// EXPLICIT: {{ |\.[/\\]}}Inputs{{[/\\]}}dependency-gen.h
|
|
// EXPLICIT-NOT: dependency-gen-
|
|
|
|
// EXPLICIT-USE: main.o:
|
|
// EXPLICIT-USE-NOT: base.pcm
|
|
// EXPLICIT-USE: explicit.pcm
|
|
// EXPLICIT-USE-NOT: base.pcm
|