Skip to content

Commit a8108c9

Browse files
author
Mirroring
committed
Merge commit 'cb77171f85a1431e67525922a53621d7475c5ebd'
2 parents 378b27e + cb77171 commit a8108c9

File tree

103 files changed

+850
-295
lines changed

Some content is hidden

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

103 files changed

+850
-295
lines changed

NuGet.config

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010
<!--Begin: Package sources managed by Dependency Flow automation. Do not edit the sources below.-->
1111
<!-- Begin: Package sources from dotnet-emsdk -->
1212
<add key="darc-pub-dotnet-emsdk-d667257" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-d6672570/nuget/v3/index.json" />
13+
<add key="darc-pub-dotnet-emsdk-2674f58" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-2674f580/nuget/v3/index.json" />
14+
<add key="darc-pub-dotnet-emsdk-2674f58-4" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-2674f580-4/nuget/v3/index.json" />
15+
<add key="darc-pub-dotnet-emsdk-2674f58-3" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-2674f580-3/nuget/v3/index.json" />
16+
<add key="darc-pub-dotnet-emsdk-2674f58-2" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-2674f580-2/nuget/v3/index.json" />
17+
<add key="darc-pub-dotnet-emsdk-2674f58-1" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-2674f580-1/nuget/v3/index.json" />
1318
<!-- End: Package sources from dotnet-emsdk -->
1419
<!-- Begin: Package sources from dotnet-sdk -->
1520
<!-- End: Package sources from dotnet-sdk -->

docs/coding-guidelines/libraries-packaging.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@ Source generators and analyzers can be included in the shared framework by addin
1818

1919
Removing a library from the shared framework is a breaking change and should be avoided.
2020

21+
### References to libraries in the shared framework that produce packages
22+
23+
It's beneficial to avoid project references to libraries that are in the shared framework because it makes the package graph smaller which reduces the number of packages that require servicing and the number of libraries that end up being copied into the application directory.
24+
25+
If a dependency is part of the shared framework a project/package reference is never required on the latest version (`NetCoreAppCurrent`). A reference is required for previous .NET versions even if the dependency is part of the shared framework if the project you are building targets .NETStandard and references the project there. You may completely avoid a package dependency on .NETStandard and .NET if it's not needed for .NETStandard (for example - if it is an implementation only dependency and you're building a PNSE assembly for .NETStandard).
26+
27+
Warning NETPKG0001 is emitted when you have an unnecessary reference to a library that is part of the shared framework. To avoid this warning, make sure your ProjectReference is conditioned so that it doesn't apply on `NetCoreAppCurrent`.
28+
2129
## Transport package
2230

2331
Transport packages are non-shipping packages that dotnet/runtime produces in order to share binaries with other repositories.

docs/project/library-servicing.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ If a library is packable (check for the `<IsPackable>true</IsPackable>` property
1616

1717
When you make a change to a library & ship it during the servicing release, the `ServicingVersion` must be bumped. This property is found in the library's source project. It's also possible that the property is not in that file, in which case you'll need to add it to the library's source project and set it to 1. If the property is already present in your library's source project, just increment the servicing version by 1.
1818

19+
## Optionally ensure all up-stack packages are also produced
20+
21+
If you wish to ensure that every package that references a serviced package is also serviced itself, you can enable validation by setting `ServiceTransitiveDependencies` to true. This can be done in an individual project, or globally. When doing this then building the repo, eg: `build libs -allConfigurations` you'll see errors from any project that didn't enable servicing. Reasons for forcing packages which depend on your package to service are security servicing or removing dependencies.
22+
1923
## Test your changes
2024

2125
All that's left is to ensure that your changes have worked as expected. To do so, execute the following steps:

docs/workflow/building/coreclr/linux-instructions.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,13 @@ All official builds are cross-builds with a rootfs for the target OS, and will u
6060

6161
| Host OS | Target OS | Target Arch | Image location | crossrootfs location |
6262
| --------------------- | ------------ | --------------- | -------------------------------------------------------------------------------- | -------------------- |
63-
| CBL-mariner 2.0 (x64) | Alpine 3.13 | x64 | `mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-amd64-alpine` | `/crossrootfs/x64` |
64-
| CBL-mariner 2.0 (x64) | Ubuntu 16.04 | x64 | `mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-amd64` | `/crossrootfs/x64` |
65-
| CBL-mariner 2.0 (x64) | Alpine | arm32 (armhf) | `mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-arm-alpine` | `/crossrootfs/arm` |
66-
| CBL-mariner 2.0 (x64) | Ubuntu 16.04 | arm32 (armhf) | `mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-arm` | `/crossrootfs/arm` |
67-
| CBL-mariner 2.0 (x64) | Alpine | arm64 (arm64v8) | `mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-arm64-alpine` | `/crossrootfs/arm64` |
68-
| CBL-mariner 2.0 (x64) | Ubuntu 16.04 | arm64 (arm64v8) | `mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-arm64` | `/crossrootfs/arm64` |
63+
| Azure Linux (x64) | Alpine 3.13 | x64 | `mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net8.0-cross-amd64-alpine` | `/crossrootfs/x64` |
64+
| Azure Linux (x64) | Ubuntu 16.04 | x64 | `mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net8.0-cross-amd64` | `/crossrootfs/x64` |
65+
| Azure Linux (x64) | Alpine | arm32 (armhf) | `mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net8.0-cross-arm-alpine` | `/crossrootfs/arm` |
66+
| Azure Linux (x64) | Ubuntu 16.04 | arm32 (armhf) | `mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net8.0-cross-arm` | `/crossrootfs/arm` |
67+
| Azure Linux (x64) | Alpine | arm64 (arm64v8) | `mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net8.0-cross-arm64-alpine` | `/crossrootfs/arm64` |
68+
| Azure Linux (x64) | Ubuntu 16.04 | arm64 (arm64v8) | `mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net8.0-cross-arm64` | `/crossrootfs/arm64` |
69+
| Azure Linux (x64) | Ubuntu 16.04 | x86 | `mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net8.0-cross-x86` | `/crossrootfs/x86` |
6970
| Ubuntu 18.04 (x64) | FreeBSD | x64 | `mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-cross-freebsd-12` | `/crossrootfs/x64` |
7071

7172
These Docker images are built using the Dockerfiles maintained in the [dotnet-buildtools-prereqs-docker repo](https://github.com/dotnet/dotnet-buildtools-prereqs-docker).

eng/Version.Details.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,9 @@
9999
<Sha>d6672570f0fde2a4a3c7e65d60cec9f8406b039c</Sha>
100100
<SourceBuild RepoName="emsdk" ManagedOnly="true" />
101101
</Dependency>
102-
<Dependency Name="Microsoft.SourceBuild.Intermediate.source-build-reference-packages" Version="8.0.0-alpha.1.24372.3">
102+
<Dependency Name="Microsoft.SourceBuild.Intermediate.source-build-reference-packages" Version="8.0.0-alpha.1.24415.1">
103103
<Uri>https://github.com/dotnet/source-build-reference-packages</Uri>
104-
<Sha>30ed464acd37779c64e9dc652d4460543ebf9966</Sha>
104+
<Sha>fe3794a68bd668d36d4d5014a9e6c9d22c0e6d86</Sha>
105105
<SourceBuild RepoName="source-build-reference-packages" ManagedOnly="true" />
106106
</Dependency>
107107
<Dependency Name="Microsoft.SourceBuild.Intermediate.source-build-externals" Version="8.0.0-alpha.1.24379.1">
@@ -354,9 +354,9 @@
354354
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-optimization</Uri>
355355
<Sha>67613417f5e1af250e6ddfba79f8f2885d8e90fb</Sha>
356356
</Dependency>
357-
<Dependency Name="Microsoft.DotNet.HotReload.Utils.Generator.BuildTool" Version="8.0.0-alpha.0.24402.1">
357+
<Dependency Name="Microsoft.DotNet.HotReload.Utils.Generator.BuildTool" Version="8.0.0-alpha.0.24453.2">
358358
<Uri>https://github.com/dotnet/hotreload-utils</Uri>
359-
<Sha>907017dae648b642c122f9a34573bd88ea0d9730</Sha>
359+
<Sha>5339e12def2a3605d069c429840089ae27838728</Sha>
360360
</Dependency>
361361
<Dependency Name="System.Runtime.Numerics.TestData" Version="8.0.0-beta.24362.2">
362362
<Uri>https://github.com/dotnet/runtime-assets</Uri>

eng/Versions.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@
188188
<MicrosoftDotNetXHarnessTestRunnersCommonVersion>8.0.0-prerelease.24229.2</MicrosoftDotNetXHarnessTestRunnersCommonVersion>
189189
<MicrosoftDotNetXHarnessTestRunnersXunitVersion>8.0.0-prerelease.24229.2</MicrosoftDotNetXHarnessTestRunnersXunitVersion>
190190
<MicrosoftDotNetXHarnessCLIVersion>8.0.0-prerelease.24229.2</MicrosoftDotNetXHarnessCLIVersion>
191-
<MicrosoftDotNetHotReloadUtilsGeneratorBuildToolVersion>8.0.0-alpha.0.24402.1</MicrosoftDotNetHotReloadUtilsGeneratorBuildToolVersion>
191+
<MicrosoftDotNetHotReloadUtilsGeneratorBuildToolVersion>8.0.0-alpha.0.24453.2</MicrosoftDotNetHotReloadUtilsGeneratorBuildToolVersion>
192192
<XUnitVersion>2.4.2</XUnitVersion>
193193
<XUnitAnalyzersVersion>1.0.0</XUnitAnalyzersVersion>
194194
<XUnitRunnerVisualStudioVersion>2.4.5</XUnitRunnerVisualStudioVersion>

eng/packaging.targets

Lines changed: 54 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,21 @@
196196
</ItemGroup>
197197
</Target>
198198

199+
<Target Name="WarnOnProjectReferenceToFrameworkAssemblies"
200+
BeforeTargets="IncludeTransitiveProjectReferences"
201+
Condition="'$(TargetFramework)' == '$(NetCoreAppCurrent)' and
202+
'@(ProjectReference)' != ''">
203+
<!-- Find project references that overlap with NetCoreApp, are direct (NuGetPackageId is not set), actually referenced (ReferenceOutputAssembly), and not hidden with PrivateAssets
204+
ProjectReferences can opt out of this checking by setting AllowFrameworkPackageReference, though they should not. -->
205+
<Warning Text="Project reference '%(ProjectReference.Identity)' is a reference to a framework assembly and is not required in $(NetCoreAppCurrent) (NetCoreAppCurrent)."
206+
Code="NETPKG0001"
207+
Condition="$(NetCoreAppLibrary.Contains('%(ProjectReference.Filename);')) and
208+
'%(ProjectReference.ReferenceOutputAssembly)' != 'false' and
209+
'%(ProjectReference.NuGetPackageId)' == '' and
210+
'%(ProjectReference.PrivateAssets)' != 'all' and
211+
'%(ProjectReference.AllowFrameworkPackageReference)' != 'true'" />
212+
</Target>
213+
199214
<Target Name="GenerateMultiTargetRoslynComponentTargetsFile"
200215
Inputs="$(MSBuildProjectFullPath);$(_MultiTargetRoslynComponentTargetsTemplate)"
201216
Outputs="$(MultiTargetRoslynComponentTargetsFileIntermediatePath)">
@@ -303,12 +318,47 @@
303318
</ItemGroup>
304319
</Target>
305320

306-
<Target Name="ValidateServicingVersionIsProperlySet"
321+
<ItemDefinitionGroup>
322+
<TargetPathWithTargetPlatformMoniker>
323+
<!-- When ServiceTransitiveDependencies is set, flow the packaging state -->
324+
<GeneratePackageOnBuild Condition="'$(ServiceTransitiveDependencies)' == 'true'">$(GeneratePackageOnBuild)</GeneratePackageOnBuild>
325+
</TargetPathWithTargetPlatformMoniker>
326+
</ItemDefinitionGroup>
327+
328+
<!-- Flows the list of ProjectReferences that are enabled for packaging when building a multi-targeting project -->
329+
<Target Name="_AddTransitiveServicedPackagesToOutput"
330+
AfterTargets="GetTargetPathWithTargetPlatformMoniker"
331+
Condition="'$(IsInnerBuild)' == 'true'">
332+
<PropertyGroup>
333+
<_TransitiveServicedPackages
334+
Condition="'%(ReferencePath.ReferenceSourceTarget)' == 'ProjectReference' and
335+
'%(ReferencePath.GeneratePackageOnBuild)' == 'true'"
336+
>@(ReferencePath->'%(OriginalProjectReferenceItemSpec)')</_TransitiveServicedPackages>
337+
</PropertyGroup>
338+
<ItemGroup>
339+
<TargetPathWithTargetPlatformMoniker TransitiveServicedPackages="$(_TransitiveServicedPackages)" />
340+
</ItemGroup>
341+
</Target>
342+
343+
<!-- Validate that ServicingVersion is set and packing is enabled. Runs once in the outer build (or only build if no outer build exists). -->
344+
<Target Name="ValidateServicingProperties"
307345
Condition="'$(PreReleaseVersionLabel)' == 'servicing' and
308346
'$(PackageUseIncrementalServicingVersion)' == 'true' and
309-
'$(DotNetBuildFromSource)' != 'true'"
310-
AfterTargets="GenerateNuspec">
311-
<Error Condition="'$(ServicingVersion)' == '0'" Text="ServicingVersion is set to 0 and it should be an increment of the patch version from the last released package." />
347+
'$(DotNetBuildFromSource)' != 'true' and
348+
'$(IsInnerBuild)' != 'true'"
349+
AfterTargets="Build">
350+
<ItemGroup>
351+
<TransitiveServicedPackages Include="%(InnerOutput.TransitiveServicedPackages)" Condition="'$(IsCrossTargetingBuild)' == 'true'" />
352+
<TransitiveServicedPackages Include="'%(ReferencePath.OriginalProjectReferenceItemSpec)"
353+
Condition="'%(ReferencePath.ReferenceSourceTarget)' == 'ProjectReference' and
354+
'%(ReferencePath.GeneratePackageOnBuild)' == 'true'" />
355+
</ItemGroup>
356+
<Error Condition="'$(ServicingVersion)' == '0' and '$(GeneratePackageOnBuild)' == 'true'"
357+
Text="ServicingVersion is set to 0 and it should be an increment of the patch version from the last released package." />
358+
359+
<Error Condition="'$(GeneratePackageOnBuild)' != 'true' and
360+
'@(TransitiveServicedPackages)' != ''"
361+
Text="This project did not set GeneratePackageOnBuild, but dependencies '@(TransitiveServicedPackages)' did. Please ship this project by setting GeneratePackageOnBuild to true and incrementing ServicingVersion." />
312362
</Target>
313363

314364
</Project>

eng/pipelines/common/templates/pipeline-with-resources.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ extends:
1717

1818
containers:
1919
linux_arm:
20-
image: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-arm
20+
image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net8.0-cross-arm
2121
env:
2222
ROOTFS_DIR: /crossrootfs/arm
2323

@@ -27,23 +27,23 @@ extends:
2727
ROOTFS_DIR: /crossrootfs/armv6
2828

2929
linux_arm64:
30-
image: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-biarch-amd64-arm64
30+
image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net8.0-cross-arm64
3131
env:
3232
ROOTFS_HOST_DIR: /crossrootfs/x64
3333
ROOTFS_DIR: /crossrootfs/arm64
3434

3535
linux_musl_x64:
36-
image: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-amd64-alpine
36+
image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net8.0-cross-amd64-alpine
3737
env:
3838
ROOTFS_DIR: /crossrootfs/x64
3939

4040
linux_musl_arm:
41-
image: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-arm-alpine
41+
image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net8.0-cross-arm-alpine
4242
env:
4343
ROOTFS_DIR: /crossrootfs/arm
4444

4545
linux_musl_arm64:
46-
image: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-arm64-alpine
46+
image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net8.0-cross-arm64-alpine
4747
env:
4848
ROOTFS_DIR: /crossrootfs/arm64
4949

@@ -56,12 +56,12 @@ extends:
5656
image: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-android-docker
5757

5858
linux_x64:
59-
image: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-amd64
59+
image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net8.0-cross-amd64
6060
env:
6161
ROOTFS_DIR: /crossrootfs/x64
6262

6363
linux_x86:
64-
image: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-x86
64+
image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net8.0-cross-x86
6565
env:
6666
ROOTFS_DIR: /crossrootfs/x86
6767

eng/pipelines/coreclr/templates/helix-queues-setup.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848

4949
# Android x64
5050
- ${{ if in(parameters.platform, 'android_x64') }}:
51-
- Ubuntu.2004.Amd64.Android.29.Open
51+
- Ubuntu.2204.Amd64.Android.29.Open
5252

5353
# Browser wasm
5454
- ${{ if eq(parameters.platform, 'browser_wasm') }}:

eng/pipelines/libraries/helix-queues-setup.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ jobs:
7272
- Ubuntu.2204.Amd64.Open
7373
- (Debian.12.Amd64.Open)[email protected]/dotnet-buildtools/prereqs:debian-12-helix-amd64
7474
- (Mariner.2.0.Amd64.Open)[email protected]/dotnet-buildtools/prereqs:cbl-mariner-2.0-helix-amd64
75+
- (AzureLinux.3.0.Amd64.Open)[email protected]/dotnet-buildtools/prereqs:azurelinux-3.0-helix-amd64
7576
- (openSUSE.15.2.Amd64.Open)[email protected]/dotnet-buildtools/prereqs:opensuse-15.2-helix-amd64
7677
- ${{ if or(ne(parameters.jobParameters.isExtraPlatforms, true), eq(parameters.jobParameters.includeAllPlatforms, true)) }}:
7778
- (Centos.9.Amd64.Open)[email protected]/dotnet-buildtools/prereqs:centos-stream9-helix
@@ -99,7 +100,7 @@ jobs:
99100

100101
# Android
101102
- ${{ if in(parameters.platform, 'android_x86', 'android_x64', 'linux_bionic_x64') }}:
102-
- Ubuntu.2004.Amd64.Android.29.Open
103+
- Ubuntu.2204.Amd64.Android.29.Open
103104
- ${{ if in(parameters.platform, 'android_arm', 'android_arm64', 'linux_bionic_arm64') }}:
104105
- Windows.11.Amd64.Android.Open
105106

0 commit comments

Comments
 (0)