kernel_headers: Fix headers not detected in incremental builds

Currently the Soong logic doesn't kick in if a change updates
headers but doesn't update gen_headers_arm*.bp files for
incremental builds. Fix the issue by making inputs to the
kernel_headers.py script as variables instead of a list.

Change-Id: I9737f6d655848458bfda70b8c6f4d9aa896a98fc
Signed-off-by: Rishabh Bhatnagar <rishabhb@codeaurora.org>
This commit is contained in:
Rishabh Bhatnagar
2020-02-12 13:50:44 -08:00
parent 958eec11ec
commit 119960e66b
3 changed files with 90 additions and 54 deletions

View File

@@ -1,7 +1,20 @@
// ***** DO NOT EDIT *****
// This file is generated by kernel_headers.py
gen_headers_srcs_arm = [
"arch/arm/include/uapi/asm/Kbuild",
"include/uapi/asm-generic/Kbuild.asm",
"Makefile",
"arch/arm/tools/syscall.tbl",
"include/uapi/**/*.h",
"arch/arm/include/uapi/**/*.h",
"techpack/*/include/uapi/*/**/*.h",
]
gen_headers_arm = [
gen_headers_exclude_srcs_arm = [
"include/uapi/linux/a.out.h",
]
gen_headers_out_arm = [
// Matching generated-y:
@@ -939,7 +952,7 @@ gen_headers_arm = [
"asm/types.h",
"asm/unistd.h",
// From techpack/*
// From techpack/*/include/uapi/*/**/*.h
"media/cam_cpas.h",
"media/cam_custom.h",
@@ -962,7 +975,8 @@ genrule {
// checked later to ensure that it matches the checked-
// in version (this file).
name: "qti_generate_gen_headers_arm",
srcs: ["arch/arm/include/uapi/asm/Kbuild", "include/uapi/asm-generic/Kbuild.asm", "arch/arm/include/uapi/**/*.h"],
srcs: gen_headers_srcs_arm,
exclude_srcs: gen_headers_exclude_srcs_arm,
tool_files: ["kernel_headers.py"],
cmd: "python3 $(location kernel_headers.py) " +
kernel_headers_verbose +
@@ -970,8 +984,10 @@ genrule {
"--gen_dir $(genDir) " +
"--arch_asm_kbuild $(location arch/arm/include/uapi/asm/Kbuild) " +
"--arch_include_uapi $(locations arch/arm/include/uapi/**/*.h) " +
"--techpack_include_uapi $(locations techpack/*/include/uapi/*/**/*.h) " +
"--asm_generic_kbuild $(location include/uapi/asm-generic/Kbuild.asm) " +
"blueprints",
"blueprints " +
"# $(in)",
out: ["gen_headers_arm.bp"],
}
@@ -982,25 +998,18 @@ genrule {
"kernel_headers.py",
"arch/arm/tools/syscallhdr.sh",
],
srcs: [
"arch/arm/include/uapi/asm/Kbuild",
"include/uapi/asm-generic/Kbuild.asm",
srcs: gen_headers_srcs_arm +[
"gen_headers_arm.bp",
":qti_generate_gen_headers_arm",
"Makefile",
"arch/arm/tools/syscall.tbl",
"include/uapi/**/*.h",
"arch/arm/include/uapi/**/*.h",
],
exclude_srcs: [
"include/uapi/linux/a.out.h",
],
exclude_srcs: gen_headers_exclude_srcs_arm,
cmd: "python3 $(location kernel_headers.py) " +
kernel_headers_verbose +
"--header_arch arm " +
"--gen_dir $(genDir) " +
"--arch_asm_kbuild $(location arch/arm/include/uapi/asm/Kbuild) " +
"--arch_include_uapi $(locations arch/arm/include/uapi/**/*.h) " +
"--techpack_include_uapi $(locations techpack/*/include/uapi/*/**/*.h) " +
"--asm_generic_kbuild $(location include/uapi/asm-generic/Kbuild.asm) " +
"headers " +
"--old_gen_headers_bp $(location gen_headers_arm.bp) " +
@@ -1010,5 +1019,5 @@ genrule {
"--arch_syscall_tbl $(location arch/arm/tools/syscall.tbl) " +
"--headers_install $(location headers_install.sh) " +
"--include_uapi $(locations include/uapi/**/*.h)",
out: ["linux/version.h"] + gen_headers_arm,
out: ["linux/version.h"] + gen_headers_out_arm,
}