Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions eng/pipelines/cdac/prepare-cdac-helix-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
parameters:
buildDebuggees: true
skipDebuggeeCopy: false
runtimeConfiguration: 'Checked'

steps:
- ${{ if parameters.buildDebuggees }}:
Expand All @@ -14,6 +15,7 @@ steps:
/t:BuildDebuggeesOnly
/p:Configuration=$(_BuildConfig)
/p:TargetArchitecture=$(archType)
/p:RuntimeConfiguration=${{ parameters.runtimeConfiguration }}
-bl:$(Build.SourcesDirectory)/artifacts/log/BuildDebuggees.binlog
displayName: 'Build Debuggees'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
<Project>
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.targets', '$(MSBuildThisFileDirectory)..\'))" />

<!--
Force debuggees to use the locally-built runtime/targeting packs and crossgen2
(not the SDK's bundled versions from global.json) when publishing with
PublishReadyToRun=true.

targetingpacks.targets handles runtime/targeting pack resolution.
tests.readytorun.targets overrides ResolveReadyToRunCompilers to use the
locally-built crossgen2 directly (the local build layout is flat, not the
NuGet pack "tools/" subdirectory layout the SDK expects).
-->
<Import Project="$(RepositoryEngineeringDir)targetingpacks.targets" />
Comment thread
max-charlamb marked this conversation as resolved.

<PropertyGroup>
<AfterMicrosoftNETSdkTargets>$(AfterMicrosoftNETSdkTargets);$(RepositoryEngineeringDir)testing\tests.readytorun.targets</AfterMicrosoftNETSdkTargets>
</PropertyGroup>

Comment thread
max-charlamb marked this conversation as resolved.
<!-- Target invoked by GenerateAllDumps (from DumpTests.targets) on each debuggee csproj
to extract the DumpTypes property. Returns the project name with DumpTypes metadata. -->
<Target Name="GetDumpTypes" Returns="@(_DumpTypeOutput)">
Expand Down
22 changes: 20 additions & 2 deletions src/native/managed/cdac/tests/DumpTests/DumpTests.targets
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,24 @@
<DebuggeesDir>$([MSBuild]::NormalizeDirectory('$(MSBuildThisFileDirectory)', 'Debuggees'))</DebuggeesDir>
<!-- Platform-aware dotnet host and exe suffix -->
<_DotNetExe>$([MSBuild]::NormalizePath('$(RepoRoot)', '.dotnet', 'dotnet$(ExeSuffix)'))</_DotNetExe>
<!-- The configuration the locally-built CoreCLR (and crossgen2) lives under.
The debuggee publish must pass this through so that targetingpacks.targets
resolves Crossgen2InBuildDir to the right path (artifacts/bin/coreclr/<os>.<arch>.<CoreCLRConfiguration>/...).
CoreCLRConfiguration derives from RuntimeConfiguration, which itself defaults to Configuration. -->
<_DebuggeeRuntimeConfig Condition="'$(_DebuggeeRuntimeConfig)' == ''">$(RuntimeConfiguration)</_DebuggeeRuntimeConfig>
<_DebuggeeRuntimeConfig Condition="'$(_DebuggeeRuntimeConfig)' == ''">$(Configuration)</_DebuggeeRuntimeConfig>
<_DebuggeeRuntimeConfig Condition="'$(_DebuggeeRuntimeConfig)' == ''">Debug</_DebuggeeRuntimeConfig>

<!-- Properties that must be propagated through to the child `dotnet publish`
process so that targetingpacks.targets can resolve the local runtime/ref
packs and Crossgen2 pack at the correct paths. In a cross-build (e.g.
building on linux-x64 for linux-arm) the child publish would otherwise
default TargetArchitecture from the process architecture and resolve
MicrosoftNetCoreAppRuntimePackDir to the wrong RID. -->
<_DebuggeePublishProps>/p:RuntimeConfiguration=$(_DebuggeeRuntimeConfig)</_DebuggeePublishProps>
<_DebuggeePublishProps Condition="'$(TargetArchitecture)' != ''">$(_DebuggeePublishProps) /p:TargetArchitecture=$(TargetArchitecture)</_DebuggeePublishProps>
<_DebuggeePublishProps Condition="'$(TargetOS)' != ''">$(_DebuggeePublishProps) /p:TargetOS=$(TargetOS)</_DebuggeePublishProps>
<_DebuggeePublishProps Condition="'$(BuildArchitecture)' != ''">$(_DebuggeePublishProps) /p:BuildArchitecture=$(BuildArchitecture)</_DebuggeePublishProps>
</PropertyGroup>

<!-- Auto-detect testhost from repo artifacts (used for "local" runtime version). -->
Expand Down Expand Up @@ -167,7 +185,7 @@
<PropertyGroup>
<_PublishOutDir>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'artifacts', 'bin', 'DumpTests', '$(DebuggeeName)', '$(DebuggeeConfiguration)', '$(NetCoreAppCurrent)'))</_PublishOutDir>
</PropertyGroup>
<Exec Command="&quot;$(_DotNetExe)&quot; publish &quot;$(_DebuggeeCsproj)&quot; -c $(DebuggeeConfiguration) -f $(NetCoreAppCurrent) -r $(PortableTargetRid) --no-self-contained /p:PublishReadyToRun=true --nologo -o &quot;$(_PublishOutDir)&quot;" />
<Exec Command="&quot;$(_DotNetExe)&quot; publish &quot;$(_DebuggeeCsproj)&quot; -c $(DebuggeeConfiguration) -f $(NetCoreAppCurrent) -r $(PortableTargetRid) --no-self-contained /p:PublishReadyToRun=true $(_DebuggeePublishProps) --nologo -o &quot;$(_PublishOutDir)&quot;" />
</Target>
Comment thread
max-charlamb marked this conversation as resolved.

<Target Name="_GenerateDumpsForDebuggee">
Expand Down Expand Up @@ -254,7 +272,7 @@
<_DebuggeeCsproj>$([MSBuild]::NormalizePath('$(_DebuggeeDir)', '$(DebuggeeName).csproj'))</_DebuggeeCsproj>
</PropertyGroup>

<Exec Command="&quot;$(_DotNetExe)&quot; publish &quot;$(_DebuggeeCsproj)&quot; -c $(DebuggeeConfiguration) -f $(NetCoreAppCurrent) -r $(PortableTargetRid) --no-self-contained /p:PublishReadyToRun=true --nologo -o &quot;$(_DebuggeeBinDir)&quot;"
<Exec Command="&quot;$(_DotNetExe)&quot; publish &quot;$(_DebuggeeCsproj)&quot; -c $(DebuggeeConfiguration) -f $(NetCoreAppCurrent) -r $(PortableTargetRid) --no-self-contained /p:PublishReadyToRun=true $(_DebuggeePublishProps) --nologo -o &quot;$(_DebuggeeBinDir)&quot;"
WorkingDirectory="$(_DebuggeeDir)" />

<MakeDir Directories="$(_DumpDir)" />
Expand Down
Loading