diff --git a/BuildToolsVersion.txt b/BuildToolsVersion.txt
index 4aaddd1c41..ad88e711d3 100644
--- a/BuildToolsVersion.txt
+++ b/BuildToolsVersion.txt
@@ -1 +1 @@
-2.1.0-preview1-02431-03
+2.1.0-preview2-02621-01
diff --git a/build-source-tarball.sh b/build-source-tarball.sh
index 611321306b..5a800af10f 100755
--- a/build-source-tarball.sh
+++ b/build-source-tarball.sh
@@ -40,6 +40,7 @@ mkdir -p "$TARBALL_ROOT"
cp $SCRIPT_ROOT/build.proj $TARBALL_ROOT/
cp $SCRIPT_ROOT/dir.props $TARBALL_ROOT/
+cp $SCRIPT_ROOT/init-tools.msbuild $TARBALL_ROOT/
cp $SCRIPT_ROOT/DotnetCLIVersion.txt $TARBALL_ROOT/
cp -r $SCRIPT_ROOT/keys $TARBALL_ROOT/
cp -r $SCRIPT_ROOT/patches $TARBALL_ROOT/
diff --git a/init-tools.msbuild b/init-tools.msbuild
index 59f1793127..523872f834 100644
--- a/init-tools.msbuild
+++ b/init-tools.msbuild
@@ -6,7 +6,10 @@
$(MSBuildThisFileDirectory)Tools/$(BuildToolsPackageVersion)
-
+
+
-
\ No newline at end of file
+
diff --git a/init-tools.sh b/init-tools.sh
index ad2995e68e..32bf39d5f5 100755
--- a/init-tools.sh
+++ b/init-tools.sh
@@ -148,11 +148,11 @@ if [ ! -e "$__BUILD_TOOLS_PATH" ]; then
fi
echo "Initializing BuildTools..."
-echo "Running: $__BUILD_TOOLS_PATH/init-tools.sh $__scriptpath $__DOTNET_CMD $__TOOLRUNTIME_DIR" >> "$__init_tools_log"
+echo "Running: $__BUILD_TOOLS_PATH/init-tools.sh $__scriptpath $__DOTNET_CMD $__TOOLRUNTIME_DIR $__PACKAGES_DIR" >> "$__init_tools_log"
# Executables restored with .NET Core 2.0 do not have executable permission flags. https://github.com/NuGet/Home/issues/4424
chmod +x "$__BUILD_TOOLS_PATH/init-tools.sh"
-"$__BUILD_TOOLS_PATH/init-tools.sh" "$__scriptpath" "$__DOTNET_CMD" "$__TOOLRUNTIME_DIR" >> "$__init_tools_log"
+"$__BUILD_TOOLS_PATH/init-tools.sh" "$__scriptpath" "$__DOTNET_CMD" "$__TOOLRUNTIME_DIR" "$__PACKAGES_DIR" >> "$__init_tools_log"
if [ "$?" != "0" ]; then
echo "ERROR: An error occured when trying to initialize the tools."1>&2
display_error_message
diff --git a/repos/dir.targets b/repos/dir.targets
index ef6f267ec8..c8ed44d4b1 100644
--- a/repos/dir.targets
+++ b/repos/dir.targets
@@ -4,6 +4,8 @@
+
+
diff --git a/src/coreclr b/src/coreclr
index 61b057cbc4..8bf232c063 160000
--- a/src/coreclr
+++ b/src/coreclr
@@ -1 +1 @@
-Subproject commit 61b057cbc4f2c3dc223c93c6f099d59caba91d17
+Subproject commit 8bf232c063ad383701467a6d5a09dd4aa6974703
diff --git a/src/standard b/src/standard
index 330eb8d167..bb2c2cb47d 160000
--- a/src/standard
+++ b/src/standard
@@ -1 +1 @@
-Subproject commit 330eb8d1678c95759fba4727e13fb7531c118727
+Subproject commit bb2c2cb47d21d12477f5af6f68ab9d698b6e245f
diff --git a/support/tarball/build.sh b/support/tarball/build.sh
index e1a0a477a3..33c72852e3 100755
--- a/support/tarball/build.sh
+++ b/support/tarball/build.sh
@@ -12,5 +12,26 @@ export NUGET_PACKAGES="$SCRIPT_ROOT/packages/"
MSBUILD_ARGUMENTS=("/p:OfflineBuild=true" "/flp:v=detailed" "/clp:v=detailed")
+echo "Expanding BuildTools dependencies into packages directory..."
+# init-tools tries to copy from its script directory to Tools, which in this case is a copy to
+# itself. This is an error. To avoid the error, use a temp dir that we immediately delete.
+TEMP_TOOLS_DIR="$SCRIPT_ROOT/ToolsTemp"
+PREBUILT_PACKAGE_SOURCE="$SCRIPT_ROOT/prebuilt/nuget-packages"
+(
+ # Log the commands that run.
+ set -x
+
+ "$CLI_ROOT/dotnet" restore "$SCRIPT_ROOT/init-tools.msbuild" --no-cache --packages "$SCRIPT_ROOT/packages" --source "$PREBUILT_PACKAGE_SOURCE" || exit $?
+
+ export __INIT_TOOLS_RESTORE_ARGS="--source $PREBUILT_PACKAGE_SOURCE" || exit $?
+ "$SCRIPT_ROOT/Tools/init-tools.sh" "$SCRIPT_ROOT" "$SCRIPT_ROOT/Tools/dotnetcli/dotnet" "$TEMP_TOOLS_DIR" "$SCRIPT_ROOT/packages" || exit $?
+
+ rm -rf "$TEMP_TOOLS_DIR" || exit $?
+) > "$SCRIPT_ROOT/init-tools.log" 2>&1 || (
+ cat "$SCRIPT_ROOT/init-tools.log"
+ echo "ERROR: Failed to expand BuildTools dependencies. Detailed log above."
+ exit 1
+)
+
$CLI_ROOT/dotnet $CLI_ROOT/sdk/$CLI_VERSION/MSBuild.dll $SCRIPT_ROOT/tools-local/init-build.proj /t:WriteDynamicPropsToStaticPropsFiles /p:GeneratingStaticPropertiesFile=true ${MSBUILD_ARGUMENTS[@]} "$@"
$CLI_ROOT/dotnet $CLI_ROOT/sdk/$CLI_VERSION/MSBuild.dll $SCRIPT_ROOT/build.proj ${MSBUILD_ARGUMENTS[@]} "$@"