2020-02-08 23:03:08 +03:00
<!-- All Rights Reserved. Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE file in the project root for more information. -->
2019-12-14 01:47:52 +03:00
<Project>
<!--
$(BuildArch) - architecture to test (x64, x86, arm, arm64). Defaults to x64.
2020-02-08 23:03:08 +03:00
$(PrivateBuildPath) - if non-empty, path to private runtime build to copy/test
2020-03-25 03:51:54 +03:00
Internal service release testing:
$(DotnetRuntimeVersion) - the service release version to test against (fx-version option value) i.e. 2.1.17, 3.1.3 or "default"
$(DotnetRuntimeDownloadVersion) - the service release package version i.e. 2.1.17, 3.1.3-servicing.20128.1 or "default"
$(RuntimeSourceFeed) - the service release internal blob storage link
$(RuntimeSourceFeedKey) - the service release blob feed token
2019-12-14 01:47:52 +03:00
From Versions.props:
2020-09-18 09:20:16 +03:00
$(MicrosoftDotnetSdkInternalVersion) - .NET SDK to use for testing
2019-12-14 01:47:52 +03:00
$(MicrosoftNETCoreAppVersion) $(MicrosoftAspNetCoreAppRefVersion) - latest dotnet runtime/aspnetcore version to install/test
$(MicrosoftNETCoreApp31Version) $(MicrosoftAspNetCoreApp31Version) - 3.1 version
$(MicrosoftNETCoreApp21Version) $(MicrosoftAspNetCoreApp21Version) - 2.1 version
From Arcade:
2020-09-18 09:20:16 +03:00
$(RepoRoot) - the root of the diagnostics repo
2019-12-14 01:47:52 +03:00
$(RepositoryEngineeringDir) - the "eng" directory
$(VersionsPropsPath) - path of Versions.props
-->
<PropertyGroup>
<BuildArch Condition="'$(BuildArch)' == ''">$(Platform)</BuildArch>
<BuildArch Condition="'$(BuildArch)' == ''">x64</BuildArch>
2020-03-25 03:51:54 +03:00
<PrivateBuildTesting>false</PrivateBuildTesting>
<PrivateBuildTesting Condition="'$(PrivateBuildPath)' != ''">true</PrivateBuildTesting>
<InternalReleaseTesting>false</InternalReleaseTesting>
<InternalReleaseTesting Condition="'$(DotnetRuntimeVersion)' != 'default'">true</InternalReleaseTesting>
<ExtraInstallArgs>-runtimesourcefeed '$(RuntimeSourceFeed)' -runtimesourcefeedkey '$(RuntimeSourceFeedKey)'</ExtraInstallArgs>
2020-02-08 23:03:08 +03:00
</PropertyGroup>
<PropertyGroup Condition="'$(BuildArch)' != 'x86'">
2020-09-18 09:20:16 +03:00
<DotNetInstallRoot>$(RepoRoot).dotnet-test\</DotNetInstallRoot>
2020-02-08 23:03:08 +03:00
<RegistryRoot>HKEY_LOCAL_MACHINE\SOFTWARE</RegistryRoot>
</PropertyGroup>
<PropertyGroup Condition="'$(BuildArch)' == 'x86'">
2020-09-18 09:20:16 +03:00
<DotNetInstallRoot>$(RepoRoot).dotnet-test\x86\</DotNetInstallRoot>
2020-02-08 23:03:08 +03:00
<RegistryRoot>HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node</RegistryRoot>
</PropertyGroup>
<PropertyGroup>
2020-09-18 09:20:16 +03:00
<CommonInstallArgs>-NoPath -SkipNonVersionedFiles -Architecture $(BuildArch) -InstallDir $(DotNetInstallRoot)</CommonInstallArgs>
2020-02-08 23:03:08 +03:00
<DotNetInstallDir>$(DotNetInstallRoot.Replace("\", "\\"))shared\\Microsoft.NETCore.App\\$(MicrosoftNETCoreAppVersion)\\</DotNetInstallDir>
<TestConfigFileName>$(DotNetInstallRoot)Debugger.Tests.Versions.txt</TestConfigFileName>
<AddRegeditFileName>$(DotNetInstallRoot)AddPrivateTesting.reg</AddRegeditFileName>
<RemoveRegeditFileName>$(DotNetInstallRoot)RemovePrivateTesting.reg</RemoveRegeditFileName>
<RegeditCommand>regedit.exe</RegeditCommand>
2019-12-14 01:47:52 +03:00
</PropertyGroup>
<Choose>
<When Condition="$([MSBuild]::IsOsPlatform(Windows))">
<PropertyGroup>
<PowershellWrapper>powershell -NonInteractive -ExecutionPolicy ByPass -NoProfile -command</PowershellWrapper>
2020-09-18 09:20:16 +03:00
<DotnetInstallScriptCmd>'$(RepositoryEngineeringDir)\dotnet-install.ps1'</DotnetInstallScriptCmd>
2019-12-14 01:47:52 +03:00
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
2020-09-18 09:20:16 +03:00
<DotnetInstallScriptCmd>$(RepositoryEngineeringDir)/dotnet-install.sh</DotnetInstallScriptCmd>
2019-12-14 01:47:52 +03:00
</PropertyGroup>
</Otherwise>
</Choose>
2020-03-25 03:51:54 +03:00
<ItemGroup Condition="!$(InternalReleaseTesting) and !$(PrivateBuildTesting)">
<TestVersions Include="Latest" RuntimeVersion="$(MicrosoftNETCoreAppVersion)" AspNetVersion="$(MicrosoftAspNetCoreAppRefVersion)" />
<TestVersions Include="31" RuntimeVersion="$(MicrosoftNETCoreApp31Version)" AspNetVersion="$(MicrosoftAspNetCoreApp31Version)" />
Fix testing on arm64. (#1608)
Disabled installing and running on 2.1.x when arm/arm64.
Fix the test scripts for arm64 registers.
Upgraded to testing on 3.1.8 and 2.1.23.
Add IMachine::SetContextFlags() and IMachine::GetFullContextFlags() to better support
cross-architecture/cross-OS. Had to use a hard coded context flags for each architecture
because the normal DT_CONTEXT_FULL define only exists for the currently building arch.
The main reason `clrstack -i -a` was failing because the architecture bits in the context
flags were being passed into the DAC/DBI were wrong so the context wasn't being copied.
DAC/DBI context copy helper function that is very sensitive to the dst/src context flags
(at the architecture specific bit) matching.
```
void CORDbgCopyThreadContext(DT_CONTEXT* pDst, const DT_CONTEXT* pSrc)
{
DWORD dstFlags = pDst->ContextFlags;
DWORD srcFlags = pSrc->ContextFlags;
LOG((LF_CORDB, LL_INFO1000000,
"CP::CTC: pDst=0x%08x dstFlags=0x%x, pSrc=0x%08x srcFlags=0x%x\n",
pDst, dstFlags, pSrc, srcFlags));
if ((dstFlags & srcFlags & DT_CONTEXT_CONTROL) == DT_CONTEXT_CONTROL)
{
CopyContextChunk(&(pDst->Fp), &(pSrc->Fp), &(pDst->V),
DT_CONTEXT_CONTROL);
CopyContextChunk(&(pDst->Cpsr), &(pSrc->Cpsr), &(pDst->X),
DT_CONTEXT_CONTROL);
}
if ((dstFlags & srcFlags & DT_CONTEXT_INTEGER) == DT_CONTEXT_INTEGER)
CopyContextChunk(&(pDst->X[0]), &(pSrc->X[0]), &(pDst->Fp),
DT_CONTEXT_INTEGER);
```
Remove arm32/arm64 installs from global because they don't work on MacOS
2020-09-25 23:01:17 +03:00
<TestVersions Condition="'$(BuildArch)' != 'arm' and '$(BuildArch)' != 'arm64'" Include="21" RuntimeVersion="$(MicrosoftNETCoreApp21Version)" AspNetVersion="$(MicrosoftAspNetCoreApp21Version)" />
2020-03-25 03:51:54 +03:00
</ItemGroup>
<!-- Local private build testing -->
<ItemGroup Condition="$(PrivateBuildTesting)">
<TestVersions Include="Latest" RuntimeVersion="$(MicrosoftNETCoreAppVersion)" AspNetVersion="$(MicrosoftAspNetCoreAppRefVersion)" />
</ItemGroup>
<!-- Internal service release testing -->
<ItemGroup Condition="$(InternalReleaseTesting)">
<TestVersions Include="Internal" RuntimeVersion="$(DotnetRuntimeDownloadVersion)" ExtraInstallArgs="$(ExtraInstallArgs)" Condition="'$(DotnetRuntimeDownloadVersion)' != 'default'"/>
<TestVersions Include="Internal" RuntimeVersion="$(DotnetRuntimeVersion)" ExtraInstallArgs="$(ExtraInstallArgs)" Condition="'$(DotnetRuntimeDownloadVersion)' == 'default'"/>
2019-12-14 01:47:52 +03:00
</ItemGroup>
2020-02-08 23:03:08 +03:00
<!--
Installs the runtimes for the SOS tests, handles private runtime build support or cleans up the private build registry keys
-->
2019-12-14 01:47:52 +03:00
<Target Name="InstallTestRuntimes"
BeforeTargets="RunTests"
2020-03-25 03:51:54 +03:00
DependsOnTargets="CleanupVersionManifest;InstallRuntimesWindows;InstallRuntimesUnix;CopyPrivateBuild;WriteTestVersionManifest;" />
2020-02-08 23:03:08 +03:00
<!--
Installs the test runtimes on Windows
-->
2019-12-14 01:47:52 +03:00
<Target Name="InstallRuntimesWindows"
Condition="$([MSBuild]::IsOsPlatform(Windows))"
Inputs="$(VersionsPropsPath)" Outputs="$(TestConfigFileName)">
2020-09-18 09:20:16 +03:00
<Exec Command="$(PowershellWrapper) "& { &$(DotnetInstallScriptCmd) $(CommonInstallArgs) -Version $(MicrosoftDotnetSdkInternalVersion) }"" />
<Exec Command="$(PowershellWrapper) "& { &$(DotnetInstallScriptCmd) $(CommonInstallArgs) %(TestVersions.ExtraInstallArgs) -Version %(TestVersions.RuntimeVersion) -Runtime dotnet }""
2020-03-25 03:51:54 +03:00
Condition="'%(TestVersions.RuntimeVersion)' != ''" />
2019-12-14 01:47:52 +03:00
2020-09-18 09:20:16 +03:00
<Exec Command="$(PowershellWrapper) "& { &$(DotnetInstallScriptCmd) $(CommonInstallArgs) %(TestVersions.ExtraInstallArgs) -Version %(TestVersions.AspNetVersion) -Runtime aspnetcore }""
2020-03-25 03:51:54 +03:00
Condition="'%(TestVersions.AspNetVersion)' != ''" />
2019-12-14 01:47:52 +03:00
</Target>
2020-02-08 23:03:08 +03:00
<!--
Installs the test runtimes on Linux/MacOS
-->
2019-12-14 01:47:52 +03:00
<Target Name="InstallRuntimesUnix"
Condition="!$([MSBuild]::IsOsPlatform(Windows))"
Inputs="$(VersionsPropsPath)" Outputs="$(TestConfigFileName)">
2020-09-18 09:20:16 +03:00
<Exec Command="bash $(DotnetInstallScriptCmd) $(CommonInstallArgs) -Version $(MicrosoftDotnetSdkInternalVersion)"
IgnoreStandardErrorWarningFormat="true" />
<Exec Command="bash $(DotnetInstallScriptCmd) $(CommonInstallArgs) %(TestVersions.ExtraInstallArgs) -Version %(TestVersions.RuntimeVersion) -Runtime dotnet"
2019-12-14 01:47:52 +03:00
IgnoreStandardErrorWarningFormat="true"
2020-03-25 03:51:54 +03:00
Condition="'%(TestVersions.RuntimeVersion)' != ''" />
2019-12-14 01:47:52 +03:00
2020-09-18 09:20:16 +03:00
<Exec Command="bash $(DotnetInstallScriptCmd) $(CommonInstallArgs) %(TestVersions.ExtraInstallArgs) -Version %(TestVersions.AspNetVersion) -Runtime aspnetcore"
2019-12-14 01:47:52 +03:00
IgnoreStandardErrorWarningFormat="true"
2020-03-25 03:51:54 +03:00
Condition="'%(TestVersions.AspNetVersion)' != ''" />
2019-12-14 01:47:52 +03:00
</Target>
2020-02-08 23:03:08 +03:00
<!--
Writes the Debugger.Tests.Versions.txt file used by the SOS test harness
-->
<Target Name="WriteTestVersionManifest"
Inputs="$(VersionsPropsPath)"
Outputs="$(TestConfigFileName)">
2019-12-14 01:47:52 +03:00
<PropertyGroup>
2020-03-25 03:51:54 +03:00
<RuntimeVersionLatest>$(MicrosoftNETCoreAppVersion)</RuntimeVersionLatest>
<RuntimeVersionLatest Condition="$(InternalReleaseTesting)">$(DotnetRuntimeVersion)</RuntimeVersionLatest>
2019-12-14 01:47:52 +03:00
<TestConfigFileLines>
<![CDATA[
<Configuration>
2020-03-25 03:51:54 +03:00
<PrivateBuildTesting>$(PrivateBuildTesting)</PrivateBuildTesting>
<InternalReleaseTesting>$(InternalReleaseTesting)</InternalReleaseTesting>
2019-12-14 01:47:52 +03:00
<RuntimeVersion21>$(MicrosoftNETCoreApp21Version)</RuntimeVersion21>
<AspNetCoreVersion21>$(MicrosoftAspNetCoreApp21Version)</AspNetCoreVersion21>
2020-03-25 03:51:54 +03:00
2019-12-14 01:47:52 +03:00
<RuntimeVersion31>$(MicrosoftNETCoreApp31Version)</RuntimeVersion31>
<AspNetCoreVersion31>$(MicrosoftAspNetCoreApp31Version)</AspNetCoreVersion31>
2020-03-25 03:51:54 +03:00
<RuntimeVersionLatest>$(RuntimeVersionLatest)</RuntimeVersionLatest>
2019-12-14 01:47:52 +03:00
<AspNetCoreVersionLatest>$(MicrosoftAspNetCoreAppRefVersion)</AspNetCoreVersionLatest>
</Configuration>
]]>
2020-02-08 23:03:08 +03:00
</TestConfigFileLines>
2019-12-14 01:47:52 +03:00
</PropertyGroup>
<WriteLinesToFile File="$(TestConfigFileName)" Lines="$(TestConfigFileLines)" Overwrite="true" WriteOnlyWhenDifferent="true" />
2020-02-08 23:03:08 +03:00
2019-12-14 01:47:52 +03:00
<Message Importance="High" Text="Created config file $(TestConfigFileName)" />
<ItemGroup>
<FileWrites Include="$(TestConfigFileName)" />
</ItemGroup>
</Target>
2020-02-08 23:03:08 +03:00
2020-03-25 03:51:54 +03:00
<!--
Removes the test config file if internal service release or private build testing
-->
<Target Name="CleanupVersionManifest"
Condition="$(InternalReleaseTesting) or $(PrivateBuildTesting)">
<!-- Make sure the config file gets regenerated in the WriteTestVersionManifest target -->
<Delete Files="$(TestConfigFileName)" />
</Target>
2020-02-08 23:03:08 +03:00
<!--
Copies the private runtime build binaries and on Windows adds registry keys
-->
2020-03-25 03:51:54 +03:00
<Target Name="CopyPrivateBuild"
2020-02-08 23:03:08 +03:00
Condition="'$(PrivateBuildPath)' != ''"
DependsOnTargets="ModifyRegistry">
<ItemGroup>
<PrivateBuildFiles Include="$(PrivateBuildPath)\*" />
</ItemGroup>
<Message Importance="High" Text="Copying private build binaries from $(PrivateBuildPath) to $(DotNetInstallDir.Replace('\\', '\'))" />
<Copy SourceFiles="@(PrivateBuildFiles)" DestinationFolder="$(DotNetInstallDir.Replace('\\', '\'))" />
</Target>
<!--
Removes the private build registry keys
-->
<Target Name="CleanupPrivateBuild"
Condition="Exists($(RemoveRegeditFileName))">
<Exec Command="$(RegeditCommand) $(RemoveRegeditFileName)" />
<!--
Delete only the AddRegeditFileName so the target ModifyRegistry will run on next
build. Leaving the remove reg key file so this target can be run multiple times.
-->
<Delete Files="$(AddRegeditFileName)" />
</Target>
<!--
On Windows adds the registry keys to allow the unsigned private build DAC to generate dumps
-->
<Target Name="ModifyRegistry"
Condition="$([MSBuild]::IsOsPlatform(Windows))"
DependsOnTargets="CreateRemoveRegFile"
Inputs="$(VersionsPropsPath)"
Outputs="$(AddRegeditFileName)">
<PropertyGroup>
<AddRegeditFileLines>
<![CDATA[
Windows Registry Editor Version 5.00
[$(RegistryRoot)\Microsoft\Windows NT\CurrentVersion\KnownManagedDebuggingDlls]
"$(DotNetInstallDir)mscordaccore.dll"=dword:0
[$(RegistryRoot)\Microsoft\Windows NT\CurrentVersion\MiniDumpAuxiliaryDlls]
"$(DotNetInstallDir)coreclr.dll"="$(DotNetInstallDir)mscordaccore.dll"
]]>
</AddRegeditFileLines>
</PropertyGroup>
<WriteLinesToFile File="$(AddRegeditFileName)" Lines="$(AddRegeditFileLines)" Overwrite="true" WriteOnlyWhenDifferent="true" />
<ItemGroup>
<FileWrites Include="$(AddRegeditFileName)" />
</ItemGroup>
<Exec Command="$(RegeditCommand) $(AddRegeditFileName)" />
</Target>
<!--
Creates the reg file to remove the registry keys added in ModifyRegistry
-->
<Target Name="CreateRemoveRegFile">
<PropertyGroup>
<RemoveRegeditFileLines>
<![CDATA[
Windows Registry Editor Version 5.00
[$(RegistryRoot)\Microsoft\Windows NT\CurrentVersion\KnownManagedDebuggingDlls]
"$(DotNetInstallDir)mscordaccore.dll"=-
[$(RegistryRoot)\Microsoft\Windows NT\CurrentVersion\MiniDumpAuxiliaryDlls]
"$(DotNetInstallDir)coreclr.dll"=-
]]>
</RemoveRegeditFileLines>
</PropertyGroup>
<WriteLinesToFile File="$(RemoveRegeditFileName)" Lines="$(RemoveRegeditFileLines)" Overwrite="true" WriteOnlyWhenDifferent="true" />
<ItemGroup>
<FileWrites Include="$(RemoveRegeditFileName)" />
</ItemGroup>
</Target>
2019-12-14 01:47:52 +03:00
</Project>