Skip to content

Commit 122237b

Browse files
authored
Merge pull request #37720 from JuliaLang/vc/stage_llvm_svn
[LLVM] stage git checkout through a bare repository
2 parents 02c71c7 + 58c4e76 commit 122237b

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

deps/llvm-options.mk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ endif
2222

2323

2424
ifeq ($(LLVM_VER),svn)
25-
LLVM_MONOSRC_DIR:=$(SRCCACHE)/llvm-project-$(LLVM_VER)
25+
LLVM_BARESRC_DIR:=$(SRCCACHE)/llvm-project-bare
26+
LLVM_MONOSRC_DIR:=$(SRCCACHE)/llvm-project-$(LLVM_VER)-${LLVM_GIT_VER}
2627
LLVM_SRC_DIR:=$(LLVM_MONOSRC_DIR)/llvm
2728
LIBCXX_ROOT_DIR:=$(LLVM_MONOSRC_DIR)
2829
else

deps/llvm.mk

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -372,8 +372,12 @@ ifneq ($(LLVM_VER),svn)
372372
mkdir -p $(LLVM_SRC_DIR)
373373
$(TAR) -C $(LLVM_SRC_DIR) --strip-components 1 -xf $(LLVM_TAR)
374374
else
375+
([ ! -d $(LLVM_BARESRC_DIR) ] && \
376+
git clone --bare $(LLVM_GIT_URL) $(LLVM_BARESRC_DIR) ) || \
377+
(cd $(LLVM_BARESRC_DIR) && \
378+
git fetch)
375379
([ ! -d $(LLVM_MONOSRC_DIR) ] && \
376-
git clone $(LLVM_GIT_URL) $(LLVM_MONOSRC_DIR) ) || \
380+
git clone --dissociate --reference $(LLVM_BARESRC_DIR) $(LLVM_GIT_URL) $(LLVM_MONOSRC_DIR) ) || \
377381
(cd $(LLVM_MONOSRC_DIR) && \
378382
git pull --ff-only)
379383
ifneq ($(LLVM_GIT_VER),)
@@ -574,8 +578,11 @@ check-llvm: $(LLVM_BUILDDIR_withtype)/build-checked
574578

575579
ifeq ($(LLVM_VER),svn)
576580
update-llvm:
577-
cd $(LLVM_MONOSRC_DIR) && \
578-
git pull --ff-only
581+
(cd $(LLVM_BARESRC_DIR) && \
582+
git fetch)
583+
(cd $(LLVM_MONOSRC_DIR) && \
584+
git fetch $(LLVM_BARESRC_DIR) +refs/remotes/*:refs/remotes/* && \
585+
git pull --ff-only)
579586
endif
580587
else # USE_BINARYBUILDER_LLVM
581588
ifneq ($(BINARYBUILDER_LLVM_ASSERTS), 1)

0 commit comments

Comments
 (0)