From 405794d4ca19445eb90c80ea9eca50f84b322d07 Mon Sep 17 00:00:00 2001 From: Dave Date: Sat, 13 Jul 2024 16:32:25 -0400 Subject: [PATCH] fix: speedup `git submodule update` with `--single-branch` (#2847) add --single-branch to submodule update commands for speed Signed-off-by: Dave Lee --- Makefile | 16 ++++++++-------- backend/cpp/grpc/Makefile | 2 +- backend/cpp/llama/Makefile | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index c16f8e71..112663e7 100644 --- a/Makefile +++ b/Makefile @@ -214,7 +214,7 @@ sources/go-bert.cpp: git remote add origin $(BERT_REPO) && \ git fetch origin && \ git checkout $(BERT_VERSION) && \ - git submodule update --init --recursive --depth 1 + git submodule update --init --recursive --depth 1 --single-branch sources/go-bert.cpp/libgobert.a: sources/go-bert.cpp $(MAKE) -C sources/go-bert.cpp libgobert.a @@ -227,7 +227,7 @@ sources/go-llama.cpp: git remote add origin $(GOLLAMA_REPO) && \ git fetch origin && \ git checkout $(GOLLAMA_VERSION) && \ - git submodule update --init --recursive --depth 1 + git submodule update --init --recursive --depth 1 --single-branch sources/go-llama.cpp/libbinding.a: sources/go-llama.cpp $(MAKE) -C sources/go-llama.cpp BUILD_TYPE=$(STABLE_BUILD_TYPE) libbinding.a @@ -240,7 +240,7 @@ sources/go-piper: git remote add origin $(PIPER_REPO) && \ git fetch origin && \ git checkout $(PIPER_VERSION) && \ - git submodule update --init --recursive --depth 1 + git submodule update --init --recursive --depth 1 --single-branch sources/go-piper/libpiper_binding.a: sources/go-piper $(MAKE) -C sources/go-piper libpiper_binding.a example/main piper.o @@ -253,7 +253,7 @@ sources/gpt4all: git remote add origin $(GPT4ALL_REPO) && \ git fetch origin && \ git checkout $(GPT4ALL_VERSION) && \ - git submodule update --init --recursive --depth 1 + git submodule update --init --recursive --depth 1 --single-branch sources/gpt4all/gpt4all-bindings/golang/libgpt4all.a: sources/gpt4all $(MAKE) -C sources/gpt4all/gpt4all-bindings/golang/ libgpt4all.a @@ -266,7 +266,7 @@ sources/go-rwkv.cpp: git remote add origin $(RWKV_REPO) && \ git fetch origin && \ git checkout $(RWKV_VERSION) && \ - git submodule update --init --recursive --depth 1 + git submodule update --init --recursive --depth 1 --single-branch sources/go-rwkv.cpp/librwkv.a: sources/go-rwkv.cpp cd sources/go-rwkv.cpp && cd rwkv.cpp && cmake . -DRWKV_BUILD_SHARED_LIBRARY=OFF && cmake --build . && cp librwkv.a .. @@ -279,7 +279,7 @@ sources/go-stable-diffusion: git remote add origin $(STABLEDIFFUSION_REPO) && \ git fetch origin && \ git checkout $(STABLEDIFFUSION_VERSION) && \ - git submodule update --init --recursive --depth 1 + git submodule update --init --recursive --depth 1 --single-branch sources/go-stable-diffusion/libstablediffusion.a: sources/go-stable-diffusion CPATH="$(CPATH):/usr/include/opencv4" $(MAKE) -C sources/go-stable-diffusion libstablediffusion.a @@ -292,7 +292,7 @@ sources/go-tiny-dream: git remote add origin $(TINYDREAM_REPO) && \ git fetch origin && \ git checkout $(TINYDREAM_VERSION) && \ - git submodule update --init --recursive --depth 1 + git submodule update --init --recursive --depth 1 --single-branch sources/go-tiny-dream/libtinydream.a: sources/go-tiny-dream $(MAKE) -C sources/go-tiny-dream libtinydream.a @@ -305,7 +305,7 @@ sources/whisper.cpp: git remote add origin $(WHISPER_REPO) && \ git fetch origin && \ git checkout $(WHISPER_CPP_VERSION) && \ - git submodule update --init --recursive --depth 1 + git submodule update --init --recursive --depth 1 --single-branch sources/whisper.cpp/libwhisper.a: sources/whisper.cpp cd sources/whisper.cpp && $(MAKE) libwhisper.a libggml.a diff --git a/backend/cpp/grpc/Makefile b/backend/cpp/grpc/Makefile index 286fc0bd..9189b69a 100644 --- a/backend/cpp/grpc/Makefile +++ b/backend/cpp/grpc/Makefile @@ -52,7 +52,7 @@ $(GRPC_REPO): git remote add origin $(GIT_REPO_LIB_GRPC) && \ git fetch origin && \ git checkout $(TAG_LIB_GRPC) && \ - git submodule update --init --recursive --depth 1 + git submodule update --init --recursive --depth 1 --single-branch $(GRPC_BUILD): $(GRPC_REPO) mkdir -p $(GRPC_BUILD) diff --git a/backend/cpp/llama/Makefile b/backend/cpp/llama/Makefile index f805f4a3..176cace6 100644 --- a/backend/cpp/llama/Makefile +++ b/backend/cpp/llama/Makefile @@ -52,7 +52,7 @@ llama.cpp: git remote add origin $(LLAMA_REPO) && \ git fetch origin && \ git checkout -b build $(LLAMA_VERSION) && \ - git submodule update --init --recursive --depth 1 + git submodule update --init --recursive --depth 1 --single-branch llama.cpp/examples/grpc-server: llama.cpp mkdir -p llama.cpp/examples/grpc-server