Skip to content

Commit 7b78b54

Browse files
committed
Merge branch 'main' into zbb
2 parents 6cb8706 + 46c3e85 commit 7b78b54

File tree

164 files changed

+5776
-1693
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

164 files changed

+5776
-1693
lines changed

Directory.Build.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,7 @@
363363
<PropertyGroup>
364364
<CustomBeforeNoTargets>$(RepositoryEngineeringDir)NoTargetsSdk.BeforeTargets.targets</CustomBeforeNoTargets>
365365
<CustomAfterTraversalTargets>$(RepositoryEngineeringDir)TraversalSdk.AfterTargets.targets</CustomAfterTraversalTargets>
366+
<BeforeMicrosoftNETSdkTargets Condition="'$(MSBuildProjectExtension)' == '.ilproj'">$(BeforeMicrosoftNETSdkTargets);$(RepositoryEngineeringDir)ILSdk.BeforeTargets.targets</BeforeMicrosoftNETSdkTargets>
366367
</PropertyGroup>
367368

368369
<PropertyGroup>

Directory.Build.targets

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@
2525
<ItemGroup Condition="'$(DotNetBuildSourceOnly)' == 'true'">
2626
<KnownFrameworkReference Update="Microsoft.NETCore.App">
2727
<RuntimePackRuntimeIdentifiers
28-
Condition="'%(TargetFramework)' == '$(NetCoreAppCurrent)'">%(RuntimePackRuntimeIdentifiers);$(PackageRID)</RuntimePackRuntimeIdentifiers>
28+
Condition="'%(TargetFramework)' == '$(NetCoreAppCurrent)'">%(RuntimePackRuntimeIdentifiers);$(NETCoreSdkRuntimeIdentifier)</RuntimePackRuntimeIdentifiers>
2929
</KnownFrameworkReference>
3030
<KnownCrossgen2Pack Update="Microsoft.NETCore.App.Crossgen2">
3131
<Crossgen2RuntimeIdentifiers
32-
Condition="'%(TargetFramework)' == '$(NetCoreAppCurrent)'" >%(Crossgen2RuntimeIdentifiers);$(PackageRID)</Crossgen2RuntimeIdentifiers>
32+
Condition="'%(TargetFramework)' == '$(NetCoreAppCurrent)'" >%(Crossgen2RuntimeIdentifiers);$(NETCoreSdkRuntimeIdentifier)</Crossgen2RuntimeIdentifiers>
3333
</KnownCrossgen2Pack>
3434
<!-- Avoid references to Microsoft.AspNetCore.App.Runtime.<rid> -->
3535
<KnownFrameworkReference Remove="Microsoft.AspNetCore.App" />

eng/DotNetBuild.props

Lines changed: 15 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,23 @@
11
<!-- When altering this file, include @dotnet/product-construction as a reviewer. -->
22

33
<Project>
4+
<PropertyGroup>
5+
<!-- TargetRid can be set by the orchestrator, so we need to set OutputRID to that as a default. -->
6+
<OutputRID Condition="'$(OutputRID)' == ''">$(TargetRid)</OutputRID>
7+
</PropertyGroup>
8+
9+
<Import Project="$(MSBuildThisFileDirectory)OSArch.props" Condition="'$(_ImportedOSArchProps)' != 'true'" />
10+
<Import Project="$(MSBuildThisFileDirectory)RuntimeIdentifier.props" Condition="'$(_ImportedRuntimeIdentifierProps)' != 'true'" />
411

512
<PropertyGroup>
613
<GitHubRepositoryName>runtime</GitHubRepositoryName>
714

815
<BaseInnerSourceBuildCommand Condition="'$(OS)' == 'Windows_NT'">.\build.cmd</BaseInnerSourceBuildCommand>
916
<BaseInnerSourceBuildCommand Condition="'$(OS)' != 'Windows_NT'">./build.sh</BaseInnerSourceBuildCommand>
1017

11-
<_hostRid>$([System.Runtime.InteropServices.RuntimeInformation]::RuntimeIdentifier)</_hostRid>
12-
<!-- TargetRid names what gets built. -->
13-
<TargetRid Condition="'$(TargetRid)' == ''">$(_hostRid)</TargetRid>
14-
15-
<!-- Split e.g. 'fedora.33-x64' into 'fedora.33' and 'x64'. -->
16-
<_targetRidPlatformIndex>$(TargetRid.LastIndexOf('-'))</_targetRidPlatformIndex>
17-
<TargetArch>$(TargetRid.Substring($(_targetRidPlatformIndex)).TrimStart('-'))</TargetArch>
18-
<TargetOS>$(TargetRid.Substring(0, $(_targetRidPlatformIndex)))</TargetOS>
19-
20-
<_hostRidPlatformIndex>$(_hostRid.LastIndexOf('-'))</_hostRidPlatformIndex>
21-
<_hostArch>$(_hostRid.Substring($(_hostRidPlatformIndex)).TrimStart('-'))</_hostArch>
22-
2318
<LogVerbosity Condition="'$(LogVerbosity)' == ''">minimal</LogVerbosity>
2419
</PropertyGroup>
2520

26-
<!-- Keep this list in sync with https://github.com/dotnet/sdk/blob/main/src/SourceBuild/content/Directory.Build.props#L23 -->
27-
<PropertyGroup Label="ShortStacks">
28-
<ShortStack Condition="'$(TargetOS)' == 'wasi'">true</ShortStack>
29-
<ShortStack Condition="'$(TargetOS)' == 'browser'">true</ShortStack>
30-
<ShortStack Condition="'$(TargetOS)' == 'ios'">true</ShortStack>
31-
<ShortStack Condition="'$(TargetOS)' == 'iossimulator'">true</ShortStack>
32-
<ShortStack Condition="'$(TargetOS)' == 'tvos'">true</ShortStack>
33-
<ShortStack Condition="'$(TargetOS)' == 'tvossimulator'">true</ShortStack>
34-
<ShortStack Condition="'$(TargetOS)' == 'maccatalyst'">true</ShortStack>
35-
<ShortStack Condition="'$(TargetOS)' == 'android'">true</ShortStack>
36-
<ShortStack Condition="'$(TargetOS)' == 'linux-bionic'">true</ShortStack>
37-
<!-- Mono LLVM builds are short -->
38-
<ShortStack Condition="'$(DotNetBuildMonoEnableLLVM)' == 'true' or '$(DotNetBuildMonoAOTEnableLLVM)' == 'true'">true</ShortStack>
39-
</PropertyGroup>
40-
41-
<!--
42-
Allow the VMR orchestrator to control whether or not to build rid-specific artifacts,
43-
but provide defaults until the VMR orchestrator provides controls in all scenarios.
44-
-->
45-
<PropertyGroup Condition="'$(EnableDefaultRidSpecificArtifacts)' == ''">
46-
<!-- Source-build always needs all artifacts to be published. -->
47-
<EnableDefaultRidSpecificArtifacts Condition="'$(DotNetBuildSourceOnly)' != ''">false</EnableDefaultRidSpecificArtifacts>
48-
<!-- Short-stack builds should always only publish RID-specific artifacts. -->
49-
<EnableDefaultRidSpecificArtifacts Condition="'$(ShortStack)' == 'true'">true</EnableDefaultRidSpecificArtifacts>
50-
<!-- If no override is specified, don't use RID-specific publishing. Instead, publish everything. -->
51-
<EnableDefaultRidSpecificArtifacts Condition="'$(EnableDefaultRidSpecificArtifacts)' == ''">false</EnableDefaultRidSpecificArtifacts>
52-
</PropertyGroup>
53-
5421
<Target Name="GetRuntimeSourceBuildCommandConfiguration"
5522
BeforeTargets="GetSourceBuildCommandConfiguration">
5623
<PropertyGroup>
@@ -63,21 +30,20 @@
6330
<InnerBuildArgs Condition="'$(DotNetBuildOrchestrator)' == 'true' and '$(Sign)' == 'true'">$(InnerBuildArgs) $(FlagParameterPrefix)sign</InnerBuildArgs>
6431
<InnerBuildArgs>$(InnerBuildArgs) $(FlagParameterPrefix)pack</InnerBuildArgs>
6532

66-
<InnerBuildArgs>$(InnerBuildArgs) $(FlagParameterPrefix)arch $(TargetArch)</InnerBuildArgs>
67-
<InnerBuildArgs Condition="'$(DotNetBuildSourceOnly)' != 'true'">$(InnerBuildArgs) $(FlagParameterPrefix)os $(TargetOS)</InnerBuildArgs>
68-
<InnerBuildArgs Condition="'$(CrossBuild)' == 'true' or ('$(TargetArch)' != '$(_hostArch)' and '$(ShortStack)' != 'true')">$(InnerBuildArgs) $(FlagParameterPrefix)cross</InnerBuildArgs>
33+
<InnerBuildArgs>$(InnerBuildArgs) $(FlagParameterPrefix)arch $(TargetArchitecture)</InnerBuildArgs>
34+
<InnerBuildArgs Condition="'$(_portableOS)' == 'win'">$(InnerBuildArgs) $(FlagParameterPrefix)os windows</InnerBuildArgs>
35+
<InnerBuildArgs>$(InnerBuildArgs) $(FlagParameterPrefix)os $(_portableOS)</InnerBuildArgs>
36+
<!-- Mobile builds are never "cross" builds as they don't have a rootfs-based filesystem build. -->
37+
<InnerBuildArgs Condition="'$(CrossBuild)' == 'true' or ('$(TargetArchitecture)' != '$(BuildArchitecture)' and '$(TargetsMobile)' != 'true')">$(InnerBuildArgs) $(FlagParameterPrefix)cross</InnerBuildArgs>
6938
<InnerBuildArgs>$(InnerBuildArgs) $(FlagParameterPrefix)configuration $(Configuration)</InnerBuildArgs>
7039
<InnerBuildArgs>$(InnerBuildArgs) $(FlagParameterPrefix)verbosity $(LogVerbosity)</InnerBuildArgs>
7140
<InnerBuildArgs>$(InnerBuildArgs) $(FlagParameterPrefix)nodereuse $(ArcadeFalseBoolBuildArg)</InnerBuildArgs>
7241
<InnerBuildArgs>$(InnerBuildArgs) $(FlagParameterPrefix)warnAsError $(ArcadeFalseBoolBuildArg)</InnerBuildArgs>
7342
<InnerBuildArgs Condition="'$(DotNetBuildUseMonoRuntime)' == 'true'">$(InnerBuildArgs) $(FlagParameterPrefix)usemonoruntime</InnerBuildArgs>
7443
<!-- TODO: This parameter is only available on the Unix script. Intentional? -->
75-
<InnerBuildArgs Condition="'$(OS)' != 'Windows_NT'">$(InnerBuildArgs) --outputrid $(TargetRid)</InnerBuildArgs>
76-
<!-- PackageOS and ToolsOS control the rids of prebuilts consumed by the build.
77-
They are set to RuntimeOS so they match with the build SDK rid. -->
78-
<InnerBuildArgs Condition="'$(RuntimeOS)' != ''">$(InnerBuildArgs) /p:PackageOS=$(RuntimeOS) /p:ToolsOS=$(RuntimeOS)</InnerBuildArgs>
79-
<!-- BaseOS is an expected known rid in the graph that TargetRid is compatible with.
80-
It's used to add TargetRid in the graph if the parent can't be detected. -->
44+
<InnerBuildArgs Condition="'$(OS)' != 'Windows_NT'">$(InnerBuildArgs) --outputrid $(OutputRID)</InnerBuildArgs>
45+
<!-- BaseOS is an expected known rid in the graph that OutputRID is compatible with.
46+
It's used to add OutputRID in the graph if the parent can't be detected. -->
8147
<InnerBuildArgs>$(InnerBuildArgs) /p:AdditionalRuntimeIdentifierParent=$(BaseOS) /p:BaseOS=$(BaseOS)</InnerBuildArgs>
8248
<!-- Pass through special build modes controlled by properties -->
8349
<InnerBuildArgs Condition="'$(DotNetBuildRuntimeWasmEnableThreads)' == 'true'">$(InnerBuildArgs) /p:WasmEnableThreads=true</InnerBuildArgs>

eng/ILSdk.BeforeTargets.targets

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<Project>
2+
<PropertyGroup>
3+
<!-- Microsoft.NET.Sdk.IL SDK defaults to the portable host rid. Match it to the SDK RID (so source-build scenarios use the same RID as the host SDK). -->
4+
<MicrosoftNetCoreIlasmPackageRuntimeId>$(NETCoreSdkRuntimeIdentifier)</MicrosoftNetCoreIlasmPackageRuntimeId>
5+
</PropertyGroup>
6+
</Project>

eng/OSArch.props

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,8 @@
3232
<TargetArchitecture Condition="'$(TargetArchitecture)' == ''">x64</TargetArchitecture>
3333
<Platform Condition="'$(Platform)' == '' and '$(InferPlatformFromTargetArchitecture)' == 'true'">$(TargetArchitecture)</Platform>
3434
</PropertyGroup>
35-
</Project>
35+
36+
<PropertyGroup>
37+
<_ImportedOSArchProps>true</_ImportedOSArchProps>
38+
</PropertyGroup>
39+
</Project>

eng/Publishing.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
but we do produce them in both the VMR and the runtime official build.
8484
-->
8585
<PropertyGroup Condition="'$(DotNetBuildOrchestrator)' == 'true'">
86-
<ShouldGenerateProductVersionFiles Condition="'$(PackageRID)' == 'win-x64' and ('$(DotNetBuildPass)' == '' or '$(DotNetBuildPass)' == '1')">true</ShouldGenerateProductVersionFiles>
86+
<ShouldGenerateProductVersionFiles Condition="'$(OutputRID)' == 'win-x64' and ('$(DotNetBuildPass)' == '' or '$(DotNetBuildPass)' == '1')">true</ShouldGenerateProductVersionFiles>
8787
<ShouldGenerateProductVersionFiles Condition="'$(DotNetBuildSourceOnly)' == 'true'">true</ShouldGenerateProductVersionFiles>
8888
</PropertyGroup>
8989

eng/RuntimeIdentifier.props

Lines changed: 4 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -25,38 +25,6 @@
2525
<_portableOS Condition="'$(HostOS)' == 'win' and '$(TargetsMobile)' != 'true'">win</_portableOS>
2626
</PropertyGroup>
2727

28-
<!-- PackageRID is used for packages needed for the target. -->
29-
<PropertyGroup Label="CalculatePackageRID">
30-
<_packageOS>$(_portableOS)</_packageOS>
31-
32-
<_packageOS Condition="'$(CrossBuild)' == 'true' and '$(_portableOS)' != 'linux-musl' and '$(_portableOS)' != 'linux-bionic' and '$(_portableOS)' != 'android'">$(_hostOS)</_packageOS>
33-
34-
<!-- source-build sets PackageOS to build with non-portable rid packages that were source-built previously. -->
35-
<PackageRID Condition="'$(PackageOS)' != ''">$(PackageOS)-$(TargetArchitecture)</PackageRID>
36-
<PackageRID Condition="'$(PackageRID)' == ''">$(_packageOS)-$(TargetArchitecture)</PackageRID>
37-
</PropertyGroup>
38-
39-
<!-- ToolsRID is used for packages needed on the build host. -->
40-
<PropertyGroup Label="CalculateToolsRID">
41-
<!-- _portableHostOS is the portable rid-OS corresponding to the build host platform.
42-
43-
To determine _portableHostOS we use _hostOS, similar to how _portableOS is calculated from TargetOS.
44-
45-
When we're not cross-building we can detect linux flavors by looking at _portableOS
46-
because the target platform and the build host platform are the same.
47-
For cross-builds, we're currently unable to detect the flavors. -->
48-
<_portableHostOS>$(_hostOS)</_portableHostOS>
49-
<_portableHostOS Condition="'$(_portableHostOS)' == 'windows'">win</_portableHostOS>
50-
<_portableHostOS Condition="'$(CrossBuild)' != 'true' and '$(_portableOS)' == 'linux-musl'">linux-musl</_portableHostOS>
51-
52-
<!-- source-build sets ToolsOS to build with non-portable rid packages that were source-built previously. -->
53-
<ToolsRID Condition="'$(ToolsOS)' != ''">$(ToolsOS)-$(_hostArch)</ToolsRID>
54-
<ToolsRID Condition="'$(ToolsRID)' == ''">$(_portableHostOS)-$(_hostArch)</ToolsRID>
55-
56-
<!-- Microsoft.NET.Sdk.IL SDK defaults to the portable host rid. Match it to ToolsRID (for source-build). -->
57-
<MicrosoftNetCoreIlasmPackageRuntimeId>$(ToolsRID)</MicrosoftNetCoreIlasmPackageRuntimeId>
58-
</PropertyGroup>
59-
6028
<!-- OutputRID is used to name the target platform.
6129
For portable builds, OutputRID matches _portableOS.
6230
For non-portable builds, it uses __DistroRid (from the native build script), or falls back to RuntimeInformation.RuntimeIdentifier.
@@ -97,4 +65,7 @@
9765
<TargetsWindows Condition="'$(TargetOS)' == 'windows'">true</TargetsWindows>
9866
<TargetsUnix Condition="'$(TargetsFreeBSD)' == 'true' or '$(Targetsillumos)' == 'true' or '$(TargetsSolaris)' == 'true' or '$(TargetsHaiku)' == 'true' or '$(TargetsLinux)' == 'true' or '$(TargetsNetBSD)' == 'true' or '$(TargetsOSX)' == 'true' or '$(TargetsMacCatalyst)' == 'true' or '$(TargetstvOS)' == 'true' or '$(TargetsiOS)' == 'true' or '$(TargetsAndroid)' == 'true'">true</TargetsUnix>
9967
</PropertyGroup>
100-
</Project>
68+
<PropertyGroup>
69+
<_ImportedRuntimeIdentifierProps>true</_ImportedRuntimeIdentifierProps>
70+
</PropertyGroup>
71+
</Project>

eng/Signing.props

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,20 @@
1414
We have specific jobs that produce RID-agnostic packages or packages for multiple RIDs set this property.
1515
- Mono AOT LLVM builds only publish LLVM-specific packages always.
1616
17-
VMR jobs can control whether or not a vertical has EnableDefaultRidSpecificArtifacts set to true or false in DotNetBuild.props.
17+
The VMR orchestrator will set EnableDefaultRidSpecificArtifacts=true as a global property based on its configuration.
1818
1919
Packages that do not meet the above rules are added with Vertical visibility in the VMR and excluded in non-VMR builds.
2020
-->
2121
<EnableDefaultArtifacts Condition="'$(MonoAOTEnableLLVM)' == 'true'">false</EnableDefaultArtifacts>
2222
<EnableBlobArtifacts>true</EnableBlobArtifacts>
2323
<EnableBlobArtifacts Condition="'$(MonoAOTEnableLLVM)' == 'true'">false</EnableBlobArtifacts>
2424

25-
<!-- Set the TargetRid property to our PackageRID, which is the right RID to use for selecting packages from our repo. -->
26-
<TargetRid>$(PackageRID)</TargetRid>
25+
<!-- Set the TargetRid property to our OutputRID, which is the right RID to use for selecting packages from our repo. -->
26+
<TargetRid>$(OutputRID)</TargetRid>
2727

2828
<!-- The final stage of the runtime official build should publish everything. -->
2929
<EnableDefaultRidSpecificArtifacts Condition="'$(DotNetFinalPublish)' != ''">false</EnableDefaultRidSpecificArtifacts>
30-
<EnableDefaultRidSpecificArtifacts Condition="'$(EnableDefaultRidSpecificArtifacts)' == ''">true</EnableDefaultRidSpecificArtifacts>
30+
<EnableDefaultRidSpecificArtifacts Condition="'$(EnableDefaultRidSpecificArtifacts)' == '' and '$(DotNetBuildOrchestrator)' != 'true'">true</EnableDefaultRidSpecificArtifacts>
3131

3232
<UseDotNetCertificate>true</UseDotNetCertificate>
3333
</PropertyGroup>
@@ -114,29 +114,29 @@
114114
<Choose>
115115
<When Condition="'$(MonoAOTEnableLLVM)' == 'true'">
116116
<ItemGroup>
117-
<PackageArtifacts Include="$(ArtifactsPackagesDir)**\*.LLVM.AOT.$(PackageRID).*.nupkg" />
117+
<PackageArtifacts Include="$(ArtifactsPackagesDir)**\*.LLVM.AOT.$(OutputRID).*.nupkg" />
118118
<Artifact Include="@(PackageArtifacts)"
119119
IsShipping="$([System.String]::Copy('%(RecursiveDir)').StartsWith('Shipping'))"
120120
Kind="Package" />
121121
</ItemGroup>
122122
</When>
123123
<When Condition="'$(EnableDefaultRidSpecificArtifacts)' == 'true'">
124-
<ItemGroup Condition="'$(PackageRID)' == 'ios-arm64'">
124+
<ItemGroup Condition="'$(OutputRID)' == 'ios-arm64'">
125125
<PackageArtifacts
126126
Include="$(ArtifactsPackagesDir)**\Microsoft.NET.Runtime.iOS.Sample.Mono.*.nupkg;
127127
$(ArtifactsPackagesDir)**\Microsoft.NET.Runtime.LibraryBuilder.Sdk.*.nupkg;
128128
$(ArtifactsPackagesDir)**\Microsoft.NET.Runtime.MonoAOTCompiler.Task.*.nupkg;
129129
$(ArtifactsPackagesDir)**\Microsoft.NET.Runtime.MonoTargets.Sdk.*.nupkg" />
130130
</ItemGroup>
131-
<ItemGroup Condition="'$(PackageRID)' == 'android-arm64'">
131+
<ItemGroup Condition="'$(OutputRID)' == 'android-arm64'">
132132
<PackageArtifacts
133133
Include="$(ArtifactsPackagesDir)**\Microsoft.NET.Runtime.Android.Sample.Mono.*.nupkg" />
134134
</ItemGroup>
135-
<ItemGroup Condition="'$(PackageRID)' == 'wasi-wasm'">
135+
<ItemGroup Condition="'$(OutputRID)' == 'wasi-wasm'">
136136
<PackageArtifacts
137137
Include="$(ArtifactsPackagesDir)**\Microsoft.NET.Runtime.WebAssembly.Wasi.Sdk.*.nupkg" />
138138
</ItemGroup>
139-
<ItemGroup Condition="'$(PackageRID)' == 'browser-wasm' and '$(WasmEnableThreads)' != 'true'">
139+
<ItemGroup Condition="'$(OutputRID)' == 'browser-wasm' and '$(WasmEnableThreads)' != 'true'">
140140
<PackageArtifacts
141141
Include="$(ArtifactsPackagesDir)**\Microsoft.NET.Runtime.wasm.Sample.Mono.*.nupkg;
142142
$(ArtifactsPackagesDir)**\Microsoft.NET.Runtime.WorkloadTesting.Internal.*.nupkg;

0 commit comments

Comments
 (0)