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).
65 lines
2.4 KiB
C
65 lines
2.4 KiB
C
/// This tests the expected error case when there is a mismatch between the pcm dependencies passed in
|
|
/// the command line with `fmodule-file` and whats encoded in the pcm.
|
|
|
|
/// The steps are:
|
|
/// 1. Build the module A with no dependencies. The first variant to build is A-1.pcm.
|
|
/// 2. Build the same module with files that resolve from different search paths.
|
|
/// This variant is named A-2.pcm.
|
|
/// 3. Build module B that depends on the earlier module A-1.pcm.
|
|
/// 4. Build client that directly depends on both modules (A & B),
|
|
/// but depends on a incompatible variant of A (A-2.pcm) for B to use.
|
|
|
|
// RUN: rm -rf %t
|
|
// RUN: split-file %s %t
|
|
|
|
// RUN: %clang_cc1 -emit-module -x c -fmodules -fno-implicit-modules -isysroot %t/Sysroot \
|
|
// RUN: -I%t/Sysroot/usr/include \
|
|
// RUN: -fmodule-name=A %t/Sysroot/usr/include/A/module.modulemap -o %t/A-1.pcm
|
|
|
|
// RUN: %clang_cc1 -emit-module -x c -fmodules -fno-implicit-modules -isysroot %t/Sysroot \
|
|
// RUN: -I%t/BuildDir \
|
|
// RUN: -fmodule-name=A %t/BuildDir/A/module.modulemap -o %t/A-2.pcm
|
|
|
|
// RUN: %clang_cc1 -emit-module -x c -fmodules -fno-implicit-modules -isysroot %t/Sysroot \
|
|
// RUN: -I%t/Sysroot/usr/include \
|
|
// RUN: -fmodule-map-file=%t/Sysroot/usr/include/A/module.modulemap \
|
|
// RUN: -fmodule-file=A=%t/A-1.pcm \
|
|
// RUN: -fmodule-name=B %t/Sysroot/usr/include/B/module.modulemap -o %t/B-1.pcm
|
|
|
|
// RUN: %clang_cc1 -x c -fmodules -fno-implicit-modules -isysroot %t/Sysroot \
|
|
// RUN: -I%t/BuildDir -I%t/Sysroot/usr/include \
|
|
// RUN: -fmodule-map-file=%t/BuildDir/A/module.modulemap \
|
|
// RUN: -fmodule-map-file=%t/Sysroot/usr/include/B/module.modulemap \
|
|
// RUN: -fmodule-file=A=%t/A-2.pcm -fmodule-file=B=%t/B-1.pcm \
|
|
// RUN: -Wmodule-file-mapping-mismatch -verify %s
|
|
|
|
|
|
#include <A/A.h>
|
|
#include <B/B.h> // expected-warning {{conflicts with imported file}} \
|
|
// expected-note {{imported by module 'B'}} \
|
|
// expected-error {{out of date and needs to be rebuilt}}
|
|
|
|
//--- Sysroot/usr/include/A/module.modulemap
|
|
module A [system] {
|
|
umbrella header "A.h"
|
|
}
|
|
//--- Sysroot/usr/include/A/A.h
|
|
typedef int A_t;
|
|
|
|
//--- Sysroot/usr/include/B/module.modulemap
|
|
module B [system] {
|
|
umbrella header "B.h"
|
|
}
|
|
|
|
//--- Sysroot/usr/include/B/B.h
|
|
#include <A/A.h>
|
|
typedef int B_t;
|
|
|
|
//--- BuildDir/A/module.modulemap
|
|
module A [system] {
|
|
umbrella header "A.h"
|
|
}
|
|
|
|
//--- BuildDir/A/A.h
|
|
typedef int A_t;
|