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/.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
-
diff --git a/docs/project/library-servicing.md b/docs/project/library-servicing.md
index ffdd1fc82a6144..3429c62085a3b2 100644
--- a/docs/project/library-servicing.md
+++ b/docs/project/library-servicing.md
@@ -1,11 +1,18 @@
# 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
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.
@@ -23,4 +30,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
diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml
index 7ad376ee2ec99c..3af55c86d6de46 100644
--- a/eng/Version.Details.xml
+++ b/eng/Version.Details.xml
@@ -4,9 +4,9 @@
https://github.com/dotnet/icu
8f5f53bc4ac6f86aa1f4044a5ec0095cfb231713
-
+
https://github.com/dotnet/msquic
- dc012a715ceb9b5d5258f2fda77520586af5a36a
+ b1a2104c42648101a2373a1278bcf4ef897ad840
https://github.com/dotnet/wcf
@@ -130,57 +130,57 @@
https://github.com/dotnet/arcade
099bbb071e187ba4e1603004597624e6acae6394
-
+
https://github.com/dotnet/runtime-assets
- a2980bba169e946d9e1e77a3a73226ee6096998c
+ ec5d27d08b78d68d96eeb8899f329a2fa732923a
-
+
https://github.com/dotnet/runtime-assets
- a2980bba169e946d9e1e77a3a73226ee6096998c
+ ec5d27d08b78d68d96eeb8899f329a2fa732923a
-
+
https://github.com/dotnet/runtime-assets
- a2980bba169e946d9e1e77a3a73226ee6096998c
+ ec5d27d08b78d68d96eeb8899f329a2fa732923a
-
+
https://github.com/dotnet/runtime-assets
- a2980bba169e946d9e1e77a3a73226ee6096998c
+ ec5d27d08b78d68d96eeb8899f329a2fa732923a
-
+
https://github.com/dotnet/runtime-assets
- a2980bba169e946d9e1e77a3a73226ee6096998c
+ ec5d27d08b78d68d96eeb8899f329a2fa732923a
-
+
https://github.com/dotnet/runtime-assets
- a2980bba169e946d9e1e77a3a73226ee6096998c
+ ec5d27d08b78d68d96eeb8899f329a2fa732923a
-
+
https://github.com/dotnet/runtime-assets
- a2980bba169e946d9e1e77a3a73226ee6096998c
+ ec5d27d08b78d68d96eeb8899f329a2fa732923a
-
+
https://github.com/dotnet/runtime-assets
- a2980bba169e946d9e1e77a3a73226ee6096998c
+ ec5d27d08b78d68d96eeb8899f329a2fa732923a
-
+
https://github.com/dotnet/runtime-assets
- a2980bba169e946d9e1e77a3a73226ee6096998c
+ ec5d27d08b78d68d96eeb8899f329a2fa732923a
-
+
https://github.com/dotnet/runtime-assets
- a2980bba169e946d9e1e77a3a73226ee6096998c
+ ec5d27d08b78d68d96eeb8899f329a2fa732923a
-
+
https://github.com/dotnet/runtime-assets
- a2980bba169e946d9e1e77a3a73226ee6096998c
+ ec5d27d08b78d68d96eeb8899f329a2fa732923a
-
+
https://github.com/dotnet/runtime-assets
- a2980bba169e946d9e1e77a3a73226ee6096998c
+ ec5d27d08b78d68d96eeb8899f329a2fa732923a
-
+
https://github.com/dotnet/runtime-assets
- a2980bba169e946d9e1e77a3a73226ee6096998c
+ ec5d27d08b78d68d96eeb8899f329a2fa732923a
https://github.com/dotnet/llvm-project
@@ -242,9 +242,9 @@
https://github.com/dotnet/runtime
e680411c22e33f45821f4ae64365a2970b2430a6
-
+
https://github.com/dotnet/linker
- 313671b195b1b36d56a8888a9a0e12edaac52c57
+ 08a09f27f664fb84368aa4b9eb862b13bf808579
https://github.com/dotnet/xharness
@@ -282,9 +282,9 @@
https://github.com/dotnet/hotreload-utils
14a4f4c6e6478b84cac9037935f823b40ddad01d
-
+
https://github.com/dotnet/runtime-assets
- a2980bba169e946d9e1e77a3a73226ee6096998c
+ ec5d27d08b78d68d96eeb8899f329a2fa732923a
https://github.com/dotnet/roslyn-analyzers
diff --git a/eng/Versions.props b/eng/Versions.props
index 83930b625852af..c91fcab0b86889 100644
--- a/eng/Versions.props
+++ b/eng/Versions.props
@@ -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.23207.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
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/eng/pipelines/libraries/helix-queues-setup.yml b/eng/pipelines/libraries/helix-queues-setup.yml
index 9d13473381ad27..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') }}:
@@ -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
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/coreclr/gc/gc.cpp b/src/coreclr/gc/gc.cpp
index 4f23aabbddbba6..d7e3dd2d71012a 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);
@@ -30515,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
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/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
//
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/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/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/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/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
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..e314fc30744921 100644
--- a/src/libraries/Microsoft.Windows.Compatibility/src/Microsoft.Windows.Compatibility.csproj
+++ b/src/libraries/Microsoft.Windows.Compatibility/src/Microsoft.Windows.Compatibility.csproj
@@ -6,7 +6,7 @@
false
true
true
- 1
+ 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.
@@ -47,7 +47,7 @@
-
+
- 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.ComponentModel.Composition/src/System.ComponentModel.Composition.csproj b/src/libraries/System.ComponentModel.Composition/src/System.ComponentModel.Composition.csproj
index f6dd177f01d10b..ea0c4a7596dcbf 100644
--- a/src/libraries/System.ComponentModel.Composition/src/System.ComponentModel.Composition.csproj
+++ b/src/libraries/System.ComponentModel.Composition/src/System.ComponentModel.Composition.csproj
@@ -3,6 +3,9 @@
$(NetCoreAppCurrent);$(NetCoreAppMinimum);netstandard2.0
false
true
+
+ false
+ 0
true
true
This namespace provides classes that constitute the core of the Managed Extensibility Framework, or MEF.
diff --git a/src/libraries/System.Configuration.ConfigurationManager/src/System.Configuration.ConfigurationManager.csproj b/src/libraries/System.Configuration.ConfigurationManager/src/System.Configuration.ConfigurationManager.csproj
index 2badd2c37adec6..b70f447de8dcb4 100644
--- a/src/libraries/System.Configuration.ConfigurationManager/src/System.Configuration.ConfigurationManager.csproj
+++ b/src/libraries/System.Configuration.ConfigurationManager/src/System.Configuration.ConfigurationManager.csproj
@@ -7,6 +7,9 @@
false
$(NoWarn);CA1847
true
+
+ false
+ 0
Provides types that support using configuration files.
Commonly Used Types:
@@ -262,7 +265,7 @@ System.Configuration.ConfigurationManager
-
+
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.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/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.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/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 568625193556fd..b2a3ad1fc3db1d 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
+
+ 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.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/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 52b27210fa6d73..37e3f532ee08a1 100644
--- a/src/libraries/System.Management/src/System.Management.csproj
+++ b/src/libraries/System.Management/src/System.Management.csproj
@@ -9,8 +9,9 @@
annotations
true
true
+
true
- 1
+ 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.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()
{
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)
{
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;
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.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.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());
}
}
}
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.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.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
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/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
+
+
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.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.
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:
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/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/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/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/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
+
+
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 ();
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.
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/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);
}
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= 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
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 {}