From f9584deba5d7faa1ff547fca5ea4e19818394de8 Mon Sep 17 00:00:00 2001 From: Daniel Hiltgen Date: Tue, 8 Oct 2024 13:04:59 -0700 Subject: [PATCH] Fix build leakages (#7141) The recent change to applying patches leaves the submodule dirty based on "new commits" being present. This ensures we clean up so the tree no longer reports dirty after a `go generate ./...` run. The Makefile was being a bit too aggressive in cleaning things up and would result in deleting the placeholder files which someone might accidentally commit. --- llama/Makefile | 2 +- llm/generate/gen_common.sh | 10 +--------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/llama/Makefile b/llama/Makefile index af1298aa2..589eb6dec 100644 --- a/llama/Makefile +++ b/llama/Makefile @@ -42,7 +42,7 @@ $(RUNNER_TARGETS): $(MAKE) -f make/Makefile.$@ clean: - rm -rf $(BUILD_DIR) $(DIST_RUNNERS) $(PAYLOAD_RUNNERS) $(RUNNERS_PAYLOAD_DIR) + rm -rf $(BUILD_DIR) $(DIST_RUNNERS) $(PAYLOAD_RUNNERS) clean-payload: rm -rf $(addprefix $(RUNNERS_PAYLOAD_DIR)/, $(RUNNER_TARGETS) metal cpu cpu_avx cpu_avx2) diff --git a/llm/generate/gen_common.sh b/llm/generate/gen_common.sh index 3825c155a..e58c2d40a 100644 --- a/llm/generate/gen_common.sh +++ b/llm/generate/gen_common.sh @@ -133,13 +133,5 @@ install() { # Keep the local tree clean after we're done with the build cleanup() { - (cd ${LLAMACPP_DIR}/ && git checkout CMakeLists.txt) - - if [ -n "$(ls -A ../patches/*.diff)" ]; then - for patch in ../patches/*.diff; do - for file in $(grep "^+++ " ${patch} | cut -f2 -d' ' | cut -f2- -d/); do - (cd ${LLAMACPP_DIR}; git checkout ${file}) - done - done - fi + git submodule update --force ${LLAMACPP_DIR} }