From 94e65c8f0111757675854c685b28fd8e94a7426a Mon Sep 17 00:00:00 2001 From: Juan Sebastian Hoyos Ayala Date: Mon, 11 Nov 2019 19:09:09 +0000 Subject: [PATCH 1/2] Add fix for restore of ilasm The restore logic in buildtools tried to use a netcoreapp2.1 TFM for Linux-musl. This ended up restoring Linux-x64 binaries which then broke the test build. This change works around this by saving a copy of the depproj that BuildTools used into the tree and restore it as a 3.0 app manually in init-tools on our side of the build. --- init-tools.cmd | 9 ++++--- init-tools.sh | 15 ++++++----- tests/ilasm-restore/Directory.Build.props | 6 +++++ tests/ilasm-restore/Directory.Build.targets | 6 +++++ tests/ilasm-restore/ilasm.depproj | 30 +++++++++++++++++++++ 5 files changed, 56 insertions(+), 10 deletions(-) create mode 100644 tests/ilasm-restore/Directory.Build.props create mode 100644 tests/ilasm-restore/Directory.Build.targets create mode 100644 tests/ilasm-restore/ilasm.depproj diff --git a/init-tools.cmd b/init-tools.cmd index 0905e913b96c..b483d72571ca 100644 --- a/init-tools.cmd +++ b/init-tools.cmd @@ -105,9 +105,6 @@ if NOT exist "%BUILD_TOOLS_PATH%\init-tools.cmd" ( :afterbuildtoolsrestore -:: Ask init-tools to also restore ILAsm -set /p ILASMCOMPILER_VERSION=< "%~dp0ILAsmVersion.txt" - echo Initializing BuildTools... echo Running: "%BUILD_TOOLS_PATH%\init-tools.cmd" "%~dp0" "%DOTNET_CMD%" "%TOOLRUNTIME_DIR%" >> "%INIT_TOOLS_LOG%" call "%BUILD_TOOLS_PATH%\init-tools.cmd" "%~dp0" "%DOTNET_CMD%" "%TOOLRUNTIME_DIR%" "%PACKAGES_DIR%" >> "%INIT_TOOLS_LOG%" @@ -117,6 +114,12 @@ if not [%INIT_TOOLS_ERRORLEVEL%]==[0] ( goto :error ) +REM ILasm/ILDasm used to be restored by buildtools. The reference there was a netocreapp2.0, which was prior to our support of linux-musl. We initialize it locally as a 3.0 with the new SDK. +set /p ILASM_VERSION=< "%~dp0ILAsmVersion.txt" +if [%NATIVE_TOOLS_RID%] == [] set NATIVE_TOOLS_RID=win-x64 +echo Running: call "%DOTNET_CMD%" build "%~dp0tests\ilasm-restore\ilasm.depproj" --no-cache --packages "%PACKAGES_DIR%" -r "%NATIVE_TOOLS_RID%" /p:ILAsmPackageVersion="%ILASM_VERSION%" /p:ExpectedILAsmPath="%TOOLRUNTIME_DIR%\ilasm" >> "%INIT_TOOLS_LOG%" +call "%DOTNET_CMD%" build "%~dp0tests\ilasm-restore\ilasm.depproj" --no-cache --packages "%PACKAGES_DIR%" -r "%NATIVE_TOOLS_RID%" /p:ILAsmPackageVersion="%ILASM_VERSION%" /p:ExpectedILAsmPath="%TOOLRUNTIME_DIR%\ilasm" + :: Create semaphore file echo Done initializing tools. if NOT exist "%BUILD_TOOLS_SEMAPHORE_DIR%" mkdir "%BUILD_TOOLS_SEMAPHORE_DIR%" diff --git a/init-tools.sh b/init-tools.sh index 42bbc0972ff8..5ac2b44d7d87 100755 --- a/init-tools.sh +++ b/init-tools.sh @@ -153,15 +153,8 @@ if [ -z "${__ILASM_RID-}" ]; then fi echo "Using RID $__ILASM_RID for BuildTools native tools" - -export ILASMCOMPILER_VERSION=$__ILASM_VERSION export NATIVE_TOOLS_RID=$__ILASM_RID -if [ -n "${DotNetBootstrapCliTarPath-}" ]; then - # Assume ilasm is not in nuget yet when bootstrapping... - unset ILASMCOMPILER_VERSION -fi - # Build tools only supported on x64 if [ "${__PKG_ARCH}" != "x64" ] && [ "${__PKG_ARCH}" != "arm" ]; then echo "Skipped installing build tools." @@ -178,6 +171,14 @@ else exit 1 fi + + if [ ! -n "${DotNetBootstrapCliTarPath-}" ]; then + # Assume ilasm is not in nuget yet when bootstrapping... + # ILasm/ILDasm used to be restored by buildtools. The reference there was a netocreapp2.0, which was prior to our support of linux-musl. We initialize it locally as a 3.0 with the new SDK. + echo "Running: eval $__DOTNET_CMD build ${__scriptpath}/tests/ilasm-restore/ilasm.depproj --no-cache --packages $__PACKAGES_DIR -r $NATIVE_TOOLS_RID -p:ILAsmPackageVersion=$__ILASM_VERSION -p:ExpectedILAsmPath=$__TOOLRUNTIME_DIR/ilasm" >> "$__init_tools_log" + eval "$__DOTNET_CMD" build "${__scriptpath}/tests/ilasm-restore/ilasm.depproj" --no-cache --packages "$__PACKAGES_DIR" -r "$NATIVE_TOOLS_RID" -p:ILAsmPackageVersion="$__ILASM_VERSION" -p:ExpectedILAsmPath="$__TOOLRUNTIME_DIR/ilasm" + fi + echo "Making all .sh files executable under Tools." # Executables restored with .NET Core 2.0 do not have executable permission flags. https://github.com/NuGet/Home/issues/4424 ls "$__scriptpath/Tools/"*.sh | xargs chmod +x diff --git a/tests/ilasm-restore/Directory.Build.props b/tests/ilasm-restore/Directory.Build.props new file mode 100644 index 000000000000..35fc3cdf4ac0 --- /dev/null +++ b/tests/ilasm-restore/Directory.Build.props @@ -0,0 +1,6 @@ + + + \ No newline at end of file diff --git a/tests/ilasm-restore/Directory.Build.targets b/tests/ilasm-restore/Directory.Build.targets new file mode 100644 index 000000000000..35fc3cdf4ac0 --- /dev/null +++ b/tests/ilasm-restore/Directory.Build.targets @@ -0,0 +1,6 @@ + + + \ No newline at end of file diff --git a/tests/ilasm-restore/ilasm.depproj b/tests/ilasm-restore/ilasm.depproj new file mode 100644 index 000000000000..d57773c22c90 --- /dev/null +++ b/tests/ilasm-restore/ilasm.depproj @@ -0,0 +1,30 @@ + + + + + false + true + + + + + + + + + + + .NETCoreApp,Version=v3.0 + netcoreapp3.0 + true + + + + + + + + + + + From 36e27da154da31ce76dd57e31a408dfce77a3805 Mon Sep 17 00:00:00 2001 From: Juan Hoyos Date: Mon, 11 Nov 2019 12:20:17 -0800 Subject: [PATCH 2/2] Change to a 3.0 SDK for servicing --- global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global.json b/global.json index ecfdff806f6f..8ef11e2107fa 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "tools": { - "dotnet": "3.0.100-preview6-012264" + "dotnet": "3.0.100" }, "native-tools": { "cmake": "3.11.1",