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>
Signed-off-by: Prateek Sood <prsood@codeaurora.org>
[bharad@codeaurora.org: resolve trivial merge conflicts]
Signed-off-by: Naitik Bharadiya <bharad@codeaurora.org>
diff --git a/gen_headers_arm.bp b/gen_headers_arm.bp
index f708dbe..e8d2f2f 100644
--- a/gen_headers_arm.bp
+++ b/gen_headers_arm.bp
@@ -1,7 +1,52 @@
// ***** DO NOT EDIT *****
// This file is generated by kernel_headers.py
-gen_headers_arm = [
+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",
+]
+
+gen_headers_exclude_srcs_arm = [
+ "include/uapi/linux/a.out.h",
+ "include/uapi/drm/armada_drm.h",
+ "include/uapi/drm/etnaviv_drm.h",
+ "include/uapi/drm/omap_drm.h",
+ "include/uapi/drm/vgem_drm.h",
+ "include/uapi/linux/auto_dev-ioctl.h",
+ "include/uapi/linux/batman_adv.h",
+ "include/uapi/linux/bcache.h",
+ "include/uapi/linux/btrfs_tree.h",
+ "include/uapi/linux/cryptouser.h",
+ "include/uapi/linux/dma-buf.h",
+ "include/uapi/linux/hash_info.h",
+ "include/uapi/linux/kcm.h",
+ "include/uapi/linux/kcov.h",
+ "include/uapi/linux/kfd_ioctl.h",
+ "include/uapi/linux/lightnvm.h",
+ "include/uapi/linux/module.h",
+ "include/uapi/linux/nilfs2_api.h",
+ "include/uapi/linux/nilfs2_ondisk.h",
+ "include/uapi/linux/nsfs.h",
+ "include/uapi/linux/pr.h",
+ "include/uapi/linux/qrtr.h",
+ "include/uapi/linux/stm.h",
+ "include/uapi/linux/tee.h",
+ "include/uapi/linux/userio.h",
+ "include/uapi/linux/wil6210_uapi.h",
+ "include/uapi/rdma/qedr-abi.h",
+ "include/uapi/video/adf.h",
+ "include/uapi/linux/cifs/cifs_mount.h",
+ "include/uapi/linux/genwqe/genwqe_card.h",
+ "include/uapi/linux/netfilter/xt_HARDIDLETIMER.h",
+ "include/uapi/linux/usb/f_accessory.h",
+ "include/uapi/linux/usb/f_mtp.h",
+]
+
+gen_headers_out_arm = [
// Matching generated-y:
@@ -885,7 +930,8 @@
// 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 +
@@ -894,7 +940,8 @@
"--arch_asm_kbuild $(location arch/arm/include/uapi/asm/Kbuild) " +
"--arch_include_uapi $(locations arch/arm/include/uapi/**/*.h) " +
"--asm_generic_kbuild $(location include/uapi/asm-generic/Kbuild.asm) " +
- "blueprints",
+ "blueprints " +
+ "# $(in)",
out: ["gen_headers_arm.bp"],
}
@@ -905,51 +952,11 @@
"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",
- "include/uapi/drm/armada_drm.h",
- "include/uapi/drm/etnaviv_drm.h",
- "include/uapi/drm/omap_drm.h",
- "include/uapi/drm/vgem_drm.h",
- "include/uapi/linux/auto_dev-ioctl.h",
- "include/uapi/linux/batman_adv.h",
- "include/uapi/linux/bcache.h",
- "include/uapi/linux/btrfs_tree.h",
- "include/uapi/linux/cryptouser.h",
- "include/uapi/linux/dma-buf.h",
- "include/uapi/linux/hash_info.h",
- "include/uapi/linux/kcm.h",
- "include/uapi/linux/kcov.h",
- "include/uapi/linux/kfd_ioctl.h",
- "include/uapi/linux/lightnvm.h",
- "include/uapi/linux/module.h",
- "include/uapi/linux/nilfs2_api.h",
- "include/uapi/linux/nilfs2_ondisk.h",
- "include/uapi/linux/nsfs.h",
- "include/uapi/linux/pr.h",
- "include/uapi/linux/qrtr.h",
- "include/uapi/linux/stm.h",
- "include/uapi/linux/tee.h",
- "include/uapi/linux/userio.h",
- "include/uapi/linux/wil6210_uapi.h",
- "include/uapi/rdma/qedr-abi.h",
- "include/uapi/video/adf.h",
- "include/uapi/linux/cifs/cifs_mount.h",
- "include/uapi/linux/genwqe/genwqe_card.h",
- "include/uapi/linux/netfilter/xt_HARDIDLETIMER.h",
- "include/uapi/linux/usb/f_accessory.h",
- "include/uapi/linux/usb/f_mtp.h",
- ],
+ exclude_srcs: gen_headers_exclude_srcs_arm,
cmd: "python3 $(location kernel_headers.py) " +
kernel_headers_verbose +
"--header_arch arm " +
@@ -965,5 +972,5 @@
"--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,
}