Skip to content

Commit

Permalink
Avoid SourceLink in bootstrap Core build
Browse files Browse the repository at this point in the history
SourceLink is a fancy modern package with fancy new MSBuild syntax . . .
which breaks on the ancient copy of MSBuild we use to bootstrap for
CoreCLR. Just don't SourceLink in that phase.
  • Loading branch information
rainersigwald committed Jun 26, 2017
1 parent 8b8b4f8 commit 3578257
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
5 changes: 4 additions & 1 deletion cibuild.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ set RUNTIME_HOST=
if /i "%HOST%"=="CoreCLR" (
set RUNTIME_HOST=%~dp0Tools\DotNetCLI\Dotnet.exe
set MSBUILD_CUSTOM_PATH=%~dp0Tools\MSBuild.exe
:: The LKG MSBuild on Core is too old to support
:: SourceLink targets, so disable them.
set SOURCE_LINK_ARGUMENT=/p:SourceLinkCreate=false
) else if /i "%HOST%"=="Full" (
set RUNTIME_HOST=
) else (
Expand All @@ -104,7 +107,7 @@ echo.
echo ** Rebuilding MSBuild with downloaded binaries

set MSBUILDLOGPATH=%~dp0msbuild_bootstrap_build-%HOST%.log
call "%~dp0build.cmd" /t:Rebuild /p:Configuration=%BUILD_CONFIGURATION% /p:"SkipBuildPackages=true" %LOCALIZED_BUILD_ARGUMENT% %SYNC_XLF_ARGUMENT% %RUNTIMETYPE_ARGUMENT%
call "%~dp0build.cmd" /t:Rebuild /p:Configuration=%BUILD_CONFIGURATION% /p:"SkipBuildPackages=true" %LOCALIZED_BUILD_ARGUMENT% %SYNC_XLF_ARGUMENT% %RUNTIMETYPE_ARGUMENT% %SOURCE_LINK_ARGUMENT%

if %ERRORLEVEL% NEQ 0 (
echo.
Expand Down
3 changes: 2 additions & 1 deletion cibuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,8 @@ restoreBuildTools

echo
echo "** Rebuilding MSBuild with downloaded binaries"
runMSBuildWith "$RUNTIME_HOST" "$RUNTIME_HOST_ARGS" "$MSBUILD_EXE" "/t:Rebuild $BUILD_MSBUILD_ARGS $CSC_ARGS" "$BOOTSTRAP_BUILD_LOG_PATH"
# Avoid SourceLink on our ancient bootstrap binaries
runMSBuildWith "$RUNTIME_HOST" "$RUNTIME_HOST_ARGS" "$MSBUILD_EXE" "/t:Rebuild $BUILD_MSBUILD_ARGS $CSC_ARGS /p:SourceLinkCreate=false /p:DebugType=portable" "$BOOTSTRAP_BUILD_LOG_PATH"

if [[ $BUILD_ONLY = true ]]; then
exit $?
Expand Down
3 changes: 3 additions & 0 deletions dir.targets
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@
Condition="'$(CopyBuildOutputToDeploymentDirectories)' != 'false'">
<ItemGroup>
<OutputItems Include="$(OutputPath)\**\*.*"/>

<!-- Avoid race condition between project's IncrementalClean coming along to delete the .pdb and this project copying it. -->
<OutputItems Remove="$(OutputPath)\**\*.pdb" Condition="'$(DebugType)' == 'embedded'" />
</ItemGroup>

<Copy SourceFiles="@(OutputItems)"
Expand Down
2 changes: 1 addition & 1 deletion src/dir.targets
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@

<!-- https://github.com/ctaggart/SourceLink - stamps portable or embedded .pdbs with URLs to sources on GitHub
so that debugger can download the exact matching source files during debugging -->
<Import Project="$(PackagesDir)\sourcelink.create.commandline\2.1.2\build\SourceLink.Create.CommandLine.targets" Condition="'$(DebugType)' != 'full' And '$(IsTestProject)' != 'true' And Exists('$(PackagesDir)\sourcelink.create.commandline\2.1.2\build\SourceLink.Create.CommandLine.targets')" />
<Import Project="$(PackagesDir)\sourcelink.create.commandline\2.1.2\build\SourceLink.Create.CommandLine.targets" Condition="'$(SourceLinkCreate)' == 'true' And '$(DebugType)' != 'full' And '$(IsTestProject)' != 'true' And Exists('$(PackagesDir)\sourcelink.create.commandline\2.1.2\build\SourceLink.Create.CommandLine.targets')" />


<!-- Taken from Microsoft.VisualStudio.SDK.EmbedInteropTypes NuGet package which tries to fix this issue
Expand Down

0 comments on commit 3578257

Please sign in to comment.