Skip to content

Commit b2a6c9d

Browse files
committed
Make DOTNET_ROOT change local per Viktor's PR feedback
1 parent 21a03c3 commit b2a6c9d

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

src/installer/pkg/sfx/Microsoft.NETCore.App/ReadyToRun.targets

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
<Project>
22
<Target Name="ResolveReadyToRunCompilers" DependsOnTargets="ResolveRuntimeFilesFromLocalBuild">
3+
<!-- The following property group can be simplified once runtime repo switches over to SDK 6.0 drop -->
4+
<PropertyGroup>
5+
<CrossDir></CrossDir>
6+
<CrossDir Condition="'$(BuildArchitecture)' != '$(TargetArchitecture)'">x64</CrossDir>
7+
<Crossgen2Dir>$(CoreCLRArtifactsPath)\$(CrossDir)\crossgen2</Crossgen2Dir>
8+
<Crossgen2Exe>$(Crossgen2Dir)\crossgen2$(ExeSuffix)</Crossgen2Exe>
9+
<PublishReadyToRunCrossgen2ExtraArgs>--targetarch:$(TargetArchitecture)</PublishReadyToRunCrossgen2ExtraArgs>
10+
11+
<JitTargetOSComponent>unix</JitTargetOSComponent>
12+
<JitTargetOSComponent Condition="'$(TargetOS)' == 'windows'">win</JitTargetOSComponent>
13+
<JitBuildArchitecture>$(TargetArchitecture)</JitBuildArchitecture>
14+
<JitBuildArchitecture Condition="'$(CrossDir)' != ''">$(CrossDir)</JitBuildArchitecture>
15+
<JitLibrary>$(Crossgen2Dir)\$(LibPrefix)clrjit_$(JitTargetOSComponent)_$(TargetArchitecture)_$(JitBuildArchitecture)$(LibSuffix)</JitLibrary>
16+
</PropertyGroup>
17+
318
<ItemGroup Condition="'$(RuntimeFlavor)' != 'Mono'">
419
<_crossTargetJit Include="@(CoreCLRCrossTargetFiles)" Condition="'%(FileName)' == '$(LibPrefix)clrjit' and '%(Extension)' == '$(LibSuffix)'" />
520
<_clrjit Include="@(RuntimeFiles)" Condition="'%(FileName)' == '$(LibPrefix)clrjit' and '%(Extension)' == '$(LibSuffix)'" />
@@ -16,5 +31,34 @@
1631
JitPath="@(_clrjit)"
1732
DiaSymReader="$(_diaSymReaderPathIfExists)" />
1833
</ItemGroup>
34+
<ItemGroup>
35+
<Crossgen2Tool Include="$(Crossgen2Exe)" JitPath="$(JitLibrary)" />
36+
</ItemGroup>
37+
</Target>
38+
39+
<!-- Hack to patch DOTNET_ROOT for the duration of Crossgen2 compilation to unblock -->
40+
<!-- Crossgen2 bring-up before SDK 6.0 Preview 2 propagates to the runtime repo. -->
41+
<!-- https://github.com/dotnet/runtime/issues/48252 -->
42+
43+
<PropertyGroup>
44+
<OriginalDotnetRootValue />
45+
<DOTNET_ROOT />
46+
</PropertyGroup>
47+
48+
<Target Name="PatchDotnetRootBeforeRunningCrossgen2" BeforeTargets="_CreateR2RImages">
49+
<PropertyGroup>
50+
<OriginalDotnetRootValue>$(DOTNET_ROOT)</OriginalDotnetRootValue>
51+
<DOTNET_ROOT>$(RepoRoot)</DOTNET_ROOT>
52+
</PropertyGroup>
53+
</Target>
54+
55+
<Target Name="RestoreDotnetRootAfterRunningCrossgen2" AfterTargets="_CreateR2RImages">
56+
<PropertyGroup>
57+
<DOTNET_ROOT>$(OriginalDotnetRootValue)</DOTNET_ROOT>
58+
</PropertyGroup>
1959
</Target>
60+
61+
<!-- End of hack to patch DOTNET_ROOT for the duration of Crossgen2 compilation. -->
62+
<!-- This can be removed once the runtime repo rolled forward to .NET 6 Preview 2 SDK repo drop. -->
63+
<!-- https://github.com/dotnet/runtime/issues/48252 -->
2064
</Project>

0 commit comments

Comments
 (0)