forked from dotnet/diagnostics
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInstallRuntimes.proj
More file actions
304 lines (233 loc) · 13.5 KB
/
InstallRuntimes.proj
File metadata and controls
304 lines (233 loc) · 13.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
<!-- 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. -->
<Project Sdk="Microsoft.Build.NoTargets">
<!--
$(BuildArch) - architecture to test (x64, x86, arm, arm64). Defaults to x64.
$(PrivateBuildPath) - if non-empty, path to private runtime build to copy/test
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
From Versions.props:
$(MicrosoftDotnetSdkInternalVersion) - .NET SDK to use for testing
$(VSRedistCommonNetCoreSharedFrameworkx6470Version) - latest dotnet runtime package version (the version to install)
$(MicrosoftNETCoreAppRuntimewinx64Version) - latest dotnet runtime stable version (the version that actually is installed)
$(MicrosoftAspNetCoreAppRefInternalVersion) - latest dotnet aspnetcore package version (the version to install)
$(MicrosoftAspNetCoreAppRefVersion) - latest dotnet aspnetcore stable version (the version that actually is installed)
$(MicrosoftNETCoreApp60Version) $(MicrosoftAspNetCoreApp60Version) - 6.0 version
$(MicrosoftNETCoreApp31Version) $(MicrosoftAspNetCoreApp31Version) - 3.1 version
$(SingleFileRuntimeLatestVersion) - The latest version of the runtime used to build single-file apps
$(SingleFileRuntime60Version) - The 6.0.x version of the runtime used to build single-file apps
From Arcade:
$(RepoRoot) - the root of the diagnostics repo
$(RepositoryEngineeringDir) - the "eng" directory
$(VersionsPropsPath) - path of Versions.props
-->
<PropertyGroup>
<BuildArch Condition="'$(BuildArch)' == ''">$(Platform)</BuildArch>
<BuildArch Condition="'$(BuildArch)' == 'AnyCpu'">$([System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture.ToString().ToLowerInvariant)</BuildArch>
<PrivateBuildTesting>false</PrivateBuildTesting>
<PrivateBuildTesting Condition="'$(PrivateBuildPath)' != ''">true</PrivateBuildTesting>
<DotnetRuntimeVersion Condition="'$(DotnetRuntimeVersion)' == ''">default</DotnetRuntimeVersion>
<InternalReleaseTesting>false</InternalReleaseTesting>
<InternalReleaseTesting Condition="'$(DotnetRuntimeVersion)' != 'default'">true</InternalReleaseTesting>
<ExtraInstallArgs>-runtimesourcefeed '$(RuntimeSourceFeed)' -runtimesourcefeedkey '$(RuntimeSourceFeedKey)'</ExtraInstallArgs>
</PropertyGroup>
<PropertyGroup Condition="'$(BuildArch)' != 'x86'">
<DotNetInstallRoot>$(RepoRoot).dotnet-test\</DotNetInstallRoot>
<RegistryRoot>HKEY_LOCAL_MACHINE\SOFTWARE</RegistryRoot>
</PropertyGroup>
<PropertyGroup Condition="'$(BuildArch)' == 'x86'">
<DotNetInstallRoot>$(RepoRoot).dotnet-test\x86\</DotNetInstallRoot>
<RegistryRoot>HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node</RegistryRoot>
</PropertyGroup>
<PropertyGroup>
<CommonInstallArgs>-NoPath -SkipNonVersionedFiles -Architecture $(BuildArch) -InstallDir $(DotNetInstallRoot)</CommonInstallArgs>
<DotNetInstallDir>$([MSBuild]::NormalizeDirectory('$(DotNetInstallRoot)', 'shared', 'Microsoft.NETCore.App', '$(MicrosoftNETCoreAppRuntimewinx64Version)'))</DotNetInstallDir>
<TestConfigFileName>$(DotNetInstallRoot)Debugger.Tests.Versions.txt</TestConfigFileName>
<AddRegeditFileName>$(DotNetInstallRoot)AddPrivateTesting.reg</AddRegeditFileName>
<RemoveRegeditFileName>$(DotNetInstallRoot)RemovePrivateTesting.reg</RemoveRegeditFileName>
<RegeditCommand>regedit.exe</RegeditCommand>
</PropertyGroup>
<PropertyGroup>
<Enable31Testing>true</Enable31Testing>
<Enable31Testing Condition="'$(BuildArch)' == 'arm64' and $([MSBuild]::IsOsPlatform(OSX))">false</Enable31Testing>
</PropertyGroup>
<Choose>
<When Condition="$([MSBuild]::IsOsPlatform(Windows))">
<PropertyGroup>
<PowershellWrapper>powershell -NonInteractive -ExecutionPolicy ByPass -NoProfile -command</PowershellWrapper>
<DotnetInstallScriptCmd>'$(RepositoryEngineeringDir)\dotnet-install.ps1'</DotnetInstallScriptCmd>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<DotnetInstallScriptCmd>$(RepositoryEngineeringDir)/dotnet-install.sh</DotnetInstallScriptCmd>
</PropertyGroup>
</Otherwise>
</Choose>
<ItemGroup Condition="!$(InternalReleaseTesting) and !$(PrivateBuildTesting)">
<TestVersions Include="Latest" RuntimeVersion="$(VSRedistCommonNetCoreSharedFrameworkx6470Version)" AspNetVersion="$(MicrosoftAspNetCoreAppRefInternalVersion)" />
<TestVersions Include="60" RuntimeVersion="$(MicrosoftNETCoreApp60Version)" AspNetVersion="$(MicrosoftAspNetCoreApp60Version)" />
<TestVersions Include="31" RuntimeVersion="$(MicrosoftNETCoreApp31Version)" AspNetVersion="$(MicrosoftAspNetCoreApp31Version)" Condition="$(Enable31Testing)" />
</ItemGroup>
<!-- Local private build testing -->
<ItemGroup Condition="$(PrivateBuildTesting)">
<TestVersions Include="Latest" RuntimeVersion="$(VSRedistCommonNetCoreSharedFrameworkx6470Version)" AspNetVersion="$(MicrosoftAspNetCoreAppRefInternalVersion)" />
</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'"/>
</ItemGroup>
<!--
Installs the runtimes for the SOS tests, handles private runtime build support or cleans up the private build registry keys
-->
<Target Name="InstallTestRuntimes"
DependsOnTargets="CleanupVersionManifest;InstallRuntimesWindows;InstallRuntimesUnix;CopyPrivateBuild;WriteTestVersionManifest;" />
<!--
Installs the test runtimes on Windows
-->
<Target Name="InstallRuntimesWindows"
Condition="$([MSBuild]::IsOsPlatform(Windows))"
Inputs="$(VersionsPropsPath)" Outputs="$(TestConfigFileName)">
<Exec Command="$(PowershellWrapper) "& { &$(DotnetInstallScriptCmd) $(CommonInstallArgs) -Version $(MicrosoftDotnetSdkInternalVersion) }"" />
<Exec Command="$(PowershellWrapper) "& { &$(DotnetInstallScriptCmd) $(CommonInstallArgs) %(TestVersions.ExtraInstallArgs) -Version %(TestVersions.RuntimeVersion) -Runtime dotnet }""
Condition="'%(TestVersions.RuntimeVersion)' != ''" />
<Exec Command="$(PowershellWrapper) "& { &$(DotnetInstallScriptCmd) $(CommonInstallArgs) %(TestVersions.ExtraInstallArgs) -Version %(TestVersions.AspNetVersion) -Runtime aspnetcore }""
Condition="'%(TestVersions.AspNetVersion)' != ''" />
</Target>
<!--
Installs the test runtimes on Linux/MacOS
-->
<Target Name="InstallRuntimesUnix"
Condition="!$([MSBuild]::IsOsPlatform(Windows))"
Inputs="$(VersionsPropsPath)" Outputs="$(TestConfigFileName)">
<Exec Command="bash $(DotnetInstallScriptCmd) $(CommonInstallArgs) -Version $(MicrosoftDotnetSdkInternalVersion)"
IgnoreStandardErrorWarningFormat="true" />
<Exec Command="bash $(DotnetInstallScriptCmd) $(CommonInstallArgs) %(TestVersions.ExtraInstallArgs) -Version %(TestVersions.RuntimeVersion) -Runtime dotnet"
IgnoreStandardErrorWarningFormat="true"
Condition="'%(TestVersions.RuntimeVersion)' != ''" />
<Exec Command="bash $(DotnetInstallScriptCmd) $(CommonInstallArgs) %(TestVersions.ExtraInstallArgs) -Version %(TestVersions.AspNetVersion) -Runtime aspnetcore"
IgnoreStandardErrorWarningFormat="true"
Condition="'%(TestVersions.AspNetVersion)' != ''" />
</Target>
<!--
Writes the Debugger.Tests.Versions.txt file used by the SOS test harness
-->
<Target Name="WriteTestVersionManifest"
Inputs="$(VersionsPropsPath)"
Outputs="$(TestConfigFileName)">
<PropertyGroup Condition="'$(PrivateBuildTesting)' != 'true' AND '$(InternalReleaseTesting)' != 'true'">
<RuntimeVersion31 Condition="$(Enable31Testing)">$(MicrosoftNETCoreApp31Version)</RuntimeVersion31>
<AspNetCoreVersion31 Condition="$(Enable31Testing)">$(MicrosoftAspNetCoreApp31Version)</AspNetCoreVersion31>
<RuntimeVersion60>$(MicrosoftNETCoreApp60Version)</RuntimeVersion60>
<AspNetCoreVersion60>$(MicrosoftAspNetCoreApp60Version)</AspNetCoreVersion60>
</PropertyGroup>
<PropertyGroup>
<RuntimeVersionLatest>$(MicrosoftNETCoreAppRuntimewinx64Version)</RuntimeVersionLatest>
<RuntimeVersionLatest Condition="$(InternalReleaseTesting)">$(DotnetRuntimeVersion)</RuntimeVersionLatest>
<AspNetCoreVersionLatest>$(MicrosoftAspNetCoreAppRefVersion)</AspNetCoreVersionLatest>
</PropertyGroup>
<PropertyGroup>
<TestConfigFileLines>
<![CDATA[
<Configuration>
<PrivateBuildTesting>$(PrivateBuildTesting)</PrivateBuildTesting>
<InternalReleaseTesting>$(InternalReleaseTesting)</InternalReleaseTesting>
<RuntimeVersion31>$(RuntimeVersion31)</RuntimeVersion31>
<AspNetCoreVersion31>$(AspNetCoreVersion31)</AspNetCoreVersion31>
<RuntimeVersion60>$(RuntimeVersion60)</RuntimeVersion60>
<AspNetCoreVersion60>$(AspNetCoreVersion60)</AspNetCoreVersion60>
<RuntimeVersionLatest>$(RuntimeVersionLatest)</RuntimeVersionLatest>
<AspNetCoreVersionLatest>$(AspNetCoreVersionLatest)</AspNetCoreVersionLatest>
<SingleFileRuntimeLatestVersion>$(SingleFileRuntimeLatestVersion)</SingleFileRuntimeLatestVersion>
<SingleFileRuntime60Version>$(SingleFileRuntime60Version)</SingleFileRuntime60Version>
</Configuration>
]]>
</TestConfigFileLines>
</PropertyGroup>
<WriteLinesToFile File="$(TestConfigFileName)" Lines="$(TestConfigFileLines)" Overwrite="true" WriteOnlyWhenDifferent="true" />
<Message Importance="High" Text="Created config file $(TestConfigFileName)" />
<ItemGroup>
<FileWrites Include="$(TestConfigFileName)" />
</ItemGroup>
</Target>
<!--
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>
<!--
Copies the private runtime build binaries and on Windows adds registry keys
-->
<Target Name="CopyPrivateBuild"
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>
</Project>