Skip to content

Commit cecaf52

Browse files
authored
win/msys2: Automatically switch msys2 symlinks mode for LLVM (#58988)
As noted in #54981 (comment), msys2 currently fails to untar an llvm source build. Fix that by setting the appropriate environment variable to switch the symlinks mode.
1 parent 95c4870 commit cecaf52

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

deps/llvm.mk

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ include $(SRCDIR)/llvm-options.mk
66
ifneq ($(USE_BINARYBUILDER_LLVM), 1)
77
LLVM_GIT_URL:=https://github.com/JuliaLang/llvm-project.git
88
LLVM_TAR_URL=https://api.github.com/repos/JuliaLang/llvm-project/tarball/$1
9+
# LLVM's tarball contains symlinks to non-existent targets. This breaks the
10+
# the default msys strategy `deepcopy` symlink strategy. To workaround this,
11+
# switch to `native` which tries native windows symlinks (possible if the
12+
# machine is in developer mode) - or if not, falls back to cygwin-style
13+
# symlinks. We don't particularly care either way - we just need to symlinks
14+
# to succeed. We could guard this by a uname check, but it's harmless elsewhere,
15+
# so let's not incur the additional overhead.
16+
$(SRCCACHE)/$(LLVM_SRC_DIR)/source-extracted: export MSYS=winsymlinks:native
917
$(eval $(call git-external,llvm,LLVM,CMakeLists.txt,,$(SRCCACHE)))
1018

1119
LLVM_BUILDDIR := $(BUILDDIR)/$(LLVM_SRC_DIR)

0 commit comments

Comments
 (0)