From 393205e6d7bd04b196c1b531242ff2b77e1820d0 Mon Sep 17 00:00:00 2001 From: Johan Lorensson Date: Wed, 6 Nov 2019 16:51:14 +0100 Subject: [PATCH] Explicit update/init only LLVM BTLS repro on external MSVC build. (mono/mono#17691) Reduce the scope of git submodule update --init to only LLVM and/or BTLS repositories when building external MSVC dependencies. Commit migrated from https://github.com/mono/mono/commit/1a6c092019877dacd33d57c104ac4cdf8933fd9b --- src/mono/msvc/build-external-btls.bat | 24 ++++++++---------------- src/mono/msvc/build-external-llvm.bat | 19 ++++++++----------- 2 files changed, 16 insertions(+), 27 deletions(-) diff --git a/src/mono/msvc/build-external-btls.bat b/src/mono/msvc/build-external-btls.bat index 95637d4..bd85f76 100755 --- a/src/mono/msvc/build-external-btls.bat +++ b/src/mono/msvc/build-external-btls.bat @@ -110,16 +110,6 @@ if "%FORCE_MSBUILD%" == "" ( set FORCE_MSBUILD=false ) -if not exist "%MONO_BTLS_DIR%" ( - echo Could not find "%MONO_BTLS_DIR%". - goto ON_ERROR -) - -if not exist "%BTLS_DIR%" ( - echo Could not find "%BTLS_DIR%". - goto ON_ERROR -) - set BTLS_CFLAGS=%VS_CFLAGS% set BTLS_ARCH=x86_64 if /i "%VS_PLATFORM%" == "win32" ( @@ -245,17 +235,19 @@ if "%GIT%" == "" ( ) :: Make sure boringssl submodule is up to date. -pushd -cd "%BTLS_DIR%" -"%GIT%" submodule update --init +"%GIT%" submodule update --init -- "%BTLS_DIR%" if not ERRORLEVEL == 0 ( - "%GIT%" submodule init - "%GIT%" submodule update + "%GIT%" submodule init -- "%BTLS_DIR%" + "%GIT%" submodule update -- "%BTLS_DIR%" if not ERRORLEVEL == 0 ( echo Git boringssl submodules failed to updated. You may experience compilation problems if some submodules are out of date. ) ) -popd + +if not exist "%BTLS_DIR%" ( + echo Could not find "%BTLS_DIR%". + goto ON_ERROR +) if not exist "%BTLS_BUILD_DIR%" ( mkdir "%BTLS_BUILD_DIR%" diff --git a/src/mono/msvc/build-external-llvm.bat b/src/mono/msvc/build-external-llvm.bat index 19e10cc..04cdd1c 100755 --- a/src/mono/msvc/build-external-llvm.bat +++ b/src/mono/msvc/build-external-llvm.bat @@ -114,11 +114,6 @@ if "%FORCE_MSBUILD%" == "" ( set FORCE_MSBUILD=false ) -if not exist "%LLVM_DIR%" ( - echo Could not find "%LLVM_DIR%". - goto ON_ERROR -) - set LLVM_CFLAGS=%VS_CFLAGS% set LLVM_ARCH=x86_64 if /i "%VS_PLATFORM%" == "win32" ( @@ -244,17 +239,19 @@ if "%GIT%" == "" ( ) :: Make sure llvm submodule is up to date. -pushd -cd "%LLVM_DIR%" -"%GIT%" submodule update --init +"%GIT%" submodule update --init -- "%LLVM_DIR%" if not ERRORLEVEL == 0 ( - "%GIT%" submodule init - "%GIT%" submodule update + "%GIT%" submodule init -- "%LLVM_DIR%" + "%GIT%" submodule update -- "%LLVM_DIR%" if not ERRORLEVEL == 0 ( echo Git llvm submodules failed to updated. You may experience compilation problems if some submodules are out of date. ) ) -popd + +if not exist "%LLVM_DIR%" ( + echo Could not find "%LLVM_DIR%". + goto ON_ERROR +) if not exist "%LLVM_BUILD_DIR%" ( mkdir "%LLVM_BUILD_DIR%" -- 2.7.4