Skip to content

Commit 69d4dc1

Browse files
authored
Merge branch 'main' into quic-stream-abort-from-api
2 parents 79a7156 + e58be47 commit 69d4dc1

File tree

607 files changed

+19692
-12834
lines changed

Some content is hidden

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

607 files changed

+19692
-12834
lines changed

Directory.Build.props

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -56,18 +56,22 @@
5656
- eng/native/configurecompiler.cmake
5757
- eng/native/build-commons.sh
5858
- src/native/libs/build-native.sh
59-
- src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/ObjectWriter.cs
59+
- src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ObjectWriter/MachObjectWriter.cs
6060
- src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets
61+
- src/mono/mono/tools/offsets-tool/offsets-tool.py
62+
- src/mono/msbuild/apple/build/AppleBuild.targets
6163
- src/installer/pkg/sfx/bundle/shared-framework-distribution-template-x64.xml
6264
- src/installer/pkg/sfx/bundle/shared-framework-distribution-template-arm64.xml
65+
- src/tasks/AotCompilerTask/MonoAOTCompiler.props
66+
- src/tasks/AppleAppBuilder/Xcode.cs
6367
- src/tasks/MobileBuildTasks/Apple/AppleProject.cs
6468
- dotnet/installer repo > src/redist/targets/GeneratePKG.targets
6569
-->
6670
<AndroidApiLevelMin>21</AndroidApiLevelMin>
67-
<iOSVersionMin>11.0</iOSVersionMin>
68-
<tvOSVersionMin>11.0</tvOSVersionMin>
69-
<macOSVersionMin>10.15</macOSVersionMin>
70-
<macOSVersionMin Condition="('$(TargetOS)' == 'osx' or '$(TargetOS)' == 'maccatalyst') and '$(TargetArchitecture)' == 'arm64'">11.0</macOSVersionMin>
71+
<iOSVersionMin>12.2</iOSVersionMin>
72+
<tvOSVersionMin>12.2</tvOSVersionMin>
73+
<macOSVersionMin>12.0</macOSVersionMin>
74+
<MacCatalystVersionMin>15.0</MacCatalystVersionMin>
7175
</PropertyGroup>
7276

7377
<PropertyGroup>
@@ -397,12 +401,10 @@
397401
<PropertyGroup Condition="$(MSBuildProjectFullPath.Contains('$([System.IO.Path]::DirectorySeparatorChar)tests$([System.IO.Path]::DirectorySeparatorChar)'))">
398402
<IsTestProject Condition="$(MSBuildProjectName.EndsWith('.UnitTests')) or $(MSBuildProjectName.EndsWith('.Tests'))">true</IsTestProject>
399403
<IsTrimmingTestProject Condition="$(MSBuildProjectName.EndsWith('.TrimmingTests'))">true</IsTrimmingTestProject>
400-
<IsNativeAotTestProject Condition="$(MSBuildProjectName.EndsWith('.NativeAotTests'))">true</IsNativeAotTestProject>
401-
<IsPublishedAppTestProject Condition="'$(IsTrimmingTestProject)' == 'true' or '$(IsNativeAotTestProject)' == 'true'">true</IsPublishedAppTestProject>
402-
<IsTestSupportProject Condition="'$(IsTestProject)' != 'true' and '$(IsPublishedAppTestProject)' != 'true'">true</IsTestSupportProject>
404+
<IsTestSupportProject Condition="'$(IsTestProject)' != 'true' and '$(IsTrimmingTestProject)' != 'true'">true</IsTestSupportProject>
403405

404406
<!-- Treat test assemblies as non-shipping (do not publish or sign them). -->
405-
<IsShipping Condition="'$(IsTestProject)' == 'true' or '$(IsTestSupportProject)' == 'true' or '$(IsPublishedAppTestProject)' == 'true'">false</IsShipping>
407+
<IsShipping Condition="'$(IsTestProject)' == 'true' or '$(IsTestSupportProject)' == 'true' or '$(IsTrimmingTestProject)' == 'true'">false</IsShipping>
406408
</PropertyGroup>
407409

408410
<PropertyGroup>
@@ -413,7 +415,7 @@
413415
'$(IsReferenceAssemblyProject)' != 'true' and
414416
'$(IsGeneratorProject)' != 'true' and
415417
'$(IsTestProject)' != 'true' and
416-
'$(IsPublishedAppTestProject)' != 'true' and
418+
'$(IsTrimmingTestProject)' != 'true' and
417419
'$(IsTestSupportProject)' != 'true' and
418420
'$(UsingMicrosoftDotNetSharedFrameworkSdk)' != 'true' and
419421
'$(MSBuildProjectExtension)' != '.pkgproj' and
@@ -464,7 +466,7 @@
464466
</PropertyGroup>
465467

466468
<!-- Warnings that should be disabled in our test projects. -->
467-
<PropertyGroup Condition="'$(IsTestProject)' == 'true' or '$(IsTestSupportProject)' == 'true' or '$(IsPublishedAppTestProject)' == 'true'">
469+
<PropertyGroup Condition="'$(IsTestProject)' == 'true' or '$(IsTestSupportProject)' == 'true' or '$(IsTrimmingTestProject)' == 'true'">
468470
<!-- we need to re-enable BinaryFormatter within test projects since some tests exercise these code paths to ensure compat -->
469471
<EnableUnsafeBinaryFormatterSerialization>true</EnableUnsafeBinaryFormatterSerialization>
470472
<!-- don't warn on usage of BinaryFormatter or legacy serialization infrastructure from test projects -->

docs/design/datacontracts/contract-descriptor.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ struct DotNetRuntimeContractDescriptor
2424
uint32_t flags;
2525
uint32_t descriptor_size;
2626
const char *descriptor;
27-
uint32_t aux_data_count;
27+
uint32_t pointer_data_count;
2828
uint32_t pad0;
29-
uintptr_t *aux_data;
29+
uintptr_t *pointer_data;
3030
};
3131
```
3232

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// the empty baseline data descriptor
2+
{
3+
"version": 0
4+
}

docs/project/list-of-diagnostics.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ The PR that reveals the implementation of the `<IncludeInternalObsoleteAttribute
109109
| __`SYSLIB0052`__ | This API supports obsolete mechanisms for Regex extensibility. It is not supported. |
110110
| __`SYSLIB0053`__ | AesGcm should indicate the required tag size for encryption and decryption. Use a constructor that accepts the tag size. |
111111
| __`SYSLIB0054`__ | Thread.VolatileRead and Thread.VolatileWrite are obsolete. Use Volatile.Read or Volatile.Write respectively instead. |
112+
| __`SYSLIB0055`__ | The underlying hardware instruction does not perform a signed saturate narrowing operation, and it always returns an unsigned result. Use the unsigned overload instead. |
112113

113114
## Analyzer Warnings
114115

docs/workflow/testing/coreclr/testing.md

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@
77
* [Building an Individual Test](#building-an-individual-test)
88
* [Building a Test Directory](#building-a-test-directory)
99
* [Building a Test Subtree](#building-a-test-subtree)
10+
* [Test Executors](#test-executors)
11+
* [The Standalone Test Runner and Build Time Test Filtering](#the-standalone-test-runner-and-build-time-test-filtering)
12+
* [Building all tests with the Standalone Runner](#building-all-tests-with-the-standalone-runner)
1013
* [Building C++/CLI Native Test Components Against the Live Ref Assemblies](#building-ccli-native-test-components-against-the-live-ref-assemblies)
1114
* [Test Priorities](#test-priorities)
1215
* [Running the Tests](#running-the-tests)
1316
* [Running Individual Tests](#running-individual-tests)
14-
* [Tests Without a Main Method](#tests-without-a-main-method)
1517
* [PAL Tests (macOS and Linux only)](#pal-tests-macos-and-linux-only)
1618
* [Building PAL Tests](#building-pal-tests)
1719
* [Running PAL Tests](#running-pal-tests)
@@ -62,7 +64,7 @@ This example assumes you built CoreCLR on _Debug_ mode and the Libraries on _Rel
6264

6365
The following subsections will explain how to segment the test suite according to your needs. There are three main scopes of building tests:
6466

65-
* Individual Test
67+
* Individual Test Runner
6668
* Full Directory
6769
* Entire Subtree
6870

@@ -83,19 +85,19 @@ To build an individual test, you have to pass the `-test` flag along with the pa
8385
On Windows:
8486

8587
```cmd
86-
.\src\tests\build.cmd test JIT\Intrinsics\MathRoundDouble_ro.csproj test JIT\Intrinsics\MathFloorDouble_ro.csproj
88+
.\src\tests\build.cmd test JIT\Methodical\Methodical_d1.csproj test JIT\JIT_ro.csproj
8789
```
8890

8991
On macOS and Linux:
9092

9193
```bash
92-
./src/tests/build.sh -test:JIT/Intrinsics/MathRoundDouble_ro.csproj -test:JIT/Intrinsics/MathFloorDouble_ro.csproj
94+
./src/tests/build.sh -test:JIT/Methodical/Methodical_d1.csproj -test:JIT/JIT_ro.csproj
9395
```
9496

9597
Alternatively, you can call _build_ directly using the `dotnet.cmd/dotnet.sh` script at the root of the repo and pass all arguments directly yourself:
9698

9799
```bash
98-
./dotnet.sh build -c <Your Configuration> src/tests/path/to/test/csproj
100+
./dotnet.sh build -c <Your Configuration> src/tests/path/to/test.csproj
99101
```
100102

101103
### Building a Test Directory
@@ -105,13 +107,13 @@ To build all the tests contained in an individual directory, you have to pass th
105107
On Windows:
106108

107109
```cmd
108-
.\src\tests\build.cmd dir JIT\Methodical\Arrays\lcs dir JIT\Methodical\cctor\misc\Desktop
110+
.\src\tests\build.cmd dir JIT dir Loader
109111
```
110112

111113
On macOS and Linux:
112114

113115
```bash
114-
./src/tests/build.sh -dir:JIT/Methodical/Arrays/lcs -dir:JIT/Methodical/cctor/misc/Desktop
116+
./src/tests/build.sh -dir:JIT -dir:Loader
115117
```
116118

117119
### Building a Test Subtree
@@ -130,6 +132,24 @@ On macOS and Linux:
130132
./src/tests/build.sh -tree:baseservices/exceptions -tree:JIT/Methodical
131133
```
132134

135+
### Test Executors
136+
137+
We have multiple different mechanisms of executing tests.
138+
139+
Our test entrypoints are generally what we call "merged test runners", as they provide an executable runner project for multiple different test assemblies. These projects can be identified by the `<Import Project="$(TestSourceDir)MergedTestRunner.targets" />` line in their .csproj file. These projects provide a simple experience for running tests. When executing a merged runner project, it will run each test sequentially and record if it passes or fails in an xunit results file. The merged test runner support runtime test filtering. If specified, the first argument to the test runner is treated as a `dotnet test --filter` argument following the xUnit rules in their documentation. Today, the runner only supports the simple form, a substring of a test's fully-qualified name, in the format `Namespace.ContainingTypeName.TypeName.Method`. If support for further filtering options is desired, please open an issue requesting it.
140+
141+
Some tests need to be run in their own process as they interact with global process state, they have a custom test entrypoint, or they interact poorly with other tests in the same process. These tests are generally marked with `<RequiresProcessIsolation>true</RequiresProcessIsolation>` in their project files. These tests can be run directly, but they can also be invoked through their corresponding merged test runner. The merged test runner will invoke them as a subprocess in the same manner as if they were run individually.
142+
143+
#### The Standalone Test Runner and Build Time Test Filtering
144+
145+
Sometimes you may want to run a test with the least amount of code before actually executing the test. In addition to the merged test runner, we have another runner mode known as the "Standalone" runner. This runner is used by default in tests that require process isolation. This runner consists of a simple `try-catch` around executing each test sequentially, with no test results file or runtime test filtering.
146+
147+
To filter tests on a merged test runner built as standalone, you can set the `TestFilter` property, like so: `./dotnet.sh build -c Checked src/tests/path/to/test.csproj -p:TestFilter=SubstringOfFullyQualifiedTestName`. This mechanism supports the same filtering as the runtime test filtering. Using this mechanism will allow you to skip individual test cases at build time instead of at runtime.
148+
149+
#### Building all tests with the Standalone Runner
150+
151+
If you wish to use the Standalone runner described in the [previous section](#the-standalone-test-runner-and-build-time-test-filtering), you can set the `BuildAllTestsAsStandalone` environment variable to `true` when invoking the `./src/tests/build.sh` or `./src/tests/build.cmd` scripts (for example, `export BuildAllTestsAsStandalone=true` or `set BuildAllTestsAsStandalone=true`). This will build all tests that are not directly in a merged test runner's project as separate executable tests and build only the tests that are compiled into the runner directly. If a runner has no tests that are built directly into the runner, then it will be excluded.
152+
133153
### Building C++/CLI Native Test Components Against the Live Ref Assemblies
134154

135155
By default, the _C++/CLI_ native test components build against the _ref pack_ from the SDK specified in the `global.json` file in the root of the repository. To build these components against the _ref assemblies_ produced in the build, pass the `-cmakeargs -DCPP_CLI_LIVE_REF_ASSEMBLIES=1` parameters to the test build. For example:
@@ -233,9 +253,7 @@ cd path/to/JIT/Intrinsics/MathRoundDouble_ro
233253
./MathRoundDouble_ro.sh -coreroot=<repo_root>/artifacts/tests/coreclr/<OS>.<Arch>.<Configuration>/Tests/Core_Root
234254
```
235255

236-
#### Tests Without a Main Method
237-
238-
Guide on how to run tests without a `Main()` Method coming soon!
256+
If you want to run an individual test from a test runner, use the filtering capabilities described in the [Test Executors section](#test-executors).
239257

240258
### PAL Tests (macOS and Linux only)
241259

eng/DotNetBuild.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@
8484
<InnerBuildArgs Condition="'$(SourceBuiltNonShippingPackagesDir)' != ''">$(InnerBuildArgs) /p:SourceBuiltNonShippingPackagesDir=$(SourceBuiltNonShippingPackagesDir)</InnerBuildArgs>
8585
<InnerBuildArgs Condition="'$(SourceBuiltAssetManifestsDir)' != ''">$(InnerBuildArgs) /p:SourceBuiltAssetManifestsDir=$(SourceBuiltAssetManifestsDir)</InnerBuildArgs>
8686
<InnerBuildArgs Condition="'$(SourceBuiltSymbolsDir)' != ''">$(InnerBuildArgs) /p:SourceBuiltSymbolsDir=$(SourceBuiltSymbolsDir)</InnerBuildArgs>
87+
<InnerBuildArgs Condition="'$(GitHubRepositoryName)' != ''">$(InnerBuildArgs) /p:GitHubRepositoryName=$(GitHubRepositoryName)</InnerBuildArgs>
8788
</PropertyGroup>
8889
</Target>
8990

eng/Subsets.props

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,8 @@
173173
<SubsetName Include="Tools.ILLink" Description="The projects that produce illink and analyzer tools for trimming." />
174174
<SubsetName Include="Tools.ILLinkTests" OnDemand="true" Description="Unit tests for the tools.illink subset." />
175175

176+
<SubsetName Include="Tools.CdacReaderTests" OnDemand="true" Description="Units tests for the cDAC reader." />
177+
176178
<!-- Host -->
177179
<SubsetName Include="Host" Description="The .NET hosts, packages, hosting libraries, and tests. Equivalent to: $(DefaultHostSubsets)" />
178180
<SubsetName Include="Host.Native" Description="The .NET hosts." />
@@ -358,6 +360,8 @@
358360
<ProjectToBuild Include="$(CoreClrProjectRoot)tools\aot\crossgen2\crossgen2_inbuild.csproj" Category="clr" />
359361

360362
<ProjectToBuild Condition="'$(TargetOS)' == 'windows' or ('$(TargetOS)' == 'linux' and ('$(TargetArchitecture)' == 'x64' or '$(TargetArchitecture)' == 'arm64')) or '$(TargetOS)' == 'osx'" Include="$(CoreClrProjectRoot)tools\SuperFileCheck\SuperFileCheck.csproj" Category="clr" />
363+
364+
<ProjectToBuild Include="$(CoreClrProjectRoot)tools\cdac-build-tool\cdac-build-tool.csproj" Category="clr" />
361365
</ItemGroup>
362366

363367
<ItemGroup Condition="$(_subset.Contains('+clr.toolstests+'))">
@@ -369,6 +373,10 @@
369373
Test="true" Category="clr" Condition="'$(DotNetBuildSourceOnly)' != 'true' and '$(NativeAotSupported)' == 'true'"/>
370374
</ItemGroup>
371375

376+
<ItemGroup Condition="$(_subset.Contains('+tools.cdacreadertests+'))">
377+
<ProjectToBuild Include="$(SharedNativeRoot)managed\cdacreader\tests\Microsoft.Diagnostics.DataContractReader.Tests.csproj" Test="true" Category="tools"/>
378+
</ItemGroup>
379+
372380
<ItemGroup Condition="$(_subset.Contains('+tools.illink+'))">
373381
<ProjectToBuild Include="$(ToolsProjectRoot)illink\src\linker\Mono.Linker.csproj" Category="tools" />
374382
<ProjectToBuild Include="$(ToolsProjectRoot)illink\src\ILLink.Tasks\ILLink.Tasks.csproj" Category="tools" />

0 commit comments

Comments
 (0)