Skip to content

Commit 1e233e7

Browse files
authored
Fix incorrect merge suppressing my change to publish CG2 framework (#49666)
As David discovered, I apparently made a merge bug in rebasing my CG2 framework switch-over change prior to checking in that actually suppressed CG2 publishing due to losing the property PublishReadyToRunUseCrossgen2. This change fixes that deficiency. Thanks Tomas
1 parent 2d552be commit 1e233e7

File tree

1 file changed

+24
-9
lines changed

1 file changed

+24
-9
lines changed

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

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<CrossDir Condition="'$(BuildArchitecture)' != '$(TargetArchitecture)'">x64</CrossDir>
77
<Crossgen2Dir>$(CoreCLRArtifactsPath)\$(CrossDir)\crossgen2</Crossgen2Dir>
88
<Crossgen2Exe>$(Crossgen2Dir)\crossgen2$(ExeSuffix)</Crossgen2Exe>
9+
<PublishReadyToRunUseCrossgen2>true</PublishReadyToRunUseCrossgen2>
910
<PublishReadyToRunCrossgen2ExtraArgs>--targetarch:$(TargetArchitecture)</PublishReadyToRunCrossgen2ExtraArgs>
1011

1112
<JitTargetOSComponent>unix</JitTargetOSComponent>
@@ -40,22 +41,36 @@
4041
<!-- Crossgen2 bring-up before SDK 6.0 Preview 2 propagates to the runtime repo. -->
4142
<!-- https://github.com/dotnet/runtime/issues/48252 -->
4243

44+
<UsingTask
45+
TaskName="SetEnvVar"
46+
TaskFactory="RoslynCodeTaskFactory"
47+
AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll" >
48+
49+
<ParameterGroup>
50+
<Name ParameterType="System.String" Required="true" />
51+
<Value ParameterType="System.String" Required="false" />
52+
</ParameterGroup>
53+
54+
<Task>
55+
<Using Namespace="System" />
56+
<Code Type="Fragment" Language="cs">
57+
<![CDATA[
58+
Environment.SetEnvironmentVariable(Name, Value);
59+
]]>
60+
</Code>
61+
</Task>
62+
</UsingTask>
63+
4364
<PropertyGroup>
44-
<OriginalDotnetRootValue />
45-
<DOTNET_ROOT />
65+
<OriginalDotnetRootValue>$(DOTNET_ROOT)</OriginalDotnetRootValue>
4666
</PropertyGroup>
4767

4868
<Target Name="PatchDotnetRootBeforeRunningCrossgen2" BeforeTargets="_CreateR2RImages">
49-
<PropertyGroup>
50-
<OriginalDotnetRootValue>$(DOTNET_ROOT)</OriginalDotnetRootValue>
51-
<DOTNET_ROOT>$(RepoRoot)</DOTNET_ROOT>
52-
</PropertyGroup>
69+
<SetEnvVar Name="DOTNET_ROOT" Value="$(DOTNET_INSTALL_DIR)" />
5370
</Target>
5471

5572
<Target Name="RestoreDotnetRootAfterRunningCrossgen2" AfterTargets="_CreateR2RImages">
56-
<PropertyGroup>
57-
<DOTNET_ROOT>$(OriginalDotnetRootValue)</DOTNET_ROOT>
58-
</PropertyGroup>
73+
<SetEnvVar Name="DOTNET_ROOT" Value="$(OriginalDotnetRootValue)" />
5974
</Target>
6075

6176
<!-- End of hack to patch DOTNET_ROOT for the duration of Crossgen2 compilation. -->

0 commit comments

Comments
 (0)