1
0
Fork 0
mirror of https://github.com/VSadov/Satori.git synced 2025-06-11 02:13:38 +09:00

Merge pull request #110370 from carlossanlop/release/9.0-staging

[manual] Merge release/9.0-staging into release/9.0
This commit is contained in:
Carlos Sánchez López 2024-12-03 12:23:19 -08:00 committed by GitHub
commit 462630b3c3
Signed by: github
GPG key ID: B5690EEEBB952194
80 changed files with 1696 additions and 2640 deletions

View file

@ -15,7 +15,7 @@
]
},
"microsoft.dotnet.xharness.cli": {
"version": "9.0.0-prerelease.24405.1",
"version": "9.0.0-prerelease.24575.3",
"commands": [
"xharness"
]

View file

@ -22,6 +22,7 @@ main PR <!-- Link to PR if any that fixed this in the main branch. -->
<!-- Please assess the risk of taking this fix. Provide details backing up your assessment. -->
# Package authoring signed off?
# Package authoring no longer needed in .NET 9
IMPORTANT: If this change touches code that ships in a NuGet package, please make certain that you have added any necessary [package authoring](../../docs/project/library-servicing.md) and gotten it explicitly reviewed.
IMPORTANT: Starting with .NET 9, you no longer need to edit a NuGet package's csproj to enable building and bump the version.
Keep in mind that we still need package authoring in .NET 8 and older versions.

View file

@ -48,4 +48,7 @@ jobs:
- The PR target branch is `release/X.0-staging`, not `release/X.0`.
- If the change touches code that ships in a NuGet package, you have added the necessary [package authoring](https://github.com/dotnet/runtime/blob/main/docs/project/library-servicing.md) and gotten it explicitly reviewed.
## Package authoring no longer needed in .NET 9
**IMPORTANT**: Starting with .NET 9, you no longer need to edit a NuGet package's csproj to enable building and bump the version.
Keep in mind that we still need package authoring in .NET 8 and older versions.

View file

@ -15,7 +15,7 @@ jobs:
os:
- name: linux
image: ubuntu-latest
container: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-cross-amd64-net9.0
container: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-cross-amd64
extension: '.sh'
cross: '--cross'
rootfs: '/crossrootfs/x64'

View file

@ -121,9 +121,8 @@
<NetFrameworkToolCurrent Condition="'$(DotNetBuildSourceOnly)' == 'true'" />
<NetFrameworkCurrent Condition="'$(DotNetBuildSourceOnly)' == 'true'" />
<!-- Important: Set this to the GA version (or a close approximation) during servicing and adjust the TFM property below. -->
<ApiCompatNetCoreAppBaselineVersion>8.0.0</ApiCompatNetCoreAppBaselineVersion>
<ApiCompatNetCoreAppBaselineTFM>net8.0</ApiCompatNetCoreAppBaselineTFM>
<ApiCompatNetCoreAppBaselineVersion>9.0.0</ApiCompatNetCoreAppBaselineVersion>
<ApiCompatNetCoreAppBaselineTFM>net9.0</ApiCompatNetCoreAppBaselineTFM>
</PropertyGroup>
<PropertyGroup Label="CalculateConfiguration">

View file

@ -9,8 +9,15 @@
<clear />
<!--Begin: Package sources managed by Dependency Flow automation. Do not edit the sources below.-->
<!-- Begin: Package sources from dotnet-emsdk -->
<add key="darc-pub-dotnet-emsdk-cd2146c" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-cd2146c9/nuget/v3/index.json" />
<add key="darc-pub-dotnet-emsdk-cd2146c-3" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-cd2146c9-3/nuget/v3/index.json" />
<add key="darc-pub-dotnet-emsdk-cd2146c-2" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-cd2146c9-2/nuget/v3/index.json" />
<add key="darc-pub-dotnet-emsdk-cd2146c-1" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-cd2146c9-1/nuget/v3/index.json" />
<add key="darc-pub-dotnet-emsdk-5a19723" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-5a197234/nuget/v3/index.json" />
<!-- End: Package sources from dotnet-emsdk -->
<!-- Begin: Package sources from dotnet-sdk -->
<add key="darc-pub-dotnet-sdk-cbec38b" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-sdk-cbec38b1/nuget/v3/index.json" />
<!-- End: Package sources from dotnet-sdk -->
<!--End: Package sources managed by Dependency Flow automation. Do not edit the sources above.-->
<!--
'src/test/PrepareTestAssets/PrepareTestAssets.proj' generates a NuGet.config file using this

View file

@ -8,17 +8,12 @@ Servicing branches represent shipped versions of .NET, and their name is in the
- `release/7.0-staging`
- `release/6.0-staging`
## Check if a package is generated
If a library is packable (check for the `<IsPackable>true</IsPackable>` property) you'll need to set `<GeneratePackageOnBuild>true</GeneratePackageOnBuild>` in the source project. That is necessary as packages aren't generated by default in servicing releases.
## Determine ServiceVersion
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.
IMPORTANT: Starting with .NET 9, you no longer need to edit a NuGet package's csproj to enable building and bump the version.
Keep in mind that we still need package authoring in .NET 8 and older versions.
## Test your changes
All that's left is to ensure that your changes have worked as expected. To do so, execute the following steps:
Develop and test your change as normal. For packages, you may want to test them outside the repo infrastructure. To do so, execute the following steps:
1. From a clean copy of your branch, run `build.cmd/sh libs -allconfigurations`

View file

@ -54,13 +54,13 @@ The images used for our official builds can be found in [the pipeline resources]
| Host OS | Target OS | Target Arch | Image | crossrootfs dir |
| --------------------- | ------------ | --------------- | -------------------------------------------------------------------------------------- | -------------------- |
| Azure Linux (x64) | Alpine 3.13 | x64 | `mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-cross-amd64-alpine-net9.0` | `/crossrootfs/x64` |
| Azure Linux (x64) | Ubuntu 16.04 | x64 | `mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-cross-amd64-net9.0` | `/crossrootfs/x64` |
| Azure Linux (x64) | Alpine | arm32 (armhf) | `mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-cross-arm-alpine-net9.0` | `/crossrootfs/arm` |
| Azure Linux (x64) | Ubuntu 16.04 | arm32 (armhf) | `mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-cross-arm-net9.0` | `/crossrootfs/arm` |
| Azure Linux (x64) | Alpine | arm64 (arm64v8) | `mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-cross-arm64-alpine-net9.0` | `/crossrootfs/arm64` |
| Azure Linux (x64) | Ubuntu 16.04 | arm64 (arm64v8) | `mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-cross-arm64-net9.0` | `/crossrootfs/arm64` |
| Azure Linux (x64) | Ubuntu 16.04 | x86 | `mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-cross-x86-net9.0` | `/crossrootfs/x86` |
| Azure Linux (x64) | Alpine 3.13 | x64 | `mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-cross-amd64-alpine` | `/crossrootfs/x64` |
| Azure Linux (x64) | Ubuntu 16.04 | x64 | `mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-cross-amd64` | `/crossrootfs/x64` |
| Azure Linux (x64) | Alpine | arm32 (armhf) | `mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-cross-arm-alpine` | `/crossrootfs/arm` |
| Azure Linux (x64) | Ubuntu 16.04 | arm32 (armhf) | `mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-cross-arm` | `/crossrootfs/arm` |
| Azure Linux (x64) | Alpine | arm64 (arm64v8) | `mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-cross-arm64-alpine` | `/crossrootfs/arm64` |
| Azure Linux (x64) | Ubuntu 16.04 | arm64 (arm64v8) | `mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-cross-arm64` | `/crossrootfs/arm64` |
| Azure Linux (x64) | Ubuntu 16.04 | x86 | `mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-cross-x86` | `/crossrootfs/x86` |
Notes:
@ -70,21 +70,21 @@ Notes:
The following images are used for more extended scenarios, including for community-supported builds, and may require different patterns of use.
| Host OS | Target OS | Target Arch | Image | crossrootfs dir |
| --------------------- | ------------ | --------------- | -------------------------------------------------------------------------------------- | -------------------- |
| Azure Linux (x64) | Android Bionic | x64 | `mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-cross-android-amd64-net9.0`| |
| Azure Linux (x64) | Android Bionic (w/OpenSSL) | x64 | `mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-android-openssl-net9.0` | |
| Azure Linux (x64) | Android Bionic (w/Docker) | x64 | `mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-android-docker-net9.0` | |
| Azure Linux (x64) | Azure Linux 3.0 | x64 | `mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-fpm-net9.0` | |
| Azure Linux (x64) | FreeBSD 13 | x64 | `mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-cross-freebsd-13-net9.0` | `/crossrootfs/x64` |
| Azure Linux (x64) | Ubuntu 18.04 | PPC64le | `mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-cross-ppc64le-net9.0` | `/crossrootfs/ppc64le` |
| Azure Linux (x64) | Ubuntu 24.04 | RISC-V | `mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-cross-riscv64-net9.0` | `/crossrootfs/riscv64` |
| Azure Linux (x64) | Ubuntu 18.04 | S390x | `mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-cross-s390x-net9.0` | `/crossrootfs/s390x` |
| Azure Linux (x64) | Ubuntu 16.04 (Wasm) | x64 | `mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-webassembly-amd64-net9.0` | `/crossrootfs/x64` |
| Debian (x64) | Debian 12 | x64 | `mcr.microsoft.com/dotnet-buildtools/prereqs:debian-12-gcc14-amd64` | `/crossrootfs/armv6` |
| Ubuntu (x64) | Ubuntu 22.04 | x64 | `mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-22.04-debpkg` | |
| Ubuntu (x64) | Tizen 9.0 | Arm32 (armel) | `mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-22.04-cross-armel-tizen` | `/crossrootfs/armel` |
| Ubuntu (x64) | Ubuntu 20.04 | Arm32 (v6) | `mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-20.04-cross-armv6-raspbian-10` | `/crossrootfs/armv6` |
| Host OS | Target OS | Target Arch | Image | crossrootfs dir |
| --------------------- | -------------------------- | ----------------- | -------------------------------------------------------------------------------------- | ---------------------- |
| Azure Linux (x64) | Android Bionic | x64 | `mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-cross-android-amd64`| |
| Azure Linux (x64) | Android Bionic (w/OpenSSL) | x64 | `mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-android-openssl` | |
| Azure Linux (x64) | Android Bionic (w/Docker) | x64 | `mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-android-docker` | |
| Azure Linux (x64) | Azure Linux 3.0 | x64 | `mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-fpm` | |
| Azure Linux (x64) | FreeBSD 13 | x64 | `mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-cross-freebsd-13` | `/crossrootfs/x64` |
| Azure Linux (x64) | Ubuntu 18.04 | PPC64le | `mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-cross-ppc64le` | `/crossrootfs/ppc64le` |
| Azure Linux (x64) | Ubuntu 24.04 | RISC-V | `mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-cross-riscv64` | `/crossrootfs/riscv64` |
| Azure Linux (x64) | Ubuntu 18.04 | S390x | `mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-cross-s390x` | `/crossrootfs/s390x` |
| Azure Linux (x64) | Ubuntu 16.04 (Wasm) | x64 | `mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-webassembly-amd64` | `/crossrootfs/x64` |
| Debian (x64) | Debian 12 | x64 | `mcr.microsoft.com/dotnet-buildtools/prereqs:debian-12-gcc14-amd64` | `/crossrootfs/armv6` |
| Ubuntu (x64) | Ubuntu 22.04 | x64 | `mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-22.04-debpkg` | |
| Ubuntu (x64) | Tizen 9.0 | Arm32 (armel) | `mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-22.04-cross-armel-tizen` | `/crossrootfs/armel` |
| Ubuntu (x64) | Ubuntu 20.04 | Arm32 (v6) | `mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-20.04-cross-armv6-raspbian-10` | `/crossrootfs/armv6` |
## Build using your own Environment

View file

@ -1,8 +1,8 @@
<Dependencies>
<ProductDependencies>
<Dependency Name="Microsoft.NETCore.Runtime.ICU.Transport" Version="9.0.0-rtm.24516.3">
<Dependency Name="Microsoft.NETCore.Runtime.ICU.Transport" Version="9.0.0-rtm.24572.1">
<Uri>https://github.com/dotnet/icu</Uri>
<Sha>34490a33d2316c2af4d6247e881d6a26b1d8977c</Sha>
<Sha>16e84948879d9ffb9b13a3df1c1f537dee2131db</Sha>
</Dependency>
<Dependency Name="System.Net.MsQuic.Transport" Version="9.0.0-alpha.1.24167.3">
<Uri>https://github.com/dotnet/msquic</Uri>
@ -54,14 +54,14 @@
<Sha>803d8598f98fb4efd94604b32627ee9407f246db</Sha>
<SourceBuild RepoName="command-line-api" ManagedOnly="true" />
</Dependency>
<Dependency Name="Microsoft.DotNet.Cecil" Version="0.11.5-alpha.24515.1">
<Dependency Name="Microsoft.DotNet.Cecil" Version="0.11.5-alpha.24602.1">
<Uri>https://github.com/dotnet/cecil</Uri>
<Sha>e51bd3677d5674fa34bf5676c5fc5562206bf94e</Sha>
<Sha>72791f7604750fb8af9249b94318547c5f1d6683</Sha>
</Dependency>
<!-- Intermediate is necessary for source build. -->
<Dependency Name="Microsoft.SourceBuild.Intermediate.cecil" Version="0.11.5-alpha.24515.1">
<Dependency Name="Microsoft.SourceBuild.Intermediate.cecil" Version="0.11.5-alpha.24602.1">
<Uri>https://github.com/dotnet/cecil</Uri>
<Sha>e51bd3677d5674fa34bf5676c5fc5562206bf94e</Sha>
<Sha>72791f7604750fb8af9249b94318547c5f1d6683</Sha>
<SourceBuild RepoName="cecil" ManagedOnly="true" />
</Dependency>
<Dependency Name="Microsoft.NET.Workload.Emscripten.Current.Manifest-9.0.100.Transport" Version="9.0.1-servicing.24571.2">
@ -79,152 +79,152 @@
<SourceBuild RepoName="emsdk" ManagedOnly="true" />
</Dependency>
<!-- Intermediate is necessary for source build. -->
<Dependency Name="Microsoft.SourceBuild.Intermediate.source-build-reference-packages" Version="9.0.0-alpha.1.24511.3">
<Dependency Name="Microsoft.SourceBuild.Intermediate.source-build-reference-packages" Version="9.0.0-alpha.1.24568.3">
<Uri>https://github.com/dotnet/source-build-reference-packages</Uri>
<Sha>c43ee853e96528e2f2eb0f6d8c151ddc07b6a844</Sha>
<Sha>a3776f67d97bd5d9ada92122330454b284bfe915</Sha>
<SourceBuild RepoName="source-build-reference-packages" ManagedOnly="true" />
</Dependency>
<!-- Intermediate is necessary for source build. -->
<Dependency Name="Microsoft.SourceBuild.Intermediate.source-build-externals" Version="9.0.0-alpha.1.24516.3">
<Dependency Name="Microsoft.SourceBuild.Intermediate.source-build-externals" Version="9.0.0-alpha.1.24575.1">
<Uri>https://github.com/dotnet/source-build-externals</Uri>
<Sha>4df883d781a4290873b3b968afc0ff0df7132507</Sha>
<Sha>ab469606a3e6b026dcac301e2dab96117c94faeb</Sha>
<SourceBuild RepoName="source-build-externals" ManagedOnly="true" />
</Dependency>
</ProductDependencies>
<ToolsetDependencies>
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="9.0.0-beta.24516.2">
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="9.0.0-beta.24572.2">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>3c393bbd85ae16ddddba20d0b75035b0c6f1a52d</Sha>
<Sha>b41381d5cd633471265e9cd72e933a7048e03062</Sha>
</Dependency>
<!-- Intermediate is necessary for source build. -->
<Dependency Name="Microsoft.SourceBuild.Intermediate.arcade" Version="9.0.0-beta.24516.2">
<Dependency Name="Microsoft.SourceBuild.Intermediate.arcade" Version="9.0.0-beta.24572.2">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>3c393bbd85ae16ddddba20d0b75035b0c6f1a52d</Sha>
<Sha>b41381d5cd633471265e9cd72e933a7048e03062</Sha>
<SourceBuild RepoName="arcade" ManagedOnly="true" />
</Dependency>
<Dependency Name="Microsoft.DotNet.XliffTasks" Version="9.0.0-beta.24516.2">
<Dependency Name="Microsoft.DotNet.XliffTasks" Version="9.0.0-beta.24572.2">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>3c393bbd85ae16ddddba20d0b75035b0c6f1a52d</Sha>
<Sha>b41381d5cd633471265e9cd72e933a7048e03062</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="9.0.0-beta.24516.2">
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="9.0.0-beta.24572.2">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>3c393bbd85ae16ddddba20d0b75035b0c6f1a52d</Sha>
<Sha>b41381d5cd633471265e9cd72e933a7048e03062</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.GenAPI" Version="9.0.0-beta.24516.2">
<Dependency Name="Microsoft.DotNet.GenAPI" Version="9.0.0-beta.24572.2">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>3c393bbd85ae16ddddba20d0b75035b0c6f1a52d</Sha>
<Sha>b41381d5cd633471265e9cd72e933a7048e03062</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.GenFacades" Version="9.0.0-beta.24516.2">
<Dependency Name="Microsoft.DotNet.GenFacades" Version="9.0.0-beta.24572.2">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>3c393bbd85ae16ddddba20d0b75035b0c6f1a52d</Sha>
<Sha>b41381d5cd633471265e9cd72e933a7048e03062</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.XUnitAssert" Version="2.9.0-beta.24516.2">
<Dependency Name="Microsoft.DotNet.XUnitAssert" Version="2.9.0-beta.24572.2">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>3c393bbd85ae16ddddba20d0b75035b0c6f1a52d</Sha>
<Sha>b41381d5cd633471265e9cd72e933a7048e03062</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.XUnitExtensions" Version="9.0.0-beta.24516.2">
<Dependency Name="Microsoft.DotNet.XUnitExtensions" Version="9.0.0-beta.24572.2">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>3c393bbd85ae16ddddba20d0b75035b0c6f1a52d</Sha>
<Sha>b41381d5cd633471265e9cd72e933a7048e03062</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.XUnitConsoleRunner" Version="2.9.0-beta.24516.2">
<Dependency Name="Microsoft.DotNet.XUnitConsoleRunner" Version="2.9.0-beta.24572.2">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>3c393bbd85ae16ddddba20d0b75035b0c6f1a52d</Sha>
<Sha>b41381d5cd633471265e9cd72e933a7048e03062</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.Build.Tasks.Archives" Version="9.0.0-beta.24516.2">
<Dependency Name="Microsoft.DotNet.Build.Tasks.Archives" Version="9.0.0-beta.24572.2">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>3c393bbd85ae16ddddba20d0b75035b0c6f1a52d</Sha>
<Sha>b41381d5cd633471265e9cd72e933a7048e03062</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.Build.Tasks.Packaging" Version="9.0.0-beta.24516.2">
<Dependency Name="Microsoft.DotNet.Build.Tasks.Packaging" Version="9.0.0-beta.24572.2">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>3c393bbd85ae16ddddba20d0b75035b0c6f1a52d</Sha>
<Sha>b41381d5cd633471265e9cd72e933a7048e03062</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.Build.Tasks.Installers" Version="9.0.0-beta.24516.2">
<Dependency Name="Microsoft.DotNet.Build.Tasks.Installers" Version="9.0.0-beta.24572.2">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>3c393bbd85ae16ddddba20d0b75035b0c6f1a52d</Sha>
<Sha>b41381d5cd633471265e9cd72e933a7048e03062</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.Build.Tasks.Templating" Version="9.0.0-beta.24516.2">
<Dependency Name="Microsoft.DotNet.Build.Tasks.Templating" Version="9.0.0-beta.24572.2">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>3c393bbd85ae16ddddba20d0b75035b0c6f1a52d</Sha>
<Sha>b41381d5cd633471265e9cd72e933a7048e03062</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.Build.Tasks.Workloads" Version="9.0.0-beta.24516.2">
<Dependency Name="Microsoft.DotNet.Build.Tasks.Workloads" Version="9.0.0-beta.24572.2">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>3c393bbd85ae16ddddba20d0b75035b0c6f1a52d</Sha>
<Sha>b41381d5cd633471265e9cd72e933a7048e03062</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.CodeAnalysis" Version="9.0.0-beta.24516.2">
<Dependency Name="Microsoft.DotNet.CodeAnalysis" Version="9.0.0-beta.24572.2">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>3c393bbd85ae16ddddba20d0b75035b0c6f1a52d</Sha>
<Sha>b41381d5cd633471265e9cd72e933a7048e03062</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.Build.Tasks.TargetFramework" Version="9.0.0-beta.24516.2">
<Dependency Name="Microsoft.DotNet.Build.Tasks.TargetFramework" Version="9.0.0-beta.24572.2">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>3c393bbd85ae16ddddba20d0b75035b0c6f1a52d</Sha>
<Sha>b41381d5cd633471265e9cd72e933a7048e03062</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.RemoteExecutor" Version="9.0.0-beta.24516.2">
<Dependency Name="Microsoft.DotNet.RemoteExecutor" Version="9.0.0-beta.24572.2">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>3c393bbd85ae16ddddba20d0b75035b0c6f1a52d</Sha>
<Sha>b41381d5cd633471265e9cd72e933a7048e03062</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.Build.Tasks.Feed" Version="9.0.0-beta.24516.2">
<Dependency Name="Microsoft.DotNet.Build.Tasks.Feed" Version="9.0.0-beta.24572.2">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>3c393bbd85ae16ddddba20d0b75035b0c6f1a52d</Sha>
<Sha>b41381d5cd633471265e9cd72e933a7048e03062</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.VersionTools.Tasks" Version="9.0.0-beta.24516.2">
<Dependency Name="Microsoft.DotNet.VersionTools.Tasks" Version="9.0.0-beta.24572.2">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>3c393bbd85ae16ddddba20d0b75035b0c6f1a52d</Sha>
<Sha>b41381d5cd633471265e9cd72e933a7048e03062</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.SharedFramework.Sdk" Version="9.0.0-beta.24516.2">
<Dependency Name="Microsoft.DotNet.SharedFramework.Sdk" Version="9.0.0-beta.24572.2">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>3c393bbd85ae16ddddba20d0b75035b0c6f1a52d</Sha>
<Sha>b41381d5cd633471265e9cd72e933a7048e03062</Sha>
</Dependency>
<Dependency Name="System.ComponentModel.TypeConverter.TestData" Version="9.0.0-beta.24459.2">
<Dependency Name="System.ComponentModel.TypeConverter.TestData" Version="9.0.0-beta.24517.2">
<Uri>https://github.com/dotnet/runtime-assets</Uri>
<Sha>e98370e661a19bdfed31eefb8740ecfad255f9ed</Sha>
<Sha>be3ffb86e48ffd7f75babda38cba492aa058f04f</Sha>
</Dependency>
<Dependency Name="System.Data.Common.TestData" Version="9.0.0-beta.24459.2">
<Dependency Name="System.Data.Common.TestData" Version="9.0.0-beta.24517.2">
<Uri>https://github.com/dotnet/runtime-assets</Uri>
<Sha>e98370e661a19bdfed31eefb8740ecfad255f9ed</Sha>
<Sha>be3ffb86e48ffd7f75babda38cba492aa058f04f</Sha>
</Dependency>
<Dependency Name="System.Drawing.Common.TestData" Version="9.0.0-beta.24459.2">
<Dependency Name="System.Drawing.Common.TestData" Version="9.0.0-beta.24517.2">
<Uri>https://github.com/dotnet/runtime-assets</Uri>
<Sha>e98370e661a19bdfed31eefb8740ecfad255f9ed</Sha>
<Sha>be3ffb86e48ffd7f75babda38cba492aa058f04f</Sha>
</Dependency>
<Dependency Name="System.Formats.Tar.TestData" Version="9.0.0-beta.24459.2">
<Dependency Name="System.Formats.Tar.TestData" Version="9.0.0-beta.24517.2">
<Uri>https://github.com/dotnet/runtime-assets</Uri>
<Sha>e98370e661a19bdfed31eefb8740ecfad255f9ed</Sha>
<Sha>be3ffb86e48ffd7f75babda38cba492aa058f04f</Sha>
</Dependency>
<Dependency Name="System.IO.Compression.TestData" Version="9.0.0-beta.24459.2">
<Dependency Name="System.IO.Compression.TestData" Version="9.0.0-beta.24517.2">
<Uri>https://github.com/dotnet/runtime-assets</Uri>
<Sha>e98370e661a19bdfed31eefb8740ecfad255f9ed</Sha>
<Sha>be3ffb86e48ffd7f75babda38cba492aa058f04f</Sha>
</Dependency>
<Dependency Name="System.IO.Packaging.TestData" Version="9.0.0-beta.24459.2">
<Dependency Name="System.IO.Packaging.TestData" Version="9.0.0-beta.24517.2">
<Uri>https://github.com/dotnet/runtime-assets</Uri>
<Sha>e98370e661a19bdfed31eefb8740ecfad255f9ed</Sha>
<Sha>be3ffb86e48ffd7f75babda38cba492aa058f04f</Sha>
</Dependency>
<Dependency Name="System.Net.TestData" Version="9.0.0-beta.24459.2">
<Dependency Name="System.Net.TestData" Version="9.0.0-beta.24517.2">
<Uri>https://github.com/dotnet/runtime-assets</Uri>
<Sha>e98370e661a19bdfed31eefb8740ecfad255f9ed</Sha>
<Sha>be3ffb86e48ffd7f75babda38cba492aa058f04f</Sha>
</Dependency>
<Dependency Name="System.Private.Runtime.UnicodeData" Version="9.0.0-beta.24459.2">
<Dependency Name="System.Private.Runtime.UnicodeData" Version="9.0.0-beta.24517.2">
<Uri>https://github.com/dotnet/runtime-assets</Uri>
<Sha>e98370e661a19bdfed31eefb8740ecfad255f9ed</Sha>
<Sha>be3ffb86e48ffd7f75babda38cba492aa058f04f</Sha>
</Dependency>
<Dependency Name="System.Runtime.TimeZoneData" Version="9.0.0-beta.24459.2">
<Dependency Name="System.Runtime.TimeZoneData" Version="9.0.0-beta.24517.2">
<Uri>https://github.com/dotnet/runtime-assets</Uri>
<Sha>e98370e661a19bdfed31eefb8740ecfad255f9ed</Sha>
<Sha>be3ffb86e48ffd7f75babda38cba492aa058f04f</Sha>
</Dependency>
<Dependency Name="System.Security.Cryptography.X509Certificates.TestData" Version="9.0.0-beta.24459.2">
<Dependency Name="System.Security.Cryptography.X509Certificates.TestData" Version="9.0.0-beta.24517.2">
<Uri>https://github.com/dotnet/runtime-assets</Uri>
<Sha>e98370e661a19bdfed31eefb8740ecfad255f9ed</Sha>
<Sha>be3ffb86e48ffd7f75babda38cba492aa058f04f</Sha>
</Dependency>
<Dependency Name="System.Text.RegularExpressions.TestData" Version="9.0.0-beta.24459.2">
<Dependency Name="System.Text.RegularExpressions.TestData" Version="9.0.0-beta.24517.2">
<Uri>https://github.com/dotnet/runtime-assets</Uri>
<Sha>e98370e661a19bdfed31eefb8740ecfad255f9ed</Sha>
<Sha>be3ffb86e48ffd7f75babda38cba492aa058f04f</Sha>
</Dependency>
<Dependency Name="System.Windows.Extensions.TestData" Version="9.0.0-beta.24459.2">
<Dependency Name="System.Windows.Extensions.TestData" Version="9.0.0-beta.24517.2">
<Uri>https://github.com/dotnet/runtime-assets</Uri>
<Sha>e98370e661a19bdfed31eefb8740ecfad255f9ed</Sha>
<Sha>be3ffb86e48ffd7f75babda38cba492aa058f04f</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.CilStrip.Sources" Version="9.0.0-beta.24459.2">
<Dependency Name="Microsoft.DotNet.CilStrip.Sources" Version="9.0.0-beta.24517.2">
<Uri>https://github.com/dotnet/runtime-assets</Uri>
<Sha>e98370e661a19bdfed31eefb8740ecfad255f9ed</Sha>
<Sha>be3ffb86e48ffd7f75babda38cba492aa058f04f</Sha>
</Dependency>
<Dependency Name="runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk" Version="19.1.0-alpha.1.24554.4" CoherentParentDependency="Microsoft.NET.Workload.Emscripten.Current.Manifest-9.0.100.Transport">
<Uri>https://github.com/dotnet/llvm-project</Uri>
@ -320,21 +320,21 @@
<Uri>https://github.com/dotnet/runtime</Uri>
<Sha>b030c4dfdfa1bf287f10f96006619a06bc2000ae</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.XHarness.TestRunners.Common" Version="9.0.0-prerelease.24405.1">
<Dependency Name="Microsoft.DotNet.XHarness.TestRunners.Common" Version="9.0.0-prerelease.24575.3">
<Uri>https://github.com/dotnet/xharness</Uri>
<Sha>9794254fa909ff5adc46326e9b54009793f61dcd</Sha>
<Sha>22c8d5baf6124c74e7cf3c1eaf4343cdf086b9e3</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.XHarness.TestRunners.Xunit" Version="9.0.0-prerelease.24405.1">
<Dependency Name="Microsoft.DotNet.XHarness.TestRunners.Xunit" Version="9.0.0-prerelease.24575.3">
<Uri>https://github.com/dotnet/xharness</Uri>
<Sha>9794254fa909ff5adc46326e9b54009793f61dcd</Sha>
<Sha>22c8d5baf6124c74e7cf3c1eaf4343cdf086b9e3</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.XHarness.CLI" Version="9.0.0-prerelease.24405.1">
<Dependency Name="Microsoft.DotNet.XHarness.CLI" Version="9.0.0-prerelease.24575.3">
<Uri>https://github.com/dotnet/xharness</Uri>
<Sha>9794254fa909ff5adc46326e9b54009793f61dcd</Sha>
<Sha>22c8d5baf6124c74e7cf3c1eaf4343cdf086b9e3</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.PackageTesting" Version="9.0.0-beta.24516.2">
<Dependency Name="Microsoft.DotNet.PackageTesting" Version="9.0.0-beta.24572.2">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>3c393bbd85ae16ddddba20d0b75035b0c6f1a52d</Sha>
<Sha>b41381d5cd633471265e9cd72e933a7048e03062</Sha>
</Dependency>
<Dependency Name="optimization.windows_nt-x64.MIBC.Runtime" Version="1.0.0-prerelease.24462.2">
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-optimization</Uri>
@ -352,48 +352,48 @@
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-optimization</Uri>
<Sha>9d7532585ce71e30ab55f0364d3cecccaf0775d1</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.HotReload.Utils.Generator.BuildTool" Version="9.0.0-alpha.0.24514.3">
<Dependency Name="Microsoft.DotNet.HotReload.Utils.Generator.BuildTool" Version="9.0.0-alpha.0.24561.2">
<Uri>https://github.com/dotnet/hotreload-utils</Uri>
<Sha>bf7e87a8574449a441bf905e2acd38e4aa25b3d4</Sha>
<Sha>4fcdfb487f36e9e27d90ad64294dbce7a15bc6ab</Sha>
</Dependency>
<Dependency Name="System.Runtime.Numerics.TestData" Version="9.0.0-beta.24459.2">
<Dependency Name="System.Runtime.Numerics.TestData" Version="9.0.0-beta.24517.2">
<Uri>https://github.com/dotnet/runtime-assets</Uri>
<Sha>e98370e661a19bdfed31eefb8740ecfad255f9ed</Sha>
<Sha>be3ffb86e48ffd7f75babda38cba492aa058f04f</Sha>
</Dependency>
<Dependency Name="Microsoft.Net.Compilers.Toolset" Version="4.12.0-3.24516.15">
<Dependency Name="Microsoft.Net.Compilers.Toolset" Version="4.12.0-3.24574.8">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>3bff3622487486dec7794dfd0c71e05a52c313a4</Sha>
<Sha>dfa7fc6bdea31a858a402168384192b633c811fa</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis" Version="4.12.0-3.24516.15">
<Dependency Name="Microsoft.CodeAnalysis" Version="4.12.0-3.24574.8">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>3bff3622487486dec7794dfd0c71e05a52c313a4</Sha>
<Sha>dfa7fc6bdea31a858a402168384192b633c811fa</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.CSharp" Version="4.12.0-3.24516.15">
<Dependency Name="Microsoft.CodeAnalysis.CSharp" Version="4.12.0-3.24574.8">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>3bff3622487486dec7794dfd0c71e05a52c313a4</Sha>
<Sha>dfa7fc6bdea31a858a402168384192b633c811fa</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0-beta1.24508.2">
<Dependency Name="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0-beta1.24574.2">
<Uri>https://github.com/dotnet/roslyn-analyzers</Uri>
<Sha>3d61c57c73c3dd5f1f407ef9cd3414d94bf0eaf2</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.NetAnalyzers" Version="9.0.0-preview.24508.2">
<Dependency Name="Microsoft.CodeAnalysis.NetAnalyzers" Version="9.0.0-preview.24574.2">
<Uri>https://github.com/dotnet/roslyn-analyzers</Uri>
<Sha>3d61c57c73c3dd5f1f407ef9cd3414d94bf0eaf2</Sha>
</Dependency>
<!-- Intermediate is necessary for source build. -->
<Dependency Name="Microsoft.SourceBuild.Intermediate.roslyn" Version="4.12.0-3.24516.15">
<Dependency Name="Microsoft.SourceBuild.Intermediate.roslyn" Version="4.12.0-3.24574.8">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>3bff3622487486dec7794dfd0c71e05a52c313a4</Sha>
<Sha>dfa7fc6bdea31a858a402168384192b633c811fa</Sha>
<SourceBuild RepoName="roslyn" ManagedOnly="true" />
</Dependency>
<Dependency Name="Microsoft.DotNet.ApiCompat.Task" Version="9.0.100-rtm.24512.1">
<Dependency Name="Microsoft.DotNet.ApiCompat.Task" Version="9.0.102">
<Uri>https://github.com/dotnet/sdk</Uri>
<Sha>5b9d9d4677ea31d954533e9de2f95a3ea638135d</Sha>
<Sha>cbec38b13edc53f701225f8f087fb5a2dbfd3679</Sha>
</Dependency>
<!-- Intermediate is necessary for source build. -->
<Dependency Name="Microsoft.SourceBuild.Intermediate.sdk" Version="9.0.100-rtm.24512.1">
<Dependency Name="Microsoft.SourceBuild.Intermediate.sdk" Version="9.0.102-servicing.24579.1">
<Uri>https://github.com/dotnet/sdk</Uri>
<Sha>5b9d9d4677ea31d954533e9de2f95a3ea638135d</Sha>
<Sha>cbec38b13edc53f701225f8f087fb5a2dbfd3679</Sha>
<SourceBuild RepoName="sdk" ManagedOnly="true" />
</Dependency>
<Dependency Name="optimization.windows_nt-arm64.MIBC.Runtime" Version="1.0.0-prerelease.24462.2">

View file

@ -10,7 +10,7 @@
<PackageVersionNet8>8.0.11</PackageVersionNet8>
<PackageVersionNet7>7.0.20</PackageVersionNet7>
<PackageVersionNet6>6.0.36</PackageVersionNet6>
<PreReleaseVersionLabel>rtm</PreReleaseVersionLabel>
<PreReleaseVersionLabel>servicing</PreReleaseVersionLabel>
<PreReleaseVersionIteration>
</PreReleaseVersionIteration>
<!-- Enable to remove prerelease label. -->
@ -36,17 +36,17 @@
</ItemGroup>
<PropertyGroup>
<!-- dotnet/roslyn-analyzers dependencies -->
<MicrosoftCodeAnalysisAnalyzersVersion>3.11.0-beta1.24508.2</MicrosoftCodeAnalysisAnalyzersVersion>
<MicrosoftCodeAnalysisNetAnalyzersVersion>9.0.0-preview.24508.2</MicrosoftCodeAnalysisNetAnalyzersVersion>
<MicrosoftCodeAnalysisAnalyzersVersion>3.11.0-beta1.24574.2</MicrosoftCodeAnalysisAnalyzersVersion>
<MicrosoftCodeAnalysisNetAnalyzersVersion>9.0.0-preview.24574.2</MicrosoftCodeAnalysisNetAnalyzersVersion>
<!-- dotnet/roslyn dependencies -->
<!--
These versions should not be used by any project that contributes to the design-time experience in VS, such as an analyzer, code-fix, or generator assembly.
Any tools that contribute to the design-time experience should use the MicrosoftCodeAnalysisVersion_LatestVS property above to ensure
they do not break the local dev experience.
-->
<MicrosoftCodeAnalysisCSharpVersion>4.12.0-3.24516.15</MicrosoftCodeAnalysisCSharpVersion>
<MicrosoftCodeAnalysisVersion>4.12.0-3.24516.15</MicrosoftCodeAnalysisVersion>
<MicrosoftNetCompilersToolsetVersion>4.12.0-3.24516.15</MicrosoftNetCompilersToolsetVersion>
<MicrosoftCodeAnalysisCSharpVersion>4.12.0-3.24574.8</MicrosoftCodeAnalysisCSharpVersion>
<MicrosoftCodeAnalysisVersion>4.12.0-3.24574.8</MicrosoftCodeAnalysisVersion>
<MicrosoftNetCompilersToolsetVersion>4.12.0-3.24574.8</MicrosoftNetCompilersToolsetVersion>
</PropertyGroup>
<!--
For source generator support we need to target multiple versions of Roslyn in order to be able to run on older versions of Roslyn.
@ -83,24 +83,24 @@
<PropertyGroup>
<StaticCsVersion>0.2.0</StaticCsVersion>
<!-- SDK dependencies (also used in wasm build tests -->
<MicrosoftDotNetApiCompatTaskVersion>9.0.100-rtm.24512.1</MicrosoftDotNetApiCompatTaskVersion>
<MicrosoftDotNetApiCompatTaskVersion>9.0.102</MicrosoftDotNetApiCompatTaskVersion>
<!-- Arcade dependencies -->
<MicrosoftDotNetBuildTasksFeedVersion>9.0.0-beta.24516.2</MicrosoftDotNetBuildTasksFeedVersion>
<MicrosoftDotNetCodeAnalysisVersion>9.0.0-beta.24516.2</MicrosoftDotNetCodeAnalysisVersion>
<MicrosoftDotNetGenAPIVersion>9.0.0-beta.24516.2</MicrosoftDotNetGenAPIVersion>
<MicrosoftDotNetGenFacadesVersion>9.0.0-beta.24516.2</MicrosoftDotNetGenFacadesVersion>
<MicrosoftDotNetXUnitAssertVersion>2.9.0-beta.24516.2</MicrosoftDotNetXUnitAssertVersion>
<MicrosoftDotNetXUnitExtensionsVersion>9.0.0-beta.24516.2</MicrosoftDotNetXUnitExtensionsVersion>
<MicrosoftDotNetXUnitConsoleRunnerVersion>2.9.0-beta.24516.2</MicrosoftDotNetXUnitConsoleRunnerVersion>
<MicrosoftDotNetBuildTasksArchivesVersion>9.0.0-beta.24516.2</MicrosoftDotNetBuildTasksArchivesVersion>
<MicrosoftDotNetBuildTasksInstallersVersion>9.0.0-beta.24516.2</MicrosoftDotNetBuildTasksInstallersVersion>
<MicrosoftDotNetBuildTasksPackagingVersion>9.0.0-beta.24516.2</MicrosoftDotNetBuildTasksPackagingVersion>
<MicrosoftDotNetBuildTasksTargetFrameworkVersion>9.0.0-beta.24516.2</MicrosoftDotNetBuildTasksTargetFrameworkVersion>
<MicrosoftDotNetBuildTasksTemplatingVersion>9.0.0-beta.24516.2</MicrosoftDotNetBuildTasksTemplatingVersion>
<MicrosoftDotNetBuildTasksWorkloadsPackageVersion>9.0.0-beta.24516.2</MicrosoftDotNetBuildTasksWorkloadsPackageVersion>
<MicrosoftDotNetRemoteExecutorVersion>9.0.0-beta.24516.2</MicrosoftDotNetRemoteExecutorVersion>
<MicrosoftDotNetVersionToolsTasksVersion>9.0.0-beta.24516.2</MicrosoftDotNetVersionToolsTasksVersion>
<MicrosoftDotNetPackageTestingVersion>9.0.0-beta.24516.2</MicrosoftDotNetPackageTestingVersion>
<MicrosoftDotNetBuildTasksFeedVersion>9.0.0-beta.24572.2</MicrosoftDotNetBuildTasksFeedVersion>
<MicrosoftDotNetCodeAnalysisVersion>9.0.0-beta.24572.2</MicrosoftDotNetCodeAnalysisVersion>
<MicrosoftDotNetGenAPIVersion>9.0.0-beta.24572.2</MicrosoftDotNetGenAPIVersion>
<MicrosoftDotNetGenFacadesVersion>9.0.0-beta.24572.2</MicrosoftDotNetGenFacadesVersion>
<MicrosoftDotNetXUnitAssertVersion>2.9.0-beta.24572.2</MicrosoftDotNetXUnitAssertVersion>
<MicrosoftDotNetXUnitExtensionsVersion>9.0.0-beta.24572.2</MicrosoftDotNetXUnitExtensionsVersion>
<MicrosoftDotNetXUnitConsoleRunnerVersion>2.9.0-beta.24572.2</MicrosoftDotNetXUnitConsoleRunnerVersion>
<MicrosoftDotNetBuildTasksArchivesVersion>9.0.0-beta.24572.2</MicrosoftDotNetBuildTasksArchivesVersion>
<MicrosoftDotNetBuildTasksInstallersVersion>9.0.0-beta.24572.2</MicrosoftDotNetBuildTasksInstallersVersion>
<MicrosoftDotNetBuildTasksPackagingVersion>9.0.0-beta.24572.2</MicrosoftDotNetBuildTasksPackagingVersion>
<MicrosoftDotNetBuildTasksTargetFrameworkVersion>9.0.0-beta.24572.2</MicrosoftDotNetBuildTasksTargetFrameworkVersion>
<MicrosoftDotNetBuildTasksTemplatingVersion>9.0.0-beta.24572.2</MicrosoftDotNetBuildTasksTemplatingVersion>
<MicrosoftDotNetBuildTasksWorkloadsPackageVersion>9.0.0-beta.24572.2</MicrosoftDotNetBuildTasksWorkloadsPackageVersion>
<MicrosoftDotNetRemoteExecutorVersion>9.0.0-beta.24572.2</MicrosoftDotNetRemoteExecutorVersion>
<MicrosoftDotNetVersionToolsTasksVersion>9.0.0-beta.24572.2</MicrosoftDotNetVersionToolsTasksVersion>
<MicrosoftDotNetPackageTestingVersion>9.0.0-beta.24572.2</MicrosoftDotNetPackageTestingVersion>
<!-- TODO: Remove pinned xunit.analyzers version: https://github.com/dotnet/runtime/issues/97088 -->
<XUnitAnalyzersVersion>1.4.0</XUnitAnalyzersVersion>
<!-- NuGet dependencies -->
@ -141,20 +141,20 @@
<SystemReflectionMetadataToolsetVersion>8.0.0</SystemReflectionMetadataToolsetVersion>
<SystemReflectionMetadataLoadContextToolsetVersion>8.0.0</SystemReflectionMetadataLoadContextToolsetVersion>
<!-- Runtime-Assets dependencies -->
<SystemRuntimeNumericsTestDataVersion>9.0.0-beta.24459.2</SystemRuntimeNumericsTestDataVersion>
<SystemComponentModelTypeConverterTestDataVersion>9.0.0-beta.24459.2</SystemComponentModelTypeConverterTestDataVersion>
<SystemDataCommonTestDataVersion>9.0.0-beta.24459.2</SystemDataCommonTestDataVersion>
<SystemDrawingCommonTestDataVersion>9.0.0-beta.24459.2</SystemDrawingCommonTestDataVersion>
<SystemFormatsTarTestDataVersion>9.0.0-beta.24459.2</SystemFormatsTarTestDataVersion>
<SystemIOCompressionTestDataVersion>9.0.0-beta.24459.2</SystemIOCompressionTestDataVersion>
<SystemIOPackagingTestDataVersion>9.0.0-beta.24459.2</SystemIOPackagingTestDataVersion>
<SystemNetTestDataVersion>9.0.0-beta.24459.2</SystemNetTestDataVersion>
<SystemPrivateRuntimeUnicodeDataVersion>9.0.0-beta.24459.2</SystemPrivateRuntimeUnicodeDataVersion>
<SystemRuntimeTimeZoneDataVersion>9.0.0-beta.24459.2</SystemRuntimeTimeZoneDataVersion>
<SystemSecurityCryptographyX509CertificatesTestDataVersion>9.0.0-beta.24459.2</SystemSecurityCryptographyX509CertificatesTestDataVersion>
<SystemTextRegularExpressionsTestDataVersion>9.0.0-beta.24459.2</SystemTextRegularExpressionsTestDataVersion>
<SystemWindowsExtensionsTestDataVersion>9.0.0-beta.24459.2</SystemWindowsExtensionsTestDataVersion>
<MicrosoftDotNetCilStripSourcesVersion>9.0.0-beta.24459.2</MicrosoftDotNetCilStripSourcesVersion>
<SystemRuntimeNumericsTestDataVersion>9.0.0-beta.24517.2</SystemRuntimeNumericsTestDataVersion>
<SystemComponentModelTypeConverterTestDataVersion>9.0.0-beta.24517.2</SystemComponentModelTypeConverterTestDataVersion>
<SystemDataCommonTestDataVersion>9.0.0-beta.24517.2</SystemDataCommonTestDataVersion>
<SystemDrawingCommonTestDataVersion>9.0.0-beta.24517.2</SystemDrawingCommonTestDataVersion>
<SystemFormatsTarTestDataVersion>9.0.0-beta.24517.2</SystemFormatsTarTestDataVersion>
<SystemIOCompressionTestDataVersion>9.0.0-beta.24517.2</SystemIOCompressionTestDataVersion>
<SystemIOPackagingTestDataVersion>9.0.0-beta.24517.2</SystemIOPackagingTestDataVersion>
<SystemNetTestDataVersion>9.0.0-beta.24517.2</SystemNetTestDataVersion>
<SystemPrivateRuntimeUnicodeDataVersion>9.0.0-beta.24517.2</SystemPrivateRuntimeUnicodeDataVersion>
<SystemRuntimeTimeZoneDataVersion>9.0.0-beta.24517.2</SystemRuntimeTimeZoneDataVersion>
<SystemSecurityCryptographyX509CertificatesTestDataVersion>9.0.0-beta.24517.2</SystemSecurityCryptographyX509CertificatesTestDataVersion>
<SystemTextRegularExpressionsTestDataVersion>9.0.0-beta.24517.2</SystemTextRegularExpressionsTestDataVersion>
<SystemWindowsExtensionsTestDataVersion>9.0.0-beta.24517.2</SystemWindowsExtensionsTestDataVersion>
<MicrosoftDotNetCilStripSourcesVersion>9.0.0-beta.24517.2</MicrosoftDotNetCilStripSourcesVersion>
<!-- dotnet-optimization dependencies -->
<optimizationwindows_ntx64MIBCRuntimeVersion>1.0.0-prerelease.24462.2</optimizationwindows_ntx64MIBCRuntimeVersion>
<optimizationwindows_ntx86MIBCRuntimeVersion>1.0.0-prerelease.24462.2</optimizationwindows_ntx86MIBCRuntimeVersion>
@ -184,10 +184,10 @@
<!-- Testing -->
<MicrosoftNETCoreCoreDisToolsVersion>1.4.0</MicrosoftNETCoreCoreDisToolsVersion>
<MicrosoftNETTestSdkVersion>17.4.0-preview-20220707-01</MicrosoftNETTestSdkVersion>
<MicrosoftDotNetXHarnessTestRunnersCommonVersion>9.0.0-prerelease.24405.1</MicrosoftDotNetXHarnessTestRunnersCommonVersion>
<MicrosoftDotNetXHarnessTestRunnersXunitVersion>9.0.0-prerelease.24405.1</MicrosoftDotNetXHarnessTestRunnersXunitVersion>
<MicrosoftDotNetXHarnessCLIVersion>9.0.0-prerelease.24405.1</MicrosoftDotNetXHarnessCLIVersion>
<MicrosoftDotNetHotReloadUtilsGeneratorBuildToolVersion>9.0.0-alpha.0.24514.3</MicrosoftDotNetHotReloadUtilsGeneratorBuildToolVersion>
<MicrosoftDotNetXHarnessTestRunnersCommonVersion>9.0.0-prerelease.24575.3</MicrosoftDotNetXHarnessTestRunnersCommonVersion>
<MicrosoftDotNetXHarnessTestRunnersXunitVersion>9.0.0-prerelease.24575.3</MicrosoftDotNetXHarnessTestRunnersXunitVersion>
<MicrosoftDotNetXHarnessCLIVersion>9.0.0-prerelease.24575.3</MicrosoftDotNetXHarnessCLIVersion>
<MicrosoftDotNetHotReloadUtilsGeneratorBuildToolVersion>9.0.0-alpha.0.24561.2</MicrosoftDotNetHotReloadUtilsGeneratorBuildToolVersion>
<NUnitVersion>3.12.0</NUnitVersion>
<NUnit3TestAdapterVersion>4.5.0</NUnit3TestAdapterVersion>
<CoverletCollectorVersion>6.0.0</CoverletCollectorVersion>
@ -215,11 +215,11 @@
<!-- Docs -->
<MicrosoftPrivateIntellisenseVersion>9.0.0-preview-20241010.1</MicrosoftPrivateIntellisenseVersion>
<!-- Mono Cecil -->
<MicrosoftDotNetCecilVersion>0.11.5-alpha.24515.1</MicrosoftDotNetCecilVersion>
<MicrosoftDotNetCecilVersion>0.11.5-alpha.24602.1</MicrosoftDotNetCecilVersion>
<!-- ILCompiler -->
<MicrosoftDotNetILCompilerVersion>9.0.0-rtm.24511.16</MicrosoftDotNetILCompilerVersion>
<!-- ICU -->
<MicrosoftNETCoreRuntimeICUTransportVersion>9.0.0-rtm.24516.3</MicrosoftNETCoreRuntimeICUTransportVersion>
<MicrosoftNETCoreRuntimeICUTransportVersion>9.0.0-rtm.24572.1</MicrosoftNETCoreRuntimeICUTransportVersion>
<MicrosoftNETCoreRuntimeICUTransportVersion>9.0.0-rtm.24466.4</MicrosoftNETCoreRuntimeICUTransportVersion>
<!-- MsQuic -->
<MicrosoftNativeQuicMsQuicSchannelVersion>2.4.3</MicrosoftNativeQuicMsQuicSchannelVersion>

View file

@ -64,7 +64,7 @@ try {
$GlobalJson.tools | Add-Member -Name "vs" -Value (ConvertFrom-Json "{ `"version`": `"16.5`" }") -MemberType NoteProperty
}
if( -not ($GlobalJson.tools.PSObject.Properties.Name -match "xcopy-msbuild" )) {
$GlobalJson.tools | Add-Member -Name "xcopy-msbuild" -Value "17.10.0-pre.4.0" -MemberType NoteProperty
$GlobalJson.tools | Add-Member -Name "xcopy-msbuild" -Value "17.12.0" -MemberType NoteProperty
}
if ($GlobalJson.tools."xcopy-msbuild".Trim() -ine "none") {
$xcopyMSBuildToolsFolder = InitializeXCopyMSBuild $GlobalJson.tools."xcopy-msbuild" -install $true

View file

@ -383,8 +383,8 @@ function InitializeVisualStudioMSBuild([bool]$install, [object]$vsRequirements =
# If the version of msbuild is going to be xcopied,
# use this version. Version matches a package here:
# https://dev.azure.com/dnceng/public/_artifacts/feed/dotnet-eng/NuGet/Microsoft.DotNet.Arcade.MSBuild.Xcopy/versions/17.10.0-pre.4.0
$defaultXCopyMSBuildVersion = '17.10.0-pre.4.0'
# https://dev.azure.com/dnceng/public/_artifacts/feed/dotnet-eng/NuGet/Microsoft.DotNet.Arcade.MSBuild.Xcopy/versions/17.12.0
$defaultXCopyMSBuildVersion = '17.12.0'
if (!$vsRequirements) {
if (Get-Member -InputObject $GlobalJson.tools -Name 'vs') {

View file

@ -27,8 +27,6 @@
<PackageReadmeFilePath Condition="'$(PackageReadmeFilePath)' == '' and '$(EnableDefaultPackageReadmeFile)' == 'true'">PACKAGE.md</PackageReadmeFilePath>
<BeforePack>$(BeforePack);ValidatePackageReadmeExists</BeforePack>
<!-- Non-shipping packages shouldn't incrementally serviced. -->
<PackageUseIncrementalServicingVersion Condition="'$(IsShipping)' != 'true'">false</PackageUseIncrementalServicingVersion>
<!-- Generate packages for rid specific projects or for allconfigurations during build. -->
<!-- A package isn't generated if in servicing or in runtimelab. Intended to be overridden at project level. -->
<IsRIDSpecificProject Condition="$(MSBuildProjectName.StartsWith('runtime.')) and
@ -37,15 +35,7 @@
'$(BuildAllConfigurations)' == 'true' or
'$(IsRIDSpecificProject)' == 'true'
) and
(
'$(PreReleaseVersionLabel)' != 'servicing' or
'$(PackageUseIncrementalServicingVersion)' != 'true'
) and
'$(GitHubRepositoryName)' != 'runtimelab'">true</GeneratePackageOnBuild>
<!-- When in source-build we need to generate all packages when building for all configurations even in servicing. -->
<GeneratePackageOnBuild Condition="'$(GeneratePackageOnBuild)' != 'true' and
'$(BuildAllConfigurations)' == 'true' and
'$(DotNetBuildSourceOnly)' == 'true'">true</GeneratePackageOnBuild>
<!-- During NoBuild pack invocations, skip project reference build. Necessary for the IncludeProjectReferencesWithPackAttributeInPackage target. -->
<BuildProjectReferences Condition="'$(NoBuild)' == 'true'">false</BuildProjectReferences>
@ -58,18 +48,6 @@
<NoWarn>$(NoWarn);CP0003</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(PreReleaseVersionLabel)' == 'servicing' and
'$(PackageUseIncrementalServicingVersion)' == 'true'">
<!-- If no servicing version is set we need to default to 0 in order for dependency versions to
be calculated properly, if we don't set it to 0, we would get the dependency version using the
product Patch Version -->
<ServicingVersion Condition="'$(ServicingVersion)' == ''">0</ServicingVersion>
<!-- Always update the package version in servicing. -->
<Version>$(MajorVersion).$(MinorVersion).$(ServicingVersion)</Version>
<Version Condition="'$(VersionSuffix)' != ''">$(Version)-$(VersionSuffix)</Version>
</PropertyGroup>
<!-- Main packages intentionally don't include assets for net6.0 and net7.0 anymore. -->
<ItemGroup>
<PackageValidationBaselineFrameworkToIgnore Include="net6.0" />
@ -325,14 +303,6 @@
</ItemGroup>
</Target>
<Target Name="ValidateServicingVersionIsProperlySet"
Condition="'$(PreReleaseVersionLabel)' == 'servicing' and
'$(PackageUseIncrementalServicingVersion)' == 'true' and
'$(DotNetBuildSourceOnly)' != 'true'"
AfterTargets="GenerateNuspec">
<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." />
</Target>
<Target Name="ValidatePackageReadmeExists"
Condition="'$(PackageReadmeFilePath)' != '' and
!Exists('$(PackageReadmeFilePath)')">

View file

@ -17,7 +17,7 @@ extends:
containers:
linux_arm:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-cross-arm-net9.0
image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-cross-arm
env:
ROOTFS_DIR: /crossrootfs/arm
@ -27,44 +27,44 @@ extends:
ROOTFS_DIR: /crossrootfs/armv6
linux_arm64:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-cross-arm64-net9.0
image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-cross-arm64
env:
ROOTFS_DIR: /crossrootfs/arm64
linux_musl_x64:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-cross-amd64-alpine-net9.0
image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-cross-amd64-alpine
env:
ROOTFS_DIR: /crossrootfs/x64
linux_musl_arm:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-cross-arm-alpine-net9.0
image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-cross-arm-alpine
env:
ROOTFS_DIR: /crossrootfs/arm
linux_musl_arm64:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-cross-arm64-alpine-net9.0
image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-cross-arm64-alpine
env:
ROOTFS_DIR: /crossrootfs/arm64
# This container contains all required toolsets to build for Android and for Linux with bionic libc.
android:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-cross-android-amd64-net9.0
image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-cross-android-amd64
# This container contains all required toolsets to build for Android and for Linux with bionic libc and a special layout of OpenSSL.
linux_bionic:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-android-openssl-net9.0
image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-android-openssl
# This container contains all required toolsets to build for Android as well as tooling to build docker images.
android_docker:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-android-docker-net9.0
image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-android-docker
linux_x64:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-cross-amd64-net9.0
image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-cross-amd64
env:
ROOTFS_DIR: /crossrootfs/x64
linux_x86:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-cross-x86-net9.0
image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-cross-x86
env:
ROOTFS_DIR: /crossrootfs/x86
@ -75,7 +75,7 @@ extends:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.19-WithNode
linux_x64_sanitizer:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-cross-amd64-net9.0-sanitizer
image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-cross-amd64-sanitizer
env:
ROOTFS_DIR: /crossrootfs/x64
@ -88,17 +88,17 @@ extends:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:almalinux-8-source-build
linux_s390x:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-cross-s390x-net9.0
image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-cross-s390x
env:
ROOTFS_DIR: /crossrootfs/s390x
linux_ppc64le:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-cross-ppc64le-net9.0
image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-cross-ppc64le
env:
ROOTFS_DIR: /crossrootfs/ppc64le
linux_riscv64:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-cross-riscv64-net9.0
image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-cross-riscv64
env:
ROOTFS_DIR: /crossrootfs/riscv64
@ -109,17 +109,17 @@ extends:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream8
browser_wasm:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-webassembly-amd64-net9.0
image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-webassembly-amd64
env:
ROOTFS_DIR: /crossrootfs/x64
wasi_wasm:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-webassembly-amd64-net9.0
image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-webassembly-amd64
env:
ROOTFS_DIR: /crossrootfs/x64
freebsd_x64:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-cross-freebsd-13-net9.0
image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-cross-freebsd-13
env:
ROOTFS_DIR: /crossrootfs/x64
@ -132,4 +132,4 @@ extends:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-22.04-debpkg
rpmpkg:
image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-fpm-net9.0
image: mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net9.0-fpm

View file

@ -170,12 +170,12 @@ jobs:
# OSX Public Build Pool (we don't have on-prem OSX BuildPool).
${{ if and(in(parameters.osGroup, 'osx', 'maccatalyst', 'ios', 'iossimulator', 'tvos', 'tvossimulator'), eq(variables['System.TeamProject'], 'public')) }}:
vmImage: 'macos-12'
vmImage: 'macos-13'
# OSX Internal Pool
${{ if and(in(parameters.osGroup, 'osx', 'maccatalyst', 'ios', 'iossimulator', 'tvos', 'tvossimulator'), ne(variables['System.TeamProject'], 'public')) }}:
name: "Azure Pipelines"
vmImage: 'macOS-12'
vmImage: 'macOS-13'
os: macOS
# Official Build Windows Pool

View file

@ -374,7 +374,7 @@ jobs:
nameSuffix: PerfBDNApp
isOfficialBuild: false
pool:
vmImage: 'macos-12'
vmImage: 'macos-13'
postBuildSteps:
- template: /eng/pipelines/coreclr/templates/build-perf-bdn-app.yml
parameters:

View file

@ -1,16 +1,16 @@
{
"sdk": {
"version": "9.0.100-rc.2.24474.11",
"version": "9.0.100",
"allowPrerelease": true,
"rollForward": "major"
},
"tools": {
"dotnet": "9.0.100-rc.2.24474.11"
"dotnet": "9.0.100"
},
"msbuild-sdks": {
"Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24516.2",
"Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.24516.2",
"Microsoft.DotNet.SharedFramework.Sdk": "9.0.0-beta.24516.2",
"Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.24572.2",
"Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.24572.2",
"Microsoft.DotNet.SharedFramework.Sdk": "9.0.0-beta.24572.2",
"Microsoft.Build.NoTargets": "3.7.0",
"Microsoft.Build.Traversal": "3.4.0",
"Microsoft.NET.Sdk.IL": "9.0.0-rtm.24511.16"

View file

@ -2890,10 +2890,14 @@ bool gc_heap::trigger_initial_gen2_p = false;
#ifdef BACKGROUND_GC
bool gc_heap::trigger_bgc_for_rethreading_p = false;
int gc_heap::total_bgc_threads = 0;
int gc_heap::last_bgc_n_heaps = 0;
int gc_heap::last_total_bgc_threads = 0;
#endif //BACKGROUND_GC
#ifdef STRESS_DYNAMIC_HEAP_COUNT
int gc_heap::heaps_in_this_gc = 0;
int gc_heap::bgc_to_ngc2_ratio = 0;
#endif //STRESS_DYNAMIC_HEAP_COUNT
#endif // DYNAMIC_HEAP_COUNT
@ -6404,7 +6408,11 @@ public:
if (GCToOSInterface::CanGetCurrentProcessorNumber())
{
uint32_t proc_no = GCToOSInterface::GetCurrentProcessorNumber();
proc_no_to_heap_no[proc_no] = (uint16_t)heap_number;
// For a 32-bit process running on a machine with > 64 procs,
// even though the process can only use up to 32 procs, the processor
// index can be >= 64; or in the cpu group case, if the process is not running in cpu group #0,
// the GetCurrentProcessorNumber will return a number that's >= 64.
proc_no_to_heap_no[proc_no % MAX_SUPPORTED_CPUS] = (uint16_t)heap_number;
}
}
@ -6426,7 +6434,11 @@ public:
if (GCToOSInterface::CanGetCurrentProcessorNumber())
{
uint32_t proc_no = GCToOSInterface::GetCurrentProcessorNumber();
int adjusted_heap = proc_no_to_heap_no[proc_no];
// For a 32-bit process running on a machine with > 64 procs,
// even though the process can only use up to 32 procs, the processor
// index can be >= 64; or in the cpu group case, if the process is not running in cpu group #0,
// the GetCurrentProcessorNumber will return a number that's >= 64.
int adjusted_heap = proc_no_to_heap_no[proc_no % MAX_SUPPORTED_CPUS];
// with dynamic heap count, need to make sure the value is in range.
if (adjusted_heap >= gc_heap::n_heaps)
{
@ -14182,6 +14194,11 @@ HRESULT gc_heap::initialize_gc (size_t soh_segment_size,
if ((dynamic_adaptation_mode == dynamic_adaptation_to_application_sizes) && (conserve_mem_setting == 0))
conserve_mem_setting = 5;
#ifdef STRESS_DYNAMIC_HEAP_COUNT
bgc_to_ngc2_ratio = (int)GCConfig::GetGCDBGCRatio();
dprintf (1, ("bgc_to_ngc2_ratio is %d", bgc_to_ngc2_ratio));
#endif
#endif //DYNAMIC_HEAP_COUNT
if (conserve_mem_setting < 0)
@ -21071,6 +21088,18 @@ int gc_heap::joined_generation_to_condemn (BOOL should_evaluate_elevation,
if (!((n == max_generation) && *blocking_collection_p))
{
n = max_generation;
#ifdef STRESS_DYNAMIC_HEAP_COUNT
if (bgc_to_ngc2_ratio)
{
int r = (int)gc_rand::get_rand ((bgc_to_ngc2_ratio + 1) * 10);
dprintf (6666, ("%d - making this full GC %s", r, ((r < 10) ? "NGC2" : "BGC")));
if (r < 10)
{
*blocking_collection_p = TRUE;
}
}
#endif //STRESS_DYNAMIC_HEAP_COUNT
}
}
}
@ -24332,12 +24361,37 @@ void gc_heap::garbage_collect (int n)
size_t saved_bgc_th_count_creation_failed = bgc_th_count_creation_failed;
#endif //DYNAMIC_HEAP_COUNT
// This is the count of threads that GCToEEInterface::CreateThread reported successful for.
int total_bgc_threads_running = 0;
for (int i = 0; i < n_heaps; i++)
{
prepare_bgc_thread (g_heaps[i]);
gc_heap* hp = g_heaps[i];
if (prepare_bgc_thread (hp))
{
assert (hp->bgc_thread_running);
if (!hp->bgc_thread_running)
{
dprintf (6666, ("h%d prepare succeeded but running is still false!", i));
GCToOSInterface::DebugBreak();
}
total_bgc_threads_running++;
}
else
{
break;
}
}
#ifdef DYNAMIC_HEAP_COUNT
// Even if we don't do a BGC, we need to record how many threads were successfully created because those will
// be running.
total_bgc_threads = max (total_bgc_threads, total_bgc_threads_running);
if (total_bgc_threads_running != n_heaps)
{
dprintf (6666, ("wanted to have %d BGC threads but only have %d", n_heaps, total_bgc_threads_running));
}
add_to_bgc_th_creation_history (current_gc_index,
(bgc_th_count_created - saved_bgc_th_count_created),
(bgc_th_count_created_th_existed - saved_bgc_th_count_created_th_existed),
@ -24369,7 +24423,15 @@ void gc_heap::garbage_collect (int n)
for (int i = 0; i < n_heaps; i++)
{
gc_heap* hp = g_heaps[i];
if (!(hp->bgc_thread) || !hp->commit_mark_array_bgc_init())
if (!(hp->bgc_thread_running))
{
assert (!(hp->bgc_thread));
}
// In theory we could be in a situation where bgc_thread_running is false but bgc_thread is non NULL. We don't
// support this scenario so don't do a BGC.
if (!(hp->bgc_thread_running && hp->bgc_thread && hp->commit_mark_array_bgc_init()))
{
do_concurrent_p = FALSE;
break;
@ -24389,8 +24451,37 @@ void gc_heap::garbage_collect (int n)
}
#endif //MULTIPLE_HEAPS
#ifdef DYNAMIC_HEAP_COUNT
dprintf (6666, ("last BGC saw %d heaps and %d total threads, currently %d heaps and %d total threads, %s BGC",
last_bgc_n_heaps, last_total_bgc_threads, n_heaps, total_bgc_threads, (do_concurrent_p ? "doing" : "not doing")));
#endif //DYNAMIC_HEAP_COUNT
if (do_concurrent_p)
{
#ifdef DYNAMIC_HEAP_COUNT
int diff = n_heaps - last_bgc_n_heaps;
if (diff > 0)
{
int saved_idle_bgc_thread_count = dynamic_heap_count_data.idle_bgc_thread_count;
int max_idle_event_count = min (n_heaps, last_total_bgc_threads);
int idle_events_to_set = max_idle_event_count - last_bgc_n_heaps;
if (idle_events_to_set > 0)
{
Interlocked::ExchangeAdd (&dynamic_heap_count_data.idle_bgc_thread_count, -idle_events_to_set);
dprintf (6666, ("%d BGC threads exist, setting %d idle events for h%d-h%d, total idle %d -> %d",
total_bgc_threads, idle_events_to_set, last_bgc_n_heaps, (last_bgc_n_heaps + idle_events_to_set - 1),
saved_idle_bgc_thread_count, VolatileLoadWithoutBarrier (&dynamic_heap_count_data.idle_bgc_thread_count)));
for (int heap_idx = last_bgc_n_heaps; heap_idx < max_idle_event_count; heap_idx++)
{
g_heaps[heap_idx]->bgc_idle_thread_event.Set();
}
}
}
last_bgc_n_heaps = n_heaps;
last_total_bgc_threads = total_bgc_threads;
#endif //DYNAMIC_HEAP_COUNT
#ifdef FEATURE_USE_SOFTWARE_WRITE_WATCH_FOR_GC_HEAP
SoftwareWriteWatch::EnableForGCHeap();
#endif //FEATURE_USE_SOFTWARE_WRITE_WATCH_FOR_GC_HEAP
@ -25918,9 +26009,6 @@ void gc_heap::check_heap_count ()
for (int heap_idx = n_heaps; heap_idx < new_n_heaps; heap_idx++)
{
g_heaps[heap_idx]->gc_idle_thread_event.Set();
#ifdef BACKGROUND_GC
g_heaps[heap_idx]->bgc_idle_thread_event.Set();
#endif //BACKGROUND_GC
}
}
@ -37637,6 +37725,19 @@ void gc_heap::gc_thread_stub (void* arg)
void gc_heap::bgc_thread_stub (void* arg)
{
gc_heap* heap = (gc_heap*)arg;
#ifdef STRESS_DYNAMIC_HEAP_COUNT
// We should only do this every so often; otherwise we'll never be able to do a BGC
int r = (int)gc_rand::get_rand (30);
bool wait_p = (r < 10);
if (wait_p)
{
GCToOSInterface::Sleep (100);
}
dprintf (6666, ("h%d %s", heap->heap_number, (wait_p ? "waited" : "did not wait")));
#endif
heap->bgc_thread = GCToEEInterface::GetThread();
assert(heap->bgc_thread != nullptr);
heap->bgc_thread_function();
@ -39429,6 +39530,8 @@ void gc_heap::add_to_bgc_th_creation_history (size_t gc_index, size_t count_crea
}
#endif //DYNAMIC_HEAP_COUNT
// If this returns TRUE, we are saying we expect that thread to be there. However, when that thread is available to work is indeterministic.
// But when we actually start a BGC, naturally we'll need to wait till it gets to the point it can work.
BOOL gc_heap::prepare_bgc_thread(gc_heap* gh)
{
BOOL success = FALSE;
@ -39440,7 +39543,19 @@ BOOL gc_heap::prepare_bgc_thread(gc_heap* gh)
dprintf (2, ("GC thread not running"));
if (gh->bgc_thread == 0)
{
#ifdef STRESS_DYNAMIC_HEAP_COUNT
// to stress, we just don't actually try to create the thread to simulate a failure
int r = (int)gc_rand::get_rand (100);
bool try_to_create_p = (r > 10);
BOOL thread_created_p = (try_to_create_p ? create_bgc_thread (gh) : FALSE);
if (!thread_created_p)
{
dprintf (6666, ("h%d we failed to create the thread, %s", gh->heap_number, (try_to_create_p ? "tried" : "didn't try")));
}
if (thread_created_p)
#else //STRESS_DYNAMIC_HEAP_COUNT
if (create_bgc_thread(gh))
#endif //STRESS_DYNAMIC_HEAP_COUNT
{
success = TRUE;
thread_created = TRUE;
@ -39458,8 +39573,11 @@ BOOL gc_heap::prepare_bgc_thread(gc_heap* gh)
else
{
#ifdef DYNAMIC_HEAP_COUNT
// This would be a very unusual scenario where GCToEEInterface::CreateThread told us it failed yet the thread was created.
bgc_th_count_created_th_existed++;
dprintf (6666, ("h%d we cannot have a thread that runs yet CreateThread reported it failed to create it", gh->heap_number));
#endif //DYNAMIC_HEAP_COUNT
assert (!"GCToEEInterface::CreateThread returned FALSE yet the thread was created!");
}
}
else
@ -39657,7 +39775,7 @@ void gc_heap::bgc_thread_function()
while (1)
{
// Wait for work to do...
dprintf (3, ("bgc thread: waiting..."));
dprintf (6666, ("h%d bgc thread: waiting...", heap_number));
cooperative_mode = enable_preemptive ();
//current_thread->m_fPreemptiveGCDisabled = 0;
@ -39706,36 +39824,71 @@ void gc_heap::bgc_thread_function()
continue;
}
}
#ifdef STRESS_DYNAMIC_HEAP_COUNT
if (n_heaps <= heap_number)
{
uint32_t delay_ms = (uint32_t)gc_rand::get_rand (200);
GCToOSInterface::Sleep (delay_ms);
}
#endif //STRESS_DYNAMIC_HEAP_COUNT
// if we signal the thread with no concurrent work to do -> exit
if (!settings.concurrent)
{
dprintf (3, ("no concurrent GC needed, exiting"));
dprintf (6666, ("h%d no concurrent GC needed, exiting", heap_number));
#ifdef STRESS_DYNAMIC_HEAP_COUNT
flush_gc_log (true);
GCToOSInterface::DebugBreak();
#endif
break;
}
gc_background_running = TRUE;
dprintf (2, (ThreadStressLog::gcStartBgcThread(), heap_number,
generation_free_list_space (generation_of (max_generation)),
generation_free_obj_space (generation_of (max_generation)),
dd_fragmentation (dynamic_data_of (max_generation))));
#ifdef DYNAMIC_HEAP_COUNT
if (n_heaps <= heap_number)
{
Interlocked::Increment (&dynamic_heap_count_data.idle_bgc_thread_count);
add_to_bgc_hc_history (hc_record_bgc_inactive);
// this is the case where we have more background GC threads than heaps
// - wait until we're told to continue...
dprintf (9999, ("BGC thread %d idle (%d heaps) (gc%Id)", heap_number, n_heaps, VolatileLoadWithoutBarrier (&settings.gc_index)));
dprintf (6666, ("BGC%Id h%d going idle (%d heaps), idle count is now %d",
VolatileLoadWithoutBarrier (&settings.gc_index), heap_number, n_heaps, VolatileLoadWithoutBarrier (&dynamic_heap_count_data.idle_bgc_thread_count)));
bgc_idle_thread_event.Wait(INFINITE, FALSE);
dprintf (9999, ("BGC thread %d waking from idle (%d heaps) (gc%Id)", heap_number, n_heaps, VolatileLoadWithoutBarrier (&settings.gc_index)));
dprintf (6666, ("BGC%Id h%d woke from idle (%d heaps), idle count is now %d",
VolatileLoadWithoutBarrier (&settings.gc_index), heap_number, n_heaps, VolatileLoadWithoutBarrier (&dynamic_heap_count_data.idle_bgc_thread_count)));
continue;
}
else
{
if (heap_number == 0)
{
const int spin_count = 1024;
int idle_bgc_thread_count = total_bgc_threads - n_heaps;
dprintf (6666, ("n_heaps %d, total %d bgc threads, bgc idle should be %d and is %d",
n_heaps, total_bgc_threads, idle_bgc_thread_count, VolatileLoadWithoutBarrier (&dynamic_heap_count_data.idle_bgc_thread_count)));
if (idle_bgc_thread_count != dynamic_heap_count_data.idle_bgc_thread_count)
{
dprintf (6666, ("current idle is %d, trying to get to %d",
VolatileLoadWithoutBarrier (&dynamic_heap_count_data.idle_bgc_thread_count), idle_bgc_thread_count));
spin_and_wait (spin_count, (idle_bgc_thread_count == dynamic_heap_count_data.idle_bgc_thread_count));
}
}
add_to_bgc_hc_history (hc_record_bgc_active);
}
#endif //DYNAMIC_HEAP_COUNT
if (heap_number == 0)
{
gc_background_running = TRUE;
dprintf (6666, (ThreadStressLog::gcStartBgcThread(), heap_number,
generation_free_list_space (generation_of (max_generation)),
generation_free_obj_space (generation_of (max_generation)),
dd_fragmentation (dynamic_data_of (max_generation))));
}
gc1();
#ifndef DOUBLY_LINKED_FL

View file

@ -142,8 +142,9 @@ public:
INT_CONFIG (GCSpinCountUnit, "GCSpinCountUnit", NULL, 0, "Specifies the spin count unit used by the GC.") \
INT_CONFIG (GCDynamicAdaptationMode, "GCDynamicAdaptationMode", "System.GC.DynamicAdaptationMode", 1, "Enable the GC to dynamically adapt to application sizes.") \
INT_CONFIG (GCDTargetTCP, "GCDTargetTCP", "System.GC.DTargetTCP", 0, "Specifies the target tcp for DATAS") \
BOOL_CONFIG (GCLogBGCThreadId, "GCLogBGCThreadId", NULL, false, "Specifies if BGC ThreadId should be logged")
INT_CONFIG (GCDBGCRatio, " GCDBGCRatio", NULL, 0, "Specifies the ratio of BGC to NGC2 for HC change") \
BOOL_CONFIG (GCLogBGCThreadId, "GCLogBGCThreadId", NULL, false, "Specifies if BGC ThreadId should be logged") \
BOOL_CONFIG (GCCacheSizeFromSysConf, "GCCacheSizeFromSysConf", NULL, false, "Specifies using sysconf to retrieve the last level cache size for Unix.")
// This class is responsible for retreiving configuration information
// for how the GC should operate.

View file

@ -5175,6 +5175,9 @@ private:
int last_n_heaps;
// don't start a GC till we see (n_max_heaps - new_n_heaps) number of threads idling
VOLATILE(int32_t) idle_thread_count;
#ifdef BACKGROUND_GC
VOLATILE(int32_t) idle_bgc_thread_count;
#endif
bool init_only_p;
bool should_change_heap_count;
@ -5202,6 +5205,17 @@ private:
// This is set when change_heap_count wants the next GC to be a BGC for rethreading gen2 FL
// and reset during that BGC.
PER_HEAP_ISOLATED_FIELD_MAINTAINED bool trigger_bgc_for_rethreading_p;
// BGC threads are created on demand but we don't destroy the ones we created. This
// is to track how many we've created. They may or may not be active depending on
// if they are needed.
PER_HEAP_ISOLATED_FIELD_MAINTAINED int total_bgc_threads;
// HC last BGC observed.
PER_HEAP_ISOLATED_FIELD_MAINTAINED int last_bgc_n_heaps;
// Number of total BGC threads last BGC observed. This tells us how many new BGC threads have
// been created since. Note that just because a BGC thread is created doesn't mean it's used.
// We can fail at committing mark array and not proceed with the BGC.
PER_HEAP_ISOLATED_FIELD_MAINTAINED int last_total_bgc_threads;
#endif //BACKGROUND_GC
#endif //DYNAMIC_HEAP_COUNT
@ -5352,6 +5366,9 @@ private:
#ifdef DYNAMIC_HEAP_COUNT
PER_HEAP_ISOLATED_FIELD_INIT_ONLY int dynamic_adaptation_mode;
#ifdef STRESS_DYNAMIC_HEAP_COUNT
PER_HEAP_ISOLATED_FIELD_INIT_ONLY int bgc_to_ngc2_ratio;
#endif //STRESS_DYNAMIC_HEAP_COUNT
#endif //DYNAMIC_HEAP_COUNT
/********************************************/

View file

@ -1,5 +1,6 @@
set(CMAKE_INCLUDE_CURRENT_DIR ON)
include_directories("../env")
include_directories("..")
include(configure.cmake)

View file

@ -18,8 +18,10 @@
#include "gcenv.structs.h"
#include "gcenv.base.h"
#include "gcenv.os.h"
#include "gcenv.ee.h"
#include "gcenv.unix.inl"
#include "volatile.h"
#include "gcconfig.h"
#include "numasupport.h"
#if HAVE_SWAPCTL
@ -862,10 +864,10 @@ done:
return result;
}
static size_t GetLogicalProcessorCacheSizeFromOS()
static void GetLogicalProcessorCacheSizeFromSysConf(size_t* cacheLevel, size_t* cacheSize)
{
size_t cacheLevel = 0;
size_t cacheSize = 0;
assert (cacheLevel != nullptr);
assert (cacheSize != nullptr);
#if defined(_SC_LEVEL1_DCACHE_SIZE) || defined(_SC_LEVEL2_CACHE_SIZE) || defined(_SC_LEVEL3_CACHE_SIZE) || defined(_SC_LEVEL4_CACHE_SIZE)
const int cacheLevelNames[] =
@ -881,47 +883,105 @@ static size_t GetLogicalProcessorCacheSizeFromOS()
long size = sysconf(cacheLevelNames[i]);
if (size > 0)
{
cacheSize = (size_t)size;
cacheLevel = i + 1;
*cacheSize = (size_t)size;
*cacheLevel = i + 1;
break;
}
}
#endif
}
static void GetLogicalProcessorCacheSizeFromSysFs(size_t* cacheLevel, size_t* cacheSize)
{
assert (cacheLevel != nullptr);
assert (cacheSize != nullptr);
#if defined(TARGET_LINUX) && !defined(HOST_ARM) && !defined(HOST_X86)
if (cacheSize == 0)
//
// Retrieve cachesize via sysfs by reading the file /sys/devices/system/cpu/cpu0/cache/index{LastLevelCache}/size
// for the platform. Currently musl and arm64 should be only cases to use
// this method to determine cache size.
//
size_t level;
char path_to_size_file[] = "/sys/devices/system/cpu/cpu0/cache/index-/size";
char path_to_level_file[] = "/sys/devices/system/cpu/cpu0/cache/index-/level";
int index = 40;
assert(path_to_size_file[index] == '-');
assert(path_to_level_file[index] == '-');
for (int i = 0; i < 5; i++)
{
//
// Fallback to retrieve cachesize via /sys/.. if sysconf was not available
// for the platform. Currently musl and arm64 should be only cases to use
// this method to determine cache size.
//
size_t level;
char path_to_size_file[] = "/sys/devices/system/cpu/cpu0/cache/index-/size";
char path_to_level_file[] = "/sys/devices/system/cpu/cpu0/cache/index-/level";
int index = 40;
assert(path_to_size_file[index] == '-');
assert(path_to_level_file[index] == '-');
path_to_size_file[index] = (char)(48 + i);
for (int i = 0; i < 5; i++)
uint64_t cache_size_from_sys_file = 0;
if (ReadMemoryValueFromFile(path_to_size_file, &cache_size_from_sys_file))
{
path_to_size_file[index] = (char)(48 + i);
*cacheSize = std::max(*cacheSize, (size_t)cache_size_from_sys_file);
uint64_t cache_size_from_sys_file = 0;
if (ReadMemoryValueFromFile(path_to_size_file, &cache_size_from_sys_file))
path_to_level_file[index] = (char)(48 + i);
if (ReadMemoryValueFromFile(path_to_level_file, &level))
{
cacheSize = std::max(cacheSize, (size_t)cache_size_from_sys_file);
path_to_level_file[index] = (char)(48 + i);
if (ReadMemoryValueFromFile(path_to_level_file, &level))
{
cacheLevel = level;
}
*cacheLevel = level;
}
}
}
#endif
}
static void GetLogicalProcessorCacheSizeFromHeuristic(size_t* cacheLevel, size_t* cacheSize)
{
assert (cacheLevel != nullptr);
assert (cacheSize != nullptr);
#if (defined(TARGET_LINUX) && !defined(TARGET_APPLE))
{
// Use the following heuristics at best depending on the CPU count
// 1 ~ 4 : 4 MB
// 5 ~ 16 : 8 MB
// 17 ~ 64 : 16 MB
// 65+ : 32 MB
DWORD logicalCPUs = g_processAffinitySet.Count();
if (logicalCPUs < 5)
{
*cacheSize = 4;
}
else if (logicalCPUs < 17)
{
*cacheSize = 8;
}
else if (logicalCPUs < 65)
{
*cacheSize = 16;
}
else
{
*cacheSize = 32;
}
*cacheSize *= (1024 * 1024);
}
#endif
}
static size_t GetLogicalProcessorCacheSizeFromOS()
{
size_t cacheLevel = 0;
size_t cacheSize = 0;
if (GCConfig::GetGCCacheSizeFromSysConf())
{
GetLogicalProcessorCacheSizeFromSysConf(&cacheLevel, &cacheSize);
}
if (cacheSize == 0)
{
GetLogicalProcessorCacheSizeFromSysFs(&cacheLevel, &cacheSize);
if (cacheSize == 0)
{
GetLogicalProcessorCacheSizeFromHeuristic(&cacheLevel, &cacheSize);
}
}
#if HAVE_SYSCTLBYNAME
if (cacheSize == 0)
@ -948,32 +1008,7 @@ static size_t GetLogicalProcessorCacheSizeFromOS()
#if (defined(HOST_ARM64) || defined(HOST_LOONGARCH64)) && !defined(TARGET_APPLE)
if (cacheLevel != 3)
{
// We expect to get the L3 cache size for Arm64 but currently expected to be missing that info
// from most of the machines.
// Hence, just use the following heuristics at best depending on the CPU count
// 1 ~ 4 : 4 MB
// 5 ~ 16 : 8 MB
// 17 ~ 64 : 16 MB
// 65+ : 32 MB
DWORD logicalCPUs = g_processAffinitySet.Count();
if (logicalCPUs < 5)
{
cacheSize = 4;
}
else if (logicalCPUs < 17)
{
cacheSize = 8;
}
else if (logicalCPUs < 65)
{
cacheSize = 16;
}
else
{
cacheSize = 32;
}
cacheSize *= (1024 * 1024);
GetLogicalProcessorCacheSizeFromHeuristic(&cacheLevel, &cacheSize);
}
#endif

View file

@ -1497,7 +1497,7 @@ namespace
TokenPairList list { nullptr };
MetaSig::CompareState state{ &list };
state.IgnoreCustomModifiers = false;
state.IgnoreCustomModifiers = true;
if (!DoesFieldMatchUnsafeAccessorDeclaration(cxt, pField, state))
continue;

View file

@ -50,10 +50,16 @@ namespace Microsoft.Win32.SafeHandles
string providerName = Marshal.PtrToStringUni((IntPtr)(pProvInfo->pwszProvName))!;
string keyContainerName = Marshal.PtrToStringUni((IntPtr)(pProvInfo->pwszContainerName))!;
CngKeyOpenOptions openOpts = CngKeyOpenOptions.None;
if ((pProvInfo->dwFlags & Interop.Crypt32.CryptAcquireContextFlags.CRYPT_MACHINE_KEYSET) != 0)
{
openOpts = CngKeyOpenOptions.MachineKey;
}
try
{
using (CngKey cngKey = CngKey.Open(keyContainerName, new CngProvider(providerName)))
using (CngKey cngKey = CngKey.Open(keyContainerName, new CngProvider(providerName), openOpts))
{
cngKey.Delete();
}

View file

@ -35,8 +35,6 @@
<!-- We can't generate an apphost without restoring the targeting pack. -->
<UseAppHost>false</UseAppHost>
<EnableDefaultItems>false</EnableDefaultItems>
<!-- Libraries packages use the incremental servicing infrastructure. -->
<PackageUseIncrementalServicingVersion>true</PackageUseIncrementalServicingVersion>
</PropertyGroup>
<!-- Language configuration -->

View file

@ -72,12 +72,11 @@
<!-- The assembly version gets updated during servicing when the assembly isn't part of a targeting pack. -->
<PropertyGroup Condition="'$(PreReleaseVersionLabel)' == 'servicing' and
'$(IsPackable)' == 'true' and
'$(PackageUseIncrementalServicingVersion)' == 'true'">
'$(IsPackable)' == 'true'">
<_IsWindowsDesktopApp Condition="$(WindowsDesktopCoreAppLibrary.Contains('$(AssemblyName);'))">true</_IsWindowsDesktopApp>
<_IsAspNetCoreApp Condition="$(AspNetCoreAppLibrary.Contains('$(AssemblyName);'))">true</_IsAspNetCoreApp>
<_AssemblyInTargetingPack Condition="('$(IsNETCoreAppSrc)' == 'true' or '$(IsNetCoreAppRef)' == 'true' or '$(_IsAspNetCoreApp)' == 'true' or '$(_IsWindowsDesktopApp)' == 'true') and '$(TargetFrameworkIdentifier)' != '.NETFramework'">true</_AssemblyInTargetingPack>
<AssemblyVersion Condition="'$(_AssemblyInTargetingPack)' != 'true'">$(MajorVersion).$(MinorVersion).0.$(ServicingVersion)</AssemblyVersion>
<AssemblyVersion Condition="'$(_AssemblyInTargetingPack)' != 'true'">$(MajorVersion).$(MinorVersion).0.$(PatchVersion)</AssemblyVersion>
</PropertyGroup>
<Import Project="$(RepositoryEngineeringDir)versioning.targets" />

View file

@ -10,6 +10,6 @@
<ItemGroup>
<Compile Include="$(CoreLibSharedDir)System\Runtime\CompilerServices\IsExternalInit.cs" Link="Common\System\Runtime\CompilerServices\IsExternalInit.cs" />
<ProjectReference Include="$(LibrariesProjectRoot)Microsoft.Extensions.Logging.Console\src\Microsoft.Extensions.Logging.Console.csproj" SkipUseReferenceAssembly="true" />
<ProjectReference Include="$(LibrariesProjectRoot)System.Diagnostics.DiagnosticSource\ref\System.Diagnostics.DiagnosticSource.csproj" />
<ProjectReference Include="$(LibrariesProjectRoot)System.Diagnostics.DiagnosticSource\src\System.Diagnostics.DiagnosticSource.csproj" />
</ItemGroup>
</Project>

View file

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- https://learn.microsoft.com/dotnet/fundamentals/package-validation/diagnostic-ids -->
<Suppressions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Suppression>
<DiagnosticId>PKV006</DiagnosticId>
<Target>net8.0</Target>
</Suppression>
</Suppressions>

View file

@ -407,105 +407,94 @@ namespace System.Diagnostics
}
}
// SynchronizedList<T> is a helper collection which ensure thread safety on the collection
// and allow enumerating the collection items and execute some action on the enumerated item and can detect any change in the collection
// during the enumeration which force restarting the enumeration again.
// Caution: We can have the action executed on the same item more than once which is ok in our scenarios.
// This class uses a copy-on-write design to ensure thread safety all operations are thread safe.
// However, it is possible for read-only operations to see stale versions of the item while a change
// is occurring.
internal sealed class SynchronizedList<T>
{
private readonly List<T> _list;
private uint _version;
public SynchronizedList() => _list = new List<T>();
private readonly object _writeLock;
// This array must not be mutated directly. To mutate, obtain the lock, copy the array and then replace it with the new array.
private T[] _volatileArray;
public SynchronizedList()
{
_volatileArray = [];
_writeLock = new();
}
public void Add(T item)
{
lock (_list)
lock (_writeLock)
{
_list.Add(item);
_version++;
T[] newArray = new T[_volatileArray.Length + 1];
Array.Copy(_volatileArray, newArray, _volatileArray.Length);// copy existing items
newArray[_volatileArray.Length] = item;// copy new item
_volatileArray = newArray;
}
}
public bool AddIfNotExist(T item)
{
lock (_list)
lock (_writeLock)
{
if (!_list.Contains(item))
int index = Array.IndexOf(_volatileArray, item);
if (index >= 0)
{
_list.Add(item);
_version++;
return true;
return false;
}
return false;
T[] newArray = new T[_volatileArray.Length + 1];
Array.Copy(_volatileArray, newArray, _volatileArray.Length);// copy existing items
newArray[_volatileArray.Length] = item;// copy new item
_volatileArray = newArray;
return true;
}
}
public bool Remove(T item)
{
lock (_list)
lock (_writeLock)
{
if (_list.Remove(item))
int index = Array.IndexOf(_volatileArray, item);
if (index < 0)
{
_version++;
return true;
return false;
}
return false;
T[] newArray = new T[_volatileArray.Length - 1];
Array.Copy(_volatileArray, newArray, index);// copy existing items before index
Array.Copy(
_volatileArray, index + 1, // position after the index, skipping it
newArray, index, _volatileArray.Length - index - 1// remaining items accounting for removed item
);
_volatileArray = newArray;
return true;
}
}
public int Count => _list.Count;
public int Count => _volatileArray.Length;
public void EnumWithFunc<TParent>(ActivitySource.Function<T, TParent> func, ref ActivityCreationOptions<TParent> data, ref ActivitySamplingResult samplingResult, ref ActivityCreationOptions<ActivityContext> dataWithContext)
{
uint version = _version;
int index = 0;
while (index < _list.Count)
foreach (T item in _volatileArray)
{
T item;
lock (_list)
{
if (version != _version)
{
version = _version;
index = 0;
continue;
}
item = _list[index];
index++;
}
// Important to call the func outside the lock.
// This is the whole point we are having this wrapper class.
func(item, ref data, ref samplingResult, ref dataWithContext);
}
}
public void EnumWithAction(Action<T, object> action, object arg)
{
uint version = _version;
int index = 0;
while (index < _list.Count)
foreach (T item in _volatileArray)
{
T item;
lock (_list)
{
if (version != _version)
{
version = _version;
index = 0;
continue;
}
item = _list[index];
index++;
}
// Important to call the action outside the lock.
// This is the whole point we are having this wrapper class.
action(item, arg);
}
}
@ -517,27 +506,8 @@ namespace System.Diagnostics
return;
}
uint version = _version;
int index = 0;
while (index < _list.Count)
foreach (T item in _volatileArray)
{
T item;
lock (_list)
{
if (version != _version)
{
version = _version;
index = 0;
continue;
}
item = _list[index];
index++;
}
// Important to notify outside the lock.
// This is the whole point we are having this wrapper class.
(item as ActivityListener)!.ExceptionRecorder?.Invoke(activity, exception, ref tags);
}
}

View file

@ -11,13 +11,13 @@ namespace System.Numerics.Tensors
{
public static partial class TensorPrimitives
{
/// <summary>Searches for the largest number in the specified tensor.</summary>
/// <summary>Searches for the smallest number in the specified tensor.</summary>
/// <param name="x">The tensor, represented as a span.</param>
/// <returns>The maximum element in <paramref name="x"/>.</returns>
/// <returns>The minimum element in <paramref name="x"/>.</returns>
/// <exception cref="ArgumentException">Length of <paramref name="x" /> must be greater than zero.</exception>
/// <remarks>
/// <para>
/// The determination of the maximum element matches the IEEE 754:2019 `maximumNumber` function. Positive 0 is considered greater than negative 0.
/// The determination of the minimum element matches the IEEE 754:2019 `minimumNumber` function. Positive 0 is considered greater than negative 0.
/// </para>
/// <para>
/// This method may call into the underlying C runtime or employ instructions specific to the current architecture. Exact results may differ between different
@ -28,7 +28,7 @@ namespace System.Numerics.Tensors
where T : INumber<T> =>
MinMaxCore<T, MinNumberOperator<T>>(x);
/// <summary>Computes the element-wise maximum of the numbers in the specified tensors.</summary>
/// <summary>Computes the element-wise minimum of the numbers in the specified tensors.</summary>
/// <param name="x">The first tensor, represented as a span.</param>
/// <param name="y">The second tensor, represented as a span.</param>
/// <param name="destination">The destination tensor, represented as a span.</param>
@ -41,7 +41,7 @@ namespace System.Numerics.Tensors
/// This method effectively computes <c><paramref name="destination" />[i] = <typeparamref name="T"/>.MinNumber(<paramref name="x" />[i], <paramref name="y" />[i])</c>.
/// </para>
/// <para>
/// The determination of the maximum element matches the IEEE 754:2019 `maximumNumber` function. If either value is <see cref="IFloatingPointIeee754{TSelf}.NaN"/>
/// The determination of the minimum element matches the IEEE 754:2019 `minimumNumber` function. If either value is <see cref="IFloatingPointIeee754{TSelf}.NaN"/>
/// the other is returned. Positive 0 is considered greater than negative 0.
/// </para>
/// <para>
@ -53,7 +53,7 @@ namespace System.Numerics.Tensors
where T : INumber<T> =>
InvokeSpanSpanIntoSpan<T, MinNumberOperator<T>>(x, y, destination);
/// <summary>Computes the element-wise maximum of the numbers in the specified tensors.</summary>
/// <summary>Computes the element-wise minimum of the numbers in the specified tensors.</summary>
/// <param name="x">The first tensor, represented as a span.</param>
/// <param name="y">The second tensor, represented as a scalar.</param>
/// <param name="destination">The destination tensor, represented as a span.</param>
@ -64,7 +64,7 @@ namespace System.Numerics.Tensors
/// This method effectively computes <c><paramref name="destination" />[i] = <typeparamref name="T"/>.MinNumber(<paramref name="x" />[i], <paramref name="y" />)</c>.
/// </para>
/// <para>
/// The determination of the maximum element matches the IEEE 754:2019 `maximumNumber` function. If either value is <see cref="IFloatingPointIeee754{TSelf}.NaN"/>
/// The determination of the minimum element matches the IEEE 754:2019 `minimumNumber` function. If either value is <see cref="IFloatingPointIeee754{TSelf}.NaN"/>
/// the other is returned. Positive 0 is considered greater than negative 0.
/// </para>
/// <para>

View file

@ -47,7 +47,7 @@ namespace System.Numerics.Tensors
/// <exception cref="DivideByZeroException"><typeparamref name="T"/> is an integer type and an element in <paramref name="x"/> is equal to zero.</exception>
/// <remarks>
/// <para>
/// This method effectively computes <c><paramref name="destination" />[i] = 1 / <paramref name="x" />[i]</c>.
/// This method effectively computes <c><paramref name="destination" />[i] = 1 / T.Sqrt(<paramref name="x" />[i])</c>.
/// </para>
/// </remarks>
public static void ReciprocalSqrt<T>(ReadOnlySpan<T> x, Span<T> destination)
@ -62,7 +62,7 @@ namespace System.Numerics.Tensors
/// <exception cref="DivideByZeroException"><typeparamref name="T"/> is an integer type and an element in <paramref name="x"/> is equal to zero.</exception>
/// <remarks>
/// <para>
/// This method effectively computes <c><paramref name="destination" />[i] = 1 / <paramref name="x" />[i]</c>.
/// This method effectively computes <c><paramref name="destination" />[i] = 1 / T.Sqrt(<paramref name="x" />[i])</c>.
/// </para>
/// </remarks>
public static void ReciprocalSqrtEstimate<T>(ReadOnlySpan<T> x, Span<T> destination)

View file

@ -819,11 +819,38 @@ namespace System.Numerics.Tests
Vector3 v = point - pp;
float d = Vector3.Dot(v, plane.Normal);
Vector3 vp = point - 2.0f * d * plane.Normal;
Assert.True(MathHelper.Equal(rp, vp), "Matrix4x4.Reflection did not provide expected value.");
Assert.True(MathHelper.Equal(rp, vp), "Matrix4x4.CreateReflection did not provide expected value.");
}
}
}
[Fact]
public void Matrix4x4CreateReflectionTest02()
{
Plane plane = new Plane(0, 1, 0, 60);
Matrix4x4 actual = Matrix4x4.CreateReflection(plane);
AssertExtensions.Equal(1.0f, actual.M11, 0.0f);
AssertExtensions.Equal(0.0f, actual.M12, 0.0f);
AssertExtensions.Equal(0.0f, actual.M13, 0.0f);
AssertExtensions.Equal(0.0f, actual.M14, 0.0f);
AssertExtensions.Equal(0.0f, actual.M21, 0.0f);
AssertExtensions.Equal(-1.0f, actual.M22, 0.0f);
AssertExtensions.Equal(0.0f, actual.M23, 0.0f);
AssertExtensions.Equal(0.0f, actual.M24, 0.0f);
AssertExtensions.Equal(0.0f, actual.M31, 0.0f);
AssertExtensions.Equal(0.0f, actual.M32, 0.0f);
AssertExtensions.Equal(1.0f, actual.M33, 0.0f);
AssertExtensions.Equal(0.0f, actual.M34, 0.0f);
AssertExtensions.Equal(0.0f, actual.M41, 0.0f);
AssertExtensions.Equal(-120.0f, actual.M42, 0.0f);
AssertExtensions.Equal(0.0f, actual.M43, 0.0f);
AssertExtensions.Equal(1.0f, actual.M44, 0.0f);
}
// A test for CreateRotationZ (float)
[Fact]
public void Matrix4x4CreateRotationZTest()

View file

@ -620,7 +620,7 @@ namespace System.Numerics
// https://github.com/microsoft/DirectXMath/blob/master/Inc/DirectXMathMatrix.inl
Vector4 p = Plane.Normalize(value).AsVector4();
Vector4 s = p * -2.0f;
Vector4 s = p * Vector4.Create(-2.0f, -2.0f, -2.0f, 0.0f);
Impl result;

View file

@ -3056,6 +3056,27 @@ namespace System.Threading.Tasks
bool returnValue = SpinWait(millisecondsTimeout);
if (!returnValue)
{
#if CORECLR
if (ThreadPoolWorkQueue.s_prioritizationExperiment)
{
// We're about to block waiting for the task to complete, which is expensive, and if
// the task being waited on depends on some other work to run, this thread could end up
// waiting for some other thread to do work. If the two threads are part of the same scheduler,
// such as the thread pool, that could lead to a (temporary) deadlock. This is made worse by
// it also leading to a possible priority inversion on previously queued work. Each thread in
// the thread pool has a local queue. A key motivator for this local queue is it allows this
// thread to create work items that it will then prioritize above all other work in the
// pool. However, while this thread makes its own local queue the top priority, that queue is
// every other thread's lowest priority. If this thread blocks, all of its created work that's
// supposed to be high priority becomes low priority, and work that's typically part of a
// currently in-flight operation gets deprioritized relative to new requests coming into the
// pool, which can lead to the whole system slowing down or even deadlocking. To address that,
// just before we block, we move all local work into a global queue, so that it's at least
// prioritized by other threads more fairly with respect to other work.
ThreadPoolWorkQueue.TransferAllLocalWorkItemsToHighPriorityGlobalQueue();
}
#endif
var mres = new SetOnInvokeMres();
try
{

View file

@ -701,6 +701,27 @@ namespace System.Threading
EnsureThreadRequested();
}
internal static void TransferAllLocalWorkItemsToHighPriorityGlobalQueue()
{
// If there's no local queue, there's nothing to transfer.
if (ThreadPoolWorkQueueThreadLocals.threadLocals is not ThreadPoolWorkQueueThreadLocals tl)
{
return;
}
// Pop each work item off the local queue and push it onto the global. This is a
// bounded loop as no other thread is allowed to push into this thread's queue.
ThreadPoolWorkQueue queue = ThreadPool.s_workQueue;
while (tl.workStealingQueue.LocalPop() is object workItem)
{
queue.highPriorityWorkItems.Enqueue(workItem);
}
Volatile.Write(ref queue._mayHaveHighPriorityWorkItems, true);
queue.EnsureThreadRequested();
}
internal static bool LocalFindAndPop(object callback)
{
ThreadPoolWorkQueueThreadLocals? tl = ThreadPoolWorkQueueThreadLocals.threadLocals;

View file

@ -544,9 +544,9 @@ namespace System.Numerics
isNegative = true;
length = value.LastIndexOfAnyExcept(uint.MaxValue) + 1;
if ((length == 0) || ((int)value[length - 1] > 0))
if ((length == 0) || ((int)value[length - 1] >= 0))
{
// We ne need to preserve the sign bit
// We need to preserve the sign bit
length++;
}
Debug.Assert((int)value[length - 1] < 0);

View file

@ -877,6 +877,11 @@ namespace System.Numerics.Tests
}
public static string Print(byte[] bytes)
{
return Print(bytes.AsSpan());
}
public static string Print(ReadOnlySpan<byte> bytes)
{
string ret = "make ";

View file

@ -0,0 +1,81 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace System.Numerics.Tests
{
public static partial class SampleGeneration
{
public static IEnumerable<ReadOnlyMemory<T>> EnumerateSequence<T>(IEnumerable<T> elementSource, int minLength, int maxLengthExclusive)
{
return EnumerateSequence(elementSource.ToArray(), minLength, maxLengthExclusive);
}
public static IEnumerable<ReadOnlyMemory<T>> EnumerateSequence<T>(T[] elementSource, int minLength, int maxLengthExclusive)
{
for (var i = minLength; maxLengthExclusive > i; ++i)
{
foreach (var item in EnumerateSequence(elementSource, i))
{
yield return item;
}
}
}
public static IEnumerable<ReadOnlyMemory<T>> EnumerateSequence<T>(IEnumerable<T> elementSource, int length)
{
return EnumerateSequence(elementSource.ToArray(), length);
}
public static IEnumerable<ReadOnlyMemory<T>> EnumerateSequence<T>(T[] elementSource, int length)
{
var a = new T[length];
var r = new ReadOnlyMemory<T>(a);
foreach (var _ in EnumerateSequenceYieldsCurrentCount(elementSource, a))
{
yield return r;
}
}
private static IEnumerable<long> EnumerateSequenceYieldsCurrentCount<T>(T[] elementSource, T[] buffer)
{
var c = 0L;
var b = elementSource.Length;
if (b != 0)
{
var stack = new int[buffer.Length];
for (var i = 0; i < buffer.Length; ++i)
{
buffer[i] = elementSource[0];
}
{
L:;
yield return c++;
for (var i = 0; stack.Length != i; ++i)
{
var en = ++stack[i];
if (b == en)
{
}
else
{
buffer[i] = elementSource[en];
for (; 0 <= --i;)
{
buffer[i] = elementSource[0];
stack[i] = 0;
}
goto L;
}
}
}
}
}
}
}

View file

@ -0,0 +1,138 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using Xunit;
namespace System.Numerics.Tests
{
public static partial class UInt32Samples
{
private static readonly uint[] set1 = new uint[] {
0B00000000000000000000000000000000U,
0B00000000000000000000000000000001U,
0B00111111111111111111111111111110U,
0B00111111111111111111111111111111U,
0B01000000000000000000000000000000U,
0B01000000000000000000000000000001U,
0B01111111111111111111111111111110U,
0B01111111111111111111111111111111U,
0B10000000000000000000000000000000U,
0B10000000000000000000000000000001U,
0B10111111111111111111111111111110U,
0B10111111111111111111111111111111U,
0B11000000000000000000000000000000U,
0B11000000000000000000000000000001U,
0B11111111111111111111111111111110U,
0B11111111111111111111111111111111U,
};
private static IEnumerable<uint> GetSet1()
{
foreach (var item in set1)
{
yield return item;
}
}
public static readonly IEnumerable<uint> Set1 = GetSet1();
private static readonly uint[] set2 = new uint[] {
0B00000000000000000000000000000000U,
0B00000000000000000000000000000001U,
0B00000000000000000100000000000000U,
0B00000000000000000100000000000001U,
0B00000000000000010000000000000000U,
0B00000000000000010000000000000001U,
0B00000000000000010100000000000000U,
0B00000000000000010100000000000001U,
0B00111111111111111111111111111110U,
0B00111111111111111111111111111111U,
0B00111111111111111011111111111110U,
0B00111111111111111011111111111111U,
0B00111111111111101111111111111110U,
0B00111111111111101111111111111111U,
0B00111111111111101011111111111110U,
0B00111111111111101011111111111111U,
0B01000000000000000000000000000000U,
0B01000000000000000000000000000001U,
0B01000000000000000100000000000000U,
0B01000000000000000100000000000001U,
0B01000000000000010000000000000000U,
0B01000000000000010000000000000001U,
0B01000000000000010100000000000000U,
0B01000000000000010100000000000001U,
0B01111111111111111111111111111110U,
0B01111111111111111111111111111111U,
0B01111111111111111011111111111110U,
0B01111111111111111011111111111111U,
0B01111111111111101111111111111110U,
0B01111111111111101111111111111111U,
0B01111111111111101011111111111110U,
0B01111111111111101011111111111111U,
0B10000000000000000000000000000000U,
0B10000000000000000000000000000001U,
0B10000000000000000100000000000000U,
0B10000000000000000100000000000001U,
0B10000000000000010000000000000000U,
0B10000000000000010000000000000001U,
0B10000000000000010100000000000000U,
0B10000000000000010100000000000001U,
0B10111111111111111111111111111110U,
0B10111111111111111111111111111111U,
0B10111111111111111011111111111110U,
0B10111111111111111011111111111111U,
0B10111111111111101111111111111110U,
0B10111111111111101111111111111111U,
0B10111111111111101011111111111110U,
0B10111111111111101011111111111111U,
0B11000000000000000000000000000000U,
0B11000000000000000000000000000001U,
0B11000000000000000100000000000000U,
0B11000000000000000100000000000001U,
0B11000000000000010000000000000000U,
0B11000000000000010000000000000001U,
0B11000000000000010100000000000000U,
0B11000000000000010100000000000001U,
0B11111111111111111111111111111110U,
0B11111111111111111111111111111111U,
0B11111111111111111011111111111110U,
0B11111111111111111011111111111111U,
0B11111111111111101111111111111110U,
0B11111111111111101111111111111111U,
0B11111111111111101011111111111110U,
0B11111111111111101011111111111111U,
};
private static IEnumerable<uint> GetSet2()
{
foreach (var item in set2)
{
yield return item;
}
}
public static readonly IEnumerable<uint> Set2 = GetSet2();
}
}

View file

@ -1,6 +1,9 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using Xunit;
namespace System.Numerics.Tests
@ -117,6 +120,42 @@ namespace System.Numerics.Tests
}
}
[Fact]
public void Issue109669()
{
// Operations on numbers whose result is of the form 0xFFFFFFFF 00000000 ... 00000000
// in two's complement.
Assert.Equal(-4294967296, new BigInteger(-4294967296) & new BigInteger(-1919810));
Assert.Equal(-4294967296, new BigInteger(-4042322161) & new BigInteger(-252645136));
Assert.Equal(-4294967296, new BigInteger(-8589934592) | new BigInteger(-21474836480));
BigInteger a = new BigInteger(MemoryMarshal.AsBytes([uint.MaxValue, 0u, 0u]), isBigEndian: true);
Assert.Equal(a, a & a);
Assert.Equal(a, a | a);
Assert.Equal(a, a ^ 0);
}
[Fact]
public static void RunAndTestsForSampleSet1()
{
var s = SampleGeneration.EnumerateSequence(UInt32Samples.Set1, 2);
var t = SampleGeneration.EnumerateSequence(UInt32Samples.Set1, 2);
foreach (var i in s)
{
foreach (var j in t)
{
var a = MemoryMarshal.AsBytes(i.Span);
var b = MemoryMarshal.AsBytes(j.Span);
VerifyAndString(Print(a) + Print(b) + "b&");
VerifyAndString(Print(b) + Print(a) + "b&");
}
}
}
private static void VerifyAndString(string opstring)
{
StackCalc sc = new StackCalc(opstring);
@ -139,5 +178,10 @@ namespace System.Numerics.Tests
{
return MyBigIntImp.Print(bytes);
}
private static string Print(ReadOnlySpan<byte> bytes)
{
return MyBigIntImp.Print(bytes);
}
}
}

View file

@ -48,10 +48,12 @@
<Compile Include="BigInteger\pow.cs" />
<Compile Include="BigInteger\properties.cs" />
<Compile Include="BigInteger\remainder.cs" />
<Compile Include="BigInteger\SampleGeneration.cs" />
<Compile Include="BigInteger\sign.cs" />
<Compile Include="BigInteger\stackcalculator.cs" />
<Compile Include="BigInteger\ToByteArray.cs" />
<Compile Include="BigInteger\TryWriteBytes.cs" />
<Compile Include="BigInteger\UInt32Samples.cs" />
<Compile Include="ComplexTests.cs" />
</ItemGroup>
<ItemGroup>

View file

@ -513,7 +513,8 @@
Link="Common\Interop\Windows\Crypt32\Interop.MsgEncodingType.cs" />
<Compile Include="$(CommonPath)Interop\Windows\Interop.Libraries.cs"
Link="Common\Interop\Windows\Interop.Libraries.cs" />
<Compile Include="X509Certificates\InteropTests.Windows.cs" />
<Compile Include="X509Certificates\InteropTests.Windows.cs" />
<Compile Include="X509Certificates\X509FilesystemTests.Windows.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="$(CommonTestPath)StreamConformanceTests\StreamConformanceTests.csproj" />

View file

@ -0,0 +1,532 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Security.Cryptography.Pkcs;
using System.Security.Principal;
using System.Threading;
using Test.Cryptography;
using Xunit;
namespace System.Security.Cryptography.X509Certificates.Tests
{
[Collection("X509Filesystem")]
public static class X509FilesystemTests
{
// Microsoft Strong Cryptographic Provider
private static readonly AsnEncodedData s_capiCsp = new AsnEncodedData(
new Oid("1.3.6.1.4.1.311.17.1", null),
(
"1E4E004D006900630072006F0073006F006600740020005300740072006F006E" +
"0067002000430072007900700074006F00670072006100700068006900630020" +
"00500072006F00760069006400650072"
).HexToByteArray());
private static readonly AsnEncodedData s_machineKey = new AsnEncodedData(
new Oid("1.3.6.1.4.1.311.17.2", null),
[0x05, 0x00]);
private static readonly Pkcs12LoaderLimits s_cspPreservingLimits = new Pkcs12LoaderLimits
{
PreserveStorageProvider = true,
};
// 6 random keys that will used across all of the tests in this file
private const int KeyGenKeySize = 2048;
private static readonly RSA[] s_keys =
{
RSA.Create(KeyGenKeySize), RSA.Create(KeyGenKeySize), RSA.Create(KeyGenKeySize),
RSA.Create(KeyGenKeySize), RSA.Create(KeyGenKeySize), RSA.Create(KeyGenKeySize),
};
[Theory]
[InlineData(X509KeyStorageFlags.DefaultKeySet)]
[InlineData(X509KeyStorageFlags.DefaultKeySet, true)]
[InlineData(X509KeyStorageFlags.UserKeySet)]
[InlineData(X509KeyStorageFlags.UserKeySet, true)]
[InlineData(X509KeyStorageFlags.MachineKeySet)]
[InlineData(X509KeyStorageFlags.MachineKeySet, true)]
public static void AllFilesDeleted_MultiplePrivateKey_Ctor(X509KeyStorageFlags storageFlags, bool capi = false)
{
AllFilesDeletedTest(
storageFlags,
capi,
multiPrivate: true,
static (bytes, pwd, flags) => new X509Certificate2(bytes, pwd, flags));
}
[Theory]
[InlineData(X509KeyStorageFlags.DefaultKeySet)]
[InlineData(X509KeyStorageFlags.DefaultKeySet, true)]
[InlineData(X509KeyStorageFlags.UserKeySet)]
[InlineData(X509KeyStorageFlags.UserKeySet, true)]
[InlineData(X509KeyStorageFlags.MachineKeySet)]
[InlineData(X509KeyStorageFlags.MachineKeySet, true)]
public static void AllFilesDeleted_SinglePrivateKey_Ctor(X509KeyStorageFlags storageFlags, bool capi = false)
{
AllFilesDeletedTest(
storageFlags,
capi,
multiPrivate: false,
static (bytes, pwd, flags) => new X509Certificate2(bytes, pwd, flags));
}
[Theory]
[InlineData(X509KeyStorageFlags.DefaultKeySet)]
[InlineData(X509KeyStorageFlags.DefaultKeySet, true)]
[InlineData(X509KeyStorageFlags.UserKeySet)]
[InlineData(X509KeyStorageFlags.UserKeySet, true)]
[InlineData(X509KeyStorageFlags.MachineKeySet)]
[InlineData(X509KeyStorageFlags.MachineKeySet, true)]
public static void AllFilesDeleted_MultiplePrivateKey_CollImport(X509KeyStorageFlags storageFlags, bool capi = false)
{
AllFilesDeletedTest(
storageFlags,
capi,
multiPrivate: true,
Cert.Import);
}
[Theory]
[InlineData(X509KeyStorageFlags.DefaultKeySet)]
[InlineData(X509KeyStorageFlags.DefaultKeySet, true)]
[InlineData(X509KeyStorageFlags.UserKeySet)]
[InlineData(X509KeyStorageFlags.UserKeySet, true)]
[InlineData(X509KeyStorageFlags.MachineKeySet)]
[InlineData(X509KeyStorageFlags.MachineKeySet, true)]
public static void AllFilesDeleted_SinglePrivateKey_CollImport(X509KeyStorageFlags storageFlags, bool capi = false)
{
AllFilesDeletedTest(
storageFlags,
capi,
multiPrivate: false,
Cert.Import);
}
[Theory]
[InlineData(X509KeyStorageFlags.DefaultKeySet)]
[InlineData(X509KeyStorageFlags.DefaultKeySet, true)]
[InlineData(X509KeyStorageFlags.UserKeySet)]
[InlineData(X509KeyStorageFlags.UserKeySet, true)]
[InlineData(X509KeyStorageFlags.MachineKeySet)]
[InlineData(X509KeyStorageFlags.MachineKeySet, true)]
public static void AllFilesDeleted_MultiplePrivateKey_SingleLoader(X509KeyStorageFlags storageFlags, bool capi = false)
{
AllFilesDeletedTest(
storageFlags,
capi,
multiPrivate: true,
static (bytes, pwd, flags) => X509CertificateLoader.LoadPkcs12(bytes, pwd, flags));
}
[Theory]
[InlineData(X509KeyStorageFlags.DefaultKeySet)]
[InlineData(X509KeyStorageFlags.DefaultKeySet, true)]
[InlineData(X509KeyStorageFlags.UserKeySet)]
[InlineData(X509KeyStorageFlags.UserKeySet, true)]
[InlineData(X509KeyStorageFlags.MachineKeySet)]
[InlineData(X509KeyStorageFlags.MachineKeySet, true)]
public static void AllFilesDeleted_SinglePrivateKey_SingleLoader(X509KeyStorageFlags storageFlags, bool capi = false)
{
AllFilesDeletedTest(
storageFlags,
capi,
multiPrivate: false,
static (bytes, pwd, flags) => X509CertificateLoader.LoadPkcs12(bytes, pwd, flags));
}
[Theory]
[InlineData(X509KeyStorageFlags.DefaultKeySet)]
[InlineData(X509KeyStorageFlags.DefaultKeySet, true)]
[InlineData(X509KeyStorageFlags.UserKeySet)]
[InlineData(X509KeyStorageFlags.UserKeySet, true)]
[InlineData(X509KeyStorageFlags.MachineKeySet)]
[InlineData(X509KeyStorageFlags.MachineKeySet, true)]
public static void AllFilesDeleted_MultiplePrivateKey_CollLoader(X509KeyStorageFlags storageFlags, bool capi = false)
{
AllFilesDeletedTest(
storageFlags,
capi,
multiPrivate: true,
static (bytes, pwd, flags) => new ImportedCollection(
X509CertificateLoader.LoadPkcs12Collection(bytes, pwd, flags)));
}
[Theory]
[InlineData(X509KeyStorageFlags.DefaultKeySet)]
[InlineData(X509KeyStorageFlags.DefaultKeySet, true)]
[InlineData(X509KeyStorageFlags.UserKeySet)]
[InlineData(X509KeyStorageFlags.UserKeySet, true)]
[InlineData(X509KeyStorageFlags.MachineKeySet)]
[InlineData(X509KeyStorageFlags.MachineKeySet, true)]
public static void AllFilesDeleted_SinglePrivateKey_CollLoader(X509KeyStorageFlags storageFlags, bool capi = false)
{
AllFilesDeletedTest(
storageFlags,
capi,
multiPrivate: false,
static (bytes, pwd, flags) => new ImportedCollection(
X509CertificateLoader.LoadPkcs12Collection(bytes, pwd, flags)));
}
[Theory]
[InlineData(X509KeyStorageFlags.DefaultKeySet)]
[InlineData(X509KeyStorageFlags.DefaultKeySet, true)]
[InlineData(X509KeyStorageFlags.UserKeySet)]
[InlineData(X509KeyStorageFlags.UserKeySet, true)]
[InlineData(X509KeyStorageFlags.MachineKeySet)]
[InlineData(X509KeyStorageFlags.MachineKeySet, true)]
public static void AllFilesDeleted_MultiplePrivateKey_SingleLoader_KeepCsp(X509KeyStorageFlags storageFlags, bool capi = false)
{
AllFilesDeletedTest(
storageFlags,
capi,
multiPrivate: true,
static (bytes, pwd, flags) =>
X509CertificateLoader.LoadPkcs12(bytes, pwd, flags, s_cspPreservingLimits));
}
[Theory]
[InlineData(X509KeyStorageFlags.DefaultKeySet)]
[InlineData(X509KeyStorageFlags.DefaultKeySet, true)]
[InlineData(X509KeyStorageFlags.UserKeySet)]
[InlineData(X509KeyStorageFlags.UserKeySet, true)]
[InlineData(X509KeyStorageFlags.MachineKeySet)]
[InlineData(X509KeyStorageFlags.MachineKeySet, true)]
public static void AllFilesDeleted_SinglePrivateKey_SingleLoader_KeepCsp(X509KeyStorageFlags storageFlags, bool capi = false)
{
AllFilesDeletedTest(
storageFlags,
capi,
multiPrivate: false,
static (bytes, pwd, flags) =>
X509CertificateLoader.LoadPkcs12(bytes, pwd, flags, s_cspPreservingLimits));
}
[Theory]
[InlineData(X509KeyStorageFlags.DefaultKeySet)]
[InlineData(X509KeyStorageFlags.DefaultKeySet, true)]
[InlineData(X509KeyStorageFlags.UserKeySet)]
[InlineData(X509KeyStorageFlags.UserKeySet, true)]
[InlineData(X509KeyStorageFlags.MachineKeySet)]
[InlineData(X509KeyStorageFlags.MachineKeySet, true)]
public static void AllFilesDeleted_MultiplePrivateKey_CollLoader_KeepCsp(X509KeyStorageFlags storageFlags, bool capi = false)
{
AllFilesDeletedTest(
storageFlags,
capi,
multiPrivate: true,
static (bytes, pwd, flags) => new ImportedCollection(
X509CertificateLoader.LoadPkcs12Collection(bytes, pwd, flags, s_cspPreservingLimits)));
}
[Theory]
[InlineData(X509KeyStorageFlags.DefaultKeySet)]
[InlineData(X509KeyStorageFlags.DefaultKeySet, true)]
[InlineData(X509KeyStorageFlags.UserKeySet)]
[InlineData(X509KeyStorageFlags.UserKeySet, true)]
[InlineData(X509KeyStorageFlags.MachineKeySet)]
[InlineData(X509KeyStorageFlags.MachineKeySet, true)]
public static void AllFilesDeleted_SinglePrivateKey_CollLoader_KeepCsp(X509KeyStorageFlags storageFlags, bool capi = false)
{
AllFilesDeletedTest(
storageFlags,
capi,
multiPrivate: false,
static (bytes, pwd, flags) => new ImportedCollection(
X509CertificateLoader.LoadPkcs12Collection(bytes, pwd, flags, s_cspPreservingLimits)));
}
private static void AllFilesDeletedTest(
X509KeyStorageFlags storageFlags,
bool capi,
bool multiPrivate,
Func<byte[], string, X509KeyStorageFlags, IDisposable> importer,
[CallerMemberName] string? name = null)
{
const X509KeyStorageFlags NonDefaultKeySet =
X509KeyStorageFlags.UserKeySet |
X509KeyStorageFlags.MachineKeySet;
bool defaultKeySet = (storageFlags & NonDefaultKeySet) == 0;
int certAndKeyCount = multiPrivate ? s_keys.Length : 1;
byte[] pfx = MakePfx(certAndKeyCount, capi, name);
EnsureNoKeysGained(
(Bytes: pfx, Flags: storageFlags, Importer: importer),
static state => state.Importer(state.Bytes, "", state.Flags));
// When importing for DefaultKeySet, try both 010101 and 101010
// intermixing of machine and user keys so that single key import
// gets both a machine key and a user key.
if (defaultKeySet)
{
pfx = MakePfx(certAndKeyCount, capi, name, 1);
EnsureNoKeysGained(
(Bytes: pfx, Flags: storageFlags, Importer: importer),
static state => state.Importer(state.Bytes, "", state.Flags));
}
}
private static byte[] MakePfx(
int certAndKeyCount,
bool capi,
[CallerMemberName] string? name = null,
int machineKeySkew = 0)
{
Pkcs12SafeContents keys = new Pkcs12SafeContents();
Pkcs12SafeContents certs = new Pkcs12SafeContents();
DateTimeOffset notBefore = DateTimeOffset.UtcNow.AddMinutes(-5);
DateTimeOffset notAfter = notBefore.AddMinutes(10);
PbeParameters pbeParams = new PbeParameters(
PbeEncryptionAlgorithm.TripleDes3KeyPkcs12,
HashAlgorithmName.SHA1,
1);
Span<int> indices = [0, 1, 2, 3, 4, 5];
RandomNumberGenerator.Shuffle(indices);
for (int i = 0; i < s_keys.Length; i++)
{
RSA key = s_keys[indices[i]];
CertificateRequest req = new CertificateRequest(
$"CN={name}.{i}",
key,
HashAlgorithmName.SHA256,
RSASignaturePadding.Pkcs1);
using (X509Certificate2 cert = req.CreateSelfSigned(notBefore, notAfter))
{
Pkcs12CertBag certBag = certs.AddCertificate(cert);
if (i < certAndKeyCount)
{
Pkcs12ShroudedKeyBag keyBag = keys.AddShroudedKey(key, "", pbeParams);
if (capi)
{
keyBag.Attributes.Add(s_capiCsp);
}
if (int.IsEvenInteger(i + machineKeySkew))
{
keyBag.Attributes.Add(s_machineKey);
}
byte keyId = checked((byte)i);
Pkcs9LocalKeyId localKeyId = new Pkcs9LocalKeyId(new ReadOnlySpan<byte>(ref keyId));
keyBag.Attributes.Add(localKeyId);
certBag.Attributes.Add(localKeyId);
}
}
}
Pkcs12Builder builder = new Pkcs12Builder();
builder.AddSafeContentsEncrypted(certs, "", pbeParams);
builder.AddSafeContentsUnencrypted(keys);
builder.SealWithMac("", HashAlgorithmName.SHA1, 1);
return builder.Encode();
}
private static void EnsureNoKeysGained<TState>(TState state, Func<TState, IDisposable> importer)
{
const int ERROR_ACCESS_DENIED = (unchecked((int)0x80010005));
// In the good old days, before we had threads or parallel processes, these tests would be easy:
// * Read the directory listing(s)
// * Import a thing
// * See what new things were added
// * Dispose the thing
// * See that the new things went away
//
// But, since files can be created by tests on other threads, or even by other processes,
// recheck the directory a few times (MicroRetryCount) after sleeping (SleepMs).
//
// Sadly, that's not sufficient, because an extra file gained during that window could itself
// be leaked, or be intentionally persisted beyond the recheck interval. So, instead of failing,
// try again from the beginning. If we get parallel leaked on MacroRetryCount times in a row
// we'll still false-fail, but unless a majority of the tests in the process are leaking keys,
// it's unlikely.
//
// Before changing these constants to bigger numbers, consider the combinatorics. Failure will
// sleep (MacroRetryCount * (MicroRetryCount - 1) * SleepMs) ms, and also involves non-zero work.
// Failing 29 tests at (3, 5, 1000) adds about 6 minutes to the test run compared to success.
const int MacroRetryCount = 3;
const int MicroRetryCount = 5;
const int SleepMs = 1000;
KeyPaths keyPaths = KeyPaths.GetKeyPaths();
HashSet<string> gainedFiles = null;
for (int macro = 0; macro < MacroRetryCount; macro++)
{
List<string> keysBefore = new(keyPaths.EnumerateAllKeys());
IDisposable imported = null;
try
{
imported = importer(state);
}
catch (CryptographicException ex) when (ex.HResult == ERROR_ACCESS_DENIED)
{
}
imported?.Dispose();
gainedFiles = new HashSet<string>(keyPaths.EnumerateAllKeys());
gainedFiles.ExceptWith(keysBefore);
for (int micro = 0; micro < MicroRetryCount; micro++)
{
if (gainedFiles.Count == 0)
{
return;
}
HashSet<string> thisTry = new(keyPaths.EnumerateAllKeys());
gainedFiles.IntersectWith(thisTry);
if (gainedFiles.Count != 0 && micro < MicroRetryCount - 1)
{
Thread.Sleep(SleepMs);
}
}
}
Assert.Empty(keyPaths.MapPaths(gainedFiles));
}
private sealed class KeyPaths
{
private static volatile KeyPaths s_instance;
private string _capiUserDsa;
private string _capiUserRsa;
private string _capiMachineDsa;
private string _capiMachineRsa;
private string _cngUser;
private string _cngMachine;
private KeyPaths()
{
}
internal IEnumerable<string> MapPaths(IEnumerable<string> paths)
{
foreach (string path in paths)
{
yield return
Replace(path, _cngUser, "CNG-USER") ??
Replace(path, _capiUserRsa, "CAPI-USER-RSA") ??
Replace(path, _cngMachine, "CNG-MACH") ??
Replace(path, _capiMachineRsa, "CAPI-MACH-RSA") ??
Replace(path, _capiUserDsa, "CAPI-USER-DSS") ??
Replace(path, _capiMachineDsa, "CAPI-MACH-DSS") ??
path;
}
static string Replace(string path, string prefix, string ifMatched)
{
if (path.StartsWith(prefix))
{
return path.Replace(prefix, ifMatched);
}
return null;
}
}
internal IEnumerable<string> EnumerateCapiUserKeys()
{
return EnumerateFiles(_capiUserRsa).Concat(EnumerateFiles(_capiUserDsa));
}
internal IEnumerable<string> EnumerateCapiMachineKeys()
{
return EnumerateFiles(_capiMachineRsa).Concat(EnumerateFiles(_capiMachineDsa));
}
internal IEnumerable<string> EnumerateCngUserKeys()
{
return EnumerateFiles(_cngUser);
}
internal IEnumerable<string> EnumerateCngMachineKeys()
{
return EnumerateFiles(_cngMachine);
}
internal IEnumerable<string> EnumerateUserKeys()
{
return EnumerateCapiUserKeys().Concat(EnumerateCngUserKeys());
}
internal IEnumerable<string> EnumerateMachineKeys()
{
return EnumerateCapiMachineKeys().Concat(EnumerateCngMachineKeys());
}
internal IEnumerable<string> EnumerateAllKeys()
{
return EnumerateUserKeys().Concat(EnumerateMachineKeys());
}
private static IEnumerable<string> EnumerateFiles(string directory)
{
try
{
return Directory.EnumerateFiles(directory);
}
catch (DirectoryNotFoundException)
{
}
return [];
}
internal static KeyPaths GetKeyPaths()
{
if (s_instance is not null)
{
return s_instance;
}
// https://learn.microsoft.com/en-us/windows/win32/seccng/key-storage-and-retrieval
WindowsIdentity identity = WindowsIdentity.GetCurrent();
string userSid = identity.User!.ToString();
string userKeyBase = Path.Join(
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
"Microsoft",
"Crypto");
string machineKeyBase = Path.Join(
Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData),
"Microsoft",
"Crypto");
KeyPaths paths = new()
{
_capiUserDsa = Path.Join(userKeyBase, "DSS", userSid),
_capiUserRsa = Path.Join(userKeyBase, "RSA", userSid),
_capiMachineDsa = Path.Join(machineKeyBase, "DSS", "MachineKeys"),
_capiMachineRsa = Path.Join(machineKeyBase, "RSA", "MachineKeys"),
_cngUser = Path.Join(userKeyBase, "Keys"),
_cngMachine = Path.Join(machineKeyBase, "Keys"),
};
s_instance = paths;
return s_instance;
}
}
}
}

View file

@ -9,6 +9,8 @@
<IncludeInternalObsoleteAttribute>true</IncludeInternalObsoleteAttribute>
<UseCompilerGeneratedDocXmlFile>false</UseCompilerGeneratedDocXmlFile>
<IsPackable>true</IsPackable>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<ServicingVersion>1</ServicingVersion>
<PackageDescription>Provides high-performance and low-allocating types that serialize objects to JavaScript Object Notation (JSON) text and deserialize JSON text to objects, with UTF-8 support built-in. Also provides types to read and write JSON text encoded as UTF-8, and to create an in-memory document object model (DOM), that is read-only, for random access of the JSON elements within a structured view of the data.
The System.Text.Json library is built-in as part of the shared framework in .NET Runtime. The package can be installed when you need to use it in other target frameworks.</PackageDescription>

View file

@ -26,8 +26,8 @@ namespace System.Text.Json.Schema
internal const string MinLengthPropertyName = "minLength";
internal const string MaxLengthPropertyName = "maxLength";
public static JsonSchema False { get; } = new(false);
public static JsonSchema True { get; } = new(true);
public static JsonSchema CreateFalseSchema() => new(false);
public static JsonSchema CreateTrueSchema() => new(true);
public JsonSchema() { }
private JsonSchema(bool trueOrFalse) { _trueOrFalse = trueOrFalse; }
@ -279,7 +279,7 @@ namespace System.Text.Json.Schema
switch (schema._trueOrFalse)
{
case false:
schema = new JsonSchema { Not = True };
schema = new JsonSchema { Not = CreateTrueSchema() };
break;
case true:
schema = new JsonSchema();

View file

@ -211,7 +211,7 @@ namespace System.Text.Json.Schema
JsonUnmappedMemberHandling effectiveUnmappedMemberHandling = typeInfo.UnmappedMemberHandling ?? typeInfo.Options.UnmappedMemberHandling;
if (effectiveUnmappedMemberHandling is JsonUnmappedMemberHandling.Disallow)
{
additionalProperties = JsonSchema.False;
additionalProperties = JsonSchema.CreateFalseSchema();
}
if (typeDiscriminator is { } typeDiscriminatorPair)
@ -350,7 +350,7 @@ namespace System.Text.Json.Schema
default:
Debug.Assert(typeInfo.Kind is JsonTypeInfoKind.None);
// Return a `true` schema for types with user-defined converters.
return CompleteSchema(ref state, JsonSchema.True);
return CompleteSchema(ref state, JsonSchema.CreateTrueSchema());
}
JsonSchema CompleteSchema(ref GenerationState state, JsonSchema schema)

View file

@ -80,6 +80,6 @@ namespace System.Text.Json.Serialization.Converters
return node;
}
internal override JsonSchema? GetSchema(JsonNumberHandling _) => JsonSchema.True;
internal override JsonSchema? GetSchema(JsonNumberHandling _) => JsonSchema.CreateTrueSchema();
}
}

View file

@ -31,6 +31,6 @@ namespace System.Text.Json.Serialization.Converters
return JsonValue.CreateFromElement(ref element, options.GetNodeOptions());
}
internal override JsonSchema? GetSchema(JsonNumberHandling _) => JsonSchema.True;
internal override JsonSchema? GetSchema(JsonNumberHandling _) => JsonSchema.CreateTrueSchema();
}
}

View file

@ -147,6 +147,6 @@ namespace System.Text.Json.Serialization.Converters
return true;
}
internal override JsonSchema? GetSchema(JsonNumberHandling _) => JsonSchema.True;
internal override JsonSchema? GetSchema(JsonNumberHandling _) => JsonSchema.CreateTrueSchema();
}
}

View file

@ -26,6 +26,6 @@ namespace System.Text.Json.Serialization.Converters
value.WriteTo(writer);
}
internal override JsonSchema? GetSchema(JsonNumberHandling _) => JsonSchema.True;
internal override JsonSchema? GetSchema(JsonNumberHandling _) => JsonSchema.CreateTrueSchema();
}
}

View file

@ -18,6 +18,6 @@ namespace System.Text.Json.Serialization.Converters
value.WriteTo(writer);
}
internal override JsonSchema? GetSchema(JsonNumberHandling _) => JsonSchema.True;
internal override JsonSchema? GetSchema(JsonNumberHandling _) => JsonSchema.CreateTrueSchema();
}
}

View file

@ -21,6 +21,6 @@ namespace System.Text.Json.Serialization.Converters
throw new NotSupportedException(ErrorMessage);
internal override JsonSchema? GetSchema(JsonNumberHandling _) =>
new JsonSchema { Comment = "Unsupported .NET type", Not = JsonSchema.True };
new JsonSchema { Comment = "Unsupported .NET type", Not = JsonSchema.CreateTrueSchema() };
}
}

View file

@ -1209,7 +1209,8 @@ namespace System.Text.Json.Serialization.Metadata
continue;
}
ParameterLookupKey paramKey = new(propertyInfo.PropertyType, propertyInfo.Name);
string propertyName = propertyInfo.MemberName ?? propertyInfo.Name;
ParameterLookupKey paramKey = new(propertyInfo.PropertyType, propertyName);
if (!parameterIndex.TryAdd(paramKey, parameterInfo))
{
// Multiple object properties cannot bind to the same constructor parameter.

View file

@ -1668,5 +1668,32 @@ namespace System.Text.Json.Serialization.Tests
Assert.Equal(2, result.Y);
Assert.Equal(3, result.Z);
}
[Fact]
public async Task ClassWithConflictingCaseInsensitiveProperties_Succeeds_When_CaseSensitive()
{
// Regression test for https://github.com/dotnet/runtime/issues/109768
string json = """{"a": "lower", "A": "upper"}""";
ClassWithConflictingCaseInsensitiveProperties result = await Serializer.DeserializeWrapper<ClassWithConflictingCaseInsensitiveProperties>(json);
Assert.Equal("lower", result.From);
Assert.Equal("upper", result.To);
}
public class ClassWithConflictingCaseInsensitiveProperties
{
[JsonPropertyName("a")]
public string From { get; set; }
[JsonPropertyName("A")]
public string To { get; set; }
[JsonConstructor]
public ClassWithConflictingCaseInsensitiveProperties(string from, string to)
{
From = from;
To = to;
}
}
}
}

View file

@ -1102,6 +1102,18 @@ namespace System.Text.Json.Schema.Tests
}
""");
yield return new TestData<ClassWithPropertiesUsingCustomConverters>(
Value: new() { Prop1 = new() , Prop2 = new() },
ExpectedJsonSchema: """
{
"type": ["object","null"],
"properties": {
"Prop1": true,
"Prop2": true,
}
}
""");
// Collection types
yield return new TestData<int[]>([1, 2, 3], ExpectedJsonSchema: """{"type":["array","null"],"items":{"type":"integer"}}""");
yield return new TestData<List<bool>>([false, true, false], ExpectedJsonSchema: """{"type":["array","null"],"items":{"type":"boolean"}}""");
@ -1586,6 +1598,29 @@ namespace System.Text.Json.Schema.Tests
IEnumerable<ITestData> GetTestDataForAllValues();
}
public class ClassWithPropertiesUsingCustomConverters
{
[JsonPropertyOrder(0)]
public ClassWithCustomConverter1 Prop1 { get; set; }
[JsonPropertyOrder(1)]
public ClassWithCustomConverter2 Prop2 { get; set; }
[JsonConverter(typeof(CustomConverter<ClassWithCustomConverter1>))]
public class ClassWithCustomConverter1;
[JsonConverter(typeof(CustomConverter<ClassWithCustomConverter2>))]
public class ClassWithCustomConverter2;
public sealed class CustomConverter<T> : JsonConverter<T>
{
public override T? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
=> default;
public override void Write(Utf8JsonWriter writer, T value, JsonSerializerOptions options)
=> writer.WriteNullValue();
}
}
private static TAttribute? GetCustomAttribute<TAttribute>(ICustomAttributeProvider? provider, bool inherit = false) where TAttribute : Attribute
=> provider?.GetCustomAttributes(typeof(TAttribute), inherit).FirstOrDefault() as TAttribute;
}

View file

@ -98,6 +98,32 @@ namespace System.Text.Json.Schema.Tests
Assert.True(schema.ToJsonString().Length < 100_000);
}
[Fact]
public void TransformSchemaNode_PropertiesWithCustomConverters()
{
// Regression test for https://github.com/dotnet/runtime/issues/109868
List<(Type? ParentType, string? PropertyName, Type type)> visitedNodes = new();
JsonSchemaExporterOptions exporterOptions = new()
{
TransformSchemaNode = (ctx, schema) =>
{
visitedNodes.Add((ctx.PropertyInfo?.DeclaringType, ctx.PropertyInfo?.Name, ctx.TypeInfo.Type));
return schema;
}
};
List<(Type? ParentType, string? PropertyName, Type type)> expectedNodes =
[
(typeof(ClassWithPropertiesUsingCustomConverters), "Prop1", typeof(ClassWithPropertiesUsingCustomConverters.ClassWithCustomConverter1)),
(typeof(ClassWithPropertiesUsingCustomConverters), "Prop2", typeof(ClassWithPropertiesUsingCustomConverters.ClassWithCustomConverter2)),
(null, null, typeof(ClassWithPropertiesUsingCustomConverters)),
];
Serializer.DefaultOptions.GetJsonSchemaAsNode(typeof(ClassWithPropertiesUsingCustomConverters), exporterOptions);
Assert.Equal(expectedNodes, visitedNodes);
}
[Fact]
public void TypeWithDisallowUnmappedMembers_AdditionalPropertiesFailValidation()
{

View file

@ -154,6 +154,7 @@ namespace System.Text.Json.SourceGeneration.Tests
[JsonSerializable(typeof(TypeWithEnumParameters))]
[JsonSerializable(typeof(ClassWithIgnoredPropertyDefaultParam))]
[JsonSerializable(typeof(ClassWithCustomConverterOnCtorParameter))]
[JsonSerializable(typeof(ClassWithConflictingCaseInsensitiveProperties))]
internal sealed partial class ConstructorTestsContext_Metadata : JsonSerializerContext
{
}
@ -303,6 +304,7 @@ namespace System.Text.Json.SourceGeneration.Tests
[JsonSerializable(typeof(TypeWithEnumParameters))]
[JsonSerializable(typeof(ClassWithIgnoredPropertyDefaultParam))]
[JsonSerializable(typeof(ClassWithCustomConverterOnCtorParameter))]
[JsonSerializable(typeof(ClassWithConflictingCaseInsensitiveProperties))]
internal sealed partial class ConstructorTestsContext_Default : JsonSerializerContext
{
}

View file

@ -110,6 +110,7 @@ namespace System.Text.Json.SourceGeneration.Tests
[JsonSerializable(typeof(ClassWithComponentModelAttributes))]
[JsonSerializable(typeof(ClassWithJsonPointerEscapablePropertyNames))]
[JsonSerializable(typeof(ClassWithOptionalObjectParameter))]
[JsonSerializable(typeof(ClassWithPropertiesUsingCustomConverters))]
// Collection types
[JsonSerializable(typeof(int[]))]
[JsonSerializable(typeof(List<bool>))]

View file

@ -1263,12 +1263,13 @@ namespace System.Threading.ThreadPools.Tests
RemoteExecutor.Invoke(() =>
{
const int WorkItemCountPerKind = 100;
const int Kinds = 3;
int completedWorkItemCount = 0;
var allWorkItemsCompleted = new AutoResetEvent(false);
Action<int> workItem = _ =>
{
if (Interlocked.Increment(ref completedWorkItemCount) == WorkItemCountPerKind * 3)
if (Interlocked.Increment(ref completedWorkItemCount) == WorkItemCountPerKind * Kinds)
{
allWorkItemsCompleted.Set();
}
@ -1305,6 +1306,27 @@ namespace System.Threading.ThreadPools.Tests
0,
preferLocal: false);
ThreadPool.UnsafeQueueUserWorkItem(
_ =>
{
// Enqueue tasks from a thread pool thread into the local queue,
// then block this thread until a queued task completes.
startTest.CheckedWait();
Task queued = null;
for (int i = 0; i < WorkItemCountPerKind; i++)
{
queued = Task.Run(() => workItem(0));
}
queued
.ContinueWith(_ => { }) // prevent wait inlining
.Wait();
},
0,
preferLocal: false);
t = new Thread(() =>
{
// Enqueue local work from thread pool worker threads

View file

@ -2580,7 +2580,7 @@ mono_class_get_field_from_name_full (MonoClass *klass, const char *name, MonoTyp
MonoClassField *gfield = mono_metadata_get_corresponding_field_from_generic_type_definition (field);
g_assert (gfield != NULL);
MonoType *field_type = gfield->type;
if (!mono_metadata_type_equal_full (type, field_type, TRUE))
if (!mono_metadata_type_equal_full (type, field_type, MONO_TYPE_EQ_FLAGS_SIG_ONLY))
continue;
}
return field;

View file

@ -2305,8 +2305,8 @@ emit_unsafe_accessor_field_wrapper (MonoMethodBuilder *mb, gboolean inflate_gene
}
MonoClassField *target_field = mono_class_get_field_from_name_full (target_class, member_name, NULL);
if (target_field == NULL || !mono_metadata_type_equal_full (target_field->type, m_class_get_byval_arg (mono_class_from_mono_type_internal (ret_type)), TRUE)) {
mono_mb_emit_exception_full (mb, "System", "MissingFieldException",
if (target_field == NULL || !mono_metadata_type_equal_full (target_field->type, m_class_get_byval_arg (mono_class_from_mono_type_internal (ret_type)), MONO_TYPE_EQ_FLAGS_SIG_ONLY | MONO_TYPE_EQ_FLAG_IGNORE_CMODS)) {
mono_mb_emit_exception_full (mb, "System", "MissingFieldException",
g_strdup_printf("No '%s' in '%s'. Or the type of '%s' doesn't match", member_name, m_class_get_name (target_class), member_name));
return;
}
@ -2403,7 +2403,7 @@ inflate_method (MonoClass *klass, MonoMethod *method, MonoMethod *accessor_metho
if ((context.class_inst != NULL) || (context.method_inst != NULL))
result = mono_class_inflate_generic_method_checked (method, &context, error);
mono_error_assert_ok (error);
return result;
}
@ -2425,13 +2425,13 @@ emit_unsafe_accessor_ctor_wrapper (MonoMethodBuilder *mb, gboolean inflate_gener
mono_mb_emit_exception_full (mb, "System", "BadImageFormatException", "Invalid usage of UnsafeAccessorAttribute.");
return;
}
MonoClass *target_class = mono_class_from_mono_type_internal (target_type);
ERROR_DECL(find_method_error);
MonoMethodSignature *member_sig = ctor_sig_from_accessor_sig (mb, sig);
MonoClass *in_class = target_class;
MonoMethod *target_method = mono_unsafe_accessor_find_ctor (in_class, member_sig, target_class, find_method_error);
@ -2506,7 +2506,7 @@ emit_unsafe_accessor_method_wrapper (MonoMethodBuilder *mb, gboolean inflate_gen
emit_missing_method_error (mb, find_method_error, member_name);
return;
}
g_assert (target_method->klass == target_class);
emit_unsafe_accessor_ldargs (mb, sig, !hasthis ? 1 : 0);
@ -2733,7 +2733,7 @@ emit_swift_lowered_struct_load (MonoMethodBuilder *mb, MonoMethodSignature *csig
}
}
/* Swift struct lowering handling causes csig to have additional arguments.
/* Swift struct lowering handling causes csig to have additional arguments.
* This function returns the index of the argument in the csig that corresponds to the argument in the original signature.
*/
static int

View file

@ -1021,8 +1021,14 @@ mono_type_stack_size_internal (MonoType *t, int *align, gboolean allow_open);
MONO_API void mono_type_get_desc (GString *res, MonoType *type, mono_bool include_namespace);
enum {
MONO_TYPE_EQ_FLAGS_NONE = 0,
MONO_TYPE_EQ_FLAGS_SIG_ONLY = 1,
MONO_TYPE_EQ_FLAG_IGNORE_CMODS = 2,
};
gboolean
mono_metadata_type_equal_full (MonoType *t1, MonoType *t2, gboolean signature_only);
mono_metadata_type_equal_full (MonoType *t1, MonoType *t2, int flags);
MonoMarshalSpec *
mono_metadata_parse_marshal_spec_full (MonoImage *image, MonoImage *parent_image, const char *ptr);

View file

@ -45,11 +45,6 @@ typedef struct {
MonoGenericContext context;
} MonoInflatedMethodSignature;
enum {
MONO_TYPE_EQ_FLAGS_SIG_ONLY = 1,
MONO_TYPE_EQ_FLAG_IGNORE_CMODS = 2,
};
static gboolean do_mono_metadata_parse_type (MonoType *type, MonoImage *m, MonoGenericContainer *container, gboolean transient,
const char *ptr, const char **rptr, MonoError *error);
@ -2936,7 +2931,7 @@ aggregate_modifiers_equal (gconstpointer ka, gconstpointer kb)
for (int i = 0; i < amods1->count; ++i) {
if (amods1->modifiers [i].required != amods2->modifiers [i].required)
return FALSE;
if (!mono_metadata_type_equal_full (amods1->modifiers [i].type, amods2->modifiers [i].type, TRUE))
if (!mono_metadata_type_equal_full (amods1->modifiers [i].type, amods2->modifiers [i].type, MONO_TYPE_EQ_FLAGS_SIG_ONLY))
return FALSE;
}
return TRUE;
@ -5936,24 +5931,23 @@ do_mono_metadata_type_equal (MonoType *t1, MonoType *t2, int equiv_flags)
gboolean
mono_metadata_type_equal (MonoType *t1, MonoType *t2)
{
return do_mono_metadata_type_equal (t1, t2, 0);
return do_mono_metadata_type_equal (t1, t2, MONO_TYPE_EQ_FLAGS_NONE);
}
/**
* mono_metadata_type_equal_full:
* \param t1 a type
* \param t2 another type
* \param signature_only if signature only comparison should be made
* \param flags flags used to modify comparison logic
*
* Determine if \p t1 and \p t2 are signature compatible if \p signature_only is TRUE, otherwise
* behaves the same way as mono_metadata_type_equal.
* The function mono_metadata_type_equal(a, b) is just a shortcut for mono_metadata_type_equal_full(a, b, FALSE).
* \returns TRUE if \p t1 and \p t2 are equal taking \p signature_only into account.
* Determine if \p t1 and \p t2 are compatible based on the supplied flags.
* The function mono_metadata_type_equal(a, b) is just a shortcut for mono_metadata_type_equal_full(a, b, MONO_TYPE_EQ_FLAGS_NONE).
* \returns TRUE if \p t1 and \p t2 are equal.
*/
gboolean
mono_metadata_type_equal_full (MonoType *t1, MonoType *t2, gboolean signature_only)
mono_metadata_type_equal_full (MonoType *t1, MonoType *t2, int flags)
{
return do_mono_metadata_type_equal (t1, t2, signature_only ? MONO_TYPE_EQ_FLAGS_SIG_ONLY : 0);
return do_mono_metadata_type_equal (t1, t2, flags);
}
enum {

View file

@ -5757,8 +5757,11 @@ check_get_virtual_method_assumptions (MonoClass* klass, MonoMethod* method)
* Returns null, if the optimization cannot be performed.
*/
static MonoMethod*
try_prepare_objaddr_callvirt_optimization (MonoCompile *cfg, guchar *next_ip, guchar* end, MonoMethod *method, MonoGenericContext* generic_context, MonoClass *klass)
try_prepare_objaddr_callvirt_optimization (MonoCompile *cfg, guchar *next_ip, guchar* end, MonoMethod *method, MonoGenericContext* generic_context, MonoType *param_type)
{
g_assert(param_type);
MonoClass *klass = mono_class_from_mono_type_internal (param_type);
// TODO: relax the _is_def requirement?
if (cfg->compile_aot || cfg->compile_llvm || !klass || !mono_class_is_def (klass))
return NULL;
@ -7256,7 +7259,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
}
*sp++ = ins;
/*if (!m_method_is_icall (method)) */{
MonoMethod* callvirt_target = try_prepare_objaddr_callvirt_optimization (cfg, next_ip, end, method, generic_context, param_types [n]->data.klass);
MonoMethod* callvirt_target = try_prepare_objaddr_callvirt_optimization (cfg, next_ip, end, method, generic_context, param_types [n]);
if (callvirt_target)
cmethod_override = callvirt_target;
}

View file

@ -95,10 +95,16 @@
<RunScriptCommands Condition="'$(OS)' == 'Windows_NT'" Include="set PATH=$(WasmtimeDir)%3B%PATH%" />
</ItemGroup>
<PropertyGroup>
<!-- Wasm.Build.Tests are not a shipping project, PackageVersion will have a version suffix even for release branch, where actual runtime pack version doesn't have version suffix. Copy & paste to Wasm.Build.Tests -->
<_RuntimePackCurrentVersion Condition="'$(StabilizePackageVersion)' == 'true'">$(ProductVersion)</_RuntimePackCurrentVersion>
<_RuntimePackCurrentVersion Condition="'$(StabilizePackageVersion)' != 'true'">$(PackageVersion)</_RuntimePackCurrentVersion>
</PropertyGroup>
<ItemGroup>
<_RuntimePackVersions Include="$(PackageVersion)" EnvVarName="RUNTIME_PACK_VER9" />
<_RuntimePackVersions Include="$(_RuntimePackCurrentVersion)" EnvVarName="RUNTIME_PACK_VER9" />
<_RuntimePackVersions Include="$(PackageVersionNet8)" EnvVarName="RUNTIME_PACK_VER8" Condition="'$(PackageVersionNet8)' != ''" />
<_RuntimePackVersions Include="$(PackageVersion)" EnvVarName="RUNTIME_PACK_VER8" Condition="'$(PackageVersionNet8)' == ''" />
<_RuntimePackVersions Include="$(_RuntimePackCurrentVersion)" EnvVarName="RUNTIME_PACK_VER8" Condition="'$(PackageVersionNet8)' == ''" />
<RunScriptCommands Condition="'$(OS)' != 'Windows_NT'" Include="export %(_RuntimePackVersions.EnvVarName)=&quot;%(_RuntimePackVersions.Identity)&quot;" />
<RunScriptCommands Condition="'$(OS)' == 'Windows_NT'" Include="set &quot;%(_RuntimePackVersions.EnvVarName)=%(_RuntimePackVersions.Identity)&quot;" />

View file

@ -67,9 +67,13 @@ public class NonWasmTemplateBuildTests : TestMainJsTestBase
)
.MultiplyWithSingleArgs
(
"net6.0",
s_previousTargetFramework,
s_latestTargetFramework
EnvironmentVariables.WorkloadsTestPreviousVersions
? [
"net6.0",
s_previousTargetFramework,
s_latestTargetFramework
]
: [s_latestTargetFramework]
)
.UnwrapItemsAsArrays().ToList();

View file

@ -134,13 +134,18 @@
<RunScriptCommands Condition="'$(OS)' == 'Windows_NT'" Include="set BUILT_NUGETS_PATH=$(LibrariesShippingPackagesDir)" />
</ItemGroup>
<PropertyGroup>
<!-- Wasm.Build.Tests are not a shipping project, PackageVersion will have a version suffix even for release branch, where actual runtime pack version doesn't have version suffix. Copy & paste to Wasi.Build.Tests -->
<_RuntimePackCurrentVersion Condition="'$(StabilizePackageVersion)' == 'true'">$(ProductVersion)</_RuntimePackCurrentVersion>
<_RuntimePackCurrentVersion Condition="'$(StabilizePackageVersion)' != 'true'">$(PackageVersion)</_RuntimePackCurrentVersion>
</PropertyGroup>
<ItemGroup>
<_RuntimePackVersions Include="$(PackageVersion)" EnvVarName="RUNTIME_PACK_VER9" />
<_RuntimePackVersions Include="$(_RuntimePackCurrentVersion)" EnvVarName="RUNTIME_PACK_VER9" />
<_RuntimePackVersions Include="$(PackageVersionNet8)" EnvVarName="RUNTIME_PACK_VER8" Condition="'$(PackageVersionNet8)' != ''" />
<_RuntimePackVersions Include="$(PackageVersion)" EnvVarName="RUNTIME_PACK_VER8" Condition="'$(PackageVersionNet8)' == ''" />
<_RuntimePackVersions Include="$(_RuntimePackCurrentVersion)" EnvVarName="RUNTIME_PACK_VER8" Condition="'$(PackageVersionNet8)' == ''" />
<_RuntimePackVersions Include="$(PackageVersionNet7)" EnvVarName="RUNTIME_PACK_VER7" Condition="'$(PackageVersionNet7)' != ''" />
<_RuntimePackVersions Include="$(PackageVersion)" EnvVarName="RUNTIME_PACK_VER7" Condition="'$(PackageVersionNet7)' == ''" />
<_RuntimePackVersions Include="$(_RuntimePackCurrentVersion)" EnvVarName="RUNTIME_PACK_VER7" Condition="'$(PackageVersionNet7)' == ''" />
<_RuntimePackVersions Include="$(PackageVersionNet6)" EnvVarName="RUNTIME_PACK_VER6" />
<RunScriptCommands Condition="'$(OS)' != 'Windows_NT'" Include="export %(_RuntimePackVersions.EnvVarName)=&quot;%(_RuntimePackVersions.Identity)&quot;" />

View file

@ -1,12 +1,17 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
#ifndef __HOSTFXR_H__
#define __HOSTFXR_H__
#ifndef HAVE_HOSTFXR_H
#define HAVE_HOSTFXR_H
#include <stddef.h>
#include <stdint.h>
#ifdef __cplusplus
extern "C"
{
#endif // __cplusplus
#if defined(_WIN32)
#define HOSTFXR_CALLTYPE __cdecl
#ifdef _WCHAR_T_DEFINED
@ -296,10 +301,6 @@ struct hostfxr_dotnet_environment_sdk_info
const char_t* path;
};
typedef void(HOSTFXR_CALLTYPE* hostfxr_get_dotnet_environment_info_result_fn)(
const struct hostfxr_dotnet_environment_info* info,
void* result_context);
struct hostfxr_dotnet_environment_framework_info
{
size_t size;
@ -322,6 +323,10 @@ struct hostfxr_dotnet_environment_info
const struct hostfxr_dotnet_environment_framework_info* frameworks;
};
typedef void(HOSTFXR_CALLTYPE* hostfxr_get_dotnet_environment_info_result_fn)(
const struct hostfxr_dotnet_environment_info* info,
void* result_context);
//
// Returns available SDKs and frameworks.
//
@ -384,7 +389,7 @@ struct hostfxr_resolve_frameworks_result
};
typedef void (HOSTFXR_CALLTYPE* hostfxr_resolve_frameworks_result_fn)(
const hostfxr_resolve_frameworks_result* result,
const struct hostfxr_resolve_frameworks_result* result,
void* result_context);
//
@ -411,8 +416,12 @@ typedef void (HOSTFXR_CALLTYPE* hostfxr_resolve_frameworks_result_fn)(
//
typedef int32_t(HOSTFXR_CALLTYPE* hostfxr_resolve_frameworks_for_runtime_config_fn)(
const char_t* runtime_config_path,
/*opt*/ const hostfxr_initialize_parameters* parameters,
/*opt*/ const struct hostfxr_initialize_parameters* parameters,
/*opt*/ hostfxr_resolve_frameworks_result_fn callback,
/*opt*/ void* result_context);
#endif //__HOSTFXR_H__
#ifdef __cplusplus
}
#endif // __cplusplus
#endif // HAVE_HOSTFXR_H

View file

@ -1,8 +1,10 @@
# Licensed to the .NET Foundation under one or more agreements.
# The .NET Foundation licenses this file to you under the MIT license.
add_library(mockhostfxr_2_2 SHARED mockhostfxr.cpp)
add_library(mockhostfxr_5_0 SHARED mockhostfxr.cpp)
set(MOCKHOSTFXR_SRC mockhostfxr.cpp test_c_api.c)
add_library(mockhostfxr_2_2 SHARED ${MOCKHOSTFXR_SRC})
add_library(mockhostfxr_5_0 SHARED ${MOCKHOSTFXR_SRC})
target_link_libraries(mockhostfxr_2_2 PRIVATE libhostcommon)
target_link_libraries(mockhostfxr_5_0 PRIVATE libhostcommon)
@ -11,4 +13,4 @@ target_compile_definitions(mockhostfxr_2_2 PRIVATE MOCKHOSTFXR_2_2 EXPORT_SHARED
target_compile_definitions(mockhostfxr_5_0 PRIVATE MOCKHOSTFXR_5_0 EXPORT_SHARED_API)
install_with_stripped_symbols(mockhostfxr_2_2 TARGETS corehost_test)
install_with_stripped_symbols(mockhostfxr_5_0 TARGETS corehost_test)
install_with_stripped_symbols(mockhostfxr_5_0 TARGETS corehost_test)

View file

@ -1,3 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
#include "error_codes.h"
#include "hostfxr.h"
#include "host_startup_info.h"

View file

@ -0,0 +1,8 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// hostfxr.h is a public API. When included in .c files, it may fail to compile
// if C++-specific syntax is used within the extern "C" block. Since all usage of
// this API in runtime repo are within C++ code, such breakages are not encountered
// during normal development or testing.
#include "hostfxr.h"

View file

@ -328,6 +328,30 @@ public static unsafe class UnsafeAccessorsTests
extern static ref delegate*<void> GetFPtr(ref AllFields f);
}
// Contains fields that have modopts/modreqs
struct FieldsWithModifiers
{
private static volatile int s_vInt;
private volatile int _vInt;
}
[Fact]
public static void Verify_AccessFieldsWithModifiers()
{
Console.WriteLine($"Running {nameof(Verify_AccessFieldsWithModifiers)}");
FieldsWithModifiers fieldsWithModifiers = default;
GetStaticVolatileInt(ref fieldsWithModifiers) = default;
GetVolatileInt(ref fieldsWithModifiers) = default;
[UnsafeAccessor(UnsafeAccessorKind.StaticField, Name="s_vInt")]
extern static ref int GetStaticVolatileInt(ref FieldsWithModifiers f);
[UnsafeAccessor(UnsafeAccessorKind.Field, Name="_vInt")]
extern static ref int GetVolatileInt(ref FieldsWithModifiers f);
}
[Fact]
public static void Verify_AccessStaticMethodClass()
{

View file

@ -10,6 +10,8 @@ namespace Mono.Linker.Tests.Cases.Reflection
[Reference ("System.Core.dll")]
[ExpectedNoWarnings]
[KeptPrivateImplementationDetails ("ThrowSwitchExpressionException")]
[KeptAttributeAttribute(typeof(UnconditionalSuppressMessageAttribute))]
[UnconditionalSuppressMessage ("AOT", "IL3050", Justification = "These tests are not targeted at AOT scenarios")]
public class ExpressionCallString
{
public static void Main ()

View file

@ -1,4 +1,5 @@
using System;
using System.Diagnostics.CodeAnalysis;
using System.Linq.Expressions;
using Mono.Linker.Tests.Cases.Expectations.Assertions;
using Mono.Linker.Tests.Cases.Expectations.Metadata;
@ -7,6 +8,8 @@ namespace Mono.Linker.Tests.Cases.Reflection
{
[Reference ("System.Core.dll")]
[ExpectedNoWarnings]
[KeptAttributeAttribute (typeof (UnconditionalSuppressMessageAttribute))]
[UnconditionalSuppressMessage ("AOT", "IL3050", Justification = "These tests are not targeted at AOT scenarios")]
public class ExpressionCallStringAndLocals
{
public static void Main ()

View file

@ -9,6 +9,7 @@ namespace Mono.Linker.Tests.Cases.Warnings.WarningSuppression
[SetupLinkAttributesFile ("AddSuppressionsBeforeAttributeRemoval.xml")]
[ExpectedNoWarnings]
[UnconditionalSuppressMessage ("AOT", "IL3050", Justification = "These tests are not targeted at AOT scenarios")]
public class AddSuppressionsBeforeAttributeRemoval
{
[Kept]

View file

@ -13,6 +13,7 @@ namespace Mono.Linker.Tests.Cases.Warnings.WarningSuppression
[SetupLinkerArgument ("--feature", "Feature", "false")]
[ExpectedNoWarnings]
[SkipKeptItemsValidation]
[UnconditionalSuppressMessage ("AOT", "IL3050", Justification = "These tests are not targeted at AOT scenarios")]
public class DetectRedundantSuppressionsFeatureSubstitutions
{
public static void Main ()

View file

@ -10,6 +10,7 @@ namespace Mono.Linker.Tests.Cases.Warnings.WarningSuppression
{
[ExpectedNoWarnings]
[SkipKeptItemsValidation]
[UnconditionalSuppressMessage ("AOT", "IL3050", Justification = "These tests are not targeted at AOT scenarios")]
public class DetectRedundantSuppressionsInMembersAndTypes
{
public static void Main ()

View file

@ -23,6 +23,7 @@ namespace Mono.Linker.Tests.Cases.Warnings.WarningSuppression
{
[ExpectedNoWarnings]
[SkipKeptItemsValidation]
[UnconditionalSuppressMessage ("AOT", "IL3050", Justification = "These tests are not targeted at AOT scenarios")]
class DetectRedundantSuppressionsTrimmedMembersTarget
{
[ExpectedWarning ("IL2072")]

View file

@ -17,6 +17,7 @@ namespace Mono.Linker.Tests.Cases.Warnings.WarningSuppression
#endif
[SkipKeptItemsValidation]
[LogDoesNotContain ("TriggerUnrecognizedPattern()")]
[UnconditionalSuppressMessage ("AOT", "IL3050", Justification = "These tests are not targeted at AOT scenarios")]
public class SuppressWarningsInMembersAndTypesUsingTarget
{
/// <summary>
@ -83,6 +84,7 @@ namespace Mono.Linker.Tests.Cases.Warnings.WarningSuppression
}
[ExpectedNoWarnings]
[UnconditionalSuppressMessage ("AOT", "IL3050", Justification = "These tests are not targeted at AOT scenarios")]
public class WarningsInMembers
{
public void Method ()