Skip to content

Commit

Permalink
Remove diasymreader from source build (#56116)
Browse files Browse the repository at this point in the history
* Remove diasymreader from source build

* Remove Diasymreader from crossgen2 package in source build scenarios
  • Loading branch information
davidwrighton authored Jul 22, 2021
1 parent 921bca0 commit ece8fc0
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,26 @@
using System.Collections.Generic;
using System.Runtime.InteropServices;

#if !DISABLE_UNMANAGED_PDB_SYMBOLS
using Microsoft.DiaSymReader;
#endif

using Internal.IL;

namespace Internal.TypeSystem.Ecma
{
#if DISABLE_UNMANAGED_PDB_SYMBOLS
/// <summary>
/// Provides PdbSymbolReader via unmanaged SymBinder from .NET Framework
/// </summary>
public abstract class UnmanagedPdbSymbolReader : PdbSymbolReader
{
public static PdbSymbolReader TryOpenSymbolReaderForMetadataFile(string metadataFileName, string searchPath)
{
return null;
}
}
#else
/// <summary>
/// Provides PdbSymbolReader via unmanaged SymBinder from .NET Framework
/// </summary>
Expand Down Expand Up @@ -284,4 +298,5 @@ public override int GetStateMachineKickoffMethod(int methodToken)
return 0;
}
}
#endif
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
<Platforms>x64;x86</Platforms>
<PlatformTarget>AnyCPU</PlatformTarget>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<EnableDiaSymReaderUse Condition="'$(DotNetBuildFromSource)' != 'true'">true</EnableDiaSymReaderUse>
<DefineConstants Condition="'$(EnableDiaSymReaderUse)' != 'true'">$(DefineConstants);DISABLE_UNMANAGED_PDB_SYMBOLS</DefineConstants>

<!-- We're binplacing these into an existing publish layout so that F5 build in VS updates
the same bits tests expect to see in artifacts/crossgen2. That way we never need to wonder which
Expand All @@ -30,7 +32,7 @@
<PackageReference Include="System.Reflection.Metadata">
<Version>$(SystemReflectionMetadataVersion)</Version>
</PackageReference>
<PackageReference Include="Microsoft.DiaSymReader">
<PackageReference Condition = "'$(EnableDiaSymReaderUse)' == 'true'" Include="Microsoft.DiaSymReader">
<Version>1.3.0</Version>
</PackageReference>
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<NativeRuntimeAsset Include="$(CoreCLRCrossgen2Dir)crossgen2$(ExeSuffix)" TargetPath="tools/" />
<Reference Include="$(CoreCLRCrossgen2Dir)crossgen2.dll" />
<Reference Include="$(CoreCLRCrossgen2Dir)ILCompiler*.dll" />
<Reference Include="$(CoreCLRCrossgen2Dir)Microsoft.DiaSymReader.dll" />
<Reference Condition="'$(DotNetBuildFromSource)' != 'true'" Include="$(CoreCLRCrossgen2Dir)Microsoft.DiaSymReader.dll" />
<NativeRuntimeAsset Include="$(CoreCLRCrossgen2Dir)$(LibPrefix)jitinterface_$(TargetArchitecture)$(LibSuffix)" TargetPath="tools/" />
<NativeRuntimeAsset Include="$(CoreCLRCrossgen2Dir)$(LibPrefix)clrjit_win_x86_$(TargetArchitecture)$(LibSuffix)" TargetPath="tools/" />
<NativeRuntimeAsset Include="$(CoreCLRCrossgen2Dir)$(LibPrefix)clrjit_win_arm_$(TargetArchitecture)$(LibSuffix)" TargetPath="tools/" />
Expand Down

0 comments on commit ece8fc0

Please sign in to comment.