Explicit update/init only LLVM BTLS repro on external MSVC build. (mono/mono#17691)
authorJohan Lorensson <lateralusx.github@gmail.com>
Wed, 6 Nov 2019 15:51:14 +0000 (16:51 +0100)
committerGitHub <noreply@github.com>
Wed, 6 Nov 2019 15:51:14 +0000 (16:51 +0100)
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
src/mono/msvc/build-external-llvm.bat

index 95637d4..bd85f76 100755 (executable)
@@ -110,16 +110,6 @@ if "%FORCE_MSBUILD%" == "" (
     set FORCE_MSBUILD=false\r
 )\r
 \r
-if not exist "%MONO_BTLS_DIR%" (\r
-    echo Could not find "%MONO_BTLS_DIR%".\r
-    goto ON_ERROR\r
-)\r
-\r
-if not exist "%BTLS_DIR%" (\r
-    echo Could not find "%BTLS_DIR%".\r
-    goto ON_ERROR\r
-)\r
-\r
 set BTLS_CFLAGS=%VS_CFLAGS%\r
 set BTLS_ARCH=x86_64\r
 if /i "%VS_PLATFORM%" == "win32" (\r
@@ -245,17 +235,19 @@ if "%GIT%" == "" (
 )\r
 \r
 :: Make sure boringssl submodule is up to date.\r
-pushd\r
-cd "%BTLS_DIR%"\r
-"%GIT%" submodule update --init\r
+"%GIT%" submodule update --init -- "%BTLS_DIR%"\r
 if not ERRORLEVEL == 0 (\r
-   "%GIT%" submodule init\r
-    "%GIT%" submodule update\r
+    "%GIT%" submodule init -- "%BTLS_DIR%"\r
+    "%GIT%" submodule update -- "%BTLS_DIR%"\r
     if not ERRORLEVEL == 0 (\r
         echo Git boringssl submodules failed to updated. You may experience compilation problems if some submodules are out of date.\r
     )\r
 )\r
-popd\r
+\r
+if not exist "%BTLS_DIR%" (\r
+    echo Could not find "%BTLS_DIR%".\r
+    goto ON_ERROR\r
+)\r
 \r
 if not exist "%BTLS_BUILD_DIR%" (\r
     mkdir "%BTLS_BUILD_DIR%"\r
index 19e10cc..04cdd1c 100755 (executable)
@@ -114,11 +114,6 @@ if "%FORCE_MSBUILD%" == "" (
     set FORCE_MSBUILD=false\r
 )\r
 \r
-if not exist "%LLVM_DIR%" (\r
-    echo Could not find "%LLVM_DIR%".\r
-    goto ON_ERROR\r
-)\r
-\r
 set LLVM_CFLAGS=%VS_CFLAGS%\r
 set LLVM_ARCH=x86_64\r
 if /i "%VS_PLATFORM%" == "win32" (\r
@@ -244,17 +239,19 @@ if "%GIT%" == "" (
 )\r
 \r
 :: Make sure llvm submodule is up to date.\r
-pushd\r
-cd "%LLVM_DIR%"\r
-"%GIT%" submodule update --init\r
+"%GIT%" submodule update --init -- "%LLVM_DIR%"\r
 if not ERRORLEVEL == 0 (\r
-   "%GIT%" submodule init\r
-    "%GIT%" submodule update\r
+    "%GIT%" submodule init -- "%LLVM_DIR%"\r
+    "%GIT%" submodule update -- "%LLVM_DIR%"\r
     if not ERRORLEVEL == 0 (\r
         echo Git llvm submodules failed to updated. You may experience compilation problems if some submodules are out of date.\r
     )\r
 )\r
-popd\r
+\r
+if not exist "%LLVM_DIR%" (\r
+    echo Could not find "%LLVM_DIR%".\r
+    goto ON_ERROR\r
+)\r
 \r
 if not exist "%LLVM_BUILD_DIR%" (\r
     mkdir "%LLVM_BUILD_DIR%"\r