Skip to content

Commit 706ace0

Browse files
committed
make: avoid fetching available LLVM revision
1 parent 7f1f99b commit 706ace0

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

make/llvm.mk

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,13 @@ llvm-source: ## Get or update LLVM sources
8383
git init $(LLVM_PROJECTDIR); \
8484
fi
8585
cd $(LLVM_PROJECTDIR) && \
86-
if ! git remote get-url origin >/dev/null 2>&1; then \
87-
git remote add origin https://github.com/tinygo-org/llvm-project; \
86+
if ! git cat-file -e "$(LLVM_REVISION)^{commit}" 2>/dev/null; then \
87+
if ! git remote get-url origin >/dev/null 2>&1; then \
88+
git remote add origin https://github.com/tinygo-org/llvm-project; \
89+
fi && \
90+
git fetch --depth=1 origin $(LLVM_REVISION); \
8891
fi && \
89-
git fetch --depth=1 origin $(LLVM_REVISION) && \
90-
git checkout FETCH_HEAD
92+
git checkout $(LLVM_REVISION)
9193

9294
# Configure LLVM.
9395
TINYGO_SOURCE_DIR=$(shell pwd)

0 commit comments

Comments
 (0)