Instead of writing to the source tree $ROOT_DIR/$KERNEL_DIR, write to $OUT_DIR instead. Note that $OUT_DIR isn't defined at this point, so it is left as a variable in the PRE_DEFCONFIG_CMDS. The change as two benefits to Kleaf: - This is one prerequesite to make --config=local possible for slider_config and others. Otherwise, multiple kernel_config targets with the same $DEFCONFIG will collide, and they cannot be executed in parallel with --config=local. OUT_DIR does not collide because OUT_DIR_SUFFIX is determined by the label of the target. - This ensures that both build.sh and Kleaf not write to the source tree (e.g. common/arch/arm64/configs/16k_gki_defconfig in this case). Otherwise, an interrupted build.sh build or an interrupted --config=local Bazel build will leave the source tree dirty, causing slider_gki_defconfig to be a readonly input file in the next Bazel execution. Because it no longer writes to the source tree, the POST_DEFCONFIG_CMDS that cleans up the file is no longer necessary. Test: builds Test: TH Bug: 234045848 Change-Id: I6ac3770cca160c025549cb336c9d2d05ad98ad1b Signed-off-by: Yifan Hong <elsk@google.com>
342 B
342 B