From f5b9cd48d1a05c05f6a7b59ab5e0623710c958c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20S=C3=A1nchez=20L=C3=B3pez?= <1175054+carlossanlop@users.noreply.github.com> Date: Tue, 28 Mar 2023 09:35:07 -0700 Subject: [PATCH 01/29] [7.0] Update backport template and servicing docs (#84005) * [7.0] Update backport template and servicing docs * fix template spacing --------- Co-authored-by: carlossanlop --- .github/workflows/backport.yml | 7 ++++++- docs/project/library-servicing.md | 21 +++++++++++++++++++-- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index 4124fa04342fe4..a02fdace09ac12 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -80,4 +80,9 @@ jobs: ## Risk - IMPORTANT: If this change touches code that ships in a NuGet package, please make certain that you have added any necessary [package authoring](https://github.com/dotnet/runtime/blob/main/docs/project/library-servicing.md) and gotten it explicitly reviewed. + **IMPORTANT**: If this backport is for a servicing release, please verify that: + + - 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/release/7.0/docs/project/library-servicing.md) and gotten it explicitly reviewed. + diff --git a/docs/project/library-servicing.md b/docs/project/library-servicing.md index ffdd1fc82a6144..a1d8de390ab04a 100644 --- a/docs/project/library-servicing.md +++ b/docs/project/library-servicing.md @@ -1,6 +1,11 @@ # How to service a library -This document provides the steps necessary after modifying a library in a servicing branch (where "servicing branch" refers to any branch whose name begins with `release/`). +This document provides the steps necessary after modifying a library in a servicing branch. + +Servicing branches represent shipped versions of .NET, and their name is in the format `release/X.0-staging`. Examples: + +- `release/7.0-staging` +- `release/6.0-staging` ## Check if a package is generated @@ -23,4 +28,16 @@ All that's left is to ensure that your changes have worked as expected. To do so ## Approval Process -All the servicing change must go through an approval process. Please create your PR using [this template](https://raw.githubusercontent.com/dotnet/runtime/main/.github/PULL_REQUEST_TEMPLATE/servicing_pull_request_template.md). You should also add `servicing-consider` label to the pull request and bring it to the attention of the engineering lead responsible for the area. +All the servicing change must go through an approval process. You have two ways to submit your PR: + +- By manually creating your PR using [this template](https://raw.githubusercontent.com/dotnet/runtime/main/.github/PULL_REQUEST_TEMPLATE/servicing_pull_request_template.md). +- Or by asking the bot to automatically create the servicing PR for you using a merged `main` PR as source. This method requires typing an AzDO backport command as a comment of your merged PR using the format `/backport to release/X.0-staging`. Examples: +- + - `/backport to release/7.0-staging` + - `/backport to release/6.0-staging` + +For both cases, you must: + +- Fill out the template of the PR description. +- Add the `servicing-consider` label. +- Bring it to the attention of the engineering lead responsible for the area, so they consider the fix for servicing. \ No newline at end of file From 57d635b2767a8b84df8790ac7adab9e78160d551 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 28 Mar 2023 12:28:01 -0700 Subject: [PATCH 02/29] Create action to check servicing label (#84041) Co-authored-by: Juan Hoyos <19413848+hoyosjs@users.noreply.github.com> --- .github/workflows/check-service-labels.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/workflows/check-service-labels.yml diff --git a/.github/workflows/check-service-labels.yml b/.github/workflows/check-service-labels.yml new file mode 100644 index 00000000000000..bcbdafa97b9daf --- /dev/null +++ b/.github/workflows/check-service-labels.yml @@ -0,0 +1,21 @@ +name: check-service-labels + +permissions: + pull-requests: read + +on: + pull_request: + branches: + - 'release/**' + +jobs: + check-labels: + runs-on: ubuntu-latest + steps: + - name: Check servicing labels + run: + if [ "${{ contains(github.event.pull_request.labels.*.name, 'Servicing-approved') }}" = "true" ]; then + exit 0 + else + exit 1 + fi From 7786569388fd1f4074229182fade2b35ff26a737 Mon Sep 17 00:00:00 2001 From: Juan Hoyos <19413848+hoyosjs@users.noreply.github.com> Date: Tue, 28 Mar 2023 12:36:07 -0700 Subject: [PATCH 03/29] Fix piping in yml (#84042) --- .github/workflows/check-service-labels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-service-labels.yml b/.github/workflows/check-service-labels.yml index bcbdafa97b9daf..4faf2c291e15a8 100644 --- a/.github/workflows/check-service-labels.yml +++ b/.github/workflows/check-service-labels.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Check servicing labels - run: + run: | if [ "${{ contains(github.event.pull_request.labels.*.name, 'Servicing-approved') }}" = "true" ]; then exit 0 else From 4c367c7ac2f522834b4e30dbd70c9d1eb60a0c7b Mon Sep 17 00:00:00 2001 From: Juan Hoyos <19413848+hoyosjs@users.noreply.github.com> Date: Tue, 28 Mar 2023 12:42:51 -0700 Subject: [PATCH 04/29] Update check-service-labels.yml (#84044) --- .github/workflows/check-service-labels.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/check-service-labels.yml b/.github/workflows/check-service-labels.yml index 4faf2c291e15a8..53435a615a19e6 100644 --- a/.github/workflows/check-service-labels.yml +++ b/.github/workflows/check-service-labels.yml @@ -5,6 +5,7 @@ permissions: on: pull_request: + types: [opened, reopened, labeled, unlabeled, synchronize] branches: - 'release/**' From 8c9da40d76ed1de5df85d251a161b78033c5ce03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20S=C3=A1nchez=20L=C3=B3pez?= <1175054+carlossanlop@users.noreply.github.com> Date: Tue, 28 Mar 2023 13:43:36 -0700 Subject: [PATCH 05/29] [7.0] Avoid using spanish helix queues (#83747) Co-authored-by: carlossanlop --- eng/pipelines/libraries/helix-queues-setup.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/pipelines/libraries/helix-queues-setup.yml b/eng/pipelines/libraries/helix-queues-setup.yml index 9d13473381ad27..4efee91302f7ed 100644 --- a/eng/pipelines/libraries/helix-queues-setup.yml +++ b/eng/pipelines/libraries/helix-queues-setup.yml @@ -144,7 +144,7 @@ jobs: - (Windows.10.Amd64.ServerRS5.Open)windows.10.amd64.serverrs5.open@mcr.microsoft.com/dotnet-buildtools/prereqs:windowsservercore-ltsc2019-helix-amd64 - ${{ if or(ne(parameters.jobParameters.isExtraPlatforms, true), eq(parameters.jobParameters.includeAllPlatforms, true)) }}: - Windows.81.Amd64.Open - - Windows.10.Amd64.Server2022.ES.Open + - Windows.Amd64.Server2022.Open - Windows.11.Amd64.Client.Open - ${{ if eq(parameters.jobParameters.testScope, 'outerloop') }}: - (Windows.10.Amd64.ServerRS5.Open)windows.10.amd64.serverrs5.open@mcr.microsoft.com/dotnet-buildtools/prereqs:windowsservercore-ltsc2019-helix-amd64 @@ -170,7 +170,7 @@ jobs: - Windows.11.Amd64.Client.Open - Windows.Amd64.Server2022.Open - ${{ if or(ne(parameters.jobParameters.isExtraPlatforms, true), eq(parameters.jobParameters.includeAllPlatforms, true)) }}: - - Windows.10.Amd64.Server2022.ES.Open + - Windows.Amd64.Server2022.Open - Windows.7.Amd64.Open # .NETFramework From 80d48e99e16acb0b78d311709da6325f18a4b882 Mon Sep 17 00:00:00 2001 From: Steve Pfister Date: Tue, 28 Mar 2023 23:15:19 -0400 Subject: [PATCH 06/29] [release/7.0] Bump to new OSX 13 AppleTV queue (#83729) Co-authored-by: Steve Pfister --- eng/pipelines/libraries/helix-queues-setup.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/pipelines/libraries/helix-queues-setup.yml b/eng/pipelines/libraries/helix-queues-setup.yml index 4efee91302f7ed..84d4f776820e55 100644 --- a/eng/pipelines/libraries/helix-queues-setup.yml +++ b/eng/pipelines/libraries/helix-queues-setup.yml @@ -123,11 +123,11 @@ jobs: # tvOS devices - ${{ if in(parameters.platform, 'tvOS_arm64') }}: - # split traffic for runtime-extra-platforms (which mostly runs on rolling builds) + # if necessary, you can split traffic between queues this way for PR's and rolling builds - ${{ if ne(parameters.jobParameters.isExtraPlatforms, true) }}: - - OSX.1015.Amd64.AppleTV.Open + - OSX.13.Amd64.AppleTV.Open - ${{ if eq(parameters.jobParameters.isExtraPlatforms, true) }}: - - OSX.1100.Amd64.AppleTV.Open + - OSX.13.Amd64.AppleTV.Open # windows x64 - ${{ if eq(parameters.platform, 'windows_x64') }}: From 74d0f47d8420439bce53fcb2fab7ae9beb241773 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 28 Mar 2023 21:23:24 -0600 Subject: [PATCH 07/29] [release/7.0] disable NTLM tests on RedHat.7 (#83602) * disable NTLM tests on RedHat.7 * Package_Unsupported_NTLM --------- Co-authored-by: wfurt --- .../Common/tests/System/Net/Capability.Security.Unix.cs | 2 +- .../tests/UnitTests/NegotiateAuthenticationTests.cs | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/libraries/Common/tests/System/Net/Capability.Security.Unix.cs b/src/libraries/Common/tests/System/Net/Capability.Security.Unix.cs index 3e08ee08a837ab..f62d68fbd28627 100644 --- a/src/libraries/Common/tests/System/Net/Capability.Security.Unix.cs +++ b/src/libraries/Common/tests/System/Net/Capability.Security.Unix.cs @@ -9,7 +9,7 @@ public static bool IsNtlmInstalled() { // GSS on Linux does not work with OpenSSL 3.0. Fix was submitted to gss-ntlm but it will take a while to make to // all supported distributions. The second part of the check should be removed when it does. - return Interop.NetSecurityNative.IsNtlmInstalled() && (!PlatformDetection.IsOpenSslSupported || PlatformDetection.OpenSslVersion.Major < 3); + return Interop.NetSecurityNative.IsNtlmInstalled() && (!PlatformDetection.IsOpenSslSupported || PlatformDetection.OpenSslVersion.Major < 3) && !PlatformDetection.IsRedHatFamily7; } } } diff --git a/src/libraries/System.Net.Security/tests/UnitTests/NegotiateAuthenticationTests.cs b/src/libraries/System.Net.Security/tests/UnitTests/NegotiateAuthenticationTests.cs index eb2b3c42b607f6..b83b8adfca2ab5 100644 --- a/src/libraries/System.Net.Security/tests/UnitTests/NegotiateAuthenticationTests.cs +++ b/src/libraries/System.Net.Security/tests/UnitTests/NegotiateAuthenticationTests.cs @@ -10,6 +10,7 @@ using System.Security.Principal; using System.Text; using System.Threading.Tasks; +using Microsoft.DotNet.XUnitExtensions; using Xunit; namespace System.Net.Security.Tests @@ -86,6 +87,10 @@ public void Package_Supported_NTLM() [ConditionalFact(nameof(IsNtlmUnavailable))] public void Package_Unsupported_NTLM() { + if (PlatformDetection.IsRedHatFamily7) + { + throw new SkipTestException("https://github.com/dotnet/runtime/issues/83540"); + } NegotiateAuthenticationClientOptions clientOptions = new NegotiateAuthenticationClientOptions { Package = "NTLM", Credential = s_testCredentialRight, TargetName = "HTTP/foo" }; NegotiateAuthentication negotiateAuthentication = new NegotiateAuthentication(clientOptions); NegotiateAuthenticationStatusCode statusCode; From fb993f50ac49f2d3f67e6708d6306648517167b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20S=C3=A1nchez=20L=C3=B3pez?= <1175054+carlossanlop@users.noreply.github.com> Date: Tue, 28 Mar 2023 20:33:10 -0700 Subject: [PATCH 08/29] [release/7.0] Improve servicing docs for Microsoft.Windows.Compatibility (#83557) * Add comment in csprojs of dependencies of M.W.Compat. * Adjust readme. * Turn off M.W.C. (reset it), it was built last month. --------- Co-authored-by: carlossanlop --- docs/project/library-servicing.md | 2 ++ .../src/Microsoft.Win32.Registry.AccessControl.csproj | 3 +++ .../src/Microsoft.Win32.SystemEvents.csproj | 3 +++ .../src/Microsoft.Windows.Compatibility.csproj | 4 ++-- src/libraries/System.CodeDom/src/System.CodeDom.csproj | 3 +++ .../System.ComponentModel.Composition.Registration.csproj | 3 +++ .../src/System.ComponentModel.Composition.csproj | 3 +++ .../src/System.Configuration.ConfigurationManager.csproj | 5 ++++- src/libraries/System.Data.Odbc/src/System.Data.Odbc.csproj | 3 +++ src/libraries/System.Data.OleDb/src/System.Data.OleDb.csproj | 3 +++ .../src/System.Diagnostics.EventLog.csproj | 3 +++ .../src/System.Diagnostics.PerformanceCounter.csproj | 3 +++ .../src/System.DirectoryServices.AccountManagement.csproj | 3 +++ .../src/System.DirectoryServices.Protocols.csproj | 3 +++ .../src/System.DirectoryServices.csproj | 1 + .../System.Drawing.Common/src/System.Drawing.Common.csproj | 3 +++ .../System.IO.Packaging/src/System.IO.Packaging.csproj | 3 +++ src/libraries/System.IO.Ports/src/System.IO.Ports.csproj | 3 +++ src/libraries/System.Management/src/System.Management.csproj | 3 ++- .../src/System.Reflection.Context.csproj | 3 +++ .../System.Runtime.Caching/src/System.Runtime.Caching.csproj | 3 +++ .../src/System.Security.Cryptography.Pkcs.csproj | 1 + .../src/System.Security.Cryptography.ProtectedData.csproj | 3 ++- .../src/System.Security.Cryptography.Xml.csproj | 3 ++- .../src/System.Security.Permissions.csproj | 3 +++ .../src/System.ServiceModel.Syndication.csproj | 3 +++ .../src/System.ServiceProcess.ServiceController.csproj | 3 +++ src/libraries/System.Speech/src/System.Speech.csproj | 3 +++ .../src/System.Text.Encoding.CodePages.csproj | 3 +++ .../src/System.Threading.AccessControl.csproj | 3 ++- 30 files changed, 81 insertions(+), 7 deletions(-) diff --git a/docs/project/library-servicing.md b/docs/project/library-servicing.md index a1d8de390ab04a..3429c62085a3b2 100644 --- a/docs/project/library-servicing.md +++ b/docs/project/library-servicing.md @@ -11,6 +11,8 @@ Servicing branches represent shipped versions of .NET, and their name is in the If a library is packable (check for the `true` property) you'll need to set `true` in the source project. That is necessary as packages aren't generated by default in servicing releases. +Additionally, if the library is listed among the project references of [Microsoft.Windows.Compatibility.csproj](https://github.com/dotnet/runtime/blob/43bb5993d4f983e9d575f52b691ecdc9b9e257ef/src/libraries/Microsoft.Windows.Compatibility/src/Microsoft.Windows.Compatibility.csproj#L15-L48), please make sure to bump the value of `ServicingVersion` for `Microsoft.Windows.Compatibility.csproj` and also set its `GeneratePackageOnBuild` property value to `true`. The version number must only be bumped once per servicing release, even if multiple dependencies get modified. + ## 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. diff --git a/src/libraries/Microsoft.Win32.Registry.AccessControl/src/Microsoft.Win32.Registry.AccessControl.csproj b/src/libraries/Microsoft.Win32.Registry.AccessControl/src/Microsoft.Win32.Registry.AccessControl.csproj index 7f6d66bdba8d38..ad39f8891e96f3 100644 --- a/src/libraries/Microsoft.Win32.Registry.AccessControl/src/Microsoft.Win32.Registry.AccessControl.csproj +++ b/src/libraries/Microsoft.Win32.Registry.AccessControl/src/Microsoft.Win32.Registry.AccessControl.csproj @@ -3,6 +3,9 @@ $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent);$(NetCoreAppMinimum)-windows;$(NetCoreAppMinimum);netstandard2.0;$(NetFrameworkMinimum) true true + + false + 0 Provides support for managing access and audit control lists for Microsoft.Win32.RegistryKey. Commonly Used Types: diff --git a/src/libraries/Microsoft.Win32.SystemEvents/src/Microsoft.Win32.SystemEvents.csproj b/src/libraries/Microsoft.Win32.SystemEvents/src/Microsoft.Win32.SystemEvents.csproj index d7e7dc61211220..b3ae3d66c72e8d 100644 --- a/src/libraries/Microsoft.Win32.SystemEvents/src/Microsoft.Win32.SystemEvents.csproj +++ b/src/libraries/Microsoft.Win32.SystemEvents/src/Microsoft.Win32.SystemEvents.csproj @@ -3,6 +3,9 @@ $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent);$(NetCoreAppMinimum)-windows;$(NetCoreAppMinimum);netstandard2.0;$(NetFrameworkMinimum) true true + + false + 0 Provides access to Windows system event notifications. Commonly Used Types: diff --git a/src/libraries/Microsoft.Windows.Compatibility/src/Microsoft.Windows.Compatibility.csproj b/src/libraries/Microsoft.Windows.Compatibility/src/Microsoft.Windows.Compatibility.csproj index c40fecd680f64f..657adbd5127346 100644 --- a/src/libraries/Microsoft.Windows.Compatibility/src/Microsoft.Windows.Compatibility.csproj +++ b/src/libraries/Microsoft.Windows.Compatibility/src/Microsoft.Windows.Compatibility.csproj @@ -5,7 +5,7 @@ false true - true + false 1 $(NoWarn);NU5128 @@ -47,7 +47,7 @@ - + - + diff --git a/src/libraries/System.Data.Odbc/src/System.Data.Odbc.csproj b/src/libraries/System.Data.Odbc/src/System.Data.Odbc.csproj index 8fad480d961a73..478786932ce7d6 100644 --- a/src/libraries/System.Data.Odbc/src/System.Data.Odbc.csproj +++ b/src/libraries/System.Data.Odbc/src/System.Data.Odbc.csproj @@ -6,6 +6,9 @@ $(NoWarn);CA1845 true + + false + 0 Provides a collection of classes used to access an ODBC data source in the managed space Commonly Used Types: diff --git a/src/libraries/System.Data.OleDb/src/System.Data.OleDb.csproj b/src/libraries/System.Data.OleDb/src/System.Data.OleDb.csproj index 1a1756a85adf69..87422949766dbf 100644 --- a/src/libraries/System.Data.OleDb/src/System.Data.OleDb.csproj +++ b/src/libraries/System.Data.OleDb/src/System.Data.OleDb.csproj @@ -9,6 +9,9 @@ $(NoWarn);CA1845 true + + false + 0 Provides a collection of classes for OLEDB. Commonly Used Types: diff --git a/src/libraries/System.Diagnostics.EventLog/src/System.Diagnostics.EventLog.csproj b/src/libraries/System.Diagnostics.EventLog/src/System.Diagnostics.EventLog.csproj index dfae87cc90a726..f4923e920a2a36 100644 --- a/src/libraries/System.Diagnostics.EventLog/src/System.Diagnostics.EventLog.csproj +++ b/src/libraries/System.Diagnostics.EventLog/src/System.Diagnostics.EventLog.csproj @@ -9,6 +9,9 @@ $(NoWarn);CA1845;CA1846 annotations true + + false + 0 Provides the System.Diagnostics.EventLog class, which allows the applications to use the windows event log service. Commonly Used Types: diff --git a/src/libraries/System.Diagnostics.PerformanceCounter/src/System.Diagnostics.PerformanceCounter.csproj b/src/libraries/System.Diagnostics.PerformanceCounter/src/System.Diagnostics.PerformanceCounter.csproj index a0dbb8e208bd40..e33e497a18f2a5 100644 --- a/src/libraries/System.Diagnostics.PerformanceCounter/src/System.Diagnostics.PerformanceCounter.csproj +++ b/src/libraries/System.Diagnostics.PerformanceCounter/src/System.Diagnostics.PerformanceCounter.csproj @@ -5,6 +5,9 @@ $(NoWarn);CA1847 annotations true + + false + 0 Provides the System.Diagnostics.PerformanceCounter class, which allows access to Windows performance counters. Commonly Used Types: diff --git a/src/libraries/System.DirectoryServices.AccountManagement/src/System.DirectoryServices.AccountManagement.csproj b/src/libraries/System.DirectoryServices.AccountManagement/src/System.DirectoryServices.AccountManagement.csproj index 8152e3c7f051ee..4c8dbdae098584 100644 --- a/src/libraries/System.DirectoryServices.AccountManagement/src/System.DirectoryServices.AccountManagement.csproj +++ b/src/libraries/System.DirectoryServices.AccountManagement/src/System.DirectoryServices.AccountManagement.csproj @@ -10,6 +10,9 @@ $(NoWarn);CA1845;CA1846;IDE0059;CA1822 annotations true + + false + 0 true true Provides uniform access and manipulation of user, computer, and group security principals across the multiple principal stores: Active Directory Domain Services (AD DS), Active Directory Lightweight Directory Services (AD LDS), and Machine SAM (MSAM). diff --git a/src/libraries/System.DirectoryServices.Protocols/src/System.DirectoryServices.Protocols.csproj b/src/libraries/System.DirectoryServices.Protocols/src/System.DirectoryServices.Protocols.csproj index 568625193556fd..c4653562c9caa9 100644 --- a/src/libraries/System.DirectoryServices.Protocols/src/System.DirectoryServices.Protocols.csproj +++ b/src/libraries/System.DirectoryServices.Protocols/src/System.DirectoryServices.Protocols.csproj @@ -4,6 +4,9 @@ true true true + + false + 0 annotations true true diff --git a/src/libraries/System.DirectoryServices/src/System.DirectoryServices.csproj b/src/libraries/System.DirectoryServices/src/System.DirectoryServices.csproj index 948411d5239464..e9f9e651841545 100644 --- a/src/libraries/System.DirectoryServices/src/System.DirectoryServices.csproj +++ b/src/libraries/System.DirectoryServices/src/System.DirectoryServices.csproj @@ -8,6 +8,7 @@ CA1846: Prefer 'AsSpan' over 'Substring' when span-based overloads are available --> $(NoWarn);CA1845;CA1846;IDE0059;CA1822 true + false 1 true diff --git a/src/libraries/System.Drawing.Common/src/System.Drawing.Common.csproj b/src/libraries/System.Drawing.Common/src/System.Drawing.Common.csproj index 36f7257c4ae9ca..26c3e7488e4735 100644 --- a/src/libraries/System.Drawing.Common/src/System.Drawing.Common.csproj +++ b/src/libraries/System.Drawing.Common/src/System.Drawing.Common.csproj @@ -6,6 +6,9 @@ CS0618 true true + + false + 0 true Provides access to GDI+ graphics functionality. diff --git a/src/libraries/System.IO.Packaging/src/System.IO.Packaging.csproj b/src/libraries/System.IO.Packaging/src/System.IO.Packaging.csproj index c5d5c39d226db7..6ef8658addebcd 100644 --- a/src/libraries/System.IO.Packaging/src/System.IO.Packaging.csproj +++ b/src/libraries/System.IO.Packaging/src/System.IO.Packaging.csproj @@ -5,6 +5,9 @@ $(NoWarn);CA1847 true + + false + 0 Provides classes that support storage of multiple data objects in a single container. diff --git a/src/libraries/System.IO.Ports/src/System.IO.Ports.csproj b/src/libraries/System.IO.Ports/src/System.IO.Ports.csproj index c341d6c3ba6ffb..ad36bee6d63439 100644 --- a/src/libraries/System.IO.Ports/src/System.IO.Ports.csproj +++ b/src/libraries/System.IO.Ports/src/System.IO.Ports.csproj @@ -6,6 +6,9 @@ true annotations true + + false + 0 Provides classes for controlling serial ports. Commonly Used Types: diff --git a/src/libraries/System.Management/src/System.Management.csproj b/src/libraries/System.Management/src/System.Management.csproj index 52b27210fa6d73..57642cb8f6476a 100644 --- a/src/libraries/System.Management/src/System.Management.csproj +++ b/src/libraries/System.Management/src/System.Management.csproj @@ -9,7 +9,8 @@ annotations true true - true + + false 1 true true diff --git a/src/libraries/System.Reflection.Context/src/System.Reflection.Context.csproj b/src/libraries/System.Reflection.Context/src/System.Reflection.Context.csproj index 0f87d7ce83ddf7..e59132bc7df043 100644 --- a/src/libraries/System.Reflection.Context/src/System.Reflection.Context.csproj +++ b/src/libraries/System.Reflection.Context/src/System.Reflection.Context.csproj @@ -2,6 +2,9 @@ $(NetCoreAppCurrent);$(NetCoreAppMinimum);netstandard2.1;netstandard2.0 true + + false + 0 true true Provides classes that enable customized reflection contexts. diff --git a/src/libraries/System.Runtime.Caching/src/System.Runtime.Caching.csproj b/src/libraries/System.Runtime.Caching/src/System.Runtime.Caching.csproj index 869129ba71f1da..8c62f669dae915 100644 --- a/src/libraries/System.Runtime.Caching/src/System.Runtime.Caching.csproj +++ b/src/libraries/System.Runtime.Caching/src/System.Runtime.Caching.csproj @@ -4,6 +4,9 @@ true Annotations true + + false + 0 true true true diff --git a/src/libraries/System.Security.Cryptography.Pkcs/src/System.Security.Cryptography.Pkcs.csproj b/src/libraries/System.Security.Cryptography.Pkcs/src/System.Security.Cryptography.Pkcs.csproj index 0578a7acdbca99..bc67ba45ef1db6 100644 --- a/src/libraries/System.Security.Cryptography.Pkcs/src/System.Security.Cryptography.Pkcs.csproj +++ b/src/libraries/System.Security.Cryptography.Pkcs/src/System.Security.Cryptography.Pkcs.csproj @@ -5,6 +5,7 @@ true $(NoWarn);CA5384 true + false 1 Provides support for PKCS and CMS algorithms. diff --git a/src/libraries/System.Security.Cryptography.ProtectedData/src/System.Security.Cryptography.ProtectedData.csproj b/src/libraries/System.Security.Cryptography.ProtectedData/src/System.Security.Cryptography.ProtectedData.csproj index 55c2c3326ab646..27084f0ad25143 100644 --- a/src/libraries/System.Security.Cryptography.ProtectedData/src/System.Security.Cryptography.ProtectedData.csproj +++ b/src/libraries/System.Security.Cryptography.ProtectedData/src/System.Security.Cryptography.ProtectedData.csproj @@ -2,8 +2,9 @@ $(NetCoreAppCurrent);$(NetCoreAppMinimum);netstandard2.0;$(NetFrameworkMinimum) true - true true + true + false 1 Provides access to Windows Data Protection Api. diff --git a/src/libraries/System.Security.Cryptography.Xml/src/System.Security.Cryptography.Xml.csproj b/src/libraries/System.Security.Cryptography.Xml/src/System.Security.Cryptography.Xml.csproj index bf3bcc122e2f2b..d11fcb26258b50 100644 --- a/src/libraries/System.Security.Cryptography.Xml/src/System.Security.Cryptography.Xml.csproj +++ b/src/libraries/System.Security.Cryptography.Xml/src/System.Security.Cryptography.Xml.csproj @@ -6,8 +6,9 @@ $(NoWarn);nullable $(NoWarn);CA1850 true - 1 + false + 1 Provides classes to support the creation and validation of XML digital signatures. The classes in this namespace implement the World Wide Web Consortium Recommendation, "XML-Signature Syntax and Processing", described at http://www.w3.org/TR/xmldsig-core/. Commonly Used Types: diff --git a/src/libraries/System.Security.Permissions/src/System.Security.Permissions.csproj b/src/libraries/System.Security.Permissions/src/System.Security.Permissions.csproj index 1994ef7007b9b3..402336b8beb1da 100644 --- a/src/libraries/System.Security.Permissions/src/System.Security.Permissions.csproj +++ b/src/libraries/System.Security.Permissions/src/System.Security.Permissions.csproj @@ -5,6 +5,9 @@ disable $(NoWarn);nullable true + + false + 0 Provides types supporting Code Access Security (CAS). diff --git a/src/libraries/System.ServiceModel.Syndication/src/System.ServiceModel.Syndication.csproj b/src/libraries/System.ServiceModel.Syndication/src/System.ServiceModel.Syndication.csproj index 3d1b9b9035a0aa..831b3eda41a36c 100644 --- a/src/libraries/System.ServiceModel.Syndication/src/System.ServiceModel.Syndication.csproj +++ b/src/libraries/System.ServiceModel.Syndication/src/System.ServiceModel.Syndication.csproj @@ -5,6 +5,9 @@ $(NoWarn);nullable true true + + false + 0 Provides classes related to service model syndication. diff --git a/src/libraries/System.ServiceProcess.ServiceController/src/System.ServiceProcess.ServiceController.csproj b/src/libraries/System.ServiceProcess.ServiceController/src/System.ServiceProcess.ServiceController.csproj index 518c800ae01135..12e4831c2ee807 100644 --- a/src/libraries/System.ServiceProcess.ServiceController/src/System.ServiceProcess.ServiceController.csproj +++ b/src/libraries/System.ServiceProcess.ServiceController/src/System.ServiceProcess.ServiceController.csproj @@ -4,6 +4,9 @@ true $(NoWarn);CA2249 true + + false + 0 Provides the System.ServiceProcess.ServiceContainer class, which allows you to connect to a running or stopped service, manipulate it, or get information about it. Commonly Used Types: diff --git a/src/libraries/System.Speech/src/System.Speech.csproj b/src/libraries/System.Speech/src/System.Speech.csproj index 22506f7bf966e0..0b2fe9a22975e1 100644 --- a/src/libraries/System.Speech/src/System.Speech.csproj +++ b/src/libraries/System.Speech/src/System.Speech.csproj @@ -9,6 +9,9 @@ annotations false true + + false + 0 true true Provides types to perform speech synthesis and speech recognition. diff --git a/src/libraries/System.Text.Encoding.CodePages/src/System.Text.Encoding.CodePages.csproj b/src/libraries/System.Text.Encoding.CodePages/src/System.Text.Encoding.CodePages.csproj index 8883abba36b613..dc0552b555db65 100644 --- a/src/libraries/System.Text.Encoding.CodePages/src/System.Text.Encoding.CodePages.csproj +++ b/src/libraries/System.Text.Encoding.CodePages/src/System.Text.Encoding.CodePages.csproj @@ -4,6 +4,9 @@ true true true + + false + 0 true Provides support for code-page based encodings, including Windows-1252, Shift-JIS, and GB2312. diff --git a/src/libraries/System.Threading.AccessControl/src/System.Threading.AccessControl.csproj b/src/libraries/System.Threading.AccessControl/src/System.Threading.AccessControl.csproj index 3b944794cfe70d..a3177384242aae 100644 --- a/src/libraries/System.Threading.AccessControl/src/System.Threading.AccessControl.csproj +++ b/src/libraries/System.Threading.AccessControl/src/System.Threading.AccessControl.csproj @@ -3,8 +3,9 @@ $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent);$(NetCoreAppMinimum)-windows;$(NetCoreAppMinimum);netstandard2.0;$(NetFrameworkMinimum) true true - 1 + false + 1 Provides support for managing access and audit control lists for synchronization primitives. Commonly Used Types: From 1cee763657e75bc2a5fa624a5138d78553775670 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20S=C3=A1nchez=20L=C3=B3pez?= <1175054+carlossanlop@users.noreply.github.com> Date: Wed, 29 Mar 2023 10:01:27 -0700 Subject: [PATCH 09/29] Fix Iran time zone test case (#84056) Co-authored-by: carlossanlop --- .../tests/System/TimeZoneInfoTests.cs | 51 ++++++++++--------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/src/libraries/System.Runtime/tests/System/TimeZoneInfoTests.cs b/src/libraries/System.Runtime/tests/System/TimeZoneInfoTests.cs index 8a8eb06bc81204..514febd5410eb3 100644 --- a/src/libraries/System.Runtime/tests/System/TimeZoneInfoTests.cs +++ b/src/libraries/System.Runtime/tests/System/TimeZoneInfoTests.cs @@ -90,44 +90,43 @@ public static void Names() public static IEnumerable Platform_TimeZoneNamesTestData() { if (PlatformDetection.IsBrowser || PlatformDetection.IsiOS || PlatformDetection.IstvOS) - return new TheoryData + return new TheoryData { - { TimeZoneInfo.FindSystemTimeZoneById(s_strPacific), "(UTC-08:00) America/Los_Angeles", "PST", "PDT" }, - { TimeZoneInfo.FindSystemTimeZoneById(s_strSydney), "(UTC+10:00) Australia/Sydney", "AEST", "AEDT" }, - { TimeZoneInfo.FindSystemTimeZoneById(s_strPerth), "(UTC+08:00) Australia/Perth", "AWST", "AWDT" }, - { TimeZoneInfo.FindSystemTimeZoneById(s_strIran), "(UTC+03:30) Asia/Tehran", "+0330", "+0430" }, + { TimeZoneInfo.FindSystemTimeZoneById(s_strPacific), "(UTC-08:00) America/Los_Angeles", null, "PST", "PDT" }, + { TimeZoneInfo.FindSystemTimeZoneById(s_strSydney), "(UTC+10:00) Australia/Sydney", null, "AEST", "AEDT" }, + { TimeZoneInfo.FindSystemTimeZoneById(s_strPerth), "(UTC+08:00) Australia/Perth", null, "AWST", "AWDT" }, + { TimeZoneInfo.FindSystemTimeZoneById(s_strIran), "(UTC+03:30) Asia/Tehran", null, "+0330", "+0430" }, - { s_NewfoundlandTz, "(UTC-03:30) America/St_Johns", "NST", "NDT" }, - { s_catamarcaTz, "(UTC-03:00) America/Argentina/Catamarca", "-03", "-02" } + { s_NewfoundlandTz, "(UTC-03:30) America/St_Johns", null, "NST", "NDT" }, + { s_catamarcaTz, "(UTC-03:00) America/Argentina/Catamarca", null, "-03", "-02" } }; else if (PlatformDetection.IsWindows) - return new TheoryData + return new TheoryData { - { TimeZoneInfo.FindSystemTimeZoneById(s_strPacific), "(UTC-08:00) Pacific Time (US & Canada)", "Pacific Standard Time", "Pacific Daylight Time" }, - { TimeZoneInfo.FindSystemTimeZoneById(s_strSydney), "(UTC+10:00) Canberra, Melbourne, Sydney", "AUS Eastern Standard Time", "AUS Eastern Daylight Time" }, - { TimeZoneInfo.FindSystemTimeZoneById(s_strPerth), "(UTC+08:00) Perth", "W. Australia Standard Time", "W. Australia Daylight Time" }, - { TimeZoneInfo.FindSystemTimeZoneById(s_strIran), "(UTC+03:30) Tehran", "Iran Standard Time", "Iran Daylight Time" }, + { TimeZoneInfo.FindSystemTimeZoneById(s_strPacific), "(UTC-08:00) Pacific Time (US & Canada)", null, "Pacific Standard Time", "Pacific Daylight Time" }, + { TimeZoneInfo.FindSystemTimeZoneById(s_strSydney), "(UTC+10:00) Canberra, Melbourne, Sydney", null, "AUS Eastern Standard Time", "AUS Eastern Daylight Time" }, + { TimeZoneInfo.FindSystemTimeZoneById(s_strPerth), "(UTC+08:00) Perth", null, "W. Australia Standard Time", "W. Australia Daylight Time" }, + { TimeZoneInfo.FindSystemTimeZoneById(s_strIran), "(UTC+03:30) Tehran", null, "Iran Standard Time", "Iran Daylight Time" }, - { s_NewfoundlandTz, "(UTC-03:30) Newfoundland", "Newfoundland Standard Time", "Newfoundland Daylight Time" }, - { s_catamarcaTz, "(UTC-03:00) City of Buenos Aires", "Argentina Standard Time", "Argentina Daylight Time" } + { s_NewfoundlandTz, "(UTC-03:30) Newfoundland", null, "Newfoundland Standard Time", "Newfoundland Daylight Time" }, + { s_catamarcaTz, "(UTC-03:00) City of Buenos Aires", null, "Argentina Standard Time", "Argentina Daylight Time" } }; else - return new TheoryData + return new TheoryData { - { TimeZoneInfo.FindSystemTimeZoneById(s_strPacific), "(UTC-08:00) Pacific Time (Los Angeles)", "Pacific Standard Time", "Pacific Daylight Time" }, - { TimeZoneInfo.FindSystemTimeZoneById(s_strSydney), "(UTC+10:00) Eastern Australia Time (Sydney)", "Australian Eastern Standard Time", "Australian Eastern Daylight Time" }, - { TimeZoneInfo.FindSystemTimeZoneById(s_strPerth), "(UTC+08:00) Australian Western Standard Time (Perth)", "Australian Western Standard Time", "Australian Western Daylight Time" }, - { TimeZoneInfo.FindSystemTimeZoneById(s_strIran), "(UTC+03:30) Iran Time", "Iran Standard Time", "Iran Daylight Time" }, - - { s_NewfoundlandTz, "(UTC-03:30) Newfoundland Time (St. John’s)", "Newfoundland Standard Time", "Newfoundland Daylight Time" }, - { s_catamarcaTz, "(UTC-03:00) Argentina Standard Time (Catamarca)", "Argentina Standard Time", "Argentina Summer Time" } + { TimeZoneInfo.FindSystemTimeZoneById(s_strPacific), "(UTC-08:00) Pacific Time (Los Angeles)", null, "Pacific Standard Time", "Pacific Daylight Time" }, + { TimeZoneInfo.FindSystemTimeZoneById(s_strSydney), "(UTC+10:00) Eastern Australia Time (Sydney)", null, "Australian Eastern Standard Time", "Australian Eastern Daylight Time" }, + { TimeZoneInfo.FindSystemTimeZoneById(s_strPerth), "(UTC+08:00) Australian Western Standard Time (Perth)", null, "Australian Western Standard Time", "Australian Western Daylight Time" }, + { TimeZoneInfo.FindSystemTimeZoneById(s_strIran), "(UTC+03:30) Iran Time", "(UTC+03:30) Iran Standard Time (Tehran)", "Iran Standard Time", "Iran Daylight Time" }, + { s_NewfoundlandTz, "(UTC-03:30) Newfoundland Time (St. John’s)", null, "Newfoundland Standard Time", "Newfoundland Daylight Time" }, + { s_catamarcaTz, "(UTC-03:00) Argentina Standard Time (Catamarca)", null, "Argentina Standard Time", "Argentina Summer Time" } }; } // We test the existence of a specific English time zone name to avoid failures on non-English platforms. [ConditionalTheory(nameof(IsEnglishUILanguage))] [MemberData(nameof(Platform_TimeZoneNamesTestData))] - public static void Platform_TimeZoneNames(TimeZoneInfo tzi, string displayName, string standardName, string daylightName) + public static void Platform_TimeZoneNames(TimeZoneInfo tzi, string displayName, string alternativeDisplayName, string standardName, string daylightName) { // Edge case - Optionally allow some characters to be absent in the display name. const string chars = ".’"; @@ -139,8 +138,10 @@ public static void Platform_TimeZoneNames(TimeZoneInfo tzi, string displayName, } } - Assert.Equal($"DisplayName: \"{displayName}\", StandardName: {standardName}\", DaylightName: {daylightName}\"", - $"DisplayName: \"{tzi.DisplayName}\", StandardName: {tzi.StandardName}\", DaylightName: {tzi.DaylightName}\""); + Assert.True(displayName == tzi.DisplayName || alternativeDisplayName == tzi.DisplayName, + $"Display Name: Neither '{displayName}' nor '{alternativeDisplayName}' equal to '{tzi.DisplayName}'"); + Assert.Equal(standardName, tzi.StandardName); + Assert.Equal(daylightName, tzi.DaylightName); } [Fact] From 721e656a8fecf144a5f74709ef3af49f3a58dc51 Mon Sep 17 00:00:00 2001 From: Juan Hoyos <19413848+hoyosjs@users.noreply.github.com> Date: Wed, 29 Mar 2023 18:32:39 -0700 Subject: [PATCH 10/29] Update check-service-labels to trigger on branch edit (#84106) --- .github/workflows/check-service-labels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-service-labels.yml b/.github/workflows/check-service-labels.yml index 53435a615a19e6..efbbcdf9925fd7 100644 --- a/.github/workflows/check-service-labels.yml +++ b/.github/workflows/check-service-labels.yml @@ -5,7 +5,7 @@ permissions: on: pull_request: - types: [opened, reopened, labeled, unlabeled, synchronize] + types: [opened, edited, reopened, labeled, unlabeled, synchronize] branches: - 'release/**' From 05038f976c1f1b937d65dac069e8f35513719284 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleksey=20Kliger=20=28=CE=BBgeek=29?= Date: Thu, 30 Mar 2023 14:12:30 -0400 Subject: [PATCH 11/29] [release/7.0][mono] Use unsigned char when computing UTF8 string hashes (#83302) * [mono] Use `unsigned char` when computing UTF8 string hashes The C standard does not specify whether `char` is signed or unsigned, it is implementation defined. Apparently Android aarch64 makes a different choice than other platforms (at least macOS arm64 and Windows x64 give different results). Mono uses `mono_metadata_str_hash` in the AOT compiler and AOT runtime to optimize class name lookup. As a result, classes whose names include UTF-8 continuation bytes (with the high bit = 1) will hash differently in the AOT compiler and on the device. Fixes https://github.com/dotnet/runtime/issues/82187 Fixes https://github.com/dotnet/runtime/issues/78638 * Add regression test --- src/mono/mono/eglib/ghashtable.c | 2 +- src/mono/mono/metadata/metadata.c | 3 +- .../GitHub_82187/GitHub_82187.csproj | 9 ++++++ .../regressions/GitHub_82187/repro.cs | 31 +++++++++++++++++++ 4 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 src/tests/Loader/classloader/regressions/GitHub_82187/GitHub_82187.csproj create mode 100644 src/tests/Loader/classloader/regressions/GitHub_82187/repro.cs diff --git a/src/mono/mono/eglib/ghashtable.c b/src/mono/mono/eglib/ghashtable.c index 8b5c29a1a9044c..79b24603a560f8 100644 --- a/src/mono/mono/eglib/ghashtable.c +++ b/src/mono/mono/eglib/ghashtable.c @@ -673,7 +673,7 @@ guint g_str_hash (gconstpointer v1) { guint hash = 0; - char *p = (char *) v1; + unsigned char *p = (unsigned char *) v1; while (*p++) hash = (hash << 5) - (hash + *p); diff --git a/src/mono/mono/metadata/metadata.c b/src/mono/mono/metadata/metadata.c index 0c63c068929173..057c4c3a802acf 100644 --- a/src/mono/mono/metadata/metadata.c +++ b/src/mono/mono/metadata/metadata.c @@ -5519,7 +5519,8 @@ guint mono_metadata_str_hash (gconstpointer v1) { /* Same as g_str_hash () in glib */ - char *p = (char *) v1; + /* note: signed/unsigned char matters - we feed UTF-8 to this function, so the high bit will give diferent results if we don't match. */ + unsigned char *p = (unsigned char *) v1; guint hash = *p; while (*p++) { diff --git a/src/tests/Loader/classloader/regressions/GitHub_82187/GitHub_82187.csproj b/src/tests/Loader/classloader/regressions/GitHub_82187/GitHub_82187.csproj new file mode 100644 index 00000000000000..32355f272f9085 --- /dev/null +++ b/src/tests/Loader/classloader/regressions/GitHub_82187/GitHub_82187.csproj @@ -0,0 +1,9 @@ + + + true + Exe + + + + + diff --git a/src/tests/Loader/classloader/regressions/GitHub_82187/repro.cs b/src/tests/Loader/classloader/regressions/GitHub_82187/repro.cs new file mode 100644 index 00000000000000..1ab3e5476a66b0 --- /dev/null +++ b/src/tests/Loader/classloader/regressions/GitHub_82187/repro.cs @@ -0,0 +1,31 @@ +using System; + +/* Regression test for https://github.com/dotnet/runtime/issues/78638 + * and https://github.com/dotnet/runtime/issues/82187 ensure AOT + * cross-compiler and AOT runtime use the same name hashing for names + * that include UTF-8 continuation bytes. + */ + +[MySpecial(typeof(MeineTüre))] +public class Program +{ + public static int Main() + { + var attr = (MySpecialAttribute)Attribute.GetCustomAttribute(typeof (Program), typeof(MySpecialAttribute), false); + if (attr == null) + return 101; + if (attr.Type == null) + return 102; + if (attr.Type.FullName != "MeineTüre") + return 103; + return 100; + } +} + +public class MySpecialAttribute : Attribute +{ + public Type Type {get; private set; } + public MySpecialAttribute(Type t) { Type = t; } +} + +public class MeineTüre {} From 88b65f9cacbf007de8e957491976ed77c32a98a1 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 30 Mar 2023 23:39:05 +0200 Subject: [PATCH 12/29] Ensure that default media type is used when 'null' is passed-in to StringContent #81506 (#83425) Co-authored-by: Simon Lovely --- .../src/System/Net/Http/StringContent.cs | 2 +- .../tests/FunctionalTests/StringContentTest.cs | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/libraries/System.Net.Http/src/System/Net/Http/StringContent.cs b/src/libraries/System.Net.Http/src/System/Net/Http/StringContent.cs index b9ce8f271464dd..519d15a60012fa 100644 --- a/src/libraries/System.Net.Http/src/System/Net/Http/StringContent.cs +++ b/src/libraries/System.Net.Http/src/System/Net/Http/StringContent.cs @@ -45,7 +45,7 @@ public StringContent(string content, Encoding? encoding) /// The encoding to use for the content. /// The media type to use for the content. public StringContent(string content, Encoding? encoding, string mediaType) - : this(content, encoding, new MediaTypeHeaderValue(mediaType, (encoding ?? DefaultStringEncoding).WebName)) + : this(content, encoding, new MediaTypeHeaderValue(mediaType ?? DefaultMediaType, (encoding ?? DefaultStringEncoding).WebName)) { } diff --git a/src/libraries/System.Net.Http/tests/FunctionalTests/StringContentTest.cs b/src/libraries/System.Net.Http/tests/FunctionalTests/StringContentTest.cs index 73e33fde4fa9ba..cb69b3e4e7259b 100644 --- a/src/libraries/System.Net.Http/tests/FunctionalTests/StringContentTest.cs +++ b/src/libraries/System.Net.Http/tests/FunctionalTests/StringContentTest.cs @@ -71,6 +71,17 @@ public async Task Ctor_DefineNoEncoding_DefaultEncodingUsed() Assert.Equal(sourceString, roundTrip); } + [Fact] + public void Ctor_PassNullForMediaType_DefaultMediaTypeUsed() + { + string sourceString = "\u00C4\u00E4\u00FC\u00DC"; + Encoding defaultStringEncoding = Encoding.GetEncoding("utf-8"); + var content = new StringContent(sourceString, defaultStringEncoding, ((string)null)!); + + // If no media is passed-in, the default is used + Assert.Equal("text/plain", content.Headers.ContentType.MediaType); + } + [Fact] public async Task Ctor_UseCustomMediaTypeHeaderValue_SpecificEncoding() { From 641393e5186e441e6f30577ec529bcafb26ce10c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 31 Mar 2023 07:23:43 +0200 Subject: [PATCH 13/29] [release/7.0] [wasm] ManagedToNativeGenerator: Skip unmanaged dlls (#83957) --- NuGet.config | 2 +- eng/Version.Details.xml | 8 +-- eng/Versions.props | 4 +- .../WasmAppBuilder/IcallTableGenerator.cs | 10 ++-- .../ManagedToNativeGenerator.cs | 50 +++++++++++++++++-- .../WasmAppBuilder/PInvokeTableGenerator.cs | 11 ++-- 6 files changed, 69 insertions(+), 16 deletions(-) diff --git a/NuGet.config b/NuGet.config index 82b1ce9063aa65..1eaea524958636 100644 --- a/NuGet.config +++ b/NuGet.config @@ -9,7 +9,7 @@ - + diff --git a/src/tasks/WasmAppBuilder/IcallTableGenerator.cs b/src/tasks/WasmAppBuilder/IcallTableGenerator.cs index 7a59ce7bbf7fb3..802ec18190057c 100644 --- a/src/tasks/WasmAppBuilder/IcallTableGenerator.cs +++ b/src/tasks/WasmAppBuilder/IcallTableGenerator.cs @@ -34,7 +34,7 @@ public IcallTableGenerator(Func fixupSymbolName, TaskLoggingHelp // The runtime icall table should be generated using // mono --print-icall-table // - public IEnumerable Generate(string? runtimeIcallTableFile, string[] assemblies, string? outputPath) + public IEnumerable Generate(string? runtimeIcallTableFile, IEnumerable assemblies, string? outputPath) { _icalls.Clear(); _signatures.Clear(); @@ -44,9 +44,13 @@ public IEnumerable Generate(string? runtimeIcallTableFile, string[] asse var resolver = new PathAssemblyResolver(assemblies); using var mlc = new MetadataLoadContext(resolver, "System.Private.CoreLib"); - foreach (var aname in assemblies) + foreach (var asmPath in assemblies) { - var a = mlc.LoadFromAssemblyPath(aname); + if (!File.Exists(asmPath)) + throw new LogAsErrorException($"Cannot find assembly {asmPath}"); + + Log.LogMessage(MessageImportance.Low, $"Loading {asmPath} to scan for icalls"); + var a = mlc.LoadFromAssemblyPath(asmPath); foreach (var type in a.GetTypes()) ProcessType(type); } diff --git a/src/tasks/WasmAppBuilder/ManagedToNativeGenerator.cs b/src/tasks/WasmAppBuilder/ManagedToNativeGenerator.cs index 1dff74a9dcc1c1..9b04d02c670f99 100644 --- a/src/tasks/WasmAppBuilder/ManagedToNativeGenerator.cs +++ b/src/tasks/WasmAppBuilder/ManagedToNativeGenerator.cs @@ -1,9 +1,12 @@ // 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.Diagnostics.CodeAnalysis; +using System.IO; using System.Linq; +using System.Reflection.PortableExecutable; using System.Text; using Microsoft.Build.Framework; using Microsoft.Build.Utilities; @@ -11,7 +14,7 @@ public class ManagedToNativeGenerator : Task { [Required] - public string[]? Assemblies { get; set; } + public string[] Assemblies { get; set; } = Array.Empty(); public string? RuntimeIcallTableFile { get; set; } @@ -62,12 +65,14 @@ public override bool Execute() private void ExecuteInternal() { + List managedAssemblies = FilterOutUnmanagedBinaries(Assemblies); + var pinvoke = new PInvokeTableGenerator(FixupSymbolName, Log); var icall = new IcallTableGenerator(FixupSymbolName, Log); IEnumerable cookies = Enumerable.Concat( - pinvoke.Generate(PInvokeModules, Assemblies!, PInvokeOutputPath!), - icall.Generate(RuntimeIcallTableFile, Assemblies!, IcallOutputPath) + pinvoke.Generate(PInvokeModules, managedAssemblies, PInvokeOutputPath!), + icall.Generate(RuntimeIcallTableFile, managedAssemblies, IcallOutputPath) ); var m2n = new InterpToNativeGenerator(Log); @@ -110,4 +115,43 @@ public string FixupSymbolName(string name) _symbolNameFixups[name] = fixedName; return fixedName; } + + private List FilterOutUnmanagedBinaries(string[] assemblies) + { + List managedAssemblies = new(assemblies.Length); + foreach (string asmPath in Assemblies) + { + if (!File.Exists(asmPath)) + throw new LogAsErrorException($"Cannot find assembly {asmPath}"); + + try + { + if (!IsManagedAssembly(asmPath)) + { + Log.LogMessage(MessageImportance.Low, $"Skipping unmanaged {asmPath}."); + continue; + } + } + catch (Exception ex) + { + Log.LogMessage(MessageImportance.Low, $"Failed to read assembly {asmPath}: {ex}"); + throw new LogAsErrorException($"Failed to read assembly {asmPath}: {ex.Message}"); + } + + managedAssemblies.Add(asmPath); + } + + return managedAssemblies; + } + + private static bool IsManagedAssembly(string filePath) + { + if (!File.Exists(filePath)) + return false; + + using FileStream fileStream = File.OpenRead(filePath); + using PEReader reader = new(fileStream, PEStreamOptions.Default); + return reader.HasMetadata; + } + } diff --git a/src/tasks/WasmAppBuilder/PInvokeTableGenerator.cs b/src/tasks/WasmAppBuilder/PInvokeTableGenerator.cs index 932a8424d513a4..12836d3d5a71e5 100644 --- a/src/tasks/WasmAppBuilder/PInvokeTableGenerator.cs +++ b/src/tasks/WasmAppBuilder/PInvokeTableGenerator.cs @@ -24,7 +24,7 @@ public PInvokeTableGenerator(Func fixupSymbolName, TaskLoggingHe _fixupSymbolName = fixupSymbolName; } - public IEnumerable Generate(string[] pinvokeModules, string[] assemblies, string outputPath) + public IEnumerable Generate(string[] pinvokeModules, IEnumerable assemblies, string outputPath) { var modules = new Dictionary(); foreach (var module in pinvokeModules) @@ -37,9 +37,14 @@ public IEnumerable Generate(string[] pinvokeModules, string[] assemblies var resolver = new PathAssemblyResolver(assemblies); using var mlc = new MetadataLoadContext(resolver, "System.Private.CoreLib"); - foreach (var aname in assemblies) + + foreach (var asmPath in assemblies) { - var a = mlc.LoadFromAssemblyPath(aname); + if (!File.Exists(asmPath)) + throw new LogAsErrorException($"Cannot find assembly {asmPath}"); + + Log.LogMessage(MessageImportance.Low, $"Loading {asmPath} to scan for pinvokes"); + var a = mlc.LoadFromAssemblyPath(asmPath); foreach (var type in a.GetTypes()) CollectPInvokes(pinvokes, callbacks, signatures, type); } From fa133ae9409bbfef6e53ac06166466f8018bcc8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Rozs=C3=ADval?= Date: Fri, 31 Mar 2023 16:24:56 +0200 Subject: [PATCH 14/29] [release/7.0] Use CLOCK_BOOTTIME to calculate BootTime on linux (#67589) (#83966) * Update dependencies from https://github.com/dotnet/emsdk build 20230323.1 (#83860) Microsoft.NET.Workload.Emscripten.net6.Manifest-7.0.100 , Microsoft.NET.Workload.Emscripten.net7.Manifest-7.0.100 From Version 7.0.4 -> To Version 7.0.5 Co-authored-by: dotnet-maestro[bot] * Use CLOCK_BOOTTIME to calculate BootTime on linux (#67589) Co-authored-by: Adam Sitnik Co-authored-by: Jeff Handley Co-authored-by: Simon Rozsival * Do no test StartTime in GetProcessesByName test (#75334) * Revert "Update dependencies from https://github.com/dotnet/emsdk build 20230323.1 (#83860)" This reverts commit 6a533c1a364e41309394d2253ad36b2e001ff23f. --------- Co-authored-by: dotnet-maestro[bot] <42748379+dotnet-maestro[bot]@users.noreply.github.com> Co-authored-by: dotnet-maestro[bot] Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com> Co-authored-by: Adam Sitnik Co-authored-by: Jeff Handley --- .../Linux/procfs/Interop.ProcFsStat.cs | 4 -- .../System.Native/Interop.GetBootTimeTicks.cs | 14 +++++++ .../src/System.Diagnostics.Process.csproj | 2 + .../src/System/Diagnostics/Process.Linux.cs | 40 +++++++------------ .../tests/ProcessTests.cs | 4 +- src/native/libs/System.Native/entrypoints.c | 1 + src/native/libs/System.Native/pal_time.c | 30 ++++++++++++-- src/native/libs/System.Native/pal_time.h | 5 +++ 8 files changed, 66 insertions(+), 34 deletions(-) create mode 100644 src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetBootTimeTicks.cs diff --git a/src/libraries/Common/src/Interop/Linux/procfs/Interop.ProcFsStat.cs b/src/libraries/Common/src/Interop/Linux/procfs/Interop.ProcFsStat.cs index 8dd29a54221d03..ee9c2b75971888 100644 --- a/src/libraries/Common/src/Interop/Linux/procfs/Interop.ProcFsStat.cs +++ b/src/libraries/Common/src/Interop/Linux/procfs/Interop.ProcFsStat.cs @@ -19,10 +19,6 @@ internal static partial class @procfs private const string FileDescriptorDirectoryName = "/fd/"; private const string TaskDirectoryName = "/task/"; - internal const string SelfExeFilePath = RootPath + "self" + ExeFileName; - internal const string SelfCmdLineFilePath = RootPath + "self" + CmdLineFileName; - internal const string ProcStatFilePath = RootPath + "stat"; - internal struct ParsedStat { // Commented out fields are available in the stat data file but diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetBootTimeTicks.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetBootTimeTicks.cs new file mode 100644 index 00000000000000..d6c327578c2183 --- /dev/null +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetBootTimeTicks.cs @@ -0,0 +1,14 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Runtime.InteropServices; + +internal static partial class Interop +{ + internal static partial class Sys + { + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetBootTimeTicks")] + [SuppressGCTransition] + internal static partial long GetBootTimeTicks(); + } +} diff --git a/src/libraries/System.Diagnostics.Process/src/System.Diagnostics.Process.csproj b/src/libraries/System.Diagnostics.Process/src/System.Diagnostics.Process.csproj index 2c273820afb4c9..6f729f78ed0a48 100644 --- a/src/libraries/System.Diagnostics.Process/src/System.Diagnostics.Process.csproj +++ b/src/libraries/System.Diagnostics.Process/src/System.Diagnostics.Process.csproj @@ -302,6 +302,8 @@ Link="Common\Interop\Linux\Interop.ProcFsStat.ParseMapModules.cs" /> + diff --git a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.Linux.cs b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.Linux.cs index bae58c8e8bcac8..e25aa2bf9fd88a 100644 --- a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.Linux.cs +++ b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/Process.Linux.cs @@ -9,6 +9,7 @@ using System.IO; using System.Runtime.Versioning; using System.Text; +using System.Threading; namespace System.Diagnostics { @@ -79,33 +80,25 @@ internal static DateTime BootTimeToDateTime(TimeSpan timespanAfterBoot) return dt.ToLocalTime(); } + private static long s_bootTimeTicks; /// Gets the system boot time. private static DateTime BootTime { get { - // '/proc/stat -> btime' gets the boot time. - // btime is the time of system boot in seconds since the Unix epoch. - // It includes suspended time and is updated based on the system time (settimeofday). - const string StatFile = Interop.procfs.ProcStatFilePath; - string text = File.ReadAllText(StatFile); - int btimeLineStart = text.IndexOf("\nbtime ", StringComparison.Ordinal); - if (btimeLineStart >= 0) - { - int btimeStart = btimeLineStart + "\nbtime ".Length; - int btimeEnd = text.IndexOf('\n', btimeStart); - if (btimeEnd > btimeStart) + long bootTimeTicks = Interlocked.Read(ref s_bootTimeTicks); + if (bootTimeTicks == 0) + { + bootTimeTicks = Interop.Sys.GetBootTimeTicks(); + long oldValue = Interlocked.CompareExchange(ref s_bootTimeTicks, bootTimeTicks, 0); + if (oldValue != 0) // a different thread has managed to update the ticks first { - if (long.TryParse(text.AsSpan(btimeStart, btimeEnd - btimeStart), out long bootTimeSeconds)) - { - return DateTime.UnixEpoch + TimeSpan.FromSeconds(bootTimeSeconds); - } + bootTimeTicks = oldValue; // consistency } - } - - return DateTime.UtcNow; - } - } + } + return new DateTime(bootTimeTicks); + } + } /// Gets the parent process ID private int ParentProcessId => @@ -258,11 +251,8 @@ private static void SetWorkingSetLimitsCore(IntPtr? newMin, IntPtr? newMax, out /// The pid for the target process, or -1 for the current process. internal static string? GetExePath(int processId = -1) { - string exeFilePath = processId == -1 ? - Interop.procfs.SelfExeFilePath : - Interop.procfs.GetExeFilePathForProcess(processId); - - return Interop.Sys.ReadLink(exeFilePath); + return processId == -1 ? Environment.ProcessPath : + Interop.Sys.ReadLink(Interop.procfs.GetExeFilePathForProcess(processId)); } /// Gets the name that was used to start the process, or null if it could not be retrieved. diff --git a/src/libraries/System.Diagnostics.Process/tests/ProcessTests.cs b/src/libraries/System.Diagnostics.Process/tests/ProcessTests.cs index 6fa4ee16248878..80fa5b8bb75b45 100644 --- a/src/libraries/System.Diagnostics.Process/tests/ProcessTests.cs +++ b/src/libraries/System.Diagnostics.Process/tests/ProcessTests.cs @@ -1151,13 +1151,13 @@ public void TestGetProcesses() // Get all the processes running on the machine, and check if the current process is one of them. var foundCurrentProcess = (from p in Process.GetProcesses() - where (p.Id == currentProcess.Id) && (p.ProcessName.Equals(currentProcess.ProcessName)) + where (p.Id == currentProcess.Id) && (p.ProcessName.Equals(currentProcess.ProcessName)) && (p.StartTime == currentProcess.StartTime) select p).Any(); Assert.True(foundCurrentProcess, "TestGetProcesses001 failed"); foundCurrentProcess = (from p in Process.GetProcesses(currentProcess.MachineName) - where (p.Id == currentProcess.Id) && (p.ProcessName.Equals(currentProcess.ProcessName)) + where (p.Id == currentProcess.Id) && (p.ProcessName.Equals(currentProcess.ProcessName)) && (p.StartTime == currentProcess.StartTime) select p).Any(); Assert.True(foundCurrentProcess, "TestGetProcesses002 failed"); diff --git a/src/native/libs/System.Native/entrypoints.c b/src/native/libs/System.Native/entrypoints.c index a9ae62ce446f44..e254f526a1a439 100644 --- a/src/native/libs/System.Native/entrypoints.c +++ b/src/native/libs/System.Native/entrypoints.c @@ -245,6 +245,7 @@ static const Entry s_sysNative[] = DllImportEntry(SystemNative_UTimensat) DllImportEntry(SystemNative_FUTimens) DllImportEntry(SystemNative_GetTimestamp) + DllImportEntry(SystemNative_GetBootTimeTicks) DllImportEntry(SystemNative_GetCpuUtilization) DllImportEntry(SystemNative_GetPwUidR) DllImportEntry(SystemNative_GetPwNamR) diff --git a/src/native/libs/System.Native/pal_time.c b/src/native/libs/System.Native/pal_time.c index 588277afdf5925..4a7bbeca4d59bd 100644 --- a/src/native/libs/System.Native/pal_time.c +++ b/src/native/libs/System.Native/pal_time.c @@ -18,9 +18,10 @@ enum { - SecondsToMicroSeconds = 1000000, // 10^6 - SecondsToNanoSeconds = 1000000000, // 10^9 - MicroSecondsToNanoSeconds = 1000 // 10^3 + MicroSecondsToNanoSeconds = 1000, // 10^3 + SecondsToNanoSeconds = 1000000000, // 10^9 + SecondsToTicks = 10000000, // 10^7 + TicksToNanoSeconds = 100, // 10^2 }; int32_t SystemNative_UTimensat(const char* path, TimeSpec* times) @@ -95,6 +96,29 @@ uint64_t SystemNative_GetTimestamp() #endif } +int64_t SystemNative_GetBootTimeTicks() +{ +#if defined(TARGET_LINUX) || defined(TARGET_ANDROID) + struct timespec ts; + + int result = clock_gettime(CLOCK_BOOTTIME, &ts); + assert(result == 0); // only possible errors are if the given clockId isn't supported or &ts is an invalid address + (void)result; // suppress unused parameter warning in release builds + + int64_t sinceBootTicks = ((int64_t)ts.tv_sec * SecondsToTicks) + (ts.tv_nsec / TicksToNanoSeconds); + + result = clock_gettime(CLOCK_REALTIME_COARSE, &ts); + assert(result == 0); + + int64_t sinceEpochTicks = ((int64_t)ts.tv_sec * SecondsToTicks) + (ts.tv_nsec / TicksToNanoSeconds); + const int64_t UnixEpochTicks = 621355968000000000; + + return UnixEpochTicks + sinceEpochTicks - sinceBootTicks; +#else + return -1; +#endif +} + double SystemNative_GetCpuUtilization(ProcessCpuInformation* previousCpuInfo) { uint64_t kernelTime = 0; diff --git a/src/native/libs/System.Native/pal_time.h b/src/native/libs/System.Native/pal_time.h index 8660902f4761f5..26db2c20c102ef 100644 --- a/src/native/libs/System.Native/pal_time.h +++ b/src/native/libs/System.Native/pal_time.h @@ -39,6 +39,11 @@ PALEXPORT int32_t SystemNative_FUTimens(intptr_t fd, TimeSpec* times); */ PALEXPORT uint64_t SystemNative_GetTimestamp(void); +/** + * Gets system boot time ticks. (Linux only) + */ +PALEXPORT int64_t SystemNative_GetBootTimeTicks(void); + /** * The main purpose of this function is to compute the overall CPU utilization * for the CLR thread pool to regulate the number of worker threads. From 7cd68bccde597caf3183ea38f6b9e1017496bd76 Mon Sep 17 00:00:00 2001 From: Andy Ayers Date: Fri, 31 Mar 2023 11:30:16 -0700 Subject: [PATCH 15/29] [release/7.0] JIT: fix bug in cloning conditions for jagged array (#83414) (#83462) Backport of #83414 to release/7.0, fixes #83242 When checking that an inner array access is in bounds, we must ensure any outer access is fully in bounds too. We were checking that `idx < array.Len` but not that `idx >= 0`. Use an unsigned compare for this check so we can do both sides with a single instruction. Fixes #83242. --- src/coreclr/jit/loopcloning.cpp | 20 +++++-- src/coreclr/jit/loopcloning.h | 6 +- .../JitBlue/Runtime_83242/Runtime_83242.cs | 55 +++++++++++++++++++ .../Runtime_83242/Runtime_83242.csproj | 9 +++ 4 files changed, 83 insertions(+), 7 deletions(-) create mode 100644 src/tests/JIT/Regression/JitBlue/Runtime_83242/Runtime_83242.cs create mode 100644 src/tests/JIT/Regression/JitBlue/Runtime_83242/Runtime_83242.csproj diff --git a/src/coreclr/jit/loopcloning.cpp b/src/coreclr/jit/loopcloning.cpp index b0027ad6717106..d2f3c2519dbb7c 100644 --- a/src/coreclr/jit/loopcloning.cpp +++ b/src/coreclr/jit/loopcloning.cpp @@ -191,7 +191,15 @@ GenTree* LC_Condition::ToGenTree(Compiler* comp, BasicBlock* bb, bool invert) GenTree* op1Tree = op1.ToGenTree(comp, bb); GenTree* op2Tree = op2.ToGenTree(comp, bb); assert(genTypeSize(genActualType(op1Tree->TypeGet())) == genTypeSize(genActualType(op2Tree->TypeGet()))); - return comp->gtNewOperNode(invert ? GenTree::ReverseRelop(oper) : oper, TYP_INT, op1Tree, op2Tree); + + GenTree* result = comp->gtNewOperNode(invert ? GenTree::ReverseRelop(oper) : oper, TYP_INT, op1Tree, op2Tree); + + if (compareUnsigned) + { + result->gtFlags |= GTF_UNSIGNED; + } + + return result; } //-------------------------------------------------------------------------------------------------- @@ -941,12 +949,14 @@ void LC_ArrayDeref::DeriveLevelConditions(JitExpandArrayStack= 0) && (i < a.len). + // We fold the two compares into one using unsigned compare, since we know a.len is non-negative. + // LC_Array arrLen = array; arrLen.oper = LC_Array::ArrLen; arrLen.dim = level - 1; - (*conds)[level * 2 - 1]->Push( - LC_Condition(GT_LT, LC_Expr(LC_Ident(Lcl(), LC_Ident::Var)), LC_Expr(LC_Ident(arrLen)))); + (*conds)[level * 2 - 1]->Push(LC_Condition(GT_LT, LC_Expr(LC_Ident(Lcl(), LC_Ident::Var)), + LC_Expr(LC_Ident(arrLen)), /* unsigned */ true)); // Push condition (a[i] != null) LC_Array arrTmp = array; @@ -1481,7 +1491,7 @@ bool Compiler::optComputeDerefConditions(unsigned loopNum, LoopCloneContext* con assert(maxRank != -1); // First level will always yield the null-check, since it is made of the array base variables. - // All other levels (dimensions) will yield two conditions ex: (i < a.length && a[i] != null) + // All other levels (dimensions) will yield two conditions ex: ((unsigned) i < a.length && a[i] != null) // So add 1 after rank * 2. const unsigned condBlocks = (unsigned)maxRank * 2 + 1; diff --git a/src/coreclr/jit/loopcloning.h b/src/coreclr/jit/loopcloning.h index 103454a89ce95a..e2867f7490efc7 100644 --- a/src/coreclr/jit/loopcloning.h +++ b/src/coreclr/jit/loopcloning.h @@ -625,12 +625,13 @@ struct LC_Condition LC_Expr op1; LC_Expr op2; genTreeOps oper; + bool compareUnsigned; #ifdef DEBUG void Print() { op1.Print(); - printf(" %s ", GenTree::OpName(oper)); + printf(" %s%s ", GenTree::OpName(oper), compareUnsigned ? "U" : ""); op2.Print(); } #endif @@ -646,7 +647,8 @@ struct LC_Condition LC_Condition() { } - LC_Condition(genTreeOps oper, const LC_Expr& op1, const LC_Expr& op2) : op1(op1), op2(op2), oper(oper) + LC_Condition(genTreeOps oper, const LC_Expr& op1, const LC_Expr& op2, bool asUnsigned = false) + : op1(op1), op2(op2), oper(oper), compareUnsigned(asUnsigned) { } diff --git a/src/tests/JIT/Regression/JitBlue/Runtime_83242/Runtime_83242.cs b/src/tests/JIT/Regression/JitBlue/Runtime_83242/Runtime_83242.cs new file mode 100644 index 00000000000000..9e0c0d9889aa11 --- /dev/null +++ b/src/tests/JIT/Regression/JitBlue/Runtime_83242/Runtime_83242.cs @@ -0,0 +1,55 @@ +// 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.Runtime.CompilerServices; + +class Runtime_83242 +{ + [MethodImpl(MethodImplOptions.NoInlining)] + static int Map(int i) + { + if (i == 5) return -1; + return i; + } + + [MethodImpl(MethodImplOptions.NoInlining)] + static void Setup(int[][] a) + { + for (int i = 0; i < a.Length; i++) + { + a[i] = new int[5]; + + for (int j = 0; j < 5; j++) + { + a[i][j] = j; + } + } + } + + public static int Main() + { + int[][] a = new int[11][]; + int sum = 0; + Setup(a); + + for (int i = 0; i < a.Length; i++) + { + int ii = Map(i); + + // Need to ensure ii >= 0 is in the cloning + // conditions for the following loop + + for (int j = 0; j < 5; j++) + { + if (ii >= 0) + { + sum += a[ii][j]; + } + } + } + + Console.WriteLine($"sum is {sum}\n"); + return sum; + } +} diff --git a/src/tests/JIT/Regression/JitBlue/Runtime_83242/Runtime_83242.csproj b/src/tests/JIT/Regression/JitBlue/Runtime_83242/Runtime_83242.csproj new file mode 100644 index 00000000000000..c0a5f3d0484e39 --- /dev/null +++ b/src/tests/JIT/Regression/JitBlue/Runtime_83242/Runtime_83242.csproj @@ -0,0 +1,9 @@ + + + Exe + True + + + + + \ No newline at end of file From 001172f9fe9f8fda817f90bc2f82b5f0cc1c2704 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 3 Apr 2023 08:47:35 +0200 Subject: [PATCH 16/29] [release/7.0] Ensure free buffer space when reading TLS messages (#83574) * Ensure free buffer space when reading TLS messages * Move buffer expansion outside of the loop to prevent unbounded grow * Fix failing tests The initial size is not enough to cover later TLS frames * Remove unwanted changes --------- Co-authored-by: Radek Zikmund Co-authored-by: Radek Zikmund Co-authored-by: Radek Zikmund <32671551+rzikm@users.noreply.github.com> --- .../src/System/Net/Security/SslStream.IO.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/libraries/System.Net.Security/src/System/Net/Security/SslStream.IO.cs b/src/libraries/System.Net.Security/src/System/Net/Security/SslStream.IO.cs index 38b097ebd961bd..174995454aec15 100644 --- a/src/libraries/System.Net.Security/src/System/Net/Security/SslStream.IO.cs +++ b/src/libraries/System.Net.Security/src/System/Net/Security/SslStream.IO.cs @@ -686,8 +686,16 @@ private async ValueTask EnsureFullTlsFrameAsync(CancellationTok if (frameSize < int.MaxValue) { + // make sure we have space for the whole frame _buffer.EnsureAvailableSpace(frameSize - _buffer.EncryptedLength); } + else + { + // move existing data to the beginning of the buffer (they will + // be couple of bytes only, otherwise we would have entire + // header and know exact size) + _buffer.EnsureAvailableSpace(_buffer.Capacity - _buffer.EncryptedLength); + } while (_buffer.EncryptedLength < frameSize) { From 5301032950b66d441f7db7e1e78163f3933f85da Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 4 Apr 2023 12:39:42 -0700 Subject: [PATCH 17/29] [release/7.0] SyntaxValueProvider: avoid performance issue with syntax list containing many items (#83743) Co-authored-by: Charles Stoner <10732005+cston@users.noreply.github.com> Co-authored-by: Eric StJohn --- ...alueProvider_ForAttributeWithSimpleName.cs | 11 +++++- ...oft.Extensions.Logging.Abstractions.csproj | 2 ++ .../LoggerMessageGeneratorParserTests.cs | 34 +++++++++++++++++++ .../src/System.Text.Json.csproj | 4 +-- 4 files changed, 48 insertions(+), 3 deletions(-) diff --git a/src/libraries/Common/src/Roslyn/SyntaxValueProvider_ForAttributeWithSimpleName.cs b/src/libraries/Common/src/Roslyn/SyntaxValueProvider_ForAttributeWithSimpleName.cs index 3e6f947065a1d4..6ecbc1b35baaa7 100644 --- a/src/libraries/Common/src/Roslyn/SyntaxValueProvider_ForAttributeWithSimpleName.cs +++ b/src/libraries/Common/src/Roslyn/SyntaxValueProvider_ForAttributeWithSimpleName.cs @@ -334,7 +334,16 @@ void processMember( // For any other node, just keep recursing deeper to see if we can find an attribute. Note: we cannot // terminate the search anywhere as attributes may be found on things like local functions, and that // means having to dive deep into statements and expressions. - foreach (var child in node.ChildNodesAndTokens().Reverse()) + var childNodesAndTokens = node.ChildNodesAndTokens(); + + // Avoid performance issue in ChildSyntaxList when iterating the child list in reverse + // (see https://github.com/dotnet/roslyn/issues/66475) by iterating forward first to + // ensure child nodes are realized. + foreach (var childNode in childNodesAndTokens) + { + } + + foreach (var child in childNodesAndTokens.Reverse()) { if (child.IsNode) nodeStack.Append(child.AsNode()!); diff --git a/src/libraries/Microsoft.Extensions.Logging.Abstractions/src/Microsoft.Extensions.Logging.Abstractions.csproj b/src/libraries/Microsoft.Extensions.Logging.Abstractions/src/Microsoft.Extensions.Logging.Abstractions.csproj index e95fbc0ac99167..0539414bea2b4f 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Abstractions/src/Microsoft.Extensions.Logging.Abstractions.csproj +++ b/src/libraries/Microsoft.Extensions.Logging.Abstractions/src/Microsoft.Extensions.Logging.Abstractions.csproj @@ -6,6 +6,8 @@ true true true + true + 1 Logging abstractions for Microsoft.Extensions.Logging. Commonly Used Types: diff --git a/src/libraries/Microsoft.Extensions.Logging.Abstractions/tests/Microsoft.Extensions.Logging.Generators.Tests/LoggerMessageGeneratorParserTests.cs b/src/libraries/Microsoft.Extensions.Logging.Abstractions/tests/Microsoft.Extensions.Logging.Generators.Tests/LoggerMessageGeneratorParserTests.cs index 4bb4271e2655c9..e948d02f7269be 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Abstractions/tests/Microsoft.Extensions.Logging.Generators.Tests/LoggerMessageGeneratorParserTests.cs +++ b/src/libraries/Microsoft.Extensions.Logging.Abstractions/tests/Microsoft.Extensions.Logging.Generators.Tests/LoggerMessageGeneratorParserTests.cs @@ -767,6 +767,40 @@ partial class C Assert.Equal(21, generatedSources[0].SourceText.Lines.Count); } + [Fact] + public static void SyntaxListWithManyItems() + { + const int nItems = 200000; + var builder = new System.Text.StringBuilder(); + builder.AppendLine( + """ + using Microsoft.Extensions.Logging; + class Program + { + [LoggerMessage(EventId = 1, Level = LogLevel.Debug, Message = "M1")] + static partial void M1(ILogger logger) + { + """); + builder.AppendLine(" int[] values = new[] { "); + for (int i = 0; i < nItems; i++) + { + builder.Append("0, "); + } + builder.AppendLine("};"); + builder.AppendLine("}"); + builder.AppendLine("}"); + + string source = builder.ToString(); + Compilation compilation = CompilationHelper.CreateCompilation(source); + LoggerMessageGenerator generator = new LoggerMessageGenerator(); + + (ImmutableArray diagnostics, _) = + RoslynTestUtils.RunGenerator(compilation, generator); + + Assert.Single(diagnostics); + Assert.Equal(DiagnosticDescriptors.LoggingMethodHasBody.Id, diagnostics[0].Id); + } + private static async Task> RunGenerator( string code, bool wrap = true, diff --git a/src/libraries/System.Text.Json/src/System.Text.Json.csproj b/src/libraries/System.Text.Json/src/System.Text.Json.csproj index e572cda0d74274..dde9b4e507e7bf 100644 --- a/src/libraries/System.Text.Json/src/System.Text.Json.csproj +++ b/src/libraries/System.Text.Json/src/System.Text.Json.csproj @@ -8,8 +8,8 @@ CS8969 true true - false - 2 + true + 3 true 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. From f8777ff3eb2f70de65c347c63fe236b4c07b808d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 4 Apr 2023 14:19:55 -0700 Subject: [PATCH 18/29] Fixing a bug that causes us to mistakenly demote a gen2 region to gen0 (#83341) We are seeing a gen0 region that's almost fully occupied (< 24 bytes free) with one giant plug (ie, no free objects at all in the region). This causes allocate_in_condemned_generations to go into an infinite loop because in ephemeral generations we expect short plugs, ie, we should be able to allocate a min free object in front of each plug. And normally we can because when we allocate objects in gen0 we make sure to break up the allocation contexts with min free objects and when we compact into gen1 we form short plugs. We are in this situation when all of the following conditions are true - + we did a gen2 compacting GC that generates a pinned plug in a gen2 region almost as big as the whole region. my guess for the reason why there's this giant pinned plug is because that gen2 region was already really compact so when we called allocate_in_condemned_generations on the non pinned plugs that are next to some pinned plugs in it we discovered we can't move the non pinned plugs anyway so we artificially pinned them and formed a giant pinned plug. and during this GC those objects were no longer pinned so we have one giant non pinned plug. + this gen2 region needs to be the last region with pinned plugs; + this gen2 region hasn't been consumed by allocate_in_condemned_generations yet so it was processed by process_remaining_regions; Then in process_remaining_regions we'll set the plan_gen_num for that gen2 region to 0 because we are doing set_region_plan_gen_num_sip (current_region, current_plan_gen_num); instead of going through the demotion logic to decide whether we should demote this region or not. Co-authored-by: Maoni0 --- src/coreclr/gc/gc.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/coreclr/gc/gc.cpp b/src/coreclr/gc/gc.cpp index 4f23aabbddbba6..bcd12311b33d51 100644 --- a/src/coreclr/gc/gc.cpp +++ b/src/coreclr/gc/gc.cpp @@ -28792,7 +28792,8 @@ void gc_heap::process_remaining_regions (int current_plan_gen_num, generation* c return; } - set_region_plan_gen_num_sip (current_region, current_plan_gen_num); + decide_on_demotion_pin_surv (current_region); + if (!heap_segment_swept_in_plan (current_region)) { heap_segment_plan_allocated (current_region) = generation_allocation_pointer (consing_gen); From ed90f146e747eb61517ee02132abf5a874343baf Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 4 Apr 2023 14:26:34 -0700 Subject: [PATCH 19/29] Fix special sweep issue for workstation (#83342) Co-authored-by: Andrew Au --- src/coreclr/gc/gc.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/coreclr/gc/gc.cpp b/src/coreclr/gc/gc.cpp index bcd12311b33d51..d7e3dd2d71012a 100644 --- a/src/coreclr/gc/gc.cpp +++ b/src/coreclr/gc/gc.cpp @@ -30516,6 +30516,13 @@ void gc_heap::plan_phase (int condemned_gen_number) gc_time_info[time_plan] = gc_time_info[time_sweep] - gc_time_info[time_plan]; } #endif //FEATURE_EVENT_TRACE + +#ifdef USE_REGIONS + if (special_sweep_p) + { + should_compact = FALSE; + } +#endif //!USE_REGIONS #endif //MULTIPLE_HEAPS #ifdef FEATURE_LOH_COMPACTION From eacc9be2b3a8ca9bf30eda39eadb0ec8ce30d598 Mon Sep 17 00:00:00 2001 From: Ilona Tomkowicz <32700855+ilonatommy@users.noreply.github.com> Date: Wed, 5 Apr 2023 11:35:24 +0200 Subject: [PATCH 20/29] [release/7.0] Fix encoding problem when publishing (#83577) * Fix. * Applied @pavelsavara's review. * Update dependencies from https://github.com/dotnet/emsdk build 20230323.1 (#83860) Microsoft.NET.Workload.Emscripten.net6.Manifest-7.0.100 , Microsoft.NET.Workload.Emscripten.net7.Manifest-7.0.100 From Version 7.0.4 -> To Version 7.0.5 Co-authored-by: dotnet-maestro[bot] --------- Co-authored-by: dotnet-maestro[bot] <42748379+dotnet-maestro[bot]@users.noreply.github.com> Co-authored-by: dotnet-maestro[bot] --- src/tasks/Common/Utils.cs | 26 +++---------------- .../BlazorWasmBuildPublishTests.cs | 2 +- .../Wasm.Build.Tests/BuildPublishTests.cs | 2 +- .../Wasm.Build.Tests/BuildTestBase.cs | 1 + 4 files changed, 6 insertions(+), 25 deletions(-) diff --git a/src/tasks/Common/Utils.cs b/src/tasks/Common/Utils.cs index 8ed6c2c13711e8..4833b4cd19b0cd 100644 --- a/src/tasks/Common/Utils.cs +++ b/src/tasks/Common/Utils.cs @@ -64,6 +64,9 @@ static string CreateTemporaryBatchFile(string command) using StreamWriter sw = new(file); if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { + // set encoding to UTF-8 -> full Unicode support is needed for usernames - + // `command` contains tmp dir path with the username + sw.WriteLine(@"%SystemRoot%\System32\chcp.com 65001>nul"); sw.WriteLine("setlocal"); sw.WriteLine("set errorlevel=dummy"); sw.WriteLine("set errorlevel="); @@ -187,29 +190,6 @@ public static (int, string) TryRunProcess( return (process.ExitCode, outputBuilder.ToString().Trim('\r', '\n')); } - internal static string CreateTemporaryBatchFile(string command) - { - string extn = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? ".cmd" : ".sh"; - string file = Path.Combine(Path.GetTempPath(), $"tmp{Guid.NewGuid():N}{extn}"); - - using StreamWriter sw = new(file); - if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) - { - sw.WriteLine("setlocal"); - sw.WriteLine("set errorlevel=dummy"); - sw.WriteLine("set errorlevel="); - } - else - { - // Use sh rather than bash, as not all 'nix systems necessarily have Bash installed - sw.WriteLine("#!/bin/sh"); - } - - sw.WriteLine(command); - - return file; - } - public static bool CopyIfDifferent(string src, string dst, bool useHash) { if (!File.Exists(src)) diff --git a/src/tests/BuildWasmApps/Wasm.Build.Tests/BlazorWasmBuildPublishTests.cs b/src/tests/BuildWasmApps/Wasm.Build.Tests/BlazorWasmBuildPublishTests.cs index a40ef1fdd69977..09bbcf8e1d0245 100644 --- a/src/tests/BuildWasmApps/Wasm.Build.Tests/BlazorWasmBuildPublishTests.cs +++ b/src/tests/BuildWasmApps/Wasm.Build.Tests/BlazorWasmBuildPublishTests.cs @@ -26,7 +26,7 @@ public BlazorWasmBuildPublishTests(ITestOutputHelper output, SharedBuildPerTestC [InlineData("Release")] public void DefaultTemplate_WithoutWorkload(string config) { - string id = $"blz_no_workload_{config}"; + string id = $"blz_no_workload_{config}{s_unicodeChar}"; CreateBlazorWasmTemplateProject(id); // Build diff --git a/src/tests/BuildWasmApps/Wasm.Build.Tests/BuildPublishTests.cs b/src/tests/BuildWasmApps/Wasm.Build.Tests/BuildPublishTests.cs index c798c79cd041fc..66fed9a630d16b 100644 --- a/src/tests/BuildWasmApps/Wasm.Build.Tests/BuildPublishTests.cs +++ b/src/tests/BuildWasmApps/Wasm.Build.Tests/BuildPublishTests.cs @@ -25,7 +25,7 @@ public BuildPublishTests(ITestOutputHelper output, SharedBuildPerTestClassFixtur [BuildAndRun(host: RunHost.Chrome, aot: false, config: "Debug")] public void BuildThenPublishNoAOT(BuildArgs buildArgs, RunHost host, string id) { - string projectName = $"build_publish_{buildArgs.Config}"; + string projectName = $"build_publish_{buildArgs.Config}_{s_unicodeChar}"; buildArgs = buildArgs with { ProjectName = projectName }; buildArgs = ExpandBuildArgs(buildArgs); diff --git a/src/tests/BuildWasmApps/Wasm.Build.Tests/BuildTestBase.cs b/src/tests/BuildWasmApps/Wasm.Build.Tests/BuildTestBase.cs index f0dc3d3457ea91..4805396442a6c8 100644 --- a/src/tests/BuildWasmApps/Wasm.Build.Tests/BuildTestBase.cs +++ b/src/tests/BuildWasmApps/Wasm.Build.Tests/BuildTestBase.cs @@ -29,6 +29,7 @@ public abstract class BuildTestBase : IClassFixture Date: Wed, 5 Apr 2023 15:54:43 -0400 Subject: [PATCH 21/29] [release/7.0] [MONO][MARSHAL] Initialize ilgen with a flag (#83813) * Use flag to initilize ilgen, instead of doing it lazily. * Formatting. * Improve variable naming. * Fix condition. * Updated name in .h file. * Updated how wasm inits ilgen. * Updated wasi driver. --------- Co-authored-by: Nathan Ricci --- src/mono/mono/metadata/marshal-ilgen.c | 10 ++-------- src/mono/mono/metadata/marshal-ilgen.h | 4 ++++ src/mono/mono/metadata/marshal-lightweight.c | 13 +++++++++++++ src/mono/mono/metadata/marshal-lightweight.h | 3 +++ src/mono/mono/metadata/marshal.c | 10 +--------- src/mono/mono/mini/mini-runtime.c | 17 +++++++++++++++++ src/mono/wasi/mono-wasi-driver/driver.c | 1 - src/mono/wasm/runtime/driver.c | 2 -- 8 files changed, 40 insertions(+), 20 deletions(-) diff --git a/src/mono/mono/metadata/marshal-ilgen.c b/src/mono/mono/metadata/marshal-ilgen.c index ceceb70149f21b..a67290f8580403 100644 --- a/src/mono/mono/metadata/marshal-ilgen.c +++ b/src/mono/mono/metadata/marshal-ilgen.c @@ -2717,13 +2717,7 @@ emit_marshal_variant_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, static MonoMarshalIlgenCallbacks * get_marshal_cb (void) { - if (G_UNLIKELY (!ilgen_cb_inited)) { -#ifdef ENABLE_ILGEN - mono_marshal_ilgen_init (); -#else - mono_marshal_noilgen_init_heavyweight (); -#endif - } + g_assert(ilgen_cb_inited); return &ilgen_marshal_cb; } @@ -2804,7 +2798,7 @@ mono_emit_marshal_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, } void -mono_marshal_ilgen_init (void) +mono_marshal_ilgen_init_internal (void) { MonoMarshalIlgenCallbacks cb; cb.version = MONO_MARSHAL_CALLBACKS_VERSION; diff --git a/src/mono/mono/metadata/marshal-ilgen.h b/src/mono/mono/metadata/marshal-ilgen.h index 1b3914588fb2e4..07ec9906dfe3ff 100644 --- a/src/mono/mono/metadata/marshal-ilgen.h +++ b/src/mono/mono/metadata/marshal-ilgen.h @@ -39,4 +39,8 @@ mono_emit_marshal_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, MonoMarshalSpec *spec, int conv_arg, MonoType **conv_arg_type, MarshalAction action, MonoMarshalLightweightCallbacks* lightweigth_cb); + +void +mono_marshal_ilgen_init_internal (void); + #endif // __MARSHAL_ILGEN_H__ \ No newline at end of file diff --git a/src/mono/mono/metadata/marshal-lightweight.c b/src/mono/mono/metadata/marshal-lightweight.c index 70a8ee0ede2947..cc79171907dc38 100644 --- a/src/mono/mono/metadata/marshal-lightweight.c +++ b/src/mono/mono/metadata/marshal-lightweight.c @@ -68,6 +68,19 @@ get_method_image (MonoMethod *method) return m_class_get_image (method->klass); } +static gboolean ilgen_callbacks_requested = FALSE; +MONO_API void +mono_marshal_ilgen_init (void) +{ + ilgen_callbacks_requested = TRUE; +} + +gboolean +mono_marshal_is_ilgen_requested (void) +{ + return ilgen_callbacks_requested; +} + /** * mono_mb_strdup: * \param mb the MethodBuilder diff --git a/src/mono/mono/metadata/marshal-lightweight.h b/src/mono/mono/metadata/marshal-lightweight.h index 8dfd4803a96496..ff33baed393c55 100644 --- a/src/mono/mono/metadata/marshal-lightweight.h +++ b/src/mono/mono/metadata/marshal-lightweight.h @@ -9,4 +9,7 @@ MONO_API void mono_marshal_lightweight_init (void); +gboolean +mono_marshal_is_ilgen_requested (void); + #endif // __MONO_MARSHAL_LIGHTWEIGHT_H__ diff --git a/src/mono/mono/metadata/marshal.c b/src/mono/mono/metadata/marshal.c index f7262ee0dff8d4..d810a5a8c67829 100644 --- a/src/mono/mono/metadata/marshal.c +++ b/src/mono/mono/metadata/marshal.c @@ -6254,15 +6254,7 @@ mono_install_marshal_callbacks (MonoMarshalLightweightCallbacks *cb) static MonoMarshalLightweightCallbacks * get_marshal_cb (void) { - - if (G_UNLIKELY (!lightweight_cb_inited)) { -#ifdef ENABLE_ILGEN - mono_marshal_lightweight_init (); -#else - mono_marshal_noilgen_init_lightweight (); -#endif - } - + g_assert (lightweight_cb_inited); return &marshal_lightweight_cb; } diff --git a/src/mono/mono/mini/mini-runtime.c b/src/mono/mono/mini/mini-runtime.c index 5aa0502bc0800e..0a4ef9fefbb618 100644 --- a/src/mono/mono/mini/mini-runtime.c +++ b/src/mono/mono/mini/mini-runtime.c @@ -41,6 +41,7 @@ #include #include #include +#include #include #include #include @@ -4467,6 +4468,22 @@ mini_init (const char *filename) mono_component_event_pipe_100ns_ticks_start (); + +#ifdef ENABLE_ILGEN + mono_marshal_lightweight_init (); + mono_marshal_ilgen_init_internal (); +#else + if (mono_marshal_is_ilgen_requested ()) + { + mono_marshal_lightweight_init (); + mono_marshal_ilgen_init_internal (); + } + else{ + mono_marshal_noilgen_init_lightweight(); + mono_marshal_noilgen_init_heavyweight (); + } +#endif + MONO_VES_INIT_BEGIN (); CHECKED_MONO_INIT (); diff --git a/src/mono/wasi/mono-wasi-driver/driver.c b/src/mono/wasi/mono-wasi-driver/driver.c index 80a0339a0df62a..d8138a46902316 100644 --- a/src/mono/wasi/mono-wasi-driver/driver.c +++ b/src/mono/wasi/mono-wasi-driver/driver.c @@ -481,7 +481,6 @@ mono_wasm_load_runtime (const char *argv, int debug_level) mono_jit_set_aot_mode (MONO_AOT_MODE_INTERP_ONLY); mono_ee_interp_init (interp_opts); - mono_marshal_lightweight_init (); mono_marshal_ilgen_init (); mono_method_builder_ilgen_init (); mono_sgen_mono_ilgen_init (); diff --git a/src/mono/wasm/runtime/driver.c b/src/mono/wasm/runtime/driver.c index e2db123f7ab5f2..5434f62585a064 100644 --- a/src/mono/wasm/runtime/driver.c +++ b/src/mono/wasm/runtime/driver.c @@ -55,7 +55,6 @@ int mono_wasm_register_root (char *start, size_t size, const char *name); void mono_wasm_deregister_root (char *addr); void mono_ee_interp_init (const char *opts); -void mono_marshal_lightweight_init (void); void mono_marshal_ilgen_init (void); void mono_method_builder_ilgen_init (void); void mono_sgen_mono_ilgen_init (void); @@ -595,7 +594,6 @@ mono_wasm_load_runtime (const char *unused, int debug_level) #endif #ifdef NEED_INTERP mono_ee_interp_init (interp_opts); - mono_marshal_lightweight_init (); mono_marshal_ilgen_init(); mono_method_builder_ilgen_init (); mono_sgen_mono_ilgen_init (); From 05061454dc393ba36a7153f0fe1bcb094bab5608 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Wed, 5 Apr 2023 20:18:44 -0600 Subject: [PATCH 22/29] [release/7.0-staging] Update dependencies from dotnet/linker dotnet/msquic dotnet/runtime-assets dotnet/emsdk (#84145) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update dependencies from https://github.com/dotnet/emsdk build 20230323.1 Microsoft.NET.Workload.Emscripten.net6.Manifest-7.0.100 , Microsoft.NET.Workload.Emscripten.net7.Manifest-7.0.100 From Version 7.0.4 -> To Version 7.0.5 * Update dependencies from https://github.com/dotnet/linker build 20230315.1 Microsoft.NET.ILLink.Tasks From Version 7.0.100-1.22423.4 -> To Version 7.0.100-1.23165.1 * Update dependencies from https://github.com/dotnet/msquic build 20220909.1 System.Net.MsQuic.Transport From Version 7.0.0-alpha.1.22406.1 -> To Version 7.0.0-alpha.1.22459.1 * Update dependencies from https://github.com/dotnet/runtime-assets build 20230329.6 Microsoft.DotNet.CilStrip.Sources , System.ComponentModel.TypeConverter.TestData , System.Data.Common.TestData , System.Drawing.Common.TestData , System.Formats.Tar.TestData , System.IO.Compression.TestData , System.IO.Packaging.TestData , System.Net.TestData , System.Private.Runtime.UnicodeData , System.Runtime.Numerics.TestData , System.Runtime.TimeZoneData , System.Security.Cryptography.X509Certificates.TestData , System.Text.RegularExpressions.TestData , System.Windows.Extensions.TestData From Version 7.0.0-beta.23151.1 -> To Version 7.0.0-beta.23179.6 * Update dependencies from https://github.com/dotnet/emsdk build 20230405.1 Microsoft.NET.Workload.Emscripten.net6.Manifest-7.0.100 , Microsoft.NET.Workload.Emscripten.net7.Manifest-7.0.100 From Version 7.0.5 -> To Version 7.0.6 --------- Co-authored-by: dotnet-maestro[bot] Co-authored-by: Carlos Sánchez López <1175054+carlossanlop@users.noreply.github.com> --- NuGet.config | 2 +- eng/Version.Details.xml | 72 ++++++++++++++++++++--------------------- eng/Versions.props | 36 ++++++++++----------- 3 files changed, 55 insertions(+), 55 deletions(-) diff --git a/NuGet.config b/NuGet.config index 1eaea524958636..3b47eb2e33ec79 100644 --- a/NuGet.config +++ b/NuGet.config @@ -9,7 +9,7 @@ - + @@ -118,20 +118,20 @@ 4.5.0 7.0.0-rc.1.22414.6 - 7.0.0-beta.23151.1 - 7.0.0-beta.23151.1 - 7.0.0-beta.23151.1 - 7.0.0-beta.23151.1 - 7.0.0-beta.23151.1 - 7.0.0-beta.23151.1 - 7.0.0-beta.23151.1 - 7.0.0-beta.23151.1 - 7.0.0-beta.23151.1 - 7.0.0-beta.23151.1 - 7.0.0-beta.23151.1 - 7.0.0-beta.23151.1 - 7.0.0-beta.23151.1 - 7.0.0-beta.23151.1 + 7.0.0-beta.23179.6 + 7.0.0-beta.23179.6 + 7.0.0-beta.23179.6 + 7.0.0-beta.23179.6 + 7.0.0-beta.23179.6 + 7.0.0-beta.23179.6 + 7.0.0-beta.23179.6 + 7.0.0-beta.23179.6 + 7.0.0-beta.23179.6 + 7.0.0-beta.23179.6 + 7.0.0-beta.23179.6 + 7.0.0-beta.23179.6 + 7.0.0-beta.23179.6 + 7.0.0-beta.23179.6 1.0.0-prerelease.22415.6 1.0.0-prerelease.22415.6 @@ -174,13 +174,13 @@ 7.0.0-preview-20221010.1 - 7.0.100-1.22423.4 + 7.0.100-1.23165.1 $(MicrosoftNETILLinkTasksVersion) 7.0.0-rtm.23115.1 2.1.1 - 7.0.0-alpha.1.22406.1 + 7.0.0-alpha.1.22459.1 11.1.0-alpha.1.23115.1 11.1.0-alpha.1.23115.1 From c2d6594855805c72e8cd93a17d0bd9532360d46f Mon Sep 17 00:00:00 2001 From: Eric StJohn Date: Thu, 6 Apr 2023 12:19:31 -0700 Subject: [PATCH 23/29] [release/7.0] Fix pinned assembly version 7.0 (#84355) * Eight packable projects pin their assembly version for .NET Framework compatibility. The incremental package servicing infrastructure didn't check if the assembly version is pinned and changed it during servicing. As an example, System.Speech pins its assembly version to 4.0.0.0 but that version gets overwritten during servicing. I.e. for .NET 7 the version would then change to "7.0.0.$(ServicingVersion)" which is incorrect. Please find the full list of impacted assemblies below: - System.ComponentModel.Composition - System.DirectoryServices - System.DirectoryServices.AccountManagement - System.DirectoryServices.Protocols - System.Management - System.Reflection.Context - System.Runtime.Caching - System.Speech For System.DirectoryServices.Protocols and System.Management we'll only pin the version for the .NETStandard assembly since those previously shipped the newer versions in servicing. * Enable System.Management and System.DirectoryServices.Protocols in servicing * Address feedback --- eng/packaging.targets | 2 +- .../src/Microsoft.Windows.Compatibility.csproj | 4 ++-- .../Directory.Build.props | 1 - .../Directory.Build.targets | 8 ++++++++ .../Directory.Build.props | 4 ---- .../Directory.Build.targets | 8 ++++++++ .../Directory.Build.props | 4 ---- .../Directory.Build.targets | 10 ++++++++++ .../src/System.DirectoryServices.Protocols.csproj | 4 ++-- .../System.DirectoryServices/Directory.Build.props | 4 ---- .../System.DirectoryServices/Directory.Build.targets | 8 ++++++++ src/libraries/System.Management/Directory.Build.props | 4 ---- .../System.Management/Directory.Build.targets | 10 ++++++++++ .../System.Management/src/System.Management.csproj | 4 ++-- .../System.Reflection.Context/Directory.Build.props | 1 - .../System.Reflection.Context/Directory.Build.targets | 9 +++++++++ .../System.Runtime.Caching/Directory.Build.props | 4 ---- .../System.Runtime.Caching/Directory.Build.targets | 8 ++++++++ src/libraries/System.Speech/Directory.Build.props | 4 ---- src/libraries/System.Speech/Directory.Build.targets | 8 ++++++++ 20 files changed, 76 insertions(+), 33 deletions(-) create mode 100644 src/libraries/System.ComponentModel.Composition/Directory.Build.targets create mode 100644 src/libraries/System.DirectoryServices.AccountManagement/Directory.Build.targets create mode 100644 src/libraries/System.DirectoryServices.Protocols/Directory.Build.targets create mode 100644 src/libraries/System.DirectoryServices/Directory.Build.targets create mode 100644 src/libraries/System.Management/Directory.Build.targets create mode 100644 src/libraries/System.Reflection.Context/Directory.Build.targets create mode 100644 src/libraries/System.Runtime.Caching/Directory.Build.targets create mode 100644 src/libraries/System.Speech/Directory.Build.targets diff --git a/eng/packaging.targets b/eng/packaging.targets index 58f6e768373fce..9911316896c150 100644 --- a/eng/packaging.targets +++ b/eng/packaging.targets @@ -43,7 +43,7 @@ <_IsWindowsDesktopApp Condition="$(WindowsDesktopCoreAppLibrary.Contains('$(AssemblyName);'))">true <_IsAspNetCoreApp Condition="$(AspNetCoreAppLibrary.Contains('$(AssemblyName);'))">true <_AssemblyInTargetingPack Condition="('$(IsNETCoreAppSrc)' == 'true' or '$(IsNetCoreAppRef)' == 'true' or '$(_IsAspNetCoreApp)' == 'true' or '$(_IsWindowsDesktopApp)' == 'true') and '$(TargetFrameworkIdentifier)' != '.NETFramework'">true - + $(MajorVersion).$(MinorVersion).0.$(ServicingVersion) diff --git a/src/libraries/Microsoft.Windows.Compatibility/src/Microsoft.Windows.Compatibility.csproj b/src/libraries/Microsoft.Windows.Compatibility/src/Microsoft.Windows.Compatibility.csproj index 657adbd5127346..e314fc30744921 100644 --- a/src/libraries/Microsoft.Windows.Compatibility/src/Microsoft.Windows.Compatibility.csproj +++ b/src/libraries/Microsoft.Windows.Compatibility/src/Microsoft.Windows.Compatibility.csproj @@ -5,8 +5,8 @@ false true - false - 1 + true + 2 $(NoWarn);NU5128 This Windows Compatibility Pack provides access to APIs that were previously available only for .NET Framework. It can be used from both .NET as well as .NET Standard. diff --git a/src/libraries/System.ComponentModel.Composition/Directory.Build.props b/src/libraries/System.ComponentModel.Composition/Directory.Build.props index 7b1204a4c7202c..798ccfd363e813 100644 --- a/src/libraries/System.ComponentModel.Composition/Directory.Build.props +++ b/src/libraries/System.ComponentModel.Composition/Directory.Build.props @@ -1,7 +1,6 @@  - 4.0.0.0 ECMA diff --git a/src/libraries/System.ComponentModel.Composition/Directory.Build.targets b/src/libraries/System.ComponentModel.Composition/Directory.Build.targets new file mode 100644 index 00000000000000..e8aeeb47a8da9c --- /dev/null +++ b/src/libraries/System.ComponentModel.Composition/Directory.Build.targets @@ -0,0 +1,8 @@ + + + + + 4.0.0.0 + + diff --git a/src/libraries/System.DirectoryServices.AccountManagement/Directory.Build.props b/src/libraries/System.DirectoryServices.AccountManagement/Directory.Build.props index 4cf151da3064fc..de81d80c303d7d 100644 --- a/src/libraries/System.DirectoryServices.AccountManagement/Directory.Build.props +++ b/src/libraries/System.DirectoryServices.AccountManagement/Directory.Build.props @@ -1,10 +1,6 @@  - - 4.0.0.0 ECMA windows diff --git a/src/libraries/System.DirectoryServices.AccountManagement/Directory.Build.targets b/src/libraries/System.DirectoryServices.AccountManagement/Directory.Build.targets new file mode 100644 index 00000000000000..e8aeeb47a8da9c --- /dev/null +++ b/src/libraries/System.DirectoryServices.AccountManagement/Directory.Build.targets @@ -0,0 +1,8 @@ + + + + + 4.0.0.0 + + diff --git a/src/libraries/System.DirectoryServices.Protocols/Directory.Build.props b/src/libraries/System.DirectoryServices.Protocols/Directory.Build.props index 525d9a0d12ab6f..831e8089e2459c 100644 --- a/src/libraries/System.DirectoryServices.Protocols/Directory.Build.props +++ b/src/libraries/System.DirectoryServices.Protocols/Directory.Build.props @@ -1,10 +1,6 @@  - - 4.0.0.0 Microsoft true browser;android;ios;tvos diff --git a/src/libraries/System.DirectoryServices.Protocols/Directory.Build.targets b/src/libraries/System.DirectoryServices.Protocols/Directory.Build.targets new file mode 100644 index 00000000000000..69fc811d007beb --- /dev/null +++ b/src/libraries/System.DirectoryServices.Protocols/Directory.Build.targets @@ -0,0 +1,10 @@ + + + + + 4.0.0.0 + + diff --git a/src/libraries/System.DirectoryServices.Protocols/src/System.DirectoryServices.Protocols.csproj b/src/libraries/System.DirectoryServices.Protocols/src/System.DirectoryServices.Protocols.csproj index c4653562c9caa9..b2a3ad1fc3db1d 100644 --- a/src/libraries/System.DirectoryServices.Protocols/src/System.DirectoryServices.Protocols.csproj +++ b/src/libraries/System.DirectoryServices.Protocols/src/System.DirectoryServices.Protocols.csproj @@ -5,8 +5,8 @@ true true - false - 0 + true + 1 annotations true true diff --git a/src/libraries/System.DirectoryServices/Directory.Build.props b/src/libraries/System.DirectoryServices/Directory.Build.props index 0740890146a71c..7b8070be7d21e6 100644 --- a/src/libraries/System.DirectoryServices/Directory.Build.props +++ b/src/libraries/System.DirectoryServices/Directory.Build.props @@ -1,10 +1,6 @@  - - 4.0.0.0 true diff --git a/src/libraries/System.DirectoryServices/Directory.Build.targets b/src/libraries/System.DirectoryServices/Directory.Build.targets new file mode 100644 index 00000000000000..e8aeeb47a8da9c --- /dev/null +++ b/src/libraries/System.DirectoryServices/Directory.Build.targets @@ -0,0 +1,8 @@ + + + + + 4.0.0.0 + + diff --git a/src/libraries/System.Management/Directory.Build.props b/src/libraries/System.Management/Directory.Build.props index bfa544ca6f649e..709a22a7537088 100644 --- a/src/libraries/System.Management/Directory.Build.props +++ b/src/libraries/System.Management/Directory.Build.props @@ -1,10 +1,6 @@  - - 4.0.0.0 Microsoft windows diff --git a/src/libraries/System.Management/Directory.Build.targets b/src/libraries/System.Management/Directory.Build.targets new file mode 100644 index 00000000000000..69fc811d007beb --- /dev/null +++ b/src/libraries/System.Management/Directory.Build.targets @@ -0,0 +1,10 @@ + + + + + 4.0.0.0 + + diff --git a/src/libraries/System.Management/src/System.Management.csproj b/src/libraries/System.Management/src/System.Management.csproj index 57642cb8f6476a..37e3f532ee08a1 100644 --- a/src/libraries/System.Management/src/System.Management.csproj +++ b/src/libraries/System.Management/src/System.Management.csproj @@ -10,8 +10,8 @@ true true - false - 1 + true + 2 true true Provides access to a rich set of management information and management events about the system, devices, and applications instrumented to the Windows Management Instrumentation (WMI) infrastructure. diff --git a/src/libraries/System.Reflection.Context/Directory.Build.props b/src/libraries/System.Reflection.Context/Directory.Build.props index ed15ad04f46183..798ccfd363e813 100644 --- a/src/libraries/System.Reflection.Context/Directory.Build.props +++ b/src/libraries/System.Reflection.Context/Directory.Build.props @@ -1,7 +1,6 @@  - 4.0.3.0 ECMA diff --git a/src/libraries/System.Reflection.Context/Directory.Build.targets b/src/libraries/System.Reflection.Context/Directory.Build.targets new file mode 100644 index 00000000000000..0d1f58eb0e89d0 --- /dev/null +++ b/src/libraries/System.Reflection.Context/Directory.Build.targets @@ -0,0 +1,9 @@ + + + + + 4.0.3.0 + + diff --git a/src/libraries/System.Runtime.Caching/Directory.Build.props b/src/libraries/System.Runtime.Caching/Directory.Build.props index 30af6959a0707b..d68d22c1b917f8 100644 --- a/src/libraries/System.Runtime.Caching/Directory.Build.props +++ b/src/libraries/System.Runtime.Caching/Directory.Build.props @@ -1,10 +1,6 @@  - - 4.0.0.0 Microsoft true diff --git a/src/libraries/System.Runtime.Caching/Directory.Build.targets b/src/libraries/System.Runtime.Caching/Directory.Build.targets new file mode 100644 index 00000000000000..e8aeeb47a8da9c --- /dev/null +++ b/src/libraries/System.Runtime.Caching/Directory.Build.targets @@ -0,0 +1,8 @@ + + + + + 4.0.0.0 + + diff --git a/src/libraries/System.Speech/Directory.Build.props b/src/libraries/System.Speech/Directory.Build.props index db2f816d5af405..d43c87c09cb684 100644 --- a/src/libraries/System.Speech/Directory.Build.props +++ b/src/libraries/System.Speech/Directory.Build.props @@ -1,10 +1,6 @@  - - 4.0.0.0 MicrosoftShared windows diff --git a/src/libraries/System.Speech/Directory.Build.targets b/src/libraries/System.Speech/Directory.Build.targets new file mode 100644 index 00000000000000..e8aeeb47a8da9c --- /dev/null +++ b/src/libraries/System.Speech/Directory.Build.targets @@ -0,0 +1,8 @@ + + + + + 4.0.0.0 + + From cb70e924f8ea4321b44e695fd27fc5941d67f200 Mon Sep 17 00:00:00 2001 From: carlossanlop <1175054+carlossanlop@users.noreply.github.com> Date: Thu, 6 Apr 2023 18:26:30 -0600 Subject: [PATCH 24/29] Manually resolve spacing conflict in check-service-labels.yml --- .github/workflows/check-service-labels.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/check-service-labels.yml b/.github/workflows/check-service-labels.yml index 3d9dbc94ca3f70..efbbcdf9925fd7 100644 --- a/.github/workflows/check-service-labels.yml +++ b/.github/workflows/check-service-labels.yml @@ -20,4 +20,3 @@ jobs: else exit 1 fi - From 7e8c33ecc389fbd7ec7ac8b9b91721daba8b9ebf Mon Sep 17 00:00:00 2001 From: Vladimir Sadov Date: Thu, 6 Apr 2023 19:46:06 -0700 Subject: [PATCH 25/29] Reverting: Set AssemblyName.ProcessorArchitecture for compatibility. #81101 (#83565) --- .../src/System.Reflection.Metadata.csproj | 6 +-- .../Metadata/MetadataReader.netstandard.cs | 42 ------------------- .../tests/Metadata/MetadataReaderTests.cs | 9 +--- 3 files changed, 5 insertions(+), 52 deletions(-) diff --git a/src/libraries/System.Reflection.Metadata/src/System.Reflection.Metadata.csproj b/src/libraries/System.Reflection.Metadata/src/System.Reflection.Metadata.csproj index 35b4dc25f483a4..a29fda1bc8b330 100644 --- a/src/libraries/System.Reflection.Metadata/src/System.Reflection.Metadata.csproj +++ b/src/libraries/System.Reflection.Metadata/src/System.Reflection.Metadata.csproj @@ -1,4 +1,4 @@ - + $(NetCoreAppCurrent);$(NetCoreAppMinimum);netstandard2.0;$(NetFrameworkMinimum) true @@ -9,8 +9,8 @@ The System.Reflection.Metadata 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. README.md - 1 - false + 2 + true diff --git a/src/libraries/System.Reflection.Metadata/src/System/Reflection/Metadata/MetadataReader.netstandard.cs b/src/libraries/System.Reflection.Metadata/src/System/Reflection/Metadata/MetadataReader.netstandard.cs index 37c4c197a68e9a..49406b39dec156 100644 --- a/src/libraries/System.Reflection.Metadata/src/System/Reflection/Metadata/MetadataReader.netstandard.cs +++ b/src/libraries/System.Reflection.Metadata/src/System/Reflection/Metadata/MetadataReader.netstandard.cs @@ -85,12 +85,6 @@ public static unsafe AssemblyName GetAssemblyName(string assemblyFile) peReader = new PEReader((byte*)safeBuffer.DangerousGetHandle(), (int)safeBuffer.ByteLength); MetadataReader mdReader = peReader.GetMetadataReader(MetadataReaderOptions.None); AssemblyName assemblyName = mdReader.GetAssemblyDefinition().GetAssemblyName(); - - AssemblyFlags aFlags = mdReader.AssemblyTable.GetFlags(); -#pragma warning disable SYSLIB0037 // AssemblyName.ProcessorArchitecture is obsolete - assemblyName.ProcessorArchitecture = CalculateProcArch(peReader, aFlags); -#pragma warning restore SYSLIB0037 - return assemblyName; } finally @@ -107,42 +101,6 @@ public static unsafe AssemblyName GetAssemblyName(string assemblyFile) } } - private static ProcessorArchitecture CalculateProcArch(PEReader peReader, AssemblyFlags aFlags) - { - // 0x70 specifies "reference assembly". - // For these, CLR wants to return None as arch so they can be always loaded, regardless of process type. - if (((uint)aFlags & 0xF0) == 0x70) - return ProcessorArchitecture.None; - - PEHeaders peHeaders = peReader.PEHeaders; - switch (peHeaders.CoffHeader.Machine) - { - case Machine.IA64: - return ProcessorArchitecture.IA64; - case Machine.Arm: - return ProcessorArchitecture.Arm; - case Machine.Amd64: - return ProcessorArchitecture.Amd64; - case Machine.I386: - { - CorFlags flags = peHeaders.CorHeader!.Flags; - if ((flags & CorFlags.ILOnly) != 0 && - (flags & CorFlags.Requires32Bit) == 0) - { - // platform neutral. - return ProcessorArchitecture.MSIL; - } - - // requires x86 - return ProcessorArchitecture.X86; - } - } - - // ProcessorArchitecture is a legacy API and does not cover other Machine kinds. - // For example ARM64 is not expressible - return ProcessorArchitecture.None; - } - private static AssemblyNameFlags GetAssemblyNameFlags(AssemblyFlags flags) { AssemblyNameFlags assemblyNameFlags = AssemblyNameFlags.None; diff --git a/src/libraries/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs b/src/libraries/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs index 3b946e5a807795..dad27d509ac645 100644 --- a/src/libraries/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs +++ b/src/libraries/System.Reflection.Metadata/tests/Metadata/MetadataReaderTests.cs @@ -3090,13 +3090,8 @@ public void GetAssemblyName() if (PlatformDetection.HasAssemblyFiles) { - Assembly a = typeof(MetadataReader).Assembly; - AssemblyName name = MetadataReader.GetAssemblyName(AssemblyPathHelper.GetAssemblyLocation(a)); - Assert.Equal(new AssemblyName(a.FullName).ToString(), name.ToString()); - -#pragma warning disable SYSLIB0037 // AssemblyName.ProcessorArchitecture is obsolete - Assert.Equal(ProcessorArchitecture.MSIL, name.ProcessorArchitecture); -#pragma warning restore SYSLIB0037 + Assembly a = typeof(MetadataReaderTests).Assembly; + Assert.Equal(new AssemblyName(a.FullName).ToString(), MetadataReader.GetAssemblyName(AssemblyPathHelper.GetAssemblyLocation(a)).ToString()); } } } From 50722b09b0fa85ae2913319031427b2e0e1900c0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 10 Apr 2023 15:08:09 -0700 Subject: [PATCH 26/29] [release/7.0] Fix reserving executable memory as per allocation type in ClrVirtualAllocWithinRange() (#83958) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix reserving executable memory as per allocation type in ClrVirtualAllocWithinRange() Fixes #83818 --------- Co-authored-by: Ilia K Co-authored-by: Carlos Sánchez López <1175054+carlossanlop@users.noreply.github.com> --- src/coreclr/utilcode/util.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/coreclr/utilcode/util.cpp b/src/coreclr/utilcode/util.cpp index 623ef923516ce5..26f09eea2564c1 100644 --- a/src/coreclr/utilcode/util.cpp +++ b/src/coreclr/utilcode/util.cpp @@ -369,7 +369,7 @@ BYTE * ClrVirtualAllocWithinRange(const BYTE *pMinAddr, { NOTHROW; PRECONDITION(dwSize != 0); - PRECONDITION(flAllocationType == MEM_RESERVE); + PRECONDITION(flAllocationType == MEM_RESERVE); // ORed with MEM_RESERVE_EXECUTABLE on Unix } CONTRACTL_END; @@ -449,7 +449,7 @@ BYTE * ClrVirtualAllocWithinRange(const BYTE *pMinAddr, (mbInfo.RegionSize >= (SIZE_T) dwSize || mbInfo.RegionSize == 0)) { // Try reserving the memory using VirtualAlloc now - pResult = (BYTE*)ClrVirtualAlloc(tryAddr, dwSize, MEM_RESERVE, flProtect); + pResult = (BYTE*)ClrVirtualAlloc(tryAddr, dwSize, flAllocationType, flProtect); // Normally this will be successful // From 8a0b03e938d9b2df1c1b5b8546d2cce3514453e2 Mon Sep 17 00:00:00 2001 From: Steve Pfister Date: Mon, 10 Apr 2023 19:41:14 -0400 Subject: [PATCH 27/29] [release/7.0][Android] Free up more disk space on CI builds (#84567) backport of https://github.com/dotnet/runtime/pull/84354 The android builds are running out of disk space when building the library test apps. This change tries to recoup some of that space by deleting artifacts after each test was built. Co-authored-by: Steve Pfister --- eng/testing/tests.android.targets | 2 ++ src/mono/msbuild/android/build/AndroidApp.targets | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/eng/testing/tests.android.targets b/eng/testing/tests.android.targets index a8b279bf853178..6539bed6e1c9de 100644 --- a/eng/testing/tests.android.targets +++ b/eng/testing/tests.android.targets @@ -69,6 +69,8 @@ DestinationFolder="$(TestArchiveTestsDir)" SkipUnchangedFiles="true" Condition="'$(ArchiveTests)' == 'true' and '$(IgnoreForCI)' != 'true'" /> + + \ No newline at end of file diff --git a/src/mono/msbuild/android/build/AndroidApp.targets b/src/mono/msbuild/android/build/AndroidApp.targets index 6fd26641cd1e10..41ca304c042b00 100644 --- a/src/mono/msbuild/android/build/AndroidApp.targets +++ b/src/mono/msbuild/android/build/AndroidApp.targets @@ -1,4 +1,9 @@ + + $(GenerateAppBundle) + true + + From 3947f8d19e805d298a0afe978afb11bfe04290e1 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Mon, 10 Apr 2023 17:48:21 -0600 Subject: [PATCH 28/29] Update dependencies from https://github.com/dotnet/linker build 20230407.1 (#84486) Microsoft.NET.ILLink.Tasks From Version 7.0.100-1.23165.1 -> To Version 7.0.100-1.23207.1 Co-authored-by: dotnet-maestro[bot] --- eng/Version.Details.xml | 4 ++-- eng/Versions.props | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 94d4b7ae688821..3af55c86d6de46 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -242,9 +242,9 @@ https://github.com/dotnet/runtime e680411c22e33f45821f4ae64365a2970b2430a6 - + https://github.com/dotnet/linker - d3fc41eadc9ff73ae8e20eb6f874cf5321714c0b + 08a09f27f664fb84368aa4b9eb862b13bf808579 https://github.com/dotnet/xharness diff --git a/eng/Versions.props b/eng/Versions.props index 6fbecbd5bbd9c0..c91fcab0b86889 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -174,7 +174,7 @@ 7.0.0-preview-20221010.1 - 7.0.100-1.23165.1 + 7.0.100-1.23207.1 $(MicrosoftNETILLinkTasksVersion) 7.0.0-rtm.23115.1 From d566ecfcfc4a0ae8e885c08372ac001a702b7941 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20S=C3=A1nchez=20L=C3=B3pez?= <1175054+carlossanlop@users.noreply.github.com> Date: Mon, 10 Apr 2023 18:06:31 -0600 Subject: [PATCH 29/29] [7.0] Reset OOB packages from 7.0.5 (#84341) Co-authored-by: carlossanlop --- .../src/Microsoft.NETCore.Platforms.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj b/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj index c2b4d5f4182fcb..7bcc94c575a494 100644 --- a/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj +++ b/src/libraries/Microsoft.NETCore.Platforms/src/Microsoft.NETCore.Platforms.csproj @@ -25,7 +25,7 @@ $(AdditionalRuntimeIdentifiers);$(OutputRID) 2 - true + false