diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json
index 447d17d5160111..8d0f6ac9192b2c 100644
--- a/.config/dotnet-tools.json
+++ b/.config/dotnet-tools.json
@@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"coverlet.console": {
- "version": "3.1.0",
+ "version": "3.1.2",
"commands": [
"coverlet"
]
@@ -15,7 +15,7 @@
]
},
"microsoft.dotnet.xharness.cli": {
- "version": "1.0.0-prerelease.22101.2",
+ "version": "1.0.0-prerelease.22110.1",
"commands": [
"xharness"
]
diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml
index 99ebe3b43d0cf8..22dc0656dabecc 100644
--- a/.github/workflows/backport.yml
+++ b/.github/workflows/backport.yml
@@ -22,7 +22,7 @@ jobs:
if (context.eventName !== "issue_comment") throw "Error: This action only works on issue_comment events.";
// extract the target branch name from the trigger phrase containing these characters: a-z, A-Z, digits, forward slash, dot, hyphen, underscore
- const regex = /\/backport to ([a-zA-Z\d\/\.\-\_]+)/;
+ const regex = /^\/backport to ([a-zA-Z\d\/\.\-\_]+)/;
target_branch = regex.exec(context.payload.comment.body);
if (target_branch == null) throw "Error: No backport branch found in the trigger phrase.";
diff --git a/Directory.Build.targets b/Directory.Build.targets
index f59955242b29f0..541cdfb59f27f9 100644
--- a/Directory.Build.targets
+++ b/Directory.Build.targets
@@ -26,6 +26,10 @@
$(ProductVersion)-$(VersionSuffix)
+
+
+
+
`
- [NOT PORTED OVER YET] Run `dotnet publish --packages pkg -r [win-x64|linux-x64|osx-64] -c [Debug|Release]` to publish your project. `--packages pkg` option restores the package into a local directory that is easy to cleanup once you are done. It avoids polluting the global nuget cache with your locally built dev package.
@@ -65,15 +67,12 @@ To run all the tests that got built, run `src\tests\run.cmd runnativeaottests [D
To run an individual test (after it was built), navigate to the `artifacts\tests\coreclr\[Windows|Linux|OSX[.x64.[Debug|Release]\$path_to_test` directory. `$path_to_test` matches the subtree of `src\tests`. You should see a `[.cmd|.sh]` file there. This file is a script that will compile and launch the individual test for you. Before invoking the script, set the following environment variables:
-* CORE_ROOT=$repo_root\artifacts\tests\coreclr\[Windows|Linux|OSX[.x64.[Debug|Release]\Tests\Core_Root
-* RunNativeAot=1
-* __TestDotNetCmd=$repo_root\dotnet[.cmd|.sh]
+* CORE_ROOT=$repo_root\artifacts\tests\coreclr\[Windows|Linux|OSX].x64.[Debug|Release]\Tests\Core_Root
+* CLRCustomTestLauncher=$repo_root\src\tests\Common\scripts\nativeaottest[.cmd|.sh]
`$repo_root` is the root of your clone of the repo.
-By default the test suite will delete the build artifacts (Native AOT images and response files) if the test compiled successfully. If you want to keep these files instead of deleting them after test run, set the following environment variables and make sure you'll have enough disk space (tens of MB per test):
-
-* CLRTestNoCleanup=1
+Sometimes it's handy to be able to rebuild the managed test manually or run the compilation under a debugger. A response file that was used to invoke the ahead of time compiler can be found in `$repo_root\artifacts\tests\coreclr\obj\[Windows|Linux|OSX].x64.[Debug|Release]\Managed`.
For more advanced scenarios, look for at [Building Test Subsets](../../testing/coreclr/windows-test-instructions.md#building-test-subsets) and [Generating Core_Root](../../testing/coreclr/windows-test-instructions.md#generating-core_root)
diff --git a/docs/workflow/testing/libraries/testing-wasm.md b/docs/workflow/testing/libraries/testing-wasm.md
index da752eb2d5974e..e75c1761d77611 100644
--- a/docs/workflow/testing/libraries/testing-wasm.md
+++ b/docs/workflow/testing/libraries/testing-wasm.md
@@ -98,9 +98,9 @@ The following shows how to run tests for a specific library
### Passing arguments to xharness
-- `$(WasmXHarnessArgs)` - xharness command arguments
+- `$(WasmXHarnessArgsCli)` - xharness command arguments
- Example: `WasmXHarnessArgs="--set-web-server-http-env=DOTNET_TEST_WEBSOCKETHOST"` -> becomes `dotnet xharness wasm test --set-web-server-http-env=DOTNET_TEST_WEBSOCKETHOST`
+ Example: `WasmXHarnessArgsCli="--set-web-server-http-env=DOTNET_TEST_WEBSOCKETHOST"` -> becomes `dotnet xharness wasm test --set-web-server-http-env=DOTNET_TEST_WEBSOCKETHOST`
- `$(WasmXHarnessMonoArgs)` - arguments and variables for mono
diff --git a/eng/CodeAnalysis.src.globalconfig b/eng/CodeAnalysis.src.globalconfig
index e5ae41903b5a76..df9d7285695cf8 100644
--- a/eng/CodeAnalysis.src.globalconfig
+++ b/eng/CodeAnalysis.src.globalconfig
@@ -1539,6 +1539,9 @@ dotnet_diagnostic.IDE0160.severity = silent
# IDE0161: Convert to file-scoped namespace
dotnet_diagnostic.IDE0161.severity = silent
+# IDE0190: Null check can be simplified
+dotnet_diagnostic.IDE0190.severity = suggestion
+
# IDE1005: Delegate invocation can be simplified.
dotnet_diagnostic.IDE1005.severity = suggestion
diff --git a/eng/CodeAnalysis.test.globalconfig b/eng/CodeAnalysis.test.globalconfig
index f56a38cfa707c0..6e8b42ea3606c7 100644
--- a/eng/CodeAnalysis.test.globalconfig
+++ b/eng/CodeAnalysis.test.globalconfig
@@ -1536,6 +1536,9 @@ dotnet_diagnostic.IDE0160.severity = silent
# IDE0161: Convert to file-scoped namespace
dotnet_diagnostic.IDE0161.severity = silent
+# IDE0190: Null check can be simplified
+dotnet_diagnostic.IDE0190.severity = silent
+
# IDE1005: Delegate invocation can be simplified.
dotnet_diagnostic.IDE1005.severity = silent
diff --git a/eng/Subsets.props b/eng/Subsets.props
index de8a2710eb6862..8d288c73ee9615 100644
--- a/eng/Subsets.props
+++ b/eng/Subsets.props
@@ -249,7 +249,8 @@
-
+
+
diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml
index 92252a1296afd1..ae6fdbb5972000 100644
--- a/eng/Version.Details.xml
+++ b/eng/Version.Details.xml
@@ -1,258 +1,258 @@
-
+
https://github.com/dotnet/icu
- cd095b0fb4c6f8adca9e44ef17346b3e13a73a7c
+ 0431d9e84dc1dd8b63ec71518e16166952294670
https://github.com/dotnet/msquic
a7213b4676c1803bb251771291a525482d42e511
-
+
https://github.com/dotnet/emsdk
- 8f6606fae08ffa42b025dc42ebe2eea91db3a242
+ 96aa78d8d62904171e1a6cd5fe8fc4742254133f
https://github.com/dotnet/wcf
7f504aabb1988e9a093c1e74d8040bd52feb2f01
-
+
https://github.com/dotnet/llvm-project
- afc9070f64d110ce2bf029a4a624b9dd1c6dbffd
+ d707b379670052dbb926739c1f060aa11f442f30
-
+
https://github.com/dotnet/llvm-project
- afc9070f64d110ce2bf029a4a624b9dd1c6dbffd
+ d707b379670052dbb926739c1f060aa11f442f30
-
+
https://github.com/dotnet/llvm-project
- afc9070f64d110ce2bf029a4a624b9dd1c6dbffd
+ d707b379670052dbb926739c1f060aa11f442f30
-
+
https://github.com/dotnet/llvm-project
- afc9070f64d110ce2bf029a4a624b9dd1c6dbffd
+ d707b379670052dbb926739c1f060aa11f442f30
-
+
https://github.com/dotnet/llvm-project
- afc9070f64d110ce2bf029a4a624b9dd1c6dbffd
+ d707b379670052dbb926739c1f060aa11f442f30
-
+
https://github.com/dotnet/llvm-project
- afc9070f64d110ce2bf029a4a624b9dd1c6dbffd
+ d707b379670052dbb926739c1f060aa11f442f30
-
+
https://github.com/dotnet/llvm-project
- afc9070f64d110ce2bf029a4a624b9dd1c6dbffd
+ d707b379670052dbb926739c1f060aa11f442f30
-
+
https://github.com/dotnet/llvm-project
- afc9070f64d110ce2bf029a4a624b9dd1c6dbffd
+ d707b379670052dbb926739c1f060aa11f442f30
-
+
https://github.com/dotnet/arcade
- 4d6406fa2e84c8516a338694be3a4097e6e1f104
+ 78eaf78761027d225030be2b28aaf4e8bf392929
-
+
https://github.com/dotnet/arcade
- 4d6406fa2e84c8516a338694be3a4097e6e1f104
+ 78eaf78761027d225030be2b28aaf4e8bf392929
-
+
https://github.com/dotnet/arcade
- 4d6406fa2e84c8516a338694be3a4097e6e1f104
+ 78eaf78761027d225030be2b28aaf4e8bf392929
-
+
https://github.com/dotnet/arcade
- 4d6406fa2e84c8516a338694be3a4097e6e1f104
+ 78eaf78761027d225030be2b28aaf4e8bf392929
-
+
https://github.com/dotnet/arcade
- 4d6406fa2e84c8516a338694be3a4097e6e1f104
+ 78eaf78761027d225030be2b28aaf4e8bf392929
-
+
https://github.com/dotnet/arcade
- 4d6406fa2e84c8516a338694be3a4097e6e1f104
+ 78eaf78761027d225030be2b28aaf4e8bf392929
-
+
https://github.com/dotnet/arcade
- 4d6406fa2e84c8516a338694be3a4097e6e1f104
+ 78eaf78761027d225030be2b28aaf4e8bf392929
-
+
https://github.com/dotnet/arcade
- 4d6406fa2e84c8516a338694be3a4097e6e1f104
+ 78eaf78761027d225030be2b28aaf4e8bf392929
-
+
https://github.com/dotnet/arcade
- 4d6406fa2e84c8516a338694be3a4097e6e1f104
+ 78eaf78761027d225030be2b28aaf4e8bf392929
-
+
https://github.com/dotnet/arcade
- 4d6406fa2e84c8516a338694be3a4097e6e1f104
+ 78eaf78761027d225030be2b28aaf4e8bf392929
-
+
https://github.com/dotnet/arcade
- 4d6406fa2e84c8516a338694be3a4097e6e1f104
+ 78eaf78761027d225030be2b28aaf4e8bf392929
-
+
https://github.com/dotnet/arcade
- 4d6406fa2e84c8516a338694be3a4097e6e1f104
+ 78eaf78761027d225030be2b28aaf4e8bf392929
-
+
https://github.com/dotnet/arcade
- 4d6406fa2e84c8516a338694be3a4097e6e1f104
+ 78eaf78761027d225030be2b28aaf4e8bf392929
-
+
https://github.com/dotnet/arcade
- 4d6406fa2e84c8516a338694be3a4097e6e1f104
+ 78eaf78761027d225030be2b28aaf4e8bf392929
-
+
https://github.com/dotnet/arcade
- 4d6406fa2e84c8516a338694be3a4097e6e1f104
+ 78eaf78761027d225030be2b28aaf4e8bf392929
-
+
https://github.com/dotnet/arcade
- 4d6406fa2e84c8516a338694be3a4097e6e1f104
+ 78eaf78761027d225030be2b28aaf4e8bf392929
-
+
https://github.com/dotnet/arcade
- 4d6406fa2e84c8516a338694be3a4097e6e1f104
+ 78eaf78761027d225030be2b28aaf4e8bf392929
-
+
https://github.com/dotnet/arcade
- 4d6406fa2e84c8516a338694be3a4097e6e1f104
+ 78eaf78761027d225030be2b28aaf4e8bf392929
https://github.com/microsoft/vstest
140434f7109d357d0158ade9e5164a4861513965
-
+
https://github.com/dotnet/runtime-assets
- 8813c6d9e73b5cb0b4ccf4c0b8c609ad344636a7
+ 359026fd1eb6864f9c634bff1af6ea4c5e5e75d1
-
+
https://github.com/dotnet/runtime-assets
- 8813c6d9e73b5cb0b4ccf4c0b8c609ad344636a7
+ 359026fd1eb6864f9c634bff1af6ea4c5e5e75d1
-
+
https://github.com/dotnet/runtime-assets
- 8813c6d9e73b5cb0b4ccf4c0b8c609ad344636a7
+ 359026fd1eb6864f9c634bff1af6ea4c5e5e75d1
-
+
https://github.com/dotnet/runtime-assets
- 8813c6d9e73b5cb0b4ccf4c0b8c609ad344636a7
+ 359026fd1eb6864f9c634bff1af6ea4c5e5e75d1
-
+
https://github.com/dotnet/runtime-assets
- 8813c6d9e73b5cb0b4ccf4c0b8c609ad344636a7
+ 359026fd1eb6864f9c634bff1af6ea4c5e5e75d1
-
+
https://github.com/dotnet/runtime-assets
- 8813c6d9e73b5cb0b4ccf4c0b8c609ad344636a7
+ 359026fd1eb6864f9c634bff1af6ea4c5e5e75d1
-
+
https://github.com/dotnet/runtime-assets
- 8813c6d9e73b5cb0b4ccf4c0b8c609ad344636a7
+ 359026fd1eb6864f9c634bff1af6ea4c5e5e75d1
-
+
https://github.com/dotnet/runtime-assets
- 8813c6d9e73b5cb0b4ccf4c0b8c609ad344636a7
+ 359026fd1eb6864f9c634bff1af6ea4c5e5e75d1
-
+
https://github.com/dotnet/runtime-assets
- 8813c6d9e73b5cb0b4ccf4c0b8c609ad344636a7
+ 359026fd1eb6864f9c634bff1af6ea4c5e5e75d1
-
+
https://github.com/dotnet/runtime-assets
- 8813c6d9e73b5cb0b4ccf4c0b8c609ad344636a7
+ 359026fd1eb6864f9c634bff1af6ea4c5e5e75d1
-
+
https://github.com/dotnet/runtime-assets
- 8813c6d9e73b5cb0b4ccf4c0b8c609ad344636a7
+ 359026fd1eb6864f9c634bff1af6ea4c5e5e75d1
-
+
https://github.com/dotnet/llvm-project
- 20080e62c2ea6ed059be57b88268dd8cd28604e6
+ 5b358880114238a553ea86fe087ccb80b17a0017
-
+
https://github.com/dotnet/llvm-project
- 20080e62c2ea6ed059be57b88268dd8cd28604e6
+ 5b358880114238a553ea86fe087ccb80b17a0017
-
+
https://github.com/dotnet/llvm-project
- 20080e62c2ea6ed059be57b88268dd8cd28604e6
+ 5b358880114238a553ea86fe087ccb80b17a0017
-
+
https://github.com/dotnet/llvm-project
- 20080e62c2ea6ed059be57b88268dd8cd28604e6
+ 5b358880114238a553ea86fe087ccb80b17a0017
-
+
https://github.com/dotnet/llvm-project
- 20080e62c2ea6ed059be57b88268dd8cd28604e6
+ 5b358880114238a553ea86fe087ccb80b17a0017
-
+
https://github.com/dotnet/llvm-project
- 20080e62c2ea6ed059be57b88268dd8cd28604e6
+ 5b358880114238a553ea86fe087ccb80b17a0017
-
+
https://github.com/dotnet/llvm-project
- 20080e62c2ea6ed059be57b88268dd8cd28604e6
+ 5b358880114238a553ea86fe087ccb80b17a0017
-
+
https://github.com/dotnet/llvm-project
- 20080e62c2ea6ed059be57b88268dd8cd28604e6
+ 5b358880114238a553ea86fe087ccb80b17a0017
-
+
https://github.com/dotnet/runtime
- bc6d349ecd72eec162f0532e6b6218fdbaa07ddb
+ 0ae04e5b33afac1c14a6127df1037f83d39a6ec3
-
+
https://github.com/dotnet/runtime
- bc6d349ecd72eec162f0532e6b6218fdbaa07ddb
+ 0ae04e5b33afac1c14a6127df1037f83d39a6ec3
-
+
https://github.com/dotnet/runtime
- bc6d349ecd72eec162f0532e6b6218fdbaa07ddb
+ 0ae04e5b33afac1c14a6127df1037f83d39a6ec3
-
+
https://github.com/dotnet/runtime
- bc6d349ecd72eec162f0532e6b6218fdbaa07ddb
+ 0ae04e5b33afac1c14a6127df1037f83d39a6ec3
-
+
https://github.com/dotnet/runtime
- bc6d349ecd72eec162f0532e6b6218fdbaa07ddb
+ 0ae04e5b33afac1c14a6127df1037f83d39a6ec3
-
+
https://github.com/dotnet/runtime
- bc6d349ecd72eec162f0532e6b6218fdbaa07ddb
+ 0ae04e5b33afac1c14a6127df1037f83d39a6ec3
-
+
https://github.com/dotnet/runtime
- bc6d349ecd72eec162f0532e6b6218fdbaa07ddb
+ 0ae04e5b33afac1c14a6127df1037f83d39a6ec3
-
+
https://github.com/dotnet/runtime
- bc6d349ecd72eec162f0532e6b6218fdbaa07ddb
+ 0ae04e5b33afac1c14a6127df1037f83d39a6ec3
-
+
https://github.com/dotnet/linker
- 3f704bb49eb2fb2847ceaecfbabe8d5f3e0c86c9
+ 24b988c6b1ca785f15745fb66a1adcb076b4d5e3
-
+
https://github.com/dotnet/xharness
- 4d24e26939bf0770047cd59299235cf6caa86cdb
+ 1d34249727dd281aad059a9a58880f003bd9f18e
-
+
https://github.com/dotnet/xharness
- 4d24e26939bf0770047cd59299235cf6caa86cdb
+ 1d34249727dd281aad059a9a58880f003bd9f18e
-
+
https://github.com/dotnet/xharness
- 4d24e26939bf0770047cd59299235cf6caa86cdb
+ 1d34249727dd281aad059a9a58880f003bd9f18e
-
+
https://github.com/dotnet/arcade
- 4d6406fa2e84c8516a338694be3a4097e6e1f104
+ 78eaf78761027d225030be2b28aaf4e8bf392929
https://dev.azure.com/dnceng/internal/_git/dotnet-optimization
@@ -270,17 +270,17 @@
https://dev.azure.com/dnceng/internal/_git/dotnet-optimization
47c55c3cf08885d691aa9d581d40310fe448c1ea
-
+
https://github.com/dotnet/hotreload-utils
- 3d4988f053ae6b9803e76687b02fee3f8a83156c
+ c57ee5cc02f5ef566981c6df8ce0465402de81a2
-
+
https://github.com/dotnet/runtime-assets
- 8813c6d9e73b5cb0b4ccf4c0b8c609ad344636a7
+ 359026fd1eb6864f9c634bff1af6ea4c5e5e75d1
-
+
https://github.com/dotnet/roslyn-analyzers
- 60eb13c44c366205e5a4dec195404477009c41de
+ 54b65374e301686f9475dc02045b370dda116db1
https://github.com/dotnet/sdk
diff --git a/eng/Versions.props b/eng/Versions.props
index aef6a22a358d5b..e43cb18f09acd0 100644
--- a/eng/Versions.props
+++ b/eng/Versions.props
@@ -20,6 +20,7 @@
false
false
$(AssemblyVersion)
+ true
+ 4.2.0-2.22105.4
2.0.0-alpha.1.21525.11
- 7.0.0-beta.22080.1
- 7.0.0-beta.22080.1
- 7.0.0-beta.22080.1
- 7.0.0-beta.22080.1
- 7.0.0-beta.22080.1
- 7.0.0-beta.22080.1
- 2.5.1-beta.22080.1
- 7.0.0-beta.22080.1
- 7.0.0-beta.22080.1
- 7.0.0-beta.22080.1
- 7.0.0-beta.22102.1
- 7.0.0-beta.22080.1
- 7.0.0-beta.22080.1
- 7.0.0-beta.22080.1
- 7.0.0-beta.22080.1
- 7.0.0-beta.22080.1
+ 7.0.0-beta.22110.7
+ 7.0.0-beta.22110.7
+ 7.0.0-beta.22110.7
+ 7.0.0-beta.22110.7
+ 7.0.0-beta.22110.7
+ 7.0.0-beta.22110.7
+ 2.5.1-beta.22110.7
+ 7.0.0-beta.22110.7
+ 7.0.0-beta.22110.7
+ 7.0.0-beta.22110.7
+ 7.0.0-beta.22110.7
+ 7.0.0-beta.22110.7
+ 7.0.0-beta.22110.7
+ 7.0.0-beta.22110.7
+ 7.0.0-beta.22110.7
+ 7.0.0-beta.22110.7
6.0.0-preview.1.102
- 7.0.0-preview.2.22080.2
- 7.0.0-preview.2.22080.2
- 7.0.0-preview.2.22080.2
+ 7.0.0-preview.2.22103.2
+ 7.0.0-preview.2.22103.2
+ 7.0.0-preview.2.22103.2
3.1.0
- 7.0.0-preview.2.22080.2
- 1.0.0-alpha.1.22073.1
- 1.0.0-alpha.1.22073.1
- 1.0.0-alpha.1.22073.1
- 1.0.0-alpha.1.22073.1
- 1.0.0-alpha.1.22073.1
- 1.0.0-alpha.1.22073.1
- 1.0.0-alpha.1.22073.1
- 1.0.0-alpha.1.22073.1
+ 7.0.0-preview.2.22103.2
+ 1.0.0-alpha.1.22104.2
+ 1.0.0-alpha.1.22104.2
+ 1.0.0-alpha.1.22104.2
+ 1.0.0-alpha.1.22104.2
+ 1.0.0-alpha.1.22104.2
+ 1.0.0-alpha.1.22104.2
+ 1.0.0-alpha.1.22104.2
+ 1.0.0-alpha.1.22104.2
5.0.0
4.3.0
5.0.0
- 1.2.0-beta.304
+ 1.2.0-beta.406
4.5.1
4.3.0
5.0.0
@@ -121,24 +124,24 @@
5.0.0
5.0.0
4.9.0-rc2.21473.1
- 7.0.0-preview.2.22080.2
- 7.0.0-preview.2.22080.2
+ 7.0.0-preview.2.22103.2
+ 7.0.0-preview.2.22103.2
4.5.4
4.5.0
- 7.0.0-preview.2.22080.2
+ 7.0.0-preview.2.22103.2
- 7.0.0-beta.22075.1
- 7.0.0-beta.22075.1
- 7.0.0-beta.22075.1
- 7.0.0-beta.22075.1
- 7.0.0-beta.22075.1
- 7.0.0-beta.22075.1
- 7.0.0-beta.22075.1
- 7.0.0-beta.22075.1
- 7.0.0-beta.22075.1
- 7.0.0-beta.22075.1
- 7.0.0-beta.22075.1
- 7.0.0-beta.22075.1
+ 7.0.0-beta.22107.1
+ 7.0.0-beta.22107.1
+ 7.0.0-beta.22107.1
+ 7.0.0-beta.22107.1
+ 7.0.0-beta.22107.1
+ 7.0.0-beta.22107.1
+ 7.0.0-beta.22107.1
+ 7.0.0-beta.22107.1
+ 7.0.0-beta.22107.1
+ 7.0.0-beta.22107.1
+ 7.0.0-beta.22107.1
+ 7.0.0-beta.22107.1
1.0.0-prerelease.22078.3
1.0.0-prerelease.22078.3
@@ -161,40 +164,40 @@
1.0.1-prerelease-00006
16.9.0-preview-20201201-01
- 1.0.0-prerelease.22101.2
- 1.0.0-prerelease.22101.2
- 1.0.0-prerelease.22101.2
- 1.0.2-alpha.0.22081.2
+ 1.0.0-prerelease.22110.1
+ 1.0.0-prerelease.22110.1
+ 1.0.0-prerelease.22110.1
+ 1.0.2-alpha.0.22107.2
2.4.2-pre.22
0.12.0-pre.20
2.4.2
- 3.1.0
+ 3.1.2
12.0.3
2.0.4
4.12.0
2.14.3
7.0.100-alpha.1.21528.1
- 1.1.1-beta1.21467.5
+ 1.1.1-beta1.22103.1
6.0.0-preview-20220104.1
- 7.0.100-1.22081.3
+ 7.0.100-1.22107.1
$(MicrosoftNETILLinkTasksVersion)
- 7.0.0-preview.2.22101.1
+ 7.0.0-preview.2.22107.1
7.0.0-alpha.1.21529.3
- 11.1.0-alpha.1.22081.2
- 11.1.0-alpha.1.22081.2
- 11.1.0-alpha.1.22081.2
- 11.1.0-alpha.1.22081.2
- 11.1.0-alpha.1.22081.2
- 11.1.0-alpha.1.22081.2
- 11.1.0-alpha.1.22081.2
- 11.1.0-alpha.1.22081.2
+ 11.1.0-alpha.1.22107.4
+ 11.1.0-alpha.1.22107.4
+ 11.1.0-alpha.1.22107.4
+ 11.1.0-alpha.1.22107.4
+ 11.1.0-alpha.1.22107.4
+ 11.1.0-alpha.1.22107.4
+ 11.1.0-alpha.1.22107.4
+ 11.1.0-alpha.1.22107.4
- 7.0.0-alpha.2.22102.3
+ 7.0.0-alpha.2.22104.1
$(MicrosoftNETWorkloadEmscriptenManifest70100Version)
1.1.87-gba258badda
diff --git a/eng/actions/backport/index.js b/eng/actions/backport/index.js
index 49a2c740108813..3cc1a57312ac92 100644
--- a/eng/actions/backport/index.js
+++ b/eng/actions/backport/index.js
@@ -39,7 +39,7 @@ async function run() {
console.log(`Verified ${comment_user} is a repo collaborator.`);
} catch (error) {
console.log(error);
- throw new BackportException(`Error: @${comment_user} is not a repo collaborator, backporting is not allowed.`);
+ throw new BackportException(`Error: @${comment_user} is not a repo collaborator, backporting is not allowed. If you're a collaborator please make sure your Microsoft team membership visibility is set to Public on https://github.com/orgs/microsoft/people?query=${comment_user}`);
}
try { await exec.exec(`git ls-remote --exit-code --heads origin ${target_branch}`) } catch { throw new BackportException(`Error: The specified backport target branch ${target_branch} wasn't found in the repo.`); }
diff --git a/eng/common/cross/build-rootfs.sh b/eng/common/cross/build-rootfs.sh
index f97dca77054089..7e4be9a0ccfbf3 100755
--- a/eng/common/cross/build-rootfs.sh
+++ b/eng/common/cross/build-rootfs.sh
@@ -120,6 +120,15 @@ while :; do
__UbuntuRepo="http://ftp.debian.org/debian/"
__CodeName=jessie
;;
+ ppc64le)
+ __BuildArch=ppc64le
+ __UbuntuArch=ppc64el
+ __UbuntuRepo="http://ports.ubuntu.com/ubuntu-ports/"
+ __UbuntuPackages=$(echo ${__UbuntuPackages} | sed 's/ libunwind8-dev//')
+ __UbuntuPackages=$(echo ${__UbuntuPackages} | sed 's/ libomp-dev//')
+ __UbuntuPackages=$(echo ${__UbuntuPackages} | sed 's/ libomp5//')
+ unset __LLDB_Package
+ ;;
s390x)
__BuildArch=s390x
__UbuntuArch=s390x
diff --git a/eng/common/cross/ppc64le/sources.list.bionic b/eng/common/cross/ppc64le/sources.list.bionic
new file mode 100644
index 00000000000000..2109557409576d
--- /dev/null
+++ b/eng/common/cross/ppc64le/sources.list.bionic
@@ -0,0 +1,11 @@
+deb http://ports.ubuntu.com/ubuntu-ports/ bionic main restricted universe
+deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic main restricted universe
+
+deb http://ports.ubuntu.com/ubuntu-ports/ bionic-updates main restricted universe
+deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-updates main restricted universe
+
+deb http://ports.ubuntu.com/ubuntu-ports/ bionic-backports main restricted
+deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-backports main restricted
+
+deb http://ports.ubuntu.com/ubuntu-ports/ bionic-security main restricted universe multiverse
+deb-src http://ports.ubuntu.com/ubuntu-ports/ bionic-security main restricted universe multiverse
diff --git a/eng/common/cross/toolchain.cmake b/eng/common/cross/toolchain.cmake
index fba2afda438b66..9fd345bde6d409 100644
--- a/eng/common/cross/toolchain.cmake
+++ b/eng/common/cross/toolchain.cmake
@@ -54,6 +54,9 @@ elseif(TARGET_ARCH_NAME STREQUAL "arm64")
if(TIZEN)
set(TIZEN_TOOLCHAIN "aarch64-tizen-linux-gnu/9.2.0")
endif()
+elseif(TARGET_ARCH_NAME STREQUAL "ppc64le")
+ set(CMAKE_SYSTEM_PROCESSOR ppc64le)
+ set(TOOLCHAIN "powerpc64le-linux-gnu")
elseif(TARGET_ARCH_NAME STREQUAL "s390x")
set(CMAKE_SYSTEM_PROCESSOR s390x)
set(TOOLCHAIN "s390x-linux-gnu")
@@ -67,7 +70,7 @@ elseif (ILLUMOS)
set(CMAKE_SYSTEM_PROCESSOR "x86_64")
set(TOOLCHAIN "x86_64-illumos")
else()
- message(FATAL_ERROR "Arch is ${TARGET_ARCH_NAME}. Only armel, arm, armv6, arm64, s390x and x86 are supported!")
+ message(FATAL_ERROR "Arch is ${TARGET_ARCH_NAME}. Only armel, arm, armv6, arm64, ppc64le, s390x and x86 are supported!")
endif()
if(DEFINED ENV{TOOLCHAIN})
@@ -201,7 +204,7 @@ endif()
# Specify compile options
-if((TARGET_ARCH_NAME MATCHES "^(arm|armv6|armel|arm64|s390x)$" AND NOT ANDROID) OR ILLUMOS)
+if((TARGET_ARCH_NAME MATCHES "^(arm|armv6|armel|arm64|ppc64le|s390x)$" AND NOT ANDROID) OR ILLUMOS)
set(CMAKE_C_COMPILER_TARGET ${TOOLCHAIN})
set(CMAKE_CXX_COMPILER_TARGET ${TOOLCHAIN})
set(CMAKE_ASM_COMPILER_TARGET ${TOOLCHAIN})
diff --git a/eng/common/generate-sbom-prep.ps1 b/eng/common/generate-sbom-prep.ps1
new file mode 100644
index 00000000000000..a733a8885824a9
--- /dev/null
+++ b/eng/common/generate-sbom-prep.ps1
@@ -0,0 +1,19 @@
+Param(
+ [Parameter(Mandatory=$true)][string] $ManifestDirPath # Manifest directory where sbom will be placed
+)
+
+Write-Host "Creating dir $ManifestDirPath"
+# create directory for sbom manifest to be placed
+if (!(Test-Path -path $ManifestDirPath))
+{
+ New-Item -ItemType Directory -path $ManifestDirPath
+ Write-Host "Successfully created directory $ManifestDirPath"
+}
+else{
+ Write-PipelineTelemetryError -category 'Build' "Unable to create sbom folder."
+}
+
+Write-Host "Updating artifact name"
+$artifact_name = "${env:SYSTEM_STAGENAME}_${env:AGENT_JOBNAME}_SBOM" -replace '["/:<>\\|?@*"() ]', '_'
+Write-Host "Artifact name $artifact_name"
+Write-Host "##vso[task.setvariable variable=ARTIFACT_NAME]$artifact_name"
diff --git a/eng/common/generate-sbom-prep.sh b/eng/common/generate-sbom-prep.sh
new file mode 100644
index 00000000000000..f6c77453142a28
--- /dev/null
+++ b/eng/common/generate-sbom-prep.sh
@@ -0,0 +1,22 @@
+#!/usr/bin/env bash
+
+source="${BASH_SOURCE[0]}"
+
+manifest_dir=$1
+
+if [ ! -d "$manifest_dir" ] ; then
+ mkdir -p "$manifest_dir"
+ echo "Sbom directory created." $manifest_dir
+else
+ Write-PipelineTelemetryError -category 'Build' "Unable to create sbom folder."
+fi
+
+artifact_name=$SYSTEM_STAGENAME"_"$AGENT_JOBNAME"_SBOM"
+echo "Artifact name before : "$artifact_name
+# replace all special characters with _, some builds use special characters like : in Agent.Jobname, that is not a permissible name while uploading artifacts.
+safe_artifact_name="${artifact_name//["/:<>\\|?@*$" ]/_}"
+echo "Artifact name after : "$safe_artifact_name
+export ARTIFACT_NAME=$safe_artifact_name
+echo "##vso[task.setvariable variable=ARTIFACT_NAME]$safe_artifact_name"
+
+exit 0
diff --git a/eng/common/templates/job/job.yml b/eng/common/templates/job/job.yml
index c5c2a9915121b3..e3ba9398016be8 100644
--- a/eng/common/templates/job/job.yml
+++ b/eng/common/templates/job/job.yml
@@ -31,6 +31,10 @@ parameters:
name: ''
preSteps: []
runAsPublic: false
+# Sbom related params
+ enableSbom: true
+ PackageVersion: 7.0.0
+ BuildDropPath: '$(Build.SourcesDirectory)/artifacts'
jobs:
- job: ${{ parameters.name }}
@@ -140,6 +144,7 @@ jobs:
- ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest'), ne(parameters.disableComponentGovernance, 'true')) }}:
- task: ComponentGovernanceComponentDetection@0
+ continueOnError: true
- ${{ if eq(parameters.enableMicrobuild, 'true') }}:
- ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
@@ -247,3 +252,10 @@ jobs:
ArtifactName: AssetManifests
continueOnError: ${{ parameters.continueOnError }}
condition: and(succeeded(), eq(variables['_DotNetPublishToBlobFeed'], 'true'))
+
+ - ${{ if and(eq(parameters.runAsPublic, 'false'), ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest'), eq(parameters.enableSbom, 'true')) }}:
+ - template: /eng/common/templates/steps/generate-sbom.yml
+ parameters:
+ PackageVersion: ${{ parameters.packageVersion}}
+ BuildDropPath: ${{ parameters.buildDropPath }}
+
diff --git a/eng/common/templates/jobs/jobs.yml b/eng/common/templates/jobs/jobs.yml
index 70d44735ace4a9..6976330862c20d 100644
--- a/eng/common/templates/jobs/jobs.yml
+++ b/eng/common/templates/jobs/jobs.yml
@@ -41,6 +41,11 @@ parameters:
# Internal resources (telemetry, microbuild) can only be accessed from non-public projects,
# and some (Microbuild) should only be applied to non-PR cases for internal builds.
+# Sbom related params
+ enableSbom: true
+ PackageVersion: 7.0.0
+ BuildDropPath: '$(Build.SourcesDirectory)/artifacts'
+
jobs:
- ${{ each job in parameters.jobs }}:
- template: ../job/job.yml
diff --git a/eng/common/templates/steps/generate-sbom.yml b/eng/common/templates/steps/generate-sbom.yml
new file mode 100644
index 00000000000000..3acba705f177cf
--- /dev/null
+++ b/eng/common/templates/steps/generate-sbom.yml
@@ -0,0 +1,42 @@
+# BuildDropPath - The root folder of the drop directory for which the manifest file will be generated.
+# PackageName - The name of the package this SBOM represents.
+# PackageVersion - The version of the package this SBOM represents.
+# ManifestDirPath - The path of the directory where the generated manifest files will be placed
+
+parameters:
+ PackageVersion: 7.0.0
+ BuildDropPath: '$(Build.SourcesDirectory)/artifacts'
+ PackageName: '.NET'
+ ManifestDirPath: $(Build.ArtifactStagingDirectory)/sbom
+ sbomContinueOnError: true
+
+steps:
+- task: PowerShell@2
+ displayName: Prep for SBOM generation in (Non-linux)
+ condition: or(eq(variables['Agent.Os'], 'Windows_NT'), eq(variables['Agent.Os'], 'Darwin'))
+ inputs:
+ filePath: ./eng/common/generate-sbom-prep.ps1
+ arguments: ${{parameters.manifestDirPath}}
+
+- script: |
+ ./eng/common/generate-sbom-prep.sh ${{parameters.manifestDirPath}}
+ displayName: Prep for SBOM generation in (Linux)
+ condition: eq(variables['Agent.Os'], 'Linux')
+ continueOnError: ${{ parameters.sbomContinueOnError }}
+
+- task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0
+ displayName: 'Generate SBOM manifest'
+ continueOnError: ${{ parameters.sbomContinueOnError }}
+ inputs:
+ PackageName: ${{ parameters.packageName }}
+ BuildDropPath: ${{ parameters.buildDropPath }}
+ PackageVersion: ${{ parameters.packageVersion }}
+ ManifestDirPath: ${{ parameters.manifestDirPath }}
+
+- task: PublishPipelineArtifact@1
+ displayName: Publish SBOM manifest
+ continueOnError: ${{parameters.sbomContinueOnError}}
+ inputs:
+ targetPath: '${{parameters.manifestDirPath}}'
+ artifactName: $(ARTIFACT_NAME)
+
diff --git a/eng/common/templates/steps/source-build.yml b/eng/common/templates/steps/source-build.yml
index d85d6d07d5c7b0..12a8ff94d8e960 100644
--- a/eng/common/templates/steps/source-build.yml
+++ b/eng/common/templates/steps/source-build.yml
@@ -43,8 +43,8 @@ steps:
# In that case, add variables to allow the download of internal runtimes if the specified versions are not found
# in the default public locations.
internalRuntimeDownloadArgs=
- if [ '$(dotnetclimsrc-read-sas-token-base64)' != '$''(dotnetclimsrc-read-sas-token-base64)' ]; then
- internalRuntimeDownloadArgs='/p:DotNetRuntimeSourceFeed=https://dotnetclimsrc.blob.core.windows.net/dotnet /p:DotNetRuntimeSourceFeedKey=$(dotnetclimsrc-read-sas-token-base64) --runtimesourcefeed https://dotnetclimsrc.blob.core.windows.net/dotnet --runtimesourcefeedkey $(dotnetclimsrc-read-sas-token-base64)'
+ if [ '$(dotnetbuilds-internal-container-read-token-base64)' != '$''(dotnetbuilds-internal-container-read-token-base64)' ]; then
+ internalRuntimeDownloadArgs='/p:DotNetRuntimeSourceFeed=https://dotnetbuilds.blob.core.windows.net/internal /p:DotNetRuntimeSourceFeedKey=$(dotnetbuilds-internal-container-read-token-base64) --runtimesourcefeed https://dotnetbuilds.blob.core.windows.net/internal --runtimesourcefeedkey $(dotnetbuilds-internal-container-read-token-base64)'
fi
buildConfig=Release
diff --git a/eng/liveBuilds.targets b/eng/liveBuilds.targets
index c2f64bf1abf8a5..8f91d3e6e42574 100644
--- a/eng/liveBuilds.targets
+++ b/eng/liveBuilds.targets
@@ -25,6 +25,7 @@
$([MSBuild]::NormalizeDirectory('$(CoreCLRArtifactsPath)', 'sharedFramework'))
$([MSBuild]::NormalizeDirectory('$(CoreCLRArtifactsPath)', 'crossgen2'))
$([MSBuild]::NormalizeDirectory('$(CoreCLRArtifactsPath)', 'ilc'))
+ $([MSBuild]::NormalizeDirectory('$(CoreCLRArtifactsPath)', '$(BuildArchitecture)', 'ilc'))
$([MSBuild]::NormalizeDirectory('$(CoreCLRArtifactsPath)', 'aotsdk'))
$([MSBuild]::NormalizeDirectory('$(CoreCLRArtifactsPath)', 'build'))
diff --git a/eng/native/configurecompiler.cmake b/eng/native/configurecompiler.cmake
index b67594cb60fb2a..4324e23ed1fa2e 100644
--- a/eng/native/configurecompiler.cmake
+++ b/eng/native/configurecompiler.cmake
@@ -390,6 +390,10 @@ if (CLR_CMAKE_HOST_UNIX)
add_compile_options(-Wno-unused-but-set-variable)
+ # Turn off floating point expression contraction because it is considered a value changing
+ # optimization in the IEEE 754 specification and is therefore considered unsafe.
+ add_compile_options(-ffp-contract=off)
+
if (CMAKE_C_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wno-unknown-warning-option)
diff --git a/eng/native/functions.cmake b/eng/native/functions.cmake
index 0c28f75706de19..6ff45a86fbb613 100644
--- a/eng/native/functions.cmake
+++ b/eng/native/functions.cmake
@@ -15,7 +15,7 @@ function(h2inc filename output)
get_filename_component(path "${filename}" DIRECTORY)
file(RELATIVE_PATH relative_filename "${CLR_REPO_ROOT_DIR}" "${filename}")
- file(APPEND "${output}" "// File start: ${relative_filename}\n")
+ file(WRITE "${output}" "// File start: ${relative_filename}\n")
# Use of NEWLINE_CONSUME is needed for lines with trailing backslash
file(STRINGS ${filename} contents NEWLINE_CONSUME)
diff --git a/eng/packaging.targets b/eng/packaging.targets
index 7a29b7d99273d1..e705b4e7110114 100644
--- a/eng/packaging.targets
+++ b/eng/packaging.targets
@@ -9,7 +9,7 @@
BeforePack must be used. Setting both to ensure that we are always running before other targets. -->
AddNETStandardCompatErrorFileForPackaging;IncludeAnalyzersInPackage;$(PackDependsOn)
AddNETStandardCompatErrorFileForPackaging;IncludeAnalyzersInPackage;$(BeforePack)
- $(TargetsForTfmSpecificContentInPackage);AddRuntimeSpecificFilesToPackage;IncludePrivateProjectReferencesWithPackAttributeInPackage
+ $(TargetsForTfmSpecificContentInPackage);AddRuntimeSpecificFilesToPackage;IncludeProjectReferencesWithPackAttributeInPackage
false
true
@@ -226,12 +226,12 @@
-
- <_projectReferenceCopyLocalPaths Include="@(ReferenceCopyLocalPaths->WithMetadataValue('ReferenceSourceTarget', 'ProjectReference')->WithMetadataValue('PrivateAssets', 'all')->WithMetadataValue('Pack', 'true'))" />
+ <_projectReferenceCopyLocalPaths Include="@(ReferenceCopyLocalPaths->WithMetadataValue('ReferenceSourceTarget', 'ProjectReference')->WithMetadataValue('Pack', 'true'))" />
-
+ or(
+ eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true),
+ eq(variables['isRollingBuild'], true))
+
+# Run net48 tests on win-x64
+- template: /eng/pipelines/common/platform-matrix.yml
+ parameters:
+ jobTemplate: /eng/pipelines/libraries/build-job.yml
+ buildConfig: Release
+ platforms:
+ - windows_x64
+ helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml
+ jobParameters:
+ framework: net48
+ runTests: true
+ testScope: innerloop
+ condition: >-
+ or(
+ eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true),
+ eq(variables['isRollingBuild'], true))
+
+#### MONO LEGS
+
+#
+# Build the whole product using Mono and run libraries tests
+#
+- template: /eng/pipelines/common/platform-matrix.yml
+ parameters:
+ jobTemplate: /eng/pipelines/common/global-build-job.yml
+ helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml
+ buildConfig: Release
+ runtimeFlavor: mono
+ platforms:
+ - Windows_x64
+ variables:
+ # map dependencies variables to local variables
+ - name: librariesContainsChange
+ value: $[ dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'] ]
+ - name: monoContainsChange
+ value: $[ dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'] ]
+ jobParameters:
+ testScope: innerloop
+ nameSuffix: AllSubsets_Mono
+ buildArgs: -s mono+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true
+ timeoutInMinutes: 120
+ condition: >-
+ or(
+ eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true),
+ eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true),
+ eq(dependencies.evaluate_paths.outputs['SetPathVars_installer.containsChange'], true),
+ eq(variables['isRollingBuild'], true))
+ # extra steps, run tests
+ extraStepsTemplate: /eng/pipelines/libraries/helix.yml
+ extraStepsParameters:
+ creator: dotnet-bot
+ testRunNamePrefixSuffix: Mono_$(_BuildConfig)
+ condition: >-
+ or(
+ eq(variables['librariesContainsChange'], true),
+ eq(variables['monoContainsChange'], true),
+ eq(variables['isRollingBuild'], true))
+
+#
+# iOS/tvOS devices - Full AOT + AggressiveTrimming to reduce size
+# Build the whole product using Mono and run libraries tests
+#
+- template: /eng/pipelines/common/platform-matrix.yml
+ parameters:
+ jobTemplate: /eng/pipelines/common/global-build-job.yml
+ helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml
+ buildConfig: Release
+ runtimeFlavor: mono
+ platforms:
+ - iOS_arm64
+ - tvOS_arm64
+ variables:
+ # map dependencies variables to local variables
+ - name: librariesContainsChange
+ value: $[ dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'] ]
+ - name: monoContainsChange
+ value: $[ dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'] ]
+ jobParameters:
+ testGroup: innerloop
+ nameSuffix: AllSubsets_Mono
+ buildArgs: -s mono+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:DevTeamProvisioning=- /p:RunAOTCompilation=true $(_runSmokeTestsOnlyArg) /p:BuildTestsOnHelix=true /p:UsePortableRuntimePack=true /p:BuildDarwinFrameworks=true
+ timeoutInMinutes: 180
+ condition: >-
+ or(
+ eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true),
+ eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true),
+ eq(variables['isRollingBuild'], true))
+ # extra steps, run tests
+ extraStepsTemplate: /eng/pipelines/libraries/helix.yml
+ extraStepsParameters:
+ creator: dotnet-bot
+ testRunNamePrefixSuffix: Mono_$(_BuildConfig)
+ extraHelixArguments: /p:NeedsToBuildAppsOnHelix=true
+ condition: >-
+ or(
+ eq(variables['librariesContainsChange'], true),
+ eq(variables['monoContainsChange'], true),
+ eq(variables['isRollingBuild'], true))
+
+- template: /eng/pipelines/common/platform-matrix.yml
+ parameters:
+ jobTemplate: /eng/pipelines/common/global-build-job.yml
+ helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml
+ buildConfig: Release
+ runtimeFlavor: mono
+ platforms:
+ - Android_arm
+ - Android_arm64
+ variables:
+ # map dependencies variables to local variables
+ - name: librariesContainsChange
+ value: $[ dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'] ]
+ - name: monoContainsChange
+ value: $[ dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'] ]
+ jobParameters:
+ testGroup: innerloop
+ nameSuffix: AllSubsets_Mono
+ buildArgs: -s mono+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true $(_runSmokeTestsOnlyArg)
+ timeoutInMinutes: 180
+ condition: >-
+ or(
+ eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true),
+ eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true),
+ eq(variables['isRollingBuild'], true))
+ # extra steps, run tests
+ extraStepsTemplate: /eng/pipelines/libraries/helix.yml
+ extraStepsParameters:
+ creator: dotnet-bot
+ testRunNamePrefixSuffix: Mono_$(_BuildConfig)
+ condition: >-
+ or(
+ eq(variables['librariesContainsChange'], true),
+ eq(variables['monoContainsChange'], true),
+ eq(variables['isRollingBuild'], true))
+
+#
+# Build the whole product using Mono and run runtime tests
+# Build Mono release
+# Only when libraries, mono, or the runtime tests changed
+# Currently only these architectures are needed for the runtime tests.
+- template: /eng/pipelines/common/platform-matrix.yml
+ parameters:
+ jobTemplate: /eng/pipelines/mono/templates/build-job.yml
+ runtimeFlavor: mono
+ buildConfig: release
+ platforms:
+ - Linux_arm64
+ jobParameters:
+ condition: >-
+ or(
+ eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true),
+ eq(dependencies.evaluate_paths.outputs['SetPathVars_runtimetests.containsChange'], true),
+ eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true),
+ eq(variables['isRollingBuild'], true))
+
+#
+# Mono Test builds with CoreCLR runtime tests using live libraries debug build
+# Only when Mono is changed
+- template: /eng/pipelines/common/platform-matrix.yml
+ parameters:
+ jobTemplate: /eng/pipelines/common/templates/runtimes/build-test-job.yml
+ buildConfig: release
+ runtimeFlavor: mono
+ platforms:
+ - CoreClrTestBuildHost # Either OSX_x64 or Linux_x64
+ jobParameters:
+ testGroup: innerloop
+ condition: >-
+ or(
+ eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true),
+ eq(dependencies.evaluate_paths.outputs['SetPathVars_runtimetests.containsChange'], true),
+ eq(variables['isRollingBuild'], true))
+
+#
+# Build the whole product using Mono for Android and run runtime tests with Android emulator
+#
+- template: /eng/pipelines/common/platform-matrix.yml
+ parameters:
+ jobTemplate: /eng/pipelines/common/global-build-job.yml
+ helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml
+ buildConfig: Release
+ runtimeFlavor: mono
+ platforms:
+ - Android_x64
+ variables:
+ - ${{ if and(eq(variables['System.TeamProject'], 'public'), eq(variables['Build.Reason'], 'PullRequest')) }}:
+ - name: _HelixSource
+ value: pr/dotnet/runtime/$(Build.SourceBranch)
+ - ${{ if and(eq(variables['System.TeamProject'], 'public'), ne(variables['Build.Reason'], 'PullRequest')) }}:
+ - name: _HelixSource
+ value: ci/dotnet/runtime/$(Build.SourceBranch)
+ - name: timeoutPerTestInMinutes
+ value: 60
+ - name: timeoutPerTestCollectionInMinutes
+ value: 180
+ jobParameters:
+ testGroup: innerloop
+ nameSuffix: AllSubsets_Mono_RuntimeTests
+ buildArgs: -s mono+libs -c $(_BuildConfig)
+ timeoutInMinutes: 240
+ condition: >-
+ or(
+ eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true),
+ eq(dependencies.evaluate_paths.outputs['SetPathVars_runtimetests.containsChange'], true),
+ eq(variables['isRollingBuild'], true))
+ # extra steps, run tests
+ extraStepsTemplate: /eng/pipelines/common/templates/runtimes/android-runtime-and-send-to-helix.yml
+ extraStepsParameters:
+ creator: dotnet-bot
+ testRunNamePrefixSuffix: Mono_$(_BuildConfig)
+
+#
+# Build the whole product using Mono for Android and run runtime tests with interpreter
+#
+- template: /eng/pipelines/common/platform-matrix.yml
+ parameters:
+ jobTemplate: /eng/pipelines/common/global-build-job.yml
+ helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml
+ buildConfig: Release
+ runtimeFlavor: mono
+ platforms:
+ - Android_x64
+ variables:
+ - ${{ if and(eq(variables['System.TeamProject'], 'public'), eq(variables['Build.Reason'], 'PullRequest')) }}:
+ - name: _HelixSource
+ value: pr/dotnet/runtime/$(Build.SourceBranch)
+ - ${{ if and(eq(variables['System.TeamProject'], 'public'), ne(variables['Build.Reason'], 'PullRequest')) }}:
+ - name: _HelixSource
+ value: ci/dotnet/runtime/$(Build.SourceBranch)
+ - name: timeoutPerTestInMinutes
+ value: 60
+ - name: timeoutPerTestCollectionInMinutes
+ value: 180
+ jobParameters:
+ testGroup: innerloop
+ nameSuffix: AllSubsets_Mono_RuntimeTests_Interp
+ buildArgs: -s mono+libs -c $(_BuildConfig)
+ timeoutInMinutes: 240
+ runtimeVariant: monointerpreter
+ condition: >-
+ or(
+ eq(dependencies.evaluate_paths.outputs['SetPathVars_runtimetests.containsChange'], true),
+ eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true),
+ eq(variables['isRollingBuild'], true))
+ # NOTE: Per PR test execution is not recommended for runtime tests
+ ${{ if eq(variables['isRollingBuild'], true) }}:
+ # extra steps, run tests
+ extraStepsTemplate: /eng/pipelines/common/templates/runtimes/android-runtime-and-send-to-helix.yml
+ extraStepsParameters:
+ creator: dotnet-bot
+ testRunNamePrefixSuffix: Mono_$(_BuildConfig)
+
+#
+# Mono CoreCLR runtime Test executions using live libraries in jit mode
+# Only when Mono is changed
+- template: /eng/pipelines/common/platform-matrix.yml
+ parameters:
+ jobTemplate: /eng/pipelines/common/templates/runtimes/run-test-job.yml
+ buildConfig: release
+ runtimeFlavor: mono
+ platforms:
+ - Linux_arm64
+ helixQueueGroup: pr
+ helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml
+ jobParameters:
+ testGroup: innerloop
+ liveLibrariesBuildConfig: Release
+ liveRuntimeBuildConfig: release
+ runtimeVariant: minijit
+ condition: >-
+ or(
+ eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true),
+ eq(dependencies.evaluate_paths.outputs['SetPathVars_runtimetests.containsChange'], true),
+ eq(variables['isRollingBuild'], true))
+
+#
+# Mono CoreCLR runtime Test executions using live libraries in interpreter mode
+# Only when Mono is changed
+- template: /eng/pipelines/common/platform-matrix.yml
+ parameters:
+ jobTemplate: /eng/pipelines/common/templates/runtimes/run-test-job.yml
+ buildConfig: release
+ runtimeFlavor: mono
+ platforms:
+ - Linux_arm64
+ helixQueueGroup: pr
+ helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml
+ jobParameters:
+ testGroup: innerloop
+ liveLibrariesBuildConfig: Release
+ liveRuntimeBuildConfig: release
+ runtimeVariant: monointerpreter
+ condition: >-
+ or(
+ eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true),
+ eq(dependencies.evaluate_paths.outputs['SetPathVars_runtimetests.containsChange'], true),
+ eq(variables['isRollingBuild'], true))
diff --git a/eng/pipelines/runtime-extra-platforms-wasm.yml b/eng/pipelines/runtime-extra-platforms-wasm.yml
new file mode 100644
index 00000000000000..af51523090fca1
--- /dev/null
+++ b/eng/pipelines/runtime-extra-platforms-wasm.yml
@@ -0,0 +1,233 @@
+# This contains only wasm-specific jobs
+# These are run as part of runtime-extra-platforms by default.
+# But can also be triggered manually via `runtime-wasm` name
+# /azp run runtime-wasm
+
+parameters:
+ isExtraPlatformsBuild: ''
+
+jobs:
+
+#
+# Build for Browser/wasm and test it on v8, browser, and nodejs
+#
+- template: /eng/pipelines/common/platform-matrix.yml
+ parameters:
+ jobTemplate: /eng/pipelines/common/global-build-job.yml
+ helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml
+ buildConfig: Release
+ runtimeFlavor: mono
+ platforms:
+ - Browser_wasm
+ - Browser_wasm_win
+ variables:
+ # map dependencies variables to local variables
+ - name: librariesContainsChange
+ value: $[ dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'] ]
+ - name: monoContainsChange
+ value: $[ dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'] ]
+ jobParameters:
+ testGroup: innerloop
+ nameSuffix: LibraryTests
+ buildArgs: -s mono+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:BrowserHost=$(_hostedOs)
+ timeoutInMinutes: 180
+ # always run for runtime-wasm builds (triggered manually)
+ # Always run for rolling builds
+ # Else run on path changes
+ condition: >-
+ or(
+ eq(variables['isWasmOnlyBuild'], true),
+ eq(variables['isRollingBuild'], true),
+ eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true),
+ eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true))
+ # extra steps, run tests
+ extraStepsTemplate: /eng/pipelines/libraries/helix.yml
+ extraStepsParameters:
+ creator: dotnet-bot
+ testRunNamePrefixSuffix: Mono_$(_BuildConfig)
+ extraHelixArguments: /p:BrowserHost=$(_hostedOs)
+ scenarios:
+ - normal
+ - WasmTestOnBrowser
+ - WasmTestOnNodeJs
+
+#
+# Build for Browser/wasm, with EnableAggressiveTrimming=true
+#
+- template: /eng/pipelines/common/platform-matrix.yml
+ parameters:
+ jobTemplate: /eng/pipelines/common/global-build-job.yml
+ helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml
+ buildConfig: Release
+ runtimeFlavor: mono
+ platforms:
+ - Browser_wasm
+ variables:
+ # map dependencies variables to local variables
+ - name: librariesContainsChange
+ value: $[ dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'] ]
+ - name: monoContainsChange
+ value: $[ dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'] ]
+ jobParameters:
+ isExtraPlatforms: ${{ parameters.isExtraPlatformsBuild }}
+ testGroup: innerloop
+ nameSuffix: LibraryTests_EAT
+ buildArgs: -s mono+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true $(_runSmokeTestsOnlyArg) /p:EnableAggressiveTrimming=true /p:BuildAOTTestsOnHelix=true /p:RunAOTCompilation=false
+ timeoutInMinutes: 180
+ # always run for runtime-wasm builds (triggered manually)
+ # Always run for rolling builds
+ # Else run on path changes
+ condition: >-
+ or(
+ eq(variables['isWasmOnlyBuild'], true),
+ eq(variables['isRollingBuild'], true),
+ eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true),
+ eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true),
+ eq(dependencies.evaluate_paths.outputs['SetPathVars_installer.containsChange'], true))
+ # extra steps, run tests
+ extraStepsTemplate: /eng/pipelines/libraries/helix.yml
+ extraStepsParameters:
+ creator: dotnet-bot
+ testRunNamePrefixSuffix: Mono_$(_BuildConfig)
+ extraHelixArguments: /p:NeedsToBuildWasmAppsOnHelix=true $(_runSmokeTestsOnlyArg)
+ scenarios:
+ - normal
+
+#
+# Build for Browser/wasm with RunAOTCompilation=true
+#
+- template: /eng/pipelines/common/platform-matrix.yml
+ parameters:
+ jobTemplate: /eng/pipelines/common/global-build-job.yml
+ helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml
+ buildConfig: Release
+ runtimeFlavor: mono
+ platforms:
+ - Browser_wasm
+ - Browser_wasm_win
+ variables:
+ # map dependencies variables to local variables
+ - name: librariesContainsChange
+ value: $[ dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'] ]
+ - name: monoContainsChange
+ value: $[ dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'] ]
+ jobParameters:
+ isExtraPlatforms: ${{ parameters.isExtraPlatformsBuild }}
+ testGroup: innerloop
+ nameSuffix: LibraryTests_AOT
+ buildArgs: -s mono+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true $(_runSmokeTestsOnlyArg) /p:EnableAggressiveTrimming=true /p:BuildAOTTestsOnHelix=true /p:RunAOTCompilation=true /p:BrowserHost=$(_hostedOs)
+ timeoutInMinutes: 180
+ # always run for runtime-wasm builds (triggered manually)
+ # Always run for rolling builds
+ # Else run on path changes
+ condition: >-
+ or(
+ eq(variables['isWasmOnlyBuild'], true),
+ eq(variables['isRollingBuild'], true),
+ eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true),
+ eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true),
+ eq(dependencies.evaluate_paths.outputs['SetPathVars_installer.containsChange'], true))
+ # extra steps, run tests
+ extraStepsTemplate: /eng/pipelines/libraries/helix.yml
+ extraStepsParameters:
+ creator: dotnet-bot
+ testRunNamePrefixSuffix: Mono_AOT_$(_BuildConfig)_$(_hostedOs)
+ extraHelixArguments: /p:NeedsToBuildWasmAppsOnHelix=true $(_runSmokeTestsOnlyArg) /p:BrowserHost=$(_hostedOs)
+ scenarios:
+ - normal
+
+## WebAssembly legs, run only when runtime-wasm is triggered
+
+#
+# runtime-wasm: Build the whole product using Mono and run libraries tests, for Wasm.Build.Tests
+#
+- template: /eng/pipelines/common/platform-matrix.yml
+ parameters:
+ jobTemplate: /eng/pipelines/common/global-build-job.yml
+ helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml
+ buildConfig: Release
+ runtimeFlavor: mono
+ platforms:
+ - Browser_wasm
+ - Browser_wasm_win
+ jobParameters:
+ testGroup: innerloop
+ nameSuffix: WasmBuildTests
+ buildArgs: -s mono+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:TestWasmBuildTests=true /p:TestAssemblies=false /p:BrowserHost=$(_hostedOs)
+ timeoutInMinutes: 180
+ # always run for runtime-wasm builds (triggered manually)
+ condition: >-
+ eq(variables['isWasmOnlyBuild'], true)
+ # extra steps, run tests
+ extraStepsTemplate: /eng/pipelines/libraries/helix.yml
+ extraStepsParameters:
+ creator: dotnet-bot
+ testRunNamePrefixSuffix: Mono_$(_BuildConfig)_$(_hostedOs)
+ extraHelixArguments: /p:BrowserHost=$(_hostedOs)
+ scenarios:
+ - buildwasmapps
+
+#
+# runtime-wasm: Build the whole product using Mono and run libraries tests, for wasm debugger tests
+#
+- template: /eng/pipelines/common/platform-matrix.yml
+ parameters:
+ jobTemplate: /eng/pipelines/common/global-build-job.yml
+ helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml
+ buildConfig: Release
+ runtimeFlavor: mono
+ platforms:
+ - Browser_wasm
+ - Browser_wasm_win
+ jobParameters:
+ testGroup: innerloop
+ nameSuffix: Mono_DebuggerTests
+ buildArgs: -s mono+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:TestWasmDebuggerTests=true /p:TestAssemblies=false /p:BrowserHost=$(_hostedOs)
+ timeoutInMinutes: 180
+ # always run for runtime-wasm builds (triggered manually)
+ condition: >-
+ eq(variables['isWasmOnlyBuild'], true)
+ # extra steps, run tests
+ extraStepsTemplate: /eng/pipelines/libraries/helix.yml
+ extraStepsParameters:
+ creator: dotnet-bot
+ testRunNamePrefixSuffix: Mono_$(_BuildConfig)_$(_hostedOs)
+ extraHelixArguments: /p:BrowserHost=$(_hostedOs)
+ scenarios:
+ - wasmdebuggertests
+
+#
+# runtime-wasm: Build the whole product using Mono and run runtime tests
+#
+- template: /eng/pipelines/common/platform-matrix.yml
+ parameters:
+ jobTemplate: /eng/pipelines/common/global-build-job.yml
+ helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml
+ buildConfig: Release
+ runtimeFlavor: mono
+ platforms:
+ - Browser_wasm
+ variables:
+ - ${{ if and(eq(variables['System.TeamProject'], 'public'), eq(variables['Build.Reason'], 'PullRequest')) }}:
+ - name: _HelixSource
+ value: pr/dotnet/runtime/$(Build.SourceBranch)
+ - ${{ if and(eq(variables['System.TeamProject'], 'public'), ne(variables['Build.Reason'], 'PullRequest')) }}:
+ - name: _HelixSource
+ value: ci/dotnet/runtime/$(Build.SourceBranch)
+ - name: timeoutPerTestInMinutes
+ value: 10
+ - name: timeoutPerTestCollectionInMinutes
+ value: 200
+ jobParameters:
+ testGroup: innerloop
+ nameSuffix: AllSubsets_Mono_RuntimeTests
+ buildArgs: -s mono+libs -c $(_BuildConfig)
+ timeoutInMinutes: 180
+ # always run for runtime-wasm builds (triggered manually)
+ condition: >-
+ eq(variables['isWasmOnlyBuild'], true)
+ extraStepsTemplate: /eng/pipelines/common/templates/runtimes/wasm-runtime-and-send-to-helix.yml
+ extraStepsParameters:
+ creator: dotnet-bot
+ testRunNamePrefixSuffix: Mono_$(_BuildConfig)
+
diff --git a/eng/pipelines/runtime-extra-platforms.yml b/eng/pipelines/runtime-extra-platforms.yml
index 729a0187ba562b..025d5d27e462ca 100644
--- a/eng/pipelines/runtime-extra-platforms.yml
+++ b/eng/pipelines/runtime-extra-platforms.yml
@@ -34,482 +34,13 @@ jobs:
- ${{ if eq(variables.dependOnEvaluatePaths, true) }}:
- template: /eng/pipelines/common/evaluate-default-paths.yml
-#
-# Build CoreCLR release
-# Always as they are needed by Installer and we always build and test the Installer.
-#
-- template: /eng/pipelines/common/platform-matrix.yml
- parameters:
- jobTemplate: /eng/pipelines/coreclr/templates/build-job.yml
- buildConfig: release
- platforms:
- - Linux_x64
- - Linux_arm
- - Linux_arm64
- - Linux_musl_x64
- - OSX_x64
- - windows_x64
- - windows_x86
- - windows_arm64
- jobParameters:
- testGroup: innerloop
-
-#
-# Build libraries using live CoreLib
-#
-- template: /eng/pipelines/common/platform-matrix.yml
- parameters:
- jobTemplate: /eng/pipelines/libraries/build-job.yml
- buildConfig: Release
- platforms:
- - Linux_x64
- - Linux_arm
- - Linux_arm64
- - Linux_musl_x64
- - OSX_x64
- - windows_x64
- - windows_x86
- - windows_arm64
-
-#
-# Libraries Release Test Execution against a release coreclr runtime
-# Only when the PR contains a libraries change
-#
-- template: /eng/pipelines/common/platform-matrix.yml
- parameters:
- jobTemplate: /eng/pipelines/libraries/run-test-job.yml
- buildConfig: Release
- platforms:
- - Linux_x64
- - Linux_arm
- - Linux_arm64
- - Linux_musl_x64
- - OSX_x64
- - windows_x64
- - windows_x86
- - windows_arm64
- helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml
- jobParameters:
- isOfficialBuild: false
- isExtraPlatforms: ${{ variables.isExtraPlatformsBuild }}
- testScope: innerloop
- liveRuntimeBuildConfig: release
- condition: >-
- or(
- eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true),
- eq(variables['isRollingBuild'], true))
-
-# Run net48 tests on win-x64
-- template: /eng/pipelines/common/platform-matrix.yml
- parameters:
- jobTemplate: /eng/pipelines/libraries/build-job.yml
- buildConfig: Release
- platforms:
- - windows_x64
- helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml
- jobParameters:
- framework: net48
- runTests: true
- testScope: innerloop
- condition: >-
- or(
- eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true),
- eq(variables['isRollingBuild'], true))
-
-#### MONO LEGS
-
-#
-# Build for Browser/wasm, with EnableAggressiveTrimming=true
-#
-- template: /eng/pipelines/common/platform-matrix.yml
- parameters:
- jobTemplate: /eng/pipelines/common/global-build-job.yml
- helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml
- buildConfig: Release
- runtimeFlavor: mono
- platforms:
- - Browser_wasm
- variables:
- # map dependencies variables to local variables
- - name: librariesContainsChange
- value: $[ dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'] ]
- - name: monoContainsChange
- value: $[ dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'] ]
- jobParameters:
- isExtraPlatforms: ${{ variables.isExtraPlatformsBuild }}
- testGroup: innerloop
- nameSuffix: LibraryTests_EAT
- buildArgs: -s mono+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true $(_runSmokeTestsOnlyArg) /p:EnableAggressiveTrimming=true /p:BuildAOTTestsOnHelix=true /p:RunAOTCompilation=false
- timeoutInMinutes: 180
- condition: >-
- or(
- eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true),
- eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true),
- eq(dependencies.evaluate_paths.outputs['SetPathVars_installer.containsChange'], true),
- eq(variables['isRollingBuild'], true))
- # extra steps, run tests
- extraStepsTemplate: /eng/pipelines/libraries/helix.yml
- extraStepsParameters:
- creator: dotnet-bot
- testRunNamePrefixSuffix: Mono_$(_BuildConfig)
- extraHelixArguments: /p:NeedsToBuildWasmAppsOnHelix=true $(_runSmokeTestsOnlyArg)
- scenarios:
- - normal
-
-#
-# Build for Browser/wasm with RunAOTCompilation=true
-#
-- template: /eng/pipelines/common/platform-matrix.yml
- parameters:
- jobTemplate: /eng/pipelines/common/global-build-job.yml
- helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml
- buildConfig: Release
- runtimeFlavor: mono
- platforms:
- - Browser_wasm
- - Browser_wasm_win
- variables:
- # map dependencies variables to local variables
- - name: librariesContainsChange
- value: $[ dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'] ]
- - name: monoContainsChange
- value: $[ dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'] ]
- jobParameters:
- isExtraPlatforms: ${{ variables.isExtraPlatformsBuild }}
- testGroup: innerloop
- nameSuffix: LibraryTests_AOT
- buildArgs: -s mono+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true $(_runSmokeTestsOnlyArg) /p:EnableAggressiveTrimming=true /p:BuildAOTTestsOnHelix=true /p:RunAOTCompilation=true /p:BrowserHost=$(_hostedOs)
- timeoutInMinutes: 180
- condition: >-
- or(
- eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true),
- eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true),
- eq(dependencies.evaluate_paths.outputs['SetPathVars_installer.containsChange'], true),
- eq(variables['isRollingBuild'], true))
- # extra steps, run tests
- extraStepsTemplate: /eng/pipelines/libraries/helix.yml
- extraStepsParameters:
- creator: dotnet-bot
- testRunNamePrefixSuffix: Mono_AOT_$(_BuildConfig)_$(_hostedOs)
- extraHelixArguments: /p:NeedsToBuildWasmAppsOnHelix=true $(_runSmokeTestsOnlyArg) /p:BrowserHost=$(_hostedOs)
- scenarios:
- - normal
-
-#
-# Build the whole product using Mono and run libraries tests
-#
-- template: /eng/pipelines/common/platform-matrix.yml
- parameters:
- jobTemplate: /eng/pipelines/common/global-build-job.yml
- helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml
- buildConfig: Release
- runtimeFlavor: mono
- platforms:
- - Windows_x64
- variables:
- # map dependencies variables to local variables
- - name: librariesContainsChange
- value: $[ dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'] ]
- - name: monoContainsChange
- value: $[ dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'] ]
- jobParameters:
- testScope: innerloop
- nameSuffix: AllSubsets_Mono
- buildArgs: -s mono+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true
- timeoutInMinutes: 120
- condition: >-
- or(
- eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true),
- eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true),
- eq(dependencies.evaluate_paths.outputs['SetPathVars_installer.containsChange'], true),
- eq(variables['isRollingBuild'], true))
- # extra steps, run tests
- extraStepsTemplate: /eng/pipelines/libraries/helix.yml
- extraStepsParameters:
- creator: dotnet-bot
- testRunNamePrefixSuffix: Mono_$(_BuildConfig)
- condition: >-
- or(
- eq(variables['librariesContainsChange'], true),
- eq(variables['monoContainsChange'], true),
- eq(variables['isRollingBuild'], true))
-
-#
-# iOS/tvOS devices - Full AOT + AggressiveTrimming to reduce size
-# Build the whole product using Mono and run libraries tests
-#
-- template: /eng/pipelines/common/platform-matrix.yml
- parameters:
- jobTemplate: /eng/pipelines/common/global-build-job.yml
- helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml
- buildConfig: Release
- runtimeFlavor: mono
- platforms:
- - iOS_arm64
- - tvOS_arm64
- variables:
- # map dependencies variables to local variables
- - name: librariesContainsChange
- value: $[ dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'] ]
- - name: monoContainsChange
- value: $[ dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'] ]
- jobParameters:
- testGroup: innerloop
- nameSuffix: AllSubsets_Mono
- buildArgs: -s mono+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:DevTeamProvisioning=- /p:RunAOTCompilation=true $(_runSmokeTestsOnlyArg) /p:BuildTestsOnHelix=true /p:UsePortableRuntimePack=true /p:BuildDarwinFrameworks=true
- timeoutInMinutes: 180
- condition: >-
- or(
- eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true),
- eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true),
- eq(variables['isRollingBuild'], true))
- # extra steps, run tests
- extraStepsTemplate: /eng/pipelines/libraries/helix.yml
- extraStepsParameters:
- creator: dotnet-bot
- testRunNamePrefixSuffix: Mono_$(_BuildConfig)
- extraHelixArguments: /p:NeedsToBuildAppsOnHelix=true
- condition: >-
- or(
- eq(variables['librariesContainsChange'], true),
- eq(variables['monoContainsChange'], true),
- eq(variables['isRollingBuild'], true))
-
-- template: /eng/pipelines/common/platform-matrix.yml
- parameters:
- jobTemplate: /eng/pipelines/common/global-build-job.yml
- helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml
- buildConfig: Release
- runtimeFlavor: mono
- platforms:
- - Android_arm
- - Android_arm64
- variables:
- # map dependencies variables to local variables
- - name: librariesContainsChange
- value: $[ dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'] ]
- - name: monoContainsChange
- value: $[ dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'] ]
- jobParameters:
- testGroup: innerloop
- nameSuffix: AllSubsets_Mono
- buildArgs: -s mono+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true $(_runSmokeTestsOnlyArg)
- timeoutInMinutes: 180
- condition: >-
- or(
- eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true),
- eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true),
- eq(variables['isRollingBuild'], true))
- # extra steps, run tests
- extraStepsTemplate: /eng/pipelines/libraries/helix.yml
- extraStepsParameters:
- creator: dotnet-bot
- testRunNamePrefixSuffix: Mono_$(_BuildConfig)
- condition: >-
- or(
- eq(variables['librariesContainsChange'], true),
- eq(variables['monoContainsChange'], true),
- eq(variables['isRollingBuild'], true))
-
-#
-# Build for Browser/wasm and test it on v8, browser, and nodejs
-#
-- template: /eng/pipelines/common/platform-matrix.yml
- parameters:
- jobTemplate: /eng/pipelines/common/global-build-job.yml
- helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml
- buildConfig: Release
- runtimeFlavor: mono
- platforms:
- - Browser_wasm
- - Browser_wasm_win
- variables:
- # map dependencies variables to local variables
- - name: librariesContainsChange
- value: $[ dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'] ]
- - name: monoContainsChange
- value: $[ dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'] ]
- jobParameters:
- testGroup: innerloop
- nameSuffix: LibraryTests
- buildArgs: -s mono+libs+host+packs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:BrowserHost=$(_hostedOs)
- timeoutInMinutes: 180
- condition: >-
- or(
- eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true),
- eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true),
- eq(dependencies.evaluate_paths.outputs['SetPathVars_installer.containsChange'], true),
- eq(variables['isRollingBuild'], true))
- # extra steps, run tests
- extraStepsTemplate: /eng/pipelines/libraries/helix.yml
- extraStepsParameters:
- creator: dotnet-bot
- testRunNamePrefixSuffix: Mono_$(_BuildConfig)
- extraHelixArguments: /p:BrowserHost=$(_hostedOs)
- scenarios:
- - normal
- - WasmTestOnBrowser
- - WasmTestOnNodeJs
-
-#
-# Build the whole product using Mono and run runtime tests
-# Build Mono release
-# Only when libraries, mono, or the runtime tests changed
-# Currently only these architectures are needed for the runtime tests.
-- template: /eng/pipelines/common/platform-matrix.yml
- parameters:
- jobTemplate: /eng/pipelines/mono/templates/build-job.yml
- runtimeFlavor: mono
- buildConfig: release
- platforms:
- - Linux_arm64
- jobParameters:
- condition: >-
- or(
- eq(dependencies.evaluate_paths.outputs['SetPathVars_libraries.containsChange'], true),
- eq(dependencies.evaluate_paths.outputs['SetPathVars_runtimetests.containsChange'], true),
- eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true),
- eq(variables['isRollingBuild'], true))
-
-#
-# Mono Test builds with CoreCLR runtime tests using live libraries debug build
-# Only when Mono is changed
-- template: /eng/pipelines/common/platform-matrix.yml
+# include this unconditionally, because it has per job conditions
+- template: /eng/pipelines/runtime-extra-platforms-wasm.yml
parameters:
- jobTemplate: /eng/pipelines/common/templates/runtimes/build-test-job.yml
- buildConfig: release
- runtimeFlavor: mono
- platforms:
- - CoreClrTestBuildHost # Either OSX_x64 or Linux_x64
- jobParameters:
- testGroup: innerloop
- condition: >-
- or(
- eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true),
- eq(dependencies.evaluate_paths.outputs['SetPathVars_runtimetests.containsChange'], true),
- eq(variables['isRollingBuild'], true))
+ isExtraPlatformsBuild: ${{ variables.isExtraPlatformsBuild }}
-#
-# Build the whole product using Mono for Android and run runtime tests with Android emulator
-#
-- template: /eng/pipelines/common/platform-matrix.yml
- parameters:
- jobTemplate: /eng/pipelines/common/global-build-job.yml
- helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml
- buildConfig: Release
- runtimeFlavor: mono
- platforms:
- - Android_x64
- variables:
- - ${{ if and(eq(variables['System.TeamProject'], 'public'), eq(variables['Build.Reason'], 'PullRequest')) }}:
- - name: _HelixSource
- value: pr/dotnet/runtime/$(Build.SourceBranch)
- - ${{ if and(eq(variables['System.TeamProject'], 'public'), ne(variables['Build.Reason'], 'PullRequest')) }}:
- - name: _HelixSource
- value: ci/dotnet/runtime/$(Build.SourceBranch)
- - name: timeoutPerTestInMinutes
- value: 60
- - name: timeoutPerTestCollectionInMinutes
- value: 180
- jobParameters:
- testGroup: innerloop
- nameSuffix: AllSubsets_Mono_RuntimeTests
- buildArgs: -s mono+libs -c $(_BuildConfig)
- timeoutInMinutes: 240
- condition: >-
- or(
- eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true),
- eq(dependencies.evaluate_paths.outputs['SetPathVars_runtimetests.containsChange'], true),
- eq(variables['isRollingBuild'], true))
- # extra steps, run tests
- extraStepsTemplate: /eng/pipelines/common/templates/runtimes/android-runtime-and-send-to-helix.yml
- extraStepsParameters:
- creator: dotnet-bot
- testRunNamePrefixSuffix: Mono_$(_BuildConfig)
-
-#
-# Build the whole product using Mono for Android and run runtime tests with interpreter
-#
-- template: /eng/pipelines/common/platform-matrix.yml
- parameters:
- jobTemplate: /eng/pipelines/common/global-build-job.yml
- helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml
- buildConfig: Release
- runtimeFlavor: mono
- platforms:
- - Android_x64
- variables:
- - ${{ if and(eq(variables['System.TeamProject'], 'public'), eq(variables['Build.Reason'], 'PullRequest')) }}:
- - name: _HelixSource
- value: pr/dotnet/runtime/$(Build.SourceBranch)
- - ${{ if and(eq(variables['System.TeamProject'], 'public'), ne(variables['Build.Reason'], 'PullRequest')) }}:
- - name: _HelixSource
- value: ci/dotnet/runtime/$(Build.SourceBranch)
- - name: timeoutPerTestInMinutes
- value: 60
- - name: timeoutPerTestCollectionInMinutes
- value: 180
- jobParameters:
- testGroup: innerloop
- nameSuffix: AllSubsets_Mono_RuntimeTests_Interp
- buildArgs: -s mono+libs -c $(_BuildConfig)
- timeoutInMinutes: 240
- runtimeVariant: monointerpreter
- condition: >-
- or(
- eq(dependencies.evaluate_paths.outputs['SetPathVars_runtimetests.containsChange'], true),
- eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true),
- eq(variables['isRollingBuild'], true))
- # NOTE: Per PR test execution is not recommended for runtime tests
- ${{ if eq(variables['isRollingBuild'], true) }}:
- # extra steps, run tests
- extraStepsTemplate: /eng/pipelines/common/templates/runtimes/android-runtime-and-send-to-helix.yml
- extraStepsParameters:
- creator: dotnet-bot
- testRunNamePrefixSuffix: Mono_$(_BuildConfig)
-
-#
-# Mono CoreCLR runtime Test executions using live libraries in jit mode
-# Only when Mono is changed
-- template: /eng/pipelines/common/platform-matrix.yml
- parameters:
- jobTemplate: /eng/pipelines/common/templates/runtimes/run-test-job.yml
- buildConfig: release
- runtimeFlavor: mono
- platforms:
- - Linux_arm64
- helixQueueGroup: pr
- helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml
- jobParameters:
- testGroup: innerloop
- liveLibrariesBuildConfig: Release
- liveRuntimeBuildConfig: release
- runtimeVariant: minijit
- condition: >-
- or(
- eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true),
- eq(dependencies.evaluate_paths.outputs['SetPathVars_runtimetests.containsChange'], true),
- eq(variables['isRollingBuild'], true))
-
-#
-# Mono CoreCLR runtime Test executions using live libraries in interpreter mode
-# Only when Mono is changed
-- template: /eng/pipelines/common/platform-matrix.yml
- parameters:
- jobTemplate: /eng/pipelines/common/templates/runtimes/run-test-job.yml
- buildConfig: release
- runtimeFlavor: mono
- platforms:
- - Linux_arm64
- helixQueueGroup: pr
- helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml
- jobParameters:
- testGroup: innerloop
- liveLibrariesBuildConfig: Release
- liveRuntimeBuildConfig: release
- runtimeVariant: monointerpreter
- condition: >-
- or(
- eq(dependencies.evaluate_paths.outputs['SetPathVars_mono.containsChange'], true),
- eq(dependencies.evaluate_paths.outputs['SetPathVars_runtimetests.containsChange'], true),
- eq(variables['isRollingBuild'], true))
+# Any jobs that are not specific to any platform
+- ${{ if eq(variables.isNotSpecificPlatformOnlyBuild, true) }}:
+ - template: /eng/pipelines/runtime-extra-platforms-other.yml
+ parameters:
+ isExtraPlatformsBuild: ${{ variables.isExtraPlatformsBuild }}
diff --git a/eng/pipelines/runtime-wasm.yml b/eng/pipelines/runtime-wasm.yml
new file mode 100644
index 00000000000000..da464d4750fc54
--- /dev/null
+++ b/eng/pipelines/runtime-wasm.yml
@@ -0,0 +1,20 @@
+# This is a wrapper yml for `runtime-extra-platforms-wasm.yml`, which
+# has all the wasm jobs. This file is essentially so we can have point
+# the pipeline in azdo UI to this, and thus avoid any scheduled triggers
+
+trigger: none
+
+variables:
+ - template: /eng/pipelines/common/variables.yml
+
+jobs:
+
+#
+# Evaluate paths
+#
+- ${{ if eq(variables.dependOnEvaluatePaths, true) }}:
+ - template: /eng/pipelines/common/evaluate-default-paths.yml
+
+- template: /eng/pipelines/runtime-extra-platforms-wasm.yml
+ parameters:
+ isExtraPlatformsBuild: false
diff --git a/eng/pipelines/runtime.yml b/eng/pipelines/runtime.yml
index 9d3bbfe477d8e0..c37478db2e39ba 100644
--- a/eng/pipelines/runtime.yml
+++ b/eng/pipelines/runtime.yml
@@ -211,7 +211,7 @@ jobs:
testGroup: innerloop
timeoutInMinutes: 120
nameSuffix: NativeAOT
- buildArgs: -s clr.jit+clr.tools+clr.nativeaotlibs+clr.nativeaotruntime+libs -rc $(_BuildConfig) -lc Release
+ buildArgs: -s clr.alljits+clr.tools+clr.nativeaotlibs+clr.nativeaotruntime+libs -rc $(_BuildConfig) -lc Release
extraStepsTemplate: /eng/pipelines/coreclr/nativeaot-post-build-steps.yml
condition: >-
or(
@@ -233,7 +233,7 @@ jobs:
testGroup: innerloop
timeoutInMinutes: 120
nameSuffix: NativeAOT
- buildArgs: -s clr.jit+clr.tools+clr.nativeaotlibs+clr.nativeaotruntime+libs -rc $(_BuildConfig) -lc Release
+ buildArgs: -s clr.alljits+clr.tools+clr.nativeaotlibs+clr.nativeaotruntime+libs -rc $(_BuildConfig) -lc Release
extraStepsTemplate: /eng/pipelines/coreclr/nativeaot-post-build-steps.yml
condition: >-
or(
@@ -242,7 +242,7 @@ jobs:
eq(variables['isFullMatrix'], true))
#
-# CoreCLR NativeAOT checked build and smoke tests
+# CoreCLR NativeAOT release build and smoke tests
# Only when CoreCLR is changed
#
- template: /eng/pipelines/common/platform-matrix.yml
@@ -257,7 +257,7 @@ jobs:
testGroup: innerloop
timeoutInMinutes: 120
nameSuffix: NativeAOT
- buildArgs: -s clr.jit+clr.tools+clr.nativeaotlibs+clr.nativeaotruntime+libs -rc $(_BuildConfig) -lc Release
+ buildArgs: -s clr.alljits+clr.tools+clr.nativeaotlibs+clr.nativeaotruntime+libs -rc $(_BuildConfig) -lc Release
extraStepsTemplate: /eng/pipelines/coreclr/nativeaot-post-build-steps.yml
condition: >-
or(
@@ -265,6 +265,34 @@ jobs:
eq(dependencies.evaluate_paths.outputs['SetPathVars_runtimetests.containsChange'], true),
eq(variables['isFullMatrix'], true))
+#
+# CoreCLR NativeAOT release build and libraries tests
+# Only when CoreCLR is changed
+#
+- template: /eng/pipelines/common/platform-matrix.yml
+ parameters:
+ jobTemplate: /eng/pipelines/common/global-build-job.yml
+ helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml
+ buildConfig: Release
+ platforms:
+ - windows_arm64
+ - Linux_arm64
+ jobParameters:
+ testGroup: innerloop
+ isSingleFile: true
+ nameSuffix: NativeAOT
+ buildArgs: -s clr.alljits+clr.tools+clr.nativeaotlibs+clr.nativeaotruntime+libs+libs.tests -c $(_BuildConfig) /p:TestNativeAot=true /p:ArchiveTests=true
+ timeoutInMinutes: 120
+ # extra steps, run tests
+ extraStepsTemplate: /eng/pipelines/libraries/helix.yml
+ extraStepsParameters:
+ creator: dotnet-bot
+ testRunNamePrefixSuffix: NativeAOT_$(_BuildConfig)
+ condition: >-
+ or(
+ eq(dependencies.evaluate_paths.outputs['SetPathVars_coreclr.containsChange'], true),
+ eq(variables['isFullMatrix'], true))
+
# Build and test clr tools
- template: /eng/pipelines/common/platform-matrix.yml
parameters:
diff --git a/eng/references.targets b/eng/references.targets
index 7cfb60411ed182..4603fb98566a91 100644
--- a/eng/references.targets
+++ b/eng/references.targets
@@ -7,31 +7,52 @@
<_FindDependencies>false
-
-
-
-
-
-
+
false
+
+ <_coreLibProjectReference Include="@(ProjectReference->WithMetadataValue('Identity', '$(CoreLibProject)'))" />
+
+
+ $(UndefineProperties);TargetFramework;Platform
+ Configuration=$(CoreCLRConfiguration)
+ Configuration=$(MonoConfiguration)
+ false
+
+
+
+
+
+
+
+
+ None
+
+
+
- <_transitiveProjectReferenceWithExclusion Include="@(ProjectReference)">
- %(DefaultReferenceExclusion.Identity)
-
-
+ <_transitiveProjectReferenceWithProjectName Include="@(ProjectReference->Metadata('NuGetPackageId'))"
+ OriginalIdentity="%(Identity)" />
+ <_transitiveIncludedProjectReferenceWithProjectName Include="@(_transitiveProjectReferenceWithProjectName)"
+ Exclude="@(DefaultReferenceExclusion)" />
+ <_transitiveExcludedProjectReferenceWithProjectName Include="@(_transitiveProjectReferenceWithProjectName)"
+ Exclude="@(_transitiveIncludedProjectReferenceWithProjectName)" />
+
@@ -55,8 +76,10 @@
-
-
+
diff --git a/eng/resolveContract.targets b/eng/resolveContract.targets
index cff60b79eb225f..327273a100e2d4 100644
--- a/eng/resolveContract.targets
+++ b/eng/resolveContract.targets
@@ -42,12 +42,10 @@
- <_resolvedP2PFiltered Include="@(ProjectReference)">
- $([System.IO.Path]::GetFullPath('%(ProjectReference.Identity)'))
- %(ProjectReference.SkipUseReferenceAssembly)
-
- <_ResolvedProjectReferencePaths Update="@(_resolvedP2PFiltered)"
- Condition="'%(_resolvedP2PFiltered.ProjectReferenceItemSpec)' == '%(_resolvedP2PFiltered.MSBuildSourceProjectFile)' and
+ <_resolvedP2PFiltered Include="@(ProjectReference)"
+ ProjectReferenceItemSpec="$([System.IO.Path]::GetFullPath('%(ProjectReference.Identity)'))"
+ SkipUseReferenceAssembly="%(ProjectReference.SkipUseReferenceAssembly)" />
+ <_ResolvedProjectReferencePaths Condition="'%(_resolvedP2PFiltered.ProjectReferenceItemSpec)' == '%(_resolvedP2PFiltered.MSBuildSourceProjectFile)' and
'%(_resolvedP2PFiltered.SkipUseReferenceAssembly)' == 'true'"
ReferenceAssembly="" />
diff --git a/eng/slngen.targets b/eng/slngen.targets
index 5f21150497c949..0747113bd3f5fd 100644
--- a/eng/slngen.targets
+++ b/eng/slngen.targets
@@ -1,5 +1,6 @@
+ gen
ref
tests
src
diff --git a/eng/targetingpacks.targets b/eng/targetingpacks.targets
index 150ddf7401c9ea..33551569c647fe 100644
--- a/eng/targetingpacks.targets
+++ b/eng/targetingpacks.targets
@@ -142,16 +142,18 @@
AfterTargets="ResolveTargetingPackAssets">
<_targetingPackReferenceExclusion Include="$(TargetName)" />
- <_targetingPackReferenceExclusion Include="@(_ResolvedProjectReferencePaths->'%(Filename)')" />
+ <_targetingPackReferenceExclusion Include="@(_ResolvedProjectReferencePaths->Metadata('Filename'))" />
<_targetingPackReferenceExclusion Include="@(DefaultReferenceExclusion)" />
- <_targetingPackReferenceWithExclusion Include="@(Reference)">
- %(_targetingPackReferenceExclusion.Identity)
-
-
+ <_targetingPackReferenceWithProjectName Include="@(Reference->WithMetadataValue('ExternallyResolved', 'true')->Metadata('Filename'))"
+ OriginalIdentity="%(Identity)" />
+ <_targetingPackIncludedReferenceWithProjectName Include="@(_targetingPackReferenceWithProjectName)"
+ Exclude="@(_targetingPackReferenceExclusion)" />
+ <_targetingPackExcludedReferenceWithProjectName Include="@(_targetingPackReferenceWithProjectName)"
+ Exclude="@(_targetingPackIncludedReferenceWithProjectName)" />
+
diff --git a/eng/testing/WasmRunnerTemplate.cmd b/eng/testing/WasmRunnerTemplate.cmd
index 2ebcbcf8e93a97..a668ce2c6a464c 100644
--- a/eng/testing/WasmRunnerTemplate.cmd
+++ b/eng/testing/WasmRunnerTemplate.cmd
@@ -54,7 +54,7 @@ if /I [%XHARNESS_COMMAND%] == [test] (
)
if [%XHARNESS_ARGS%] == [] (
- set "XHARNESS_ARGS=%JS_ENGINE% %JS_ENGINE_ARGS% %BROWSER_PATH% %MAIN_JS% %WASM_XHARNESS_MONO_ARGS%"
+ set "XHARNESS_ARGS=%JS_ENGINE% %JS_ENGINE_ARGS% %BROWSER_PATH% %MAIN_JS%"
)
echo EXECUTION_DIR=%EXECUTION_DIR%
diff --git a/eng/testing/WasmRunnerTemplate.sh b/eng/testing/WasmRunnerTemplate.sh
index d4e352976e8075..ae78d5304e8aed 100644
--- a/eng/testing/WasmRunnerTemplate.sh
+++ b/eng/testing/WasmRunnerTemplate.sh
@@ -50,7 +50,7 @@ if [[ "$XHARNESS_COMMAND" == "test" ]]; then
fi
if [[ -z "$XHARNESS_ARGS" ]]; then
- XHARNESS_ARGS="$JS_ENGINE $JS_ENGINE_ARGS $MAIN_JS $WASM_XHARNESS_MONO_ARGS"
+ XHARNESS_ARGS="$JS_ENGINE $JS_ENGINE_ARGS $MAIN_JS"
fi
echo EXECUTION_DIR=$EXECUTION_DIR
diff --git a/eng/testing/performance/android_scenarios.proj b/eng/testing/performance/android_scenarios.proj
index fefff6deeefe08..f616c6a693d8cf 100644
--- a/eng/testing/performance/android_scenarios.proj
+++ b/eng/testing/performance/android_scenarios.proj
@@ -25,39 +25,41 @@
$(WorkItemDirectory)
- cd $(ScenarioDirectory)helloandroid;copy %HELIX_CORRELATION_PAYLOAD%\HelloAndroid.apk .;$(Python) pre.py
+ cd $(ScenarioDirectory)helloandroid;copy %HELIX_CORRELATION_PAYLOAD%\HelloAndroid.apk .;$(Python) pre.py --apk-name HelloAndroid.apk
$(Python) test.py sod --scenario-name "%(Identity)"
$(Python) post.py
$(WorkItemDirectory)
- cd $(ScenarioDirectory)helloandroid;copy %HELIX_CORRELATION_PAYLOAD%\HelloAndroid.apk .;$(Python) pre.py --unzip
+ cd $(ScenarioDirectory)helloandroid;copy %HELIX_CORRELATION_PAYLOAD%\HelloAndroid.apk .;$(Python) pre.py --unzip --apk-name HelloAndroid.apk
$(Python) test.py sod --scenario-name "%(Identity)"
$(Python) post.py
-
+
+
$(WorkItemDirectory)
- echo on;set XHARNESSPATH=$(XharnessPath);cd $(ScenarioDirectory)helloandroid;copy %HELIX_CORRELATION_PAYLOAD%\HelloAndroid.apk .;$(Python) pre.py
+ echo on;set XHARNESSPATH=$(XharnessPath);cd $(ScenarioDirectory)helloandroid;copy %HELIX_CORRELATION_PAYLOAD%\HelloAndroid.apk .;$(Python) pre.py --apk-name HelloAndroid.apk
$(Python) test.py devicestartup --device-type android --package-path pub\HelloAndroid.apk --package-name net.dot.HelloAndroid --scenario-name "%(Identity)"
$(Python) post.py
-
+
+
diff --git a/eng/testing/performance/performance-setup.ps1 b/eng/testing/performance/performance-setup.ps1
index 7f1be6761b5049..9696ffc9da4c75 100644
--- a/eng/testing/performance/performance-setup.ps1
+++ b/eng/testing/performance/performance-setup.ps1
@@ -149,8 +149,9 @@ if ($AndroidMono) {
mkdir $WorkItemDirectory
}
- Copy-Item -path "$SourceDirectory\androidHelloWorld\HelloAndroid.apk" $PayloadDirectory -Verbose
- Copy-Item -path "$SourceDirectory\MauiAndroidDefault.apk" $PayloadDirectory -Verbose
+ Copy-Item -path "$SourceDirectory\androidHelloWorld\HelloAndroid.apk" $PayloadDirectory -Verbose
+ #### Commented out to mitigate https://github.com/dotnet/performance/issues/2254 on main
+ #Copy-Item -path "$SourceDirectory\MauiAndroidDefault.apk" $PayloadDirectory -Verbose
$SetupArguments = $SetupArguments -replace $Architecture, 'arm64'
}
diff --git a/eng/testing/tests.singlefile.targets b/eng/testing/tests.singlefile.targets
index e6783add3640a3..e5f12a683a9f79 100644
--- a/eng/testing/tests.singlefile.targets
+++ b/eng/testing/tests.singlefile.targets
@@ -22,11 +22,15 @@
$(CoreCLRILCompilerDir)
+ $(CoreCLRCrossILCompilerDir)
+ clang-9
+ $(ROOTFS_DIR)
$(CoreCLRILCompilerDir)netstandard/ILCompiler.Build.Tasks.dll
$(CoreCLRAotSdkDir)
$(NetCoreAppCurrentTestHostSharedFrameworkPath)
- $(NoWarn);IL3050;IL3052;IL3055;IL1005
+ $(NoWarn);IL3050;IL3051;IL3052;IL3055;IL1005
false
+ true
true
diff --git a/eng/testing/tests.wasm.targets b/eng/testing/tests.wasm.targets
index bed571a3064021..e9e8d34d696790 100644
--- a/eng/testing/tests.wasm.targets
+++ b/eng/testing/tests.wasm.targets
@@ -46,6 +46,7 @@
<_XHarnessArgs Condition="'$(IsFunctionalTest)' == 'true'" >$(_XHarnessArgs) --expected-exit-code=$(ExpectedExitCode)
<_XHarnessArgs Condition="'$(WasmXHarnessArgs)' != ''" >$(_XHarnessArgs) $(WasmXHarnessArgs)
+ <_XHarnessArgs Condition="'$(WasmXHarnessArgsCli)' != ''" >$(_XHarnessArgs) $(WasmXHarnessArgsCli)
<_AppArgs Condition="'$(IsFunctionalTest)' != 'true' and '$(Scenario)' != 'BuildWasmApps' and '$(WasmMainAssemblyFileName)' == ''">--run WasmTestRunner.dll $(AssemblyName).dll
<_AppArgs Condition="'$(IsFunctionalTest)' != 'true' and '$(WasmMainAssemblyFileName)' != ''">--run $(WasmMainAssemblyFileName)
@@ -53,6 +54,7 @@
<_AppArgs Condition="'$(WasmTestAppArgs)' != ''">$(_AppArgs) $(WasmTestAppArgs)
+
$HARNESS_RUNNER $(_XHarnessArgs) %24XHARNESS_ARGS %24WasmXHarnessArgs -- $(WasmXHarnessMonoArgs) %24WasmXHarnessMonoArgs $(_AppArgs) %24WasmTestAppArgs
%HARNESS_RUNNER% $(_XHarnessArgs) %XHARNESS_ARGS% %WasmXHarnessArgs% -- $(WasmXHarnessMonoArgs) %WasmXHarnessMonoArgs% $(_AppArgs) %WasmTestAppArgs%
diff --git a/global.json b/global.json
index cdc6966b29227b..74fffa1e3eb804 100644
--- a/global.json
+++ b/global.json
@@ -12,11 +12,11 @@
"python3": "3.7.1"
},
"msbuild-sdks": {
- "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22080.1",
- "Microsoft.DotNet.Helix.Sdk": "7.0.0-beta.22080.1",
- "Microsoft.DotNet.SharedFramework.Sdk": "7.0.0-beta.22080.1",
+ "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22110.7",
+ "Microsoft.DotNet.Helix.Sdk": "7.0.0-beta.22110.7",
+ "Microsoft.DotNet.SharedFramework.Sdk": "7.0.0-beta.22110.7",
"Microsoft.Build.NoTargets": "3.1.0",
"Microsoft.Build.Traversal": "3.0.23",
- "Microsoft.NET.Sdk.IL": "7.0.0-preview.2.22080.2"
+ "Microsoft.NET.Sdk.IL": "7.0.0-preview.2.22103.2"
}
}
diff --git a/src/coreclr/.nuget/coreclr-packages.proj b/src/coreclr/.nuget/coreclr-packages.proj
index 5d6391b6124e22..80e3f60a9192f6 100644
--- a/src/coreclr/.nuget/coreclr-packages.proj
+++ b/src/coreclr/.nuget/coreclr-packages.proj
@@ -1,8 +1,8 @@
-
-
+
+
diff --git a/src/coreclr/System.Private.CoreLib/src/Microsoft/Win32/OAVariantLib.cs b/src/coreclr/System.Private.CoreLib/src/Microsoft/Win32/OAVariantLib.cs
index 3886195966ebd4..958199de5a5d44 100644
--- a/src/coreclr/System.Private.CoreLib/src/Microsoft/Win32/OAVariantLib.cs
+++ b/src/coreclr/System.Private.CoreLib/src/Microsoft/Win32/OAVariantLib.cs
@@ -72,12 +72,8 @@ internal static class OAVariantLib
* Variant and the types that CLR supports explicitly in the
* CLR Variant class.
*/
- internal static Variant ChangeType(Variant source, Type targetClass, short options, CultureInfo culture)
+ internal static Variant ChangeType(Variant source, Type targetClass!!, short options, CultureInfo culture!!)
{
- if (targetClass == null)
- throw new ArgumentNullException(nameof(targetClass));
- if (culture == null)
- throw new ArgumentNullException(nameof(culture));
Variant result = default;
ChangeTypeEx(ref result, ref source,
culture.LCID,
diff --git a/src/coreclr/System.Private.CoreLib/src/System/Attribute.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Attribute.CoreCLR.cs
index 90261791d0c8d5..f33849d2a949e5 100644
--- a/src/coreclr/System.Private.CoreLib/src/System/Attribute.CoreCLR.cs
+++ b/src/coreclr/System.Private.CoreLib/src/System/Attribute.CoreCLR.cs
@@ -450,14 +450,8 @@ public static Attribute[] GetCustomAttributes(MemberInfo element, Type attribute
return GetCustomAttributes(element, attributeType, true);
}
- public static Attribute[] GetCustomAttributes(MemberInfo element, Type attributeType, bool inherit)
+ public static Attribute[] GetCustomAttributes(MemberInfo element!!, Type attributeType!!, bool inherit)
{
- if (element == null)
- throw new ArgumentNullException(nameof(element));
-
- if (attributeType == null)
- throw new ArgumentNullException(nameof(attributeType));
-
if (!attributeType.IsSubclassOf(typeof(Attribute)) && attributeType != typeof(Attribute))
throw new ArgumentException(SR.Argument_MustHaveAttributeBaseClass);
@@ -474,11 +468,8 @@ public static Attribute[] GetCustomAttributes(MemberInfo element)
return GetCustomAttributes(element, true);
}
- public static Attribute[] GetCustomAttributes(MemberInfo element, bool inherit)
+ public static Attribute[] GetCustomAttributes(MemberInfo element!!, bool inherit)
{
- if (element == null)
- throw new ArgumentNullException(nameof(element));
-
return element.MemberType switch
{
MemberTypes.Property => InternalGetCustomAttributes((PropertyInfo)element, typeof(Attribute), inherit),
@@ -492,15 +483,9 @@ public static bool IsDefined(MemberInfo element, Type attributeType)
return IsDefined(element, attributeType, true);
}
- public static bool IsDefined(MemberInfo element, Type attributeType, bool inherit)
+ public static bool IsDefined(MemberInfo element!!, Type attributeType!!, bool inherit)
{
// Returns true if a custom attribute subclass of attributeType class/interface with inheritance walk
- if (element == null)
- throw new ArgumentNullException(nameof(element));
-
- if (attributeType == null)
- throw new ArgumentNullException(nameof(attributeType));
-
if (!attributeType.IsSubclassOf(typeof(Attribute)) && attributeType != typeof(Attribute))
throw new ArgumentException(SR.Argument_MustHaveAttributeBaseClass);
@@ -543,14 +528,8 @@ public static Attribute[] GetCustomAttributes(ParameterInfo element, Type attrib
return GetCustomAttributes(element, attributeType, true);
}
- public static Attribute[] GetCustomAttributes(ParameterInfo element, Type attributeType, bool inherit)
+ public static Attribute[] GetCustomAttributes(ParameterInfo element!!, Type attributeType!!, bool inherit)
{
- if (element == null)
- throw new ArgumentNullException(nameof(element));
-
- if (attributeType == null)
- throw new ArgumentNullException(nameof(attributeType));
-
if (!attributeType.IsSubclassOf(typeof(Attribute)) && attributeType != typeof(Attribute))
throw new ArgumentException(SR.Argument_MustHaveAttributeBaseClass);
@@ -565,11 +544,8 @@ public static Attribute[] GetCustomAttributes(ParameterInfo element, Type attrib
return (element.GetCustomAttributes(attributeType, inherit) as Attribute[])!;
}
- public static Attribute[] GetCustomAttributes(ParameterInfo element, bool inherit)
+ public static Attribute[] GetCustomAttributes(ParameterInfo element!!, bool inherit)
{
- if (element == null)
- throw new ArgumentNullException(nameof(element));
-
if (element.Member == null)
throw new ArgumentException(SR.Argument_InvalidParameterInfo, nameof(element));
@@ -586,14 +562,9 @@ public static bool IsDefined(ParameterInfo element, Type attributeType)
return IsDefined(element, attributeType, true);
}
- public static bool IsDefined(ParameterInfo element, Type attributeType, bool inherit)
+ public static bool IsDefined(ParameterInfo element!!, Type attributeType!!, bool inherit)
{
// Returns true is a custom attribute subclass of attributeType class/interface with inheritance walk
- if (element == null)
- throw new ArgumentNullException(nameof(element));
-
- if (attributeType == null)
- throw new ArgumentNullException(nameof(attributeType));
if (!attributeType.IsSubclassOf(typeof(Attribute)) && attributeType != typeof(Attribute))
throw new ArgumentException(SR.Argument_MustHaveAttributeBaseClass);
@@ -653,22 +624,13 @@ public static Attribute[] GetCustomAttributes(Module element)
return GetCustomAttributes(element, true);
}
- public static Attribute[] GetCustomAttributes(Module element, bool inherit)
+ public static Attribute[] GetCustomAttributes(Module element!!, bool inherit)
{
- if (element == null)
- throw new ArgumentNullException(nameof(element));
-
return (Attribute[])element.GetCustomAttributes(typeof(Attribute), inherit);
}
- public static Attribute[] GetCustomAttributes(Module element, Type attributeType, bool inherit)
+ public static Attribute[] GetCustomAttributes(Module element!!, Type attributeType!!, bool inherit)
{
- if (element == null)
- throw new ArgumentNullException(nameof(element));
-
- if (attributeType == null)
- throw new ArgumentNullException(nameof(attributeType));
-
if (!attributeType.IsSubclassOf(typeof(Attribute)) && attributeType != typeof(Attribute))
throw new ArgumentException(SR.Argument_MustHaveAttributeBaseClass);
@@ -680,14 +642,9 @@ public static bool IsDefined(Module element, Type attributeType)
return IsDefined(element, attributeType, false);
}
- public static bool IsDefined(Module element, Type attributeType, bool inherit)
+ public static bool IsDefined(Module element!!, Type attributeType!!, bool inherit)
{
// Returns true is a custom attribute subclass of attributeType class/interface with no inheritance walk
- if (element == null)
- throw new ArgumentNullException(nameof(element));
-
- if (attributeType == null)
- throw new ArgumentNullException(nameof(attributeType));
if (!attributeType.IsSubclassOf(typeof(Attribute)) && attributeType != typeof(Attribute))
throw new ArgumentException(SR.Argument_MustHaveAttributeBaseClass);
@@ -723,14 +680,8 @@ public static Attribute[] GetCustomAttributes(Assembly element, Type attributeTy
return GetCustomAttributes(element, attributeType, true);
}
- public static Attribute[] GetCustomAttributes(Assembly element, Type attributeType, bool inherit)
+ public static Attribute[] GetCustomAttributes(Assembly element!!, Type attributeType!!, bool inherit)
{
- if (element == null)
- throw new ArgumentNullException(nameof(element));
-
- if (attributeType == null)
- throw new ArgumentNullException(nameof(attributeType));
-
if (!attributeType.IsSubclassOf(typeof(Attribute)) && attributeType != typeof(Attribute))
throw new ArgumentException(SR.Argument_MustHaveAttributeBaseClass);
@@ -742,11 +693,8 @@ public static Attribute[] GetCustomAttributes(Assembly element)
return GetCustomAttributes(element, true);
}
- public static Attribute[] GetCustomAttributes(Assembly element, bool inherit)
+ public static Attribute[] GetCustomAttributes(Assembly element!!, bool inherit)
{
- if (element == null)
- throw new ArgumentNullException(nameof(element));
-
return (Attribute[])element.GetCustomAttributes(typeof(Attribute), inherit);
}
@@ -755,14 +703,9 @@ public static bool IsDefined(Assembly element, Type attributeType)
return IsDefined(element, attributeType, true);
}
- public static bool IsDefined(Assembly element, Type attributeType, bool inherit)
+ public static bool IsDefined(Assembly element!!, Type attributeType!!, bool inherit)
{
// Returns true is a custom attribute subclass of attributeType class/interface with no inheritance walk
- if (element == null)
- throw new ArgumentNullException(nameof(element));
-
- if (attributeType == null)
- throw new ArgumentNullException(nameof(attributeType));
if (!attributeType.IsSubclassOf(typeof(Attribute)) && attributeType != typeof(Attribute))
throw new ArgumentException(SR.Argument_MustHaveAttributeBaseClass);
diff --git a/src/coreclr/System.Private.CoreLib/src/System/Collections/EmptyReadOnlyDictionaryInternal.cs b/src/coreclr/System.Private.CoreLib/src/System/Collections/EmptyReadOnlyDictionaryInternal.cs
index bb9d40bc38db3c..e63e57a3f4a11e 100644
--- a/src/coreclr/System.Private.CoreLib/src/System/Collections/EmptyReadOnlyDictionaryInternal.cs
+++ b/src/coreclr/System.Private.CoreLib/src/System/Collections/EmptyReadOnlyDictionaryInternal.cs
@@ -33,11 +33,8 @@ IEnumerator IEnumerable.GetEnumerator()
// ICollection members
- public void CopyTo(Array array, int index)
+ public void CopyTo(Array array!!, int index)
{
- if (array == null)
- throw new ArgumentNullException(nameof(array));
-
if (array.Rank != 1)
throw new ArgumentException(SR.Arg_RankMultiDimNotSupported);
@@ -58,23 +55,14 @@ public void CopyTo(Array array, int index)
// IDictionary members
- public object? this[object key]
+ public object? this[object key!!]
{
get
{
- if (key == null)
- {
- throw new ArgumentNullException(nameof(key), SR.ArgumentNull_Key);
- }
return null;
}
set
{
- if (key == null)
- {
- throw new ArgumentNullException(nameof(key), SR.ArgumentNull_Key);
- }
-
if (!key.GetType().IsSerializable)
throw new ArgumentException(SR.Argument_NotSerializable, nameof(key));
@@ -94,13 +82,8 @@ public bool Contains(object key)
return false;
}
- public void Add(object key, object? value)
+ public void Add(object key!!, object? value)
{
- if (key == null)
- {
- throw new ArgumentNullException(nameof(key), SR.ArgumentNull_Key);
- }
-
if (!key.GetType().IsSerializable)
throw new ArgumentException(SR.Argument_NotSerializable, nameof(key));
diff --git a/src/coreclr/System.Private.CoreLib/src/System/Delegate.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Delegate.CoreCLR.cs
index 23567e475d99b9..3afbff9eb08000 100644
--- a/src/coreclr/System.Private.CoreLib/src/System/Delegate.CoreCLR.cs
+++ b/src/coreclr/System.Private.CoreLib/src/System/Delegate.CoreCLR.cs
@@ -34,14 +34,8 @@ public abstract partial class Delegate : ICloneable, ISerializable
// This constructor is called from the class generated by the
// compiler generated code
[RequiresUnreferencedCode("The target method might be removed")]
- protected Delegate(object target, string method)
+ protected Delegate(object target!!, string method!!)
{
- if (target == null)
- throw new ArgumentNullException(nameof(target));
-
- if (method == null)
- throw new ArgumentNullException(nameof(method));
-
// This API existed in v1/v1.1 and only expected to create closed
// instance delegates. Constrain the call to BindToMethodName to
// such and don't allow relaxed signature matching (which could make
@@ -57,17 +51,10 @@ protected Delegate(object target, string method)
// This constructor is called from a class to generate a
// delegate based upon a static method name and the Type object
// for the class defining the method.
- protected Delegate([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type target, string method)
+ protected Delegate([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type target!!, string method!!)
{
- if (target == null)
- throw new ArgumentNullException(nameof(target));
-
if (target.ContainsGenericParameters)
throw new ArgumentException(SR.Arg_UnboundGenParam, nameof(target));
-
- if (method == null)
- throw new ArgumentNullException(nameof(method));
-
if (!(target is RuntimeType rtTarget))
throw new ArgumentException(SR.Argument_MustBeRuntimeType, nameof(target));
@@ -220,15 +207,8 @@ protected virtual MethodInfo GetMethodImpl()
// V1 API.
[RequiresUnreferencedCode("The target method might be removed")]
- public static Delegate? CreateDelegate(Type type, object target, string method, bool ignoreCase, bool throwOnBindFailure)
+ public static Delegate? CreateDelegate(Type type!!, object target!!, string method!!, bool ignoreCase, bool throwOnBindFailure)
{
- if (type == null)
- throw new ArgumentNullException(nameof(type));
- if (target == null)
- throw new ArgumentNullException(nameof(target));
- if (method == null)
- throw new ArgumentNullException(nameof(method));
-
if (!(type is RuntimeType rtType))
throw new ArgumentException(SR.Argument_MustBeRuntimeType, nameof(type));
if (!rtType.IsDelegate())
@@ -258,17 +238,10 @@ protected virtual MethodInfo GetMethodImpl()
}
// V1 API.
- public static Delegate? CreateDelegate(Type type, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type target, string method, bool ignoreCase, bool throwOnBindFailure)
+ public static Delegate? CreateDelegate(Type type!!, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type target!!, string method!!, bool ignoreCase, bool throwOnBindFailure)
{
- if (type == null)
- throw new ArgumentNullException(nameof(type));
- if (target == null)
- throw new ArgumentNullException(nameof(target));
if (target.ContainsGenericParameters)
throw new ArgumentException(SR.Arg_UnboundGenParam, nameof(target));
- if (method == null)
- throw new ArgumentNullException(nameof(method));
-
if (!(type is RuntimeType rtType))
throw new ArgumentException(SR.Argument_MustBeRuntimeType, nameof(type));
if (!(target is RuntimeType rtTarget))
@@ -297,13 +270,9 @@ protected virtual MethodInfo GetMethodImpl()
}
// V1 API.
- public static Delegate? CreateDelegate(Type type, MethodInfo method, bool throwOnBindFailure)
+ public static Delegate? CreateDelegate(Type type!!, MethodInfo method!!, bool throwOnBindFailure)
{
// Validate the parameters.
- if (type == null)
- throw new ArgumentNullException(nameof(type));
- if (method == null)
- throw new ArgumentNullException(nameof(method));
if (!(type is RuntimeType rtType))
throw new ArgumentException(SR.Argument_MustBeRuntimeType, nameof(type));
@@ -374,11 +343,9 @@ protected virtual MethodInfo GetMethodImpl()
//
// V2 internal API.
- internal static Delegate CreateDelegateNoSecurityCheck(Type type, object? target, RuntimeMethodHandle method)
+ internal static Delegate CreateDelegateNoSecurityCheck(Type type!!, object? target, RuntimeMethodHandle method)
{
// Validate the parameters.
- if (type == null)
- throw new ArgumentNullException(nameof(type));
if (method.IsNullHandle())
throw new ArgumentNullException(nameof(method));
diff --git a/src/coreclr/System.Private.CoreLib/src/System/Diagnostics/Eventing/EventPipe.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Diagnostics/Eventing/EventPipe.CoreCLR.cs
index 21f121b24f02a6..d4938c14002edc 100644
--- a/src/coreclr/System.Private.CoreLib/src/System/Diagnostics/Eventing/EventPipe.CoreCLR.cs
+++ b/src/coreclr/System.Private.CoreLib/src/System/Diagnostics/Eventing/EventPipe.CoreCLR.cs
@@ -40,11 +40,8 @@ private static unsafe partial ulong Enable(
[GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_DeleteProvider")]
internal static partial void DeleteProvider(IntPtr provHandle);
-#pragma warning disable DLLIMPORTGENANALYZER015 // Use 'GeneratedDllImportAttribute' instead of 'DllImportAttribute' to generate P/Invoke marshalling code at compile time
- // TODO: [DllImportGenerator] Switch to use GeneratedDllImport once we annotate blittable types used in interop in CoreLib (like Guid)
- [DllImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_EventActivityIdControl")]
- internal static extern int EventActivityIdControl(uint controlCode, ref Guid activityId);
-#pragma warning restore DLLIMPORTGENANALYZER015
+ [GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_EventActivityIdControl")]
+ internal static partial int EventActivityIdControl(uint controlCode, ref Guid activityId);
[GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "EventPipeInternal_WriteEventData")]
internal static unsafe partial void WriteEventData(IntPtr eventHandle, EventProvider.EventData* pEventData, uint dataCount, Guid* activityId, Guid* relatedActivityId);
diff --git a/src/coreclr/System.Private.CoreLib/src/System/GC.cs b/src/coreclr/System.Private.CoreLib/src/System/GC.cs
index 7597672f683164..3e28ba7d3947d5 100644
--- a/src/coreclr/System.Private.CoreLib/src/System/GC.cs
+++ b/src/coreclr/System.Private.CoreLib/src/System/GC.cs
@@ -303,10 +303,8 @@ public static void WaitForPendingFinalizers()
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern void _SuppressFinalize(object o);
- public static void SuppressFinalize(object obj)
+ public static void SuppressFinalize(object obj!!)
{
- if (obj == null)
- throw new ArgumentNullException(nameof(obj));
_SuppressFinalize(obj);
}
@@ -317,10 +315,8 @@ public static void SuppressFinalize(object obj)
[MethodImpl(MethodImplOptions.InternalCall)]
private static extern void _ReRegisterForFinalize(object o);
- public static void ReRegisterForFinalize(object obj)
+ public static void ReRegisterForFinalize(object obj!!)
{
- if (obj == null)
- throw new ArgumentNullException(nameof(obj));
_ReRegisterForFinalize(obj);
}
@@ -609,10 +605,7 @@ internal static void RegisterMemoryLoadChangeNotification(float lowMemoryPercent
{
throw new ArgumentOutOfRangeException(nameof(lowMemoryPercent));
}
- if (notification == null)
- {
- throw new ArgumentNullException(nameof(notification));
- }
+ ArgumentNullException.ThrowIfNull(notification);
lock (s_notifications)
{
@@ -625,13 +618,8 @@ internal static void RegisterMemoryLoadChangeNotification(float lowMemoryPercent
}
}
- internal static void UnregisterMemoryLoadChangeNotification(Action notification)
+ internal static void UnregisterMemoryLoadChangeNotification(Action notification!!)
{
- if (notification == null)
- {
- throw new ArgumentNullException(nameof(notification));
- }
-
lock (s_notifications)
{
for (int i = 0; i < s_notifications.Count; ++i)
diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Assembly.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Assembly.CoreCLR.cs
index 282d713232b660..651c4aed685f46 100644
--- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Assembly.CoreCLR.cs
+++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Assembly.CoreCLR.cs
@@ -23,11 +23,8 @@ public static Assembly Load(string assemblyString)
[Obsolete("Assembly.LoadWithPartialName has been deprecated. Use Assembly.Load() instead.")]
[System.Security.DynamicSecurityMethod] // Methods containing StackCrawlMark local var has to be marked DynamicSecurityMethod
- public static Assembly? LoadWithPartialName(string partialName)
+ public static Assembly? LoadWithPartialName(string partialName!!)
{
- if (partialName == null)
- throw new ArgumentNullException(nameof(partialName));
-
if ((partialName.Length == 0) || (partialName[0] == '\0'))
throw new ArgumentException(SR.Format_StringZeroLength, nameof(partialName));
@@ -45,11 +42,8 @@ public static Assembly Load(string assemblyString)
// Locate an assembly by its name. The name can be strong or
// weak. The assembly is loaded into the domain of the caller.
[System.Security.DynamicSecurityMethod] // Methods containing StackCrawlMark local var has to be marked DynamicSecurityMethod
- public static Assembly Load(AssemblyName assemblyRef)
+ public static Assembly Load(AssemblyName assemblyRef!!)
{
- if (assemblyRef == null)
- throw new ArgumentNullException(nameof(assemblyRef));
-
StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
return RuntimeAssembly.InternalLoad(assemblyRef, ref stackMark, AssemblyLoadContext.CurrentContextualReflectionContext);
}
diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/AssemblyBuilder.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/AssemblyBuilder.cs
index 3e8bd014fb0aa3..b821a1141fa75a 100644
--- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/AssemblyBuilder.cs
+++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/AssemblyBuilder.cs
@@ -1,29 +1,13 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-// For each dynamic assembly there will be two AssemblyBuilder objects: the "internal"
-// AssemblyBuilder object and the "external" AssemblyBuilder object.
-// 1. The "internal" object is the real assembly object that the VM creates and knows about. However,
-// you can perform RefEmit operations on it only if you have its granted permission. From the AppDomain
-// and other "internal" objects like the "internal" ModuleBuilders and runtime types, you can only
-// get the "internal" objects. This is to prevent low-trust code from getting a hold of the dynamic
-// AssemblyBuilder/ModuleBuilder/TypeBuilder/MethodBuilder/etc other people have created by simply
-// enumerating the AppDomain and inject code in it.
-// 2. The "external" object is merely an wrapper of the "internal" object and all operations on it
-// are directed to the internal object. This is the one you get by calling DefineDynamicAssembly
-// on AppDomain and the one you can always perform RefEmit operations on. You can get other "external"
-// objects from the "external" AssemblyBuilder, ModuleBuilder, TypeBuilder, MethodBuilder, etc. Note
-// that VM doesn't know about this object. So every time we call into the VM we need to pass in the
-// "internal" object.
-//
-// "internal" and "external" ModuleBuilders are similar
-
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Diagnostics.SymbolStore;
using System.Globalization;
using System.IO;
+using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Loader;
@@ -73,20 +57,26 @@ internal ModuleBuilder GetModuleBuilder(RuntimeModule module)
#region Constructor
- internal AssemblyBuilder(AssemblyName name,
+ internal AssemblyBuilder(AssemblyName name!!,
AssemblyBuilderAccess access,
- ref StackCrawlMark stackMark,
+ Assembly? callingAssembly,
AssemblyLoadContext? assemblyLoadContext,
IEnumerable? unsafeAssemblyAttributes)
{
- if (name == null)
- {
- throw new ArgumentNullException(nameof(name));
- }
if (access != AssemblyBuilderAccess.Run && access != AssemblyBuilderAccess.RunAndCollect)
{
throw new ArgumentException(SR.Format(SR.Arg_EnumIllegalVal, (int)access), nameof(access));
}
+ if (callingAssembly == null)
+ {
+ // Called either from interop or async delegate invocation. Rejecting because we don't
+ // know how to set the correct context of the new dynamic assembly.
+ throw new InvalidOperationException();
+ }
+ if (assemblyLoadContext == null)
+ {
+ assemblyLoadContext = AssemblyLoadContext.GetLoadContext(callingAssembly);
+ }
// Clone the name in case the caller modifies it underneath us.
name = (AssemblyName)name.Clone();
@@ -104,7 +94,6 @@ internal AssemblyBuilder(AssemblyName name,
RuntimeAssembly? retAssembly = null;
CreateDynamicAssembly(ObjectHandleOnStack.Create(ref name),
- new StackCrawlMarkHandle(ref stackMark),
(int)access,
ObjectHandleOnStack.Create(ref assemblyLoadContext),
ObjectHandleOnStack.Create(ref retAssembly));
@@ -150,39 +139,31 @@ private void InitManifestModule()
#region DefineDynamicAssembly
- ///
- /// If an AssemblyName has a public key specified, the assembly is assumed
- /// to have a strong name and a hash will be computed when the assembly
- /// is saved.
- ///
- [DynamicSecurityMethod] // Methods containing StackCrawlMark local var has to be marked DynamicSecurityMethod.
+ [DynamicSecurityMethod] // Required to make Assembly.GetCallingAssembly reliable.
public static AssemblyBuilder DefineDynamicAssembly(AssemblyName name, AssemblyBuilderAccess access)
{
- StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
return InternalDefineDynamicAssembly(name,
access,
- ref stackMark,
+ Assembly.GetCallingAssembly(),
AssemblyLoadContext.CurrentContextualReflectionContext,
null);
}
- [DynamicSecurityMethod] // Methods containing StackCrawlMark local var has to be marked DynamicSecurityMethod.
+ [DynamicSecurityMethod] // Required to make Assembly.GetCallingAssembly reliable.
public static AssemblyBuilder DefineDynamicAssembly(
AssemblyName name,
AssemblyBuilderAccess access,
IEnumerable? assemblyAttributes)
{
- StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
return InternalDefineDynamicAssembly(name,
access,
- ref stackMark,
+ Assembly.GetCallingAssembly(),
AssemblyLoadContext.CurrentContextualReflectionContext,
assemblyAttributes);
}
[GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "AppDomain_CreateDynamicAssembly")]
private static partial void CreateDynamicAssembly(ObjectHandleOnStack name,
- StackCrawlMarkHandle stackMark,
int access,
ObjectHandleOnStack assemblyLoadContext,
ObjectHandleOnStack retAssembly);
@@ -192,7 +173,7 @@ private static partial void CreateDynamicAssembly(ObjectHandleOnStack name,
internal static AssemblyBuilder InternalDefineDynamicAssembly(
AssemblyName name,
AssemblyBuilderAccess access,
- ref StackCrawlMark stackMark,
+ Assembly? callingAssembly,
AssemblyLoadContext? assemblyLoadContext,
IEnumerable? unsafeAssemblyAttributes)
{
@@ -201,7 +182,7 @@ internal static AssemblyBuilder InternalDefineDynamicAssembly(
// We can only create dynamic assemblies in the current domain
return new AssemblyBuilder(name,
access,
- ref stackMark,
+ callingAssembly,
assemblyLoadContext,
unsafeAssemblyAttributes);
}
@@ -215,7 +196,6 @@ internal static AssemblyBuilder InternalDefineDynamicAssembly(
/// modules within an Assembly with the same name. This dynamic module is
/// a transient module.
///
- [DynamicSecurityMethod] // Methods containing StackCrawlMark local var has to be marked DynamicSecurityMethod.
public ModuleBuilder DefineDynamicModule(string name)
{
lock (SyncRoot)
@@ -387,17 +367,8 @@ public override Assembly GetSatelliteAssembly(CultureInfo culture, Version? vers
///
/// Use this function if client decides to form the custom attribute blob themselves.
///
- public void SetCustomAttribute(ConstructorInfo con, byte[] binaryAttribute)
+ public void SetCustomAttribute(ConstructorInfo con!!, byte[] binaryAttribute!!)
{
- if (con == null)
- {
- throw new ArgumentNullException(nameof(con));
- }
- if (binaryAttribute == null)
- {
- throw new ArgumentNullException(nameof(binaryAttribute));
- }
-
lock (SyncRoot)
{
TypeBuilder.DefineCustomAttribute(
@@ -411,13 +382,8 @@ public void SetCustomAttribute(ConstructorInfo con, byte[] binaryAttribute)
///
/// Use this function if client wishes to build CustomAttribute using CustomAttributeBuilder.
///
- public void SetCustomAttribute(CustomAttributeBuilder customBuilder)
+ public void SetCustomAttribute(CustomAttributeBuilder customBuilder!!)
{
- if (customBuilder == null)
- {
- throw new ArgumentNullException(nameof(customBuilder));
- }
-
lock (SyncRoot)
{
customBuilder.CreateCustomAttribute(_manifestModuleBuilder, AssemblyBuilderData.AssemblyDefToken);
diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/CustomAttributeBuilder.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/CustomAttributeBuilder.cs
index 1038d9ba86504a..f910b8a7e7da0d 100644
--- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/CustomAttributeBuilder.cs
+++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/CustomAttributeBuilder.cs
@@ -48,20 +48,8 @@ public CustomAttributeBuilder(ConstructorInfo con, object?[] constructorArgs, Fi
// public constructor to form the custom attribute with constructor and constructor
// parameters.
- public CustomAttributeBuilder(ConstructorInfo con, object?[] constructorArgs, PropertyInfo[] namedProperties, object?[] propertyValues, FieldInfo[] namedFields, object?[] fieldValues)
+ public CustomAttributeBuilder(ConstructorInfo con!!, object?[] constructorArgs!!, PropertyInfo[] namedProperties!!, object?[] propertyValues!!, FieldInfo[] namedFields!!, object?[] fieldValues!!)
{
- if (con == null)
- throw new ArgumentNullException(nameof(con));
- if (constructorArgs == null)
- throw new ArgumentNullException(nameof(constructorArgs));
- if (namedProperties == null)
- throw new ArgumentNullException(nameof(namedProperties));
- if (propertyValues == null)
- throw new ArgumentNullException(nameof(propertyValues));
- if (namedFields == null)
- throw new ArgumentNullException(nameof(namedFields));
- if (fieldValues == null)
- throw new ArgumentNullException(nameof(fieldValues));
#pragma warning disable CA2208 // Instantiate argument exceptions correctly, combination of arguments used
if (namedProperties.Length != propertyValues.Length)
throw new ArgumentException(SR.Arg_ArrayLengthsDiffer, "namedProperties, propertyValues");
diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/DynamicILGenerator.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/DynamicILGenerator.cs
index ff832cff7e14a2..d5d36a60b4231f 100644
--- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/DynamicILGenerator.cs
+++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/DynamicILGenerator.cs
@@ -32,11 +32,9 @@ internal void GetCallableMethod(RuntimeModule module, DynamicMethod dm)
// *** ILGenerator api ***
- public override LocalBuilder DeclareLocal(Type localType, bool pinned)
+ public override LocalBuilder DeclareLocal(Type localType!!, bool pinned)
{
LocalBuilder localBuilder;
- if (localType == null)
- throw new ArgumentNullException(nameof(localType));
RuntimeType? rtType = localType as RuntimeType;
@@ -55,11 +53,8 @@ public override LocalBuilder DeclareLocal(Type localType, bool pinned)
// Token resolution calls
//
//
- public override void Emit(OpCode opcode, MethodInfo meth)
+ public override void Emit(OpCode opcode, MethodInfo meth!!)
{
- if (meth == null)
- throw new ArgumentNullException(nameof(meth));
-
int stackchange = 0;
int token;
DynamicMethod? dynMeth = meth as DynamicMethod;
@@ -110,11 +105,8 @@ public override void Emit(OpCode opcode, MethodInfo meth)
PutInteger4(token);
}
- public override void Emit(OpCode opcode, ConstructorInfo con)
+ public override void Emit(OpCode opcode, ConstructorInfo con!!)
{
- if (con == null)
- throw new ArgumentNullException(nameof(con));
-
RuntimeConstructorInfo? rtConstructor = con as RuntimeConstructorInfo;
if (rtConstructor == null)
throw new ArgumentException(SR.Argument_MustBeRuntimeMethodInfo, nameof(con));
@@ -137,11 +129,8 @@ public override void Emit(OpCode opcode, ConstructorInfo con)
PutInteger4(token);
}
- public override void Emit(OpCode opcode, Type type)
+ public override void Emit(OpCode opcode, Type type!!)
{
- if (type == null)
- throw new ArgumentNullException(nameof(type));
-
RuntimeType? rtType = type as RuntimeType;
if (rtType == null)
@@ -153,11 +142,8 @@ public override void Emit(OpCode opcode, Type type)
PutInteger4(token);
}
- public override void Emit(OpCode opcode, FieldInfo field)
+ public override void Emit(OpCode opcode, FieldInfo field!!)
{
- if (field == null)
- throw new ArgumentNullException(nameof(field));
-
RuntimeFieldInfo? runtimeField = field as RuntimeFieldInfo;
if (runtimeField == null)
throw new ArgumentException(SR.Argument_MustBeRuntimeFieldInfo, nameof(field));
@@ -173,11 +159,8 @@ public override void Emit(OpCode opcode, FieldInfo field)
PutInteger4(token);
}
- public override void Emit(OpCode opcode, string str)
+ public override void Emit(OpCode opcode, string str!!)
{
- if (str == null)
- throw new ArgumentNullException(nameof(str));
-
int tempVal = GetTokenForString(str);
EnsureCapacity(7);
InternalEmit(opcode);
@@ -264,11 +247,8 @@ public override void EmitCalli(OpCode opcode, CallingConvention unmanagedCallCon
PutInteger4(token);
}
- public override void EmitCall(OpCode opcode, MethodInfo methodInfo, Type[]? optionalParameterTypes)
+ public override void EmitCall(OpCode opcode, MethodInfo methodInfo!!, Type[]? optionalParameterTypes)
{
- if (methodInfo == null)
- throw new ArgumentNullException(nameof(methodInfo));
-
if (!(opcode.Equals(OpCodes.Call) || opcode.Equals(OpCodes.Callvirt) || opcode.Equals(OpCodes.Newobj)))
throw new ArgumentException(SR.Argument_NotMethodCallOpcode, nameof(opcode));
@@ -303,11 +283,8 @@ public override void EmitCall(OpCode opcode, MethodInfo methodInfo, Type[]? opti
PutInteger4(tk);
}
- public override void Emit(OpCode opcode, SignatureHelper signature)
+ public override void Emit(OpCode opcode, SignatureHelper signature!!)
{
- if (signature == null)
- throw new ArgumentNullException(nameof(signature));
-
int stackchange = 0;
EnsureCapacity(7);
InternalEmit(opcode);
@@ -376,8 +353,7 @@ public override void BeginCatchBlock(Type exceptionType)
else
{
// execute this branch if previous clause is Catch or Fault
- if (exceptionType == null)
- throw new ArgumentNullException(nameof(exceptionType));
+ ArgumentNullException.ThrowIfNull(exceptionType);
if (rtType == null)
throw new ArgumentException(SR.Argument_MustBeRuntimeType);
@@ -895,8 +871,8 @@ public unsafe void SetCode(byte* code, int codeSize, int maxStackSize)
{
if (codeSize < 0)
throw new ArgumentOutOfRangeException(nameof(codeSize), SR.ArgumentOutOfRange_GenericPositive);
- if (codeSize > 0 && code == null)
- throw new ArgumentNullException(nameof(code));
+ if (codeSize > 0)
+ ArgumentNullException.ThrowIfNull(code);
m_code = new Span(code, codeSize).ToArray();
m_maxStackSize = maxStackSize;
@@ -913,8 +889,8 @@ public unsafe void SetExceptions(byte* exceptions, int exceptionsSize)
if (exceptionsSize < 0)
throw new ArgumentOutOfRangeException(nameof(exceptionsSize), SR.ArgumentOutOfRange_GenericPositive);
- if (exceptionsSize > 0 && exceptions == null)
- throw new ArgumentNullException(nameof(exceptions));
+ if (exceptionsSize > 0)
+ ArgumentNullException.ThrowIfNull(exceptions);
m_exceptions = new Span(exceptions, exceptionsSize).ToArray();
}
@@ -930,8 +906,8 @@ public unsafe void SetLocalSignature(byte* localSignature, int signatureSize)
if (signatureSize < 0)
throw new ArgumentOutOfRangeException(nameof(signatureSize), SR.ArgumentOutOfRange_GenericPositive);
- if (signatureSize > 0 && localSignature == null)
- throw new ArgumentNullException(nameof(localSignature));
+ if (signatureSize > 0)
+ ArgumentNullException.ThrowIfNull(localSignature);
m_localSignature = new Span(localSignature, signatureSize).ToArray();
}
diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/DynamicMethod.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/DynamicMethod.cs
index c98d78da4c84bf..e1819a363d3866 100644
--- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/DynamicMethod.cs
+++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/DynamicMethod.cs
@@ -5,6 +5,7 @@
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Runtime.CompilerServices;
+using System.Runtime.Loader;
using System.Text;
using System.Threading;
@@ -82,11 +83,8 @@ public DynamicMethod(string name,
public DynamicMethod(string name,
Type? returnType,
Type[]? parameterTypes,
- Module m)
+ Module m!!)
{
- if (m == null)
- throw new ArgumentNullException(nameof(m));
-
Init(name,
MethodAttributes.Public | MethodAttributes.Static,
CallingConventions.Standard,
@@ -101,12 +99,9 @@ public DynamicMethod(string name,
public DynamicMethod(string name,
Type? returnType,
Type[]? parameterTypes,
- Module m,
+ Module m!!,
bool skipVisibility)
{
- if (m == null)
- throw new ArgumentNullException(nameof(m));
-
Init(name,
MethodAttributes.Public | MethodAttributes.Static,
CallingConventions.Standard,
@@ -123,12 +118,9 @@ public DynamicMethod(string name,
CallingConventions callingConvention,
Type? returnType,
Type[]? parameterTypes,
- Module m,
+ Module m!!,
bool skipVisibility)
{
- if (m == null)
- throw new ArgumentNullException(nameof(m));
-
Init(name,
attributes,
callingConvention,
@@ -143,11 +135,8 @@ public DynamicMethod(string name,
public DynamicMethod(string name,
Type? returnType,
Type[]? parameterTypes,
- Type owner)
+ Type owner!!)
{
- if (owner == null)
- throw new ArgumentNullException(nameof(owner));
-
Init(name,
MethodAttributes.Public | MethodAttributes.Static,
CallingConventions.Standard,
@@ -162,12 +151,9 @@ public DynamicMethod(string name,
public DynamicMethod(string name,
Type? returnType,
Type[]? parameterTypes,
- Type owner,
+ Type owner!!,
bool skipVisibility)
{
- if (owner == null)
- throw new ArgumentNullException(nameof(owner));
-
Init(name,
MethodAttributes.Public | MethodAttributes.Static,
CallingConventions.Standard,
@@ -184,12 +170,9 @@ public DynamicMethod(string name,
CallingConventions callingConvention,
Type? returnType,
Type[]? parameterTypes,
- Type owner,
+ Type owner!!,
bool skipVisibility)
{
- if (owner == null)
- throw new ArgumentNullException(nameof(owner));
-
Init(name,
attributes,
callingConvention,
@@ -234,12 +217,11 @@ private static RuntimeModule GetDynamicMethodsModule()
return s_anonymouslyHostedDynamicMethodsModule;
AssemblyName assemblyName = new AssemblyName("Anonymously Hosted DynamicMethods Assembly");
- StackCrawlMark stackMark = StackCrawlMark.LookForMe;
AssemblyBuilder assembly = AssemblyBuilder.InternalDefineDynamicAssembly(
assemblyName,
AssemblyBuilderAccess.Run,
- ref stackMark,
+ typeof(object).Assembly,
null,
null);
@@ -253,17 +235,17 @@ private static RuntimeModule GetDynamicMethodsModule()
[MemberNotNull(nameof(m_parameterTypes))]
[MemberNotNull(nameof(m_returnType))]
[MemberNotNull(nameof(m_dynMethod))]
- private void Init(string name,
- MethodAttributes attributes,
- CallingConventions callingConvention,
- Type? returnType,
- Type[]? signature,
- Type? owner,
- Module? m,
- bool skipVisibility,
- bool transparentMethod)
+ private void Init(string name!!,
+ MethodAttributes attributes,
+ CallingConventions callingConvention,
+ Type? returnType,
+ Type[]? signature,
+ Type? owner,
+ Module? m,
+ bool skipVisibility,
+ bool transparentMethod)
{
- DynamicMethod.CheckConsistency(attributes, callingConvention);
+ CheckConsistency(attributes, callingConvention);
// check and store the signature
if (signature != null)
@@ -329,10 +311,6 @@ private void Init(string name,
m_ilGenerator = null;
m_fInitLocals = true;
m_methodHandle = null;
-
- if (name == null)
- throw new ArgumentNullException(nameof(name));
-
m_dynMethod = new RTDynamicMethod(this, name, attributes, callingConvention);
}
@@ -655,11 +633,8 @@ public override object[] GetCustomAttributes(bool inherit)
return new object[] { new MethodImplAttribute((MethodImplOptions)GetMethodImplementationFlags()) };
}
- public override bool IsDefined(Type attributeType, bool inherit)
+ public override bool IsDefined(Type attributeType!!, bool inherit)
{
- if (attributeType == null)
- throw new ArgumentNullException(nameof(attributeType));
-
if (attributeType.IsAssignableFrom(typeof(MethodImplAttribute)))
return true;
else
diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/EventBuilder.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/EventBuilder.cs
index be0ed200842094..c393d8dd1d6857 100644
--- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/EventBuilder.cs
+++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/EventBuilder.cs
@@ -46,13 +46,8 @@ internal int GetEventToken()
return m_evToken;
}
- private void SetMethodSemantics(MethodBuilder mdBuilder, MethodSemanticsAttributes semantics)
+ private void SetMethodSemantics(MethodBuilder mdBuilder!!, MethodSemanticsAttributes semantics)
{
- if (mdBuilder == null)
- {
- throw new ArgumentNullException(nameof(mdBuilder));
- }
-
m_type.ThrowIfCreated();
ModuleBuilder module = m_module;
TypeBuilder.DefineMethodSemantics(
@@ -84,12 +79,8 @@ public void AddOtherMethod(MethodBuilder mdBuilder)
// Use this function if client decides to form the custom attribute blob themselves
- public void SetCustomAttribute(ConstructorInfo con, byte[] binaryAttribute)
+ public void SetCustomAttribute(ConstructorInfo con!!, byte[] binaryAttribute!!)
{
- if (con == null)
- throw new ArgumentNullException(nameof(con));
- if (binaryAttribute == null)
- throw new ArgumentNullException(nameof(binaryAttribute));
m_type.ThrowIfCreated();
TypeBuilder.DefineCustomAttribute(
@@ -100,12 +91,8 @@ public void SetCustomAttribute(ConstructorInfo con, byte[] binaryAttribute)
}
// Use this function if client wishes to build CustomAttribute using CustomAttributeBuilder
- public void SetCustomAttribute(CustomAttributeBuilder customBuilder)
+ public void SetCustomAttribute(CustomAttributeBuilder customBuilder!!)
{
- if (customBuilder == null)
- {
- throw new ArgumentNullException(nameof(customBuilder));
- }
m_type.ThrowIfCreated();
customBuilder.CreateCustomAttribute(m_module, m_evToken);
}
diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/FieldBuilder.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/FieldBuilder.cs
index c3e22c5d340719..5c65ff31c00b67 100644
--- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/FieldBuilder.cs
+++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/FieldBuilder.cs
@@ -154,14 +154,8 @@ public void SetConstant(object? defaultValue)
TypeBuilder.SetConstantValue(m_typeBuilder.GetModuleBuilder(), m_fieldTok, m_fieldType, defaultValue);
}
- public void SetCustomAttribute(ConstructorInfo con, byte[] binaryAttribute)
+ public void SetCustomAttribute(ConstructorInfo con!!, byte[] binaryAttribute!!)
{
- if (con == null)
- throw new ArgumentNullException(nameof(con));
-
- if (binaryAttribute == null)
- throw new ArgumentNullException(nameof(binaryAttribute));
-
ModuleBuilder module = (m_typeBuilder.Module as ModuleBuilder)!;
m_typeBuilder.ThrowIfCreated();
@@ -170,11 +164,8 @@ public void SetCustomAttribute(ConstructorInfo con, byte[] binaryAttribute)
m_fieldTok, module.GetConstructorToken(con), binaryAttribute);
}
- public void SetCustomAttribute(CustomAttributeBuilder customBuilder)
+ public void SetCustomAttribute(CustomAttributeBuilder customBuilder!!)
{
- if (customBuilder == null)
- throw new ArgumentNullException(nameof(customBuilder));
-
m_typeBuilder.ThrowIfCreated();
ModuleBuilder? module = m_typeBuilder.Module as ModuleBuilder;
diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/ILGenerator.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/ILGenerator.cs
index 1b35f5cdbb15f0..65d97cd384e7d3 100644
--- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/ILGenerator.cs
+++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/ILGenerator.cs
@@ -474,11 +474,8 @@ public virtual void Emit(OpCode opcode, int arg)
PutInteger4(arg);
}
- public virtual void Emit(OpCode opcode, MethodInfo meth)
+ public virtual void Emit(OpCode opcode, MethodInfo meth!!)
{
- if (meth == null)
- throw new ArgumentNullException(nameof(meth));
-
if (opcode.Equals(OpCodes.Call) || opcode.Equals(OpCodes.Callvirt) || opcode.Equals(OpCodes.Newobj))
{
EmitCall(opcode, meth, null);
@@ -586,11 +583,8 @@ public virtual void EmitCalli(OpCode opcode, CallingConvention unmanagedCallConv
PutInteger4(modBuilder.GetSignatureToken(sig));
}
- public virtual void EmitCall(OpCode opcode, MethodInfo methodInfo, Type[]? optionalParameterTypes)
+ public virtual void EmitCall(OpCode opcode, MethodInfo methodInfo!!, Type[]? optionalParameterTypes)
{
- if (methodInfo == null)
- throw new ArgumentNullException(nameof(methodInfo));
-
if (!(opcode.Equals(OpCodes.Call) || opcode.Equals(OpCodes.Callvirt) || opcode.Equals(OpCodes.Newobj)))
throw new ArgumentException(SR.Argument_NotMethodCallOpcode, nameof(opcode));
@@ -621,11 +615,8 @@ public virtual void EmitCall(OpCode opcode, MethodInfo methodInfo, Type[]? optio
PutInteger4(tk);
}
- public virtual void Emit(OpCode opcode, SignatureHelper signature)
+ public virtual void Emit(OpCode opcode, SignatureHelper signature!!)
{
- if (signature == null)
- throw new ArgumentNullException(nameof(signature));
-
int stackchange = 0;
ModuleBuilder modBuilder = (ModuleBuilder)m_methodBuilder.Module;
int sig = modBuilder.GetSignatureToken(signature);
@@ -655,11 +646,8 @@ public virtual void Emit(OpCode opcode, SignatureHelper signature)
PutInteger4(tempVal);
}
- public virtual void Emit(OpCode opcode, ConstructorInfo con)
+ public virtual void Emit(OpCode opcode, ConstructorInfo con!!)
{
- if (con == null)
- throw new ArgumentNullException(nameof(con));
-
int stackchange = 0;
// Constructors cannot be generic so the value of UseMethodDef doesn't matter.
@@ -772,11 +760,8 @@ public virtual void Emit(OpCode opcode, Label label)
}
}
- public virtual void Emit(OpCode opcode, Label[] labels)
+ public virtual void Emit(OpCode opcode, Label[] labels!!)
{
- if (labels == null)
- throw new ArgumentNullException(nameof(labels));
-
// Emitting a switch table
int i;
@@ -818,14 +803,9 @@ public virtual void Emit(OpCode opcode, string str)
PutInteger4(tempVal);
}
- public virtual void Emit(OpCode opcode, LocalBuilder local)
+ public virtual void Emit(OpCode opcode, LocalBuilder local!!)
{
// Puts the opcode onto the IL stream followed by the information for local variable local.
-
- if (local == null)
- {
- throw new ArgumentNullException(nameof(local));
- }
int tempVal = local.GetLocalIndex();
if (local.GetMethodBuilder() != m_methodBuilder)
{
@@ -1022,10 +1002,7 @@ public virtual void BeginCatchBlock(Type exceptionType)
else
{
// execute this branch if previous clause is Catch or Fault
- if (exceptionType == null)
- {
- throw new ArgumentNullException(nameof(exceptionType));
- }
+ ArgumentNullException.ThrowIfNull(exceptionType);
Emit(OpCodes.Leave, current.GetEndLabel());
}
@@ -1188,18 +1165,13 @@ public virtual void EmitWriteLine(LocalBuilder localBuilder)
Emit(OpCodes.Callvirt, mi);
}
- public virtual void EmitWriteLine(FieldInfo fld)
+ public virtual void EmitWriteLine(FieldInfo fld!!)
{
// Emits the IL necessary to call WriteLine with fld. It is
// an error to call EmitWriteLine with a fld which is not of
// one of the types for which Console.WriteLine implements overloads. (e.g.
// we do *not* call ToString on the fields.
- if (fld == null)
- {
- throw new ArgumentNullException(nameof(fld));
- }
-
Type consoleType = Type.GetType(ConsoleTypeFullName, throwOnError: true)!;
MethodInfo prop = consoleType.GetMethod("get_Out")!;
Emit(OpCodes.Call, prop);
@@ -1252,10 +1224,7 @@ public virtual LocalBuilder DeclareLocal(Type localType, bool pinned)
throw new InvalidOperationException(SR.InvalidOperation_TypeHasBeenCreated);
}
- if (localType == null)
- {
- throw new ArgumentNullException(nameof(localType));
- }
+ ArgumentNullException.ThrowIfNull(localType);
if (methodBuilder.m_bIsBaked)
{
diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/MethodBuilder.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/MethodBuilder.cs
index 9d11aacaf53ea8..8c1c738f0d390b 100644
--- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/MethodBuilder.cs
+++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/MethodBuilder.cs
@@ -130,14 +130,10 @@ internal MethodBuilder(string name, MethodAttributes attributes, CallingConventi
#region Internal Members
- internal void CreateMethodBodyHelper(ILGenerator il)
+ internal void CreateMethodBodyHelper(ILGenerator il!!)
{
// Sets the IL of the method. An ILGenerator is passed as an argument and the method
// queries this instance to get all of the information which it needs.
- if (il == null)
- {
- throw new ArgumentNullException(nameof(il));
- }
__ExceptionInfo[] excp;
int counter = 0;
@@ -517,11 +513,8 @@ public override MethodInfo MakeGenericMethod(params Type[] typeArguments)
return MethodBuilderInstantiation.MakeGenericMethod(this, typeArguments);
}
- public GenericTypeParameterBuilder[] DefineGenericParameters(params string[] names)
+ public GenericTypeParameterBuilder[] DefineGenericParameters(params string[] names!!)
{
- if (names == null)
- throw new ArgumentNullException(nameof(names));
-
if (names.Length == 0)
throw new ArgumentException(SR.Arg_EmptyArray, nameof(names));
@@ -529,8 +522,7 @@ public GenericTypeParameterBuilder[] DefineGenericParameters(params string[] nam
throw new InvalidOperationException(SR.InvalidOperation_GenericParametersAlreadySet);
for (int i = 0; i < names.Length; i++)
- if (names[i] == null)
- throw new ArgumentNullException(nameof(names));
+ ArgumentNullException.ThrowIfNull(names[i], nameof(names));
if (m_token != 0)
throw new InvalidOperationException(SR.InvalidOperation_MethodBuilderBaked);
@@ -734,13 +726,8 @@ internal Module GetModule()
return GetModuleBuilder();
}
- public void SetCustomAttribute(ConstructorInfo con, byte[] binaryAttribute)
+ public void SetCustomAttribute(ConstructorInfo con!!, byte[] binaryAttribute!!)
{
- if (con is null)
- throw new ArgumentNullException(nameof(con));
- if (binaryAttribute is null)
- throw new ArgumentNullException(nameof(binaryAttribute));
-
ThrowIfGeneric();
TypeBuilder.DefineCustomAttribute(m_module, MetadataToken,
@@ -751,11 +738,8 @@ public void SetCustomAttribute(ConstructorInfo con, byte[] binaryAttribute)
ParseCA(con);
}
- public void SetCustomAttribute(CustomAttributeBuilder customBuilder)
+ public void SetCustomAttribute(CustomAttributeBuilder customBuilder!!)
{
- if (customBuilder == null)
- throw new ArgumentNullException(nameof(customBuilder));
-
ThrowIfGeneric();
customBuilder.CreateCustomAttribute((ModuleBuilder)m_module, MetadataToken);
diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/ModuleBuilder.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/ModuleBuilder.cs
index f1ffa97874925f..3bf175e13e1f62 100644
--- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/ModuleBuilder.cs
+++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/ModuleBuilder.cs
@@ -216,14 +216,9 @@ private int GetTypeRefNested(Type type, Module? refedModule, string? strRefedMod
return GetTypeRef(new QCallModule(ref thisModule), typeName, new QCallModule(ref refedRuntimeModule), strRefedModuleFileName, tkResolution);
}
- internal int InternalGetConstructorToken(ConstructorInfo con, bool usingRef)
+ internal int InternalGetConstructorToken(ConstructorInfo con!!, bool usingRef)
{
// Helper to get constructor token. If usingRef is true, we will never use the def token
- if (con == null)
- {
- throw new ArgumentNullException(nameof(con));
- }
-
int tr;
int mr;
@@ -1033,13 +1028,8 @@ internal int GetTypeToken(Type type)
return GetTypeTokenInternal(type, getGenericDefinition: true);
}
- private int GetTypeTokenWorkerNoLock(Type type, bool getGenericDefinition)
+ private int GetTypeTokenWorkerNoLock(Type type!!, bool getGenericDefinition)
{
- if (type == null)
- {
- throw new ArgumentNullException(nameof(type));
- }
-
AssemblyBuilder.CheckContext(type);
// Return a token for the class relative to the Module. Tokens
@@ -1131,15 +1121,10 @@ internal int GetMethodToken(MethodInfo method)
// 1. GetMethodToken
// 2. ldtoken (see ILGenerator)
// For all other occasions we should return the method on the generic type instantiated on the formal parameters.
- private int GetMethodTokenNoLock(MethodInfo method, bool getGenericTypeDefinition)
+ private int GetMethodTokenNoLock(MethodInfo method!!, bool getGenericTypeDefinition)
{
// Return a MemberRef token if MethodInfo is not defined in this module. Or
// return the MethodDef token.
- if (method == null)
- {
- throw new ArgumentNullException(nameof(method));
- }
-
int tr;
int mr;
@@ -1370,13 +1355,8 @@ internal int GetFieldToken(FieldInfo field)
}
}
- private int GetFieldTokenNoLock(FieldInfo field)
+ private int GetFieldTokenNoLock(FieldInfo field!!)
{
- if (field == null)
- {
- throw new ArgumentNullException(nameof(field));
- }
-
int tr;
int mr;
@@ -1448,41 +1428,26 @@ private int GetFieldTokenNoLock(FieldInfo field)
return mr;
}
- internal int GetStringConstant(string str)
+ internal int GetStringConstant(string str!!)
{
- if (str == null)
- {
- throw new ArgumentNullException(nameof(str));
- }
-
// Returns a token representing a String constant. If the string
// value has already been defined, the existing token will be returned.
ModuleBuilder thisModule = this;
return GetStringConstant(new QCallModule(ref thisModule), str, str.Length);
}
- internal int GetSignatureToken(SignatureHelper sigHelper)
+ internal int GetSignatureToken(SignatureHelper sigHelper!!)
{
// Define signature token given a signature helper. This will define a metadata
// token for the signature described by SignatureHelper.
- if (sigHelper == null)
- {
- throw new ArgumentNullException(nameof(sigHelper));
- }
-
- // get the signature in byte form
+ // Get the signature in byte form.
byte[] sigBytes = sigHelper.InternalGetSignature(out int sigLength);
ModuleBuilder thisModule = this;
return TypeBuilder.GetTokenFromSig(new QCallModule(ref thisModule), sigBytes, sigLength);
}
- internal int GetSignatureToken(byte[] sigBytes, int sigLength)
+ internal int GetSignatureToken(byte[] sigBytes!!, int sigLength)
{
- if (sigBytes == null)
- {
- throw new ArgumentNullException(nameof(sigBytes));
- }
-
byte[] localSigBytes = new byte[sigBytes.Length];
Buffer.BlockCopy(sigBytes, 0, localSigBytes, 0, sigBytes.Length);
@@ -1494,17 +1459,8 @@ internal int GetSignatureToken(byte[] sigBytes, int sigLength)
#region Other
- public void SetCustomAttribute(ConstructorInfo con, byte[] binaryAttribute)
+ public void SetCustomAttribute(ConstructorInfo con!!, byte[] binaryAttribute!!)
{
- if (con == null)
- {
- throw new ArgumentNullException(nameof(con));
- }
- if (binaryAttribute == null)
- {
- throw new ArgumentNullException(nameof(binaryAttribute));
- }
-
TypeBuilder.DefineCustomAttribute(
this,
1, // This is hard coding the module token to 1
@@ -1512,13 +1468,8 @@ public void SetCustomAttribute(ConstructorInfo con, byte[] binaryAttribute)
binaryAttribute);
}
- public void SetCustomAttribute(CustomAttributeBuilder customBuilder)
+ public void SetCustomAttribute(CustomAttributeBuilder customBuilder!!)
{
- if (customBuilder == null)
- {
- throw new ArgumentNullException(nameof(customBuilder));
- }
-
customBuilder.CreateCustomAttribute(this, 1); // This is hard coding the module token to 1
}
diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/ParameterBuilder.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/ParameterBuilder.cs
index 79379c535874c7..6be9a88cfe9210 100644
--- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/ParameterBuilder.cs
+++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/ParameterBuilder.cs
@@ -18,17 +18,8 @@ public virtual void SetConstant(object? defaultValue)
}
// Use this function if client decides to form the custom attribute blob themselves
- public void SetCustomAttribute(ConstructorInfo con, byte[] binaryAttribute)
+ public void SetCustomAttribute(ConstructorInfo con!!, byte[] binaryAttribute!!)
{
- if (con == null)
- {
- throw new ArgumentNullException(nameof(con));
- }
- if (binaryAttribute == null)
- {
- throw new ArgumentNullException(nameof(binaryAttribute));
- }
-
TypeBuilder.DefineCustomAttribute(
_methodBuilder.GetModuleBuilder(),
_token,
@@ -37,12 +28,8 @@ public void SetCustomAttribute(ConstructorInfo con, byte[] binaryAttribute)
}
// Use this function if client wishes to build CustomAttribute using CustomAttributeBuilder
- public void SetCustomAttribute(CustomAttributeBuilder customBuilder)
+ public void SetCustomAttribute(CustomAttributeBuilder customBuilder!!)
{
- if (customBuilder == null)
- {
- throw new ArgumentNullException(nameof(customBuilder));
- }
customBuilder.CreateCustomAttribute((ModuleBuilder)(_methodBuilder.GetModule()), _token);
}
diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/PropertyBuilder.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/PropertyBuilder.cs
index 89accc39caeb98..71dfd932e12605 100644
--- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/PropertyBuilder.cs
+++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/PropertyBuilder.cs
@@ -67,13 +67,8 @@ public void SetConstant(object? defaultValue)
public override Module Module => m_containingType.Module;
- private void SetMethodSemantics(MethodBuilder mdBuilder, MethodSemanticsAttributes semantics)
+ private void SetMethodSemantics(MethodBuilder mdBuilder!!, MethodSemanticsAttributes semantics)
{
- if (mdBuilder == null)
- {
- throw new ArgumentNullException(nameof(mdBuilder));
- }
-
m_containingType.ThrowIfCreated();
ModuleBuilder module = m_moduleBuilder;
TypeBuilder.DefineMethodSemantics(
@@ -102,13 +97,8 @@ public void AddOtherMethod(MethodBuilder mdBuilder)
// Use this function if client decides to form the custom attribute blob themselves
- public void SetCustomAttribute(ConstructorInfo con, byte[] binaryAttribute)
+ public void SetCustomAttribute(ConstructorInfo con!!, byte[] binaryAttribute!!)
{
- if (con == null)
- throw new ArgumentNullException(nameof(con));
- if (binaryAttribute == null)
- throw new ArgumentNullException(nameof(binaryAttribute));
-
m_containingType.ThrowIfCreated();
TypeBuilder.DefineCustomAttribute(
m_moduleBuilder,
@@ -118,12 +108,8 @@ public void SetCustomAttribute(ConstructorInfo con, byte[] binaryAttribute)
}
// Use this function if client wishes to build CustomAttribute using CustomAttributeBuilder
- public void SetCustomAttribute(CustomAttributeBuilder customBuilder)
+ public void SetCustomAttribute(CustomAttributeBuilder customBuilder!!)
{
- if (customBuilder == null)
- {
- throw new ArgumentNullException(nameof(customBuilder));
- }
m_containingType.ThrowIfCreated();
customBuilder.CreateCustomAttribute(m_moduleBuilder, m_tkProperty);
}
diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/SignatureHelper.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/SignatureHelper.cs
index 9dd3a2fbb63e89..cacb7ac0121c55 100644
--- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/SignatureHelper.cs
+++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/SignatureHelper.cs
@@ -167,14 +167,8 @@ public static SignatureHelper GetPropertySigHelper(Module? mod, CallingConventio
return sigHelp;
}
- internal static SignatureHelper GetTypeSigToken(Module module, Type type)
+ internal static SignatureHelper GetTypeSigToken(Module module!!, Type type!!)
{
- if (module == null)
- throw new ArgumentNullException(nameof(module));
-
- if (type == null)
- throw new ArgumentNullException(nameof(type));
-
return new SignatureHelper(module, type);
}
#endregion
@@ -308,8 +302,7 @@ private void AddOneArgTypeHelper(Type clsArgument, Type[]? requiredCustomModifie
{
Type t = requiredCustomModifiers[i];
- if (t == null)
- throw new ArgumentNullException(nameof(requiredCustomModifiers));
+ ArgumentNullException.ThrowIfNull(t, nameof(requiredCustomModifiers));
if (t.HasElementType)
throw new ArgumentException(SR.Argument_ArraysInvalid, nameof(requiredCustomModifiers));
@@ -746,11 +739,8 @@ public void AddArgument(Type clsArgument)
AddArgument(clsArgument, null, null);
}
- public void AddArgument(Type argument, bool pinned)
+ public void AddArgument(Type argument!!, bool pinned)
{
- if (argument == null)
- throw new ArgumentNullException(nameof(argument));
-
IncrementArgCounts();
AddOneArgTypeHelper(argument, pinned);
}
@@ -777,8 +767,7 @@ public void AddArgument(Type argument, Type[]? requiredCustomModifiers, Type[]?
if (m_sigDone)
throw new ArgumentException(SR.Argument_SigIsFinalized);
- if (argument == null)
- throw new ArgumentNullException(nameof(argument));
+ ArgumentNullException.ThrowIfNull(argument);
IncrementArgCounts();
diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/SymbolType.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/SymbolType.cs
index f714e5ebd59975..735956362086dd 100644
--- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/SymbolType.cs
+++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/SymbolType.cs
@@ -224,11 +224,8 @@ internal SymbolType(TypeKind typeKind)
#endregion
#region Internal Members
- internal void SetElementType(Type baseType)
+ internal void SetElementType(Type baseType!!)
{
- if (baseType is null)
- throw new ArgumentNullException(nameof(baseType));
-
m_baseType = baseType;
}
diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/TypeBuilder.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/TypeBuilder.cs
index ad80acad078350..0f353d383e0afb 100644
--- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/TypeBuilder.cs
+++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/TypeBuilder.cs
@@ -25,23 +25,14 @@ private sealed class CustAttr
private readonly byte[]? m_binaryAttribute;
private readonly CustomAttributeBuilder? m_customBuilder;
- public CustAttr(ConstructorInfo con, byte[] binaryAttribute)
+ public CustAttr(ConstructorInfo con!!, byte[] binaryAttribute!!)
{
- if (con is null)
- throw new ArgumentNullException(nameof(con));
-
- if (binaryAttribute is null)
- throw new ArgumentNullException(nameof(binaryAttribute));
-
m_con = con;
m_binaryAttribute = binaryAttribute;
}
- public CustAttr(CustomAttributeBuilder customBuilder)
+ public CustAttr(CustomAttributeBuilder customBuilder!!)
{
- if (customBuilder is null)
- throw new ArgumentNullException(nameof(customBuilder));
-
m_customBuilder = customBuilder;
}
@@ -509,11 +500,8 @@ internal TypeBuilder(
{
for (i = 0; i < interfaces.Length; i++)
{
- if (interfaces[i] == null)
- {
- // cannot contain null in the interface list
- throw new ArgumentNullException(nameof(interfaces));
- }
+ // cannot contain null in the interface list
+ ArgumentNullException.ThrowIfNull(interfaces[i], nameof(interfaces));
}
interfaceTokens = new int[interfaces.Length + 1];
for (i = 0; i < interfaces.Length; i++)
@@ -1120,8 +1108,7 @@ public override object[] GetCustomAttributes(Type attributeType, bool inherit)
if (!IsCreated())
throw new NotSupportedException(SR.NotSupported_TypeNotYetCreated);
- if (attributeType == null)
- throw new ArgumentNullException(nameof(attributeType));
+ ArgumentNullException.ThrowIfNull(attributeType);
if (attributeType.UnderlyingSystemType is not RuntimeType attributeRuntimeType)
throw new ArgumentException(SR.Arg_MustBeType, nameof(attributeType));
@@ -1134,8 +1121,7 @@ public override bool IsDefined(Type attributeType, bool inherit)
if (!IsCreated())
throw new NotSupportedException(SR.NotSupported_TypeNotYetCreated);
- if (attributeType == null)
- throw new ArgumentNullException(nameof(attributeType));
+ ArgumentNullException.ThrowIfNull(attributeType);
if (attributeType.UnderlyingSystemType is not RuntimeType attributeRuntimeType)
throw new ArgumentException(SR.Arg_MustBeType, nameof(attributeType));
@@ -1161,17 +1147,13 @@ internal void SetInterfaces(params Type[]? interfaces)
}
}
- public GenericTypeParameterBuilder[] DefineGenericParameters(params string[] names)
+ public GenericTypeParameterBuilder[] DefineGenericParameters(params string[] names!!)
{
- if (names == null)
- throw new ArgumentNullException(nameof(names));
-
if (names.Length == 0)
throw new ArgumentException(SR.Arg_EmptyArray, nameof(names));
for (int i = 0; i < names.Length; i++)
- if (names[i] == null)
- throw new ArgumentNullException(nameof(names));
+ ArgumentNullException.ThrowIfNull(names[i], nameof(names));
if (m_inst != null)
throw new InvalidOperationException();
@@ -1214,14 +1196,8 @@ public void DefineMethodOverride(MethodInfo methodInfoBody, MethodInfo methodInf
}
}
- private void DefineMethodOverrideNoLock(MethodInfo methodInfoBody, MethodInfo methodInfoDeclaration)
+ private void DefineMethodOverrideNoLock(MethodInfo methodInfoBody!!, MethodInfo methodInfoDeclaration!!)
{
- if (methodInfoBody == null)
- throw new ArgumentNullException(nameof(methodInfoBody));
-
- if (methodInfoDeclaration == null)
- throw new ArgumentNullException(nameof(methodInfoDeclaration));
-
ThrowIfCreated();
if (!ReferenceEquals(methodInfoBody.DeclaringType, this))
@@ -1700,11 +1676,8 @@ public FieldBuilder DefineInitializedData(string name, byte[] data, FieldAttribu
}
}
- private FieldBuilder DefineInitializedDataNoLock(string name, byte[] data, FieldAttributes attributes)
+ private FieldBuilder DefineInitializedDataNoLock(string name, byte[] data!!, FieldAttributes attributes)
{
- if (data == null)
- throw new ArgumentNullException(nameof(data));
-
// This method will define an initialized Data in .sdata.
// We will create a fake TypeDef to represent the data with size. This TypeDef
// will be the signature for the Field.
@@ -2096,13 +2069,8 @@ public void SetParent([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes
}
}
- public void AddInterfaceImplementation([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type interfaceType)
+ public void AddInterfaceImplementation([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type interfaceType!!)
{
- if (interfaceType == null)
- {
- throw new ArgumentNullException(nameof(interfaceType));
- }
-
AssemblyBuilder.CheckContext(interfaceType);
ThrowIfCreated();
@@ -2125,23 +2093,14 @@ internal int TypeToken
}
}
- public void SetCustomAttribute(ConstructorInfo con, byte[] binaryAttribute)
+ public void SetCustomAttribute(ConstructorInfo con!!, byte[] binaryAttribute!!)
{
- if (con == null)
- throw new ArgumentNullException(nameof(con));
-
- if (binaryAttribute == null)
- throw new ArgumentNullException(nameof(binaryAttribute));
-
DefineCustomAttribute(m_module, m_tdType, ((ModuleBuilder)m_module).GetConstructorToken(con),
binaryAttribute);
}
- public void SetCustomAttribute(CustomAttributeBuilder customBuilder)
+ public void SetCustomAttribute(CustomAttributeBuilder customBuilder!!)
{
- if (customBuilder == null)
- throw new ArgumentNullException(nameof(customBuilder));
-
customBuilder.CreateCustomAttribute((ModuleBuilder)m_module, m_tdType);
}
diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/TypeBuilderInstantiation.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/TypeBuilderInstantiation.cs
index 3f2cadc852e6af..4e195408633ece 100644
--- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/TypeBuilderInstantiation.cs
+++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/TypeBuilderInstantiation.cs
@@ -24,13 +24,11 @@ internal static Type MakeGenericType(Type type, Type[] typeArguments)
if (!type.IsGenericTypeDefinition)
throw new InvalidOperationException();
- if (typeArguments == null)
- throw new ArgumentNullException(nameof(typeArguments));
+ ArgumentNullException.ThrowIfNull(typeArguments);
foreach (Type t in typeArguments)
{
- if (t == null)
- throw new ArgumentNullException(nameof(typeArguments));
+ ArgumentNullException.ThrowIfNull(t, nameof(typeArguments));
}
return new TypeBuilderInstantiation(type, typeArguments);
diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/MemberInfo.Internal.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/MemberInfo.Internal.cs
index 7d5736ee88de11..fe79a0e8e7c83f 100644
--- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/MemberInfo.Internal.cs
+++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/MemberInfo.Internal.cs
@@ -7,11 +7,8 @@ public abstract partial class MemberInfo
{
internal virtual bool CacheEquals(object? o) { throw new NotImplementedException(); }
- internal bool HasSameMetadataDefinitionAsCore(MemberInfo other) where TOther : MemberInfo
+ internal bool HasSameMetadataDefinitionAsCore(MemberInfo other!!) where TOther : MemberInfo
{
- if (other is null)
- throw new ArgumentNullException(nameof(other));
-
// Ensure that "other" is a runtime-implemented MemberInfo. Do this check before calling any methods on it!
if (!(other is TOther))
return false;
diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Metadata/AssemblyExtensions.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Metadata/AssemblyExtensions.cs
index 332dd6301cde09..fa7385a02dfc66 100644
--- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Metadata/AssemblyExtensions.cs
+++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Metadata/AssemblyExtensions.cs
@@ -28,13 +28,8 @@ public static partial class AssemblyExtensions
/// The caller is responsible for keeping the assembly object alive while accessing the metadata blob.
///
[CLSCompliant(false)] // out byte* blob
- public static unsafe bool TryGetRawMetadata(this Assembly assembly, out byte* blob, out int length)
+ public static unsafe bool TryGetRawMetadata(this Assembly assembly!!, out byte* blob, out int length)
{
- if (assembly == null)
- {
- throw new ArgumentNullException(nameof(assembly));
- }
-
blob = null;
length = 0;
diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Metadata/MetadataUpdater.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Metadata/MetadataUpdater.cs
index 87366de57eb010..462df732af729c 100644
--- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Metadata/MetadataUpdater.cs
+++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Metadata/MetadataUpdater.cs
@@ -36,7 +36,7 @@ public static void ApplyUpdate(Assembly assembly, ReadOnlySpan metadataDel
{
if (assembly is not RuntimeAssembly runtimeAssembly)
{
- if (assembly is null) throw new ArgumentNullException(nameof(assembly));
+ ArgumentNullException.ThrowIfNull(assembly);
throw new ArgumentException(SR.Argument_MustBeRuntimeAssembly);
}
diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeAssembly.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeAssembly.cs
index 7eed453959c668..1b66fb3c8244c1 100644
--- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeAssembly.cs
+++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeAssembly.cs
@@ -88,12 +88,22 @@ public override string? CodeBase
{
get
{
- var codeBase = GetCodeBase();
+ if (IsDynamic)
+ {
+ throw new NotSupportedException(SR.NotSupported_DynamicAssembly);
+ }
+
+ string? codeBase = GetCodeBase();
if (codeBase is null)
{
- // Not supported if the assembly was loaded from memory
+ // Not supported if the assembly was loaded from single-file bundle.
throw new NotSupportedException(SR.NotSupported_CodeBase);
}
+ if (codeBase.Length == 0)
+ {
+ // For backward compatibility, return CoreLib codebase for assemblies loaded from memory.
+ codeBase = typeof(object).Assembly.CodeBase;
+ }
return codeBase;
}
}
@@ -174,12 +184,10 @@ private static partial void GetType(QCallAssembly assembly,
ObjectHandleOnStack assemblyLoadContext);
[RequiresUnreferencedCode("Types might be removed")]
- public override Type? GetType(string name, bool throwOnError, bool ignoreCase)
+ public override Type? GetType(
+ string name!!, // throw on null strings regardless of the value of "throwOnError"
+ bool throwOnError, bool ignoreCase)
{
- // throw on null strings regardless of the value of "throwOnError"
- if (name == null)
- throw new ArgumentNullException(nameof(name));
-
RuntimeType? type = null;
object? keepAlive = null;
AssemblyLoadContext? assemblyLoadContextStack = AssemblyLoadContext.CurrentContextualReflectionContext;
@@ -252,8 +260,8 @@ public override bool IsCollectible
// Load a resource based on the NameSpace of the type.
public override Stream? GetManifestResourceStream(Type type, string name)
{
- if (type == null && name == null)
- throw new ArgumentNullException(nameof(type));
+ if (name == null)
+ ArgumentNullException.ThrowIfNull(type);
string? nameSpace = type?.Namespace;
@@ -294,22 +302,16 @@ public override object[] GetCustomAttributes(bool inherit)
return CustomAttribute.GetCustomAttributes(this, (typeof(object) as RuntimeType)!);
}
- public override object[] GetCustomAttributes(Type attributeType, bool inherit)
+ public override object[] GetCustomAttributes(Type attributeType!!, bool inherit)
{
- if (attributeType == null)
- throw new ArgumentNullException(nameof(attributeType));
-
if (attributeType.UnderlyingSystemType is not RuntimeType attributeRuntimeType)
throw new ArgumentException(SR.Arg_MustBeType, nameof(attributeType));
return CustomAttribute.GetCustomAttributes(this, attributeRuntimeType);
}
- public override bool IsDefined(Type attributeType, bool inherit)
+ public override bool IsDefined(Type attributeType!!, bool inherit)
{
- if (attributeType == null)
- throw new ArgumentNullException(nameof(attributeType));
-
if (attributeType.UnderlyingSystemType is not RuntimeType attributeRuntimeType)
throw new ArgumentException(SR.Arg_MustBeType, nameof(attributeType));
@@ -566,11 +568,8 @@ public override Assembly GetSatelliteAssembly(CultureInfo culture)
}
// Useful for binding to a very specific version of a satellite assembly
- public override Assembly GetSatelliteAssembly(CultureInfo culture, Version? version)
+ public override Assembly GetSatelliteAssembly(CultureInfo culture!!, Version? version)
{
- if (culture == null)
- throw new ArgumentNullException(nameof(culture));
-
return InternalGetSatelliteAssembly(culture, version, throwOnFileNotFound: true)!;
}
diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeConstructorInfo.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeConstructorInfo.CoreCLR.cs
index 7f34d5438c6bea..267b738794a63a 100644
--- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeConstructorInfo.CoreCLR.cs
+++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeConstructorInfo.CoreCLR.cs
@@ -115,22 +115,16 @@ public override object[] GetCustomAttributes(bool inherit)
return CustomAttribute.GetCustomAttributes(this, (typeof(object) as RuntimeType)!);
}
- public override object[] GetCustomAttributes(Type attributeType, bool inherit)
+ public override object[] GetCustomAttributes(Type attributeType!!, bool inherit)
{
- if (attributeType == null)
- throw new ArgumentNullException(nameof(attributeType));
-
if (attributeType.UnderlyingSystemType is not RuntimeType attributeRuntimeType)
throw new ArgumentException(SR.Arg_MustBeType, nameof(attributeType));
return CustomAttribute.GetCustomAttributes(this, attributeRuntimeType);
}
- public override bool IsDefined(Type attributeType, bool inherit)
+ public override bool IsDefined(Type attributeType!!, bool inherit)
{
- if (attributeType == null)
- throw new ArgumentNullException(nameof(attributeType));
-
if (attributeType.UnderlyingSystemType is not RuntimeType attributeRuntimeType)
throw new ArgumentException(SR.Arg_MustBeType, nameof(attributeType));
diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeCustomAttributeData.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeCustomAttributeData.cs
index edf7aeb269c26b..9eecc089e72c40 100644
--- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeCustomAttributeData.cs
+++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeCustomAttributeData.cs
@@ -679,11 +679,8 @@ private static extern void ParseAttributeArguments(
internal static void ParseAttributeArguments(ConstArray attributeBlob,
ref CustomAttributeCtorParameter[] customAttributeCtorParameters,
ref CustomAttributeNamedParameter[] customAttributeNamedParameters,
- RuntimeModule customAttributeModule)
+ RuntimeModule customAttributeModule!!)
{
- if (customAttributeModule is null)
- throw new ArgumentNullException(nameof(customAttributeModule));
-
Debug.Assert(customAttributeCtorParameters is not null);
Debug.Assert(customAttributeNamedParameters is not null);
@@ -713,11 +710,8 @@ internal readonly struct CustomAttributeNamedParameter
private readonly CustomAttributeType m_type;
private readonly CustomAttributeEncodedArgument m_encodedArgument;
- public CustomAttributeNamedParameter(string argumentName, CustomAttributeEncoding fieldOrProperty, CustomAttributeType type)
+ public CustomAttributeNamedParameter(string argumentName!!, CustomAttributeEncoding fieldOrProperty, CustomAttributeType type)
{
- if (argumentName is null)
- throw new ArgumentNullException(nameof(argumentName));
-
m_argumentName = argumentName;
m_fieldOrProperty = fieldOrProperty;
m_padding = fieldOrProperty;
@@ -1873,12 +1867,6 @@ internal static bool IsDefined(RuntimeFieldInfo field, RuntimeType? caType)
}
type.GetRuntimeModule().MetadataImport.GetClassLayout(type.MetadataToken, out int pack, out int size);
- // Metadata parameter checking should not have allowed 0 for packing size.
- // The runtime later converts a packing size of 0 to 8 so do the same here
- // because it's more useful from a user perspective.
- if (pack == 0)
- pack = 8; // DEFAULT_PACKING_SIZE
-
StructLayoutAttribute attribute = new StructLayoutAttribute(layoutKind);
attribute.Pack = pack;
diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeEventInfo.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeEventInfo.cs
index 6abf767636e0dd..b0d5805804208c 100644
--- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeEventInfo.cs
+++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeEventInfo.cs
@@ -76,22 +76,16 @@ public override object[] GetCustomAttributes(bool inherit)
return CustomAttribute.GetCustomAttributes(this, (typeof(object) as RuntimeType)!);
}
- public override object[] GetCustomAttributes(Type attributeType, bool inherit)
+ public override object[] GetCustomAttributes(Type attributeType!!, bool inherit)
{
- if (attributeType == null)
- throw new ArgumentNullException(nameof(attributeType));
-
if (attributeType.UnderlyingSystemType is not RuntimeType attributeRuntimeType)
throw new ArgumentException(SR.Arg_MustBeType, nameof(attributeType));
return CustomAttribute.GetCustomAttributes(this, attributeRuntimeType);
}
- public override bool IsDefined(Type attributeType, bool inherit)
+ public override bool IsDefined(Type attributeType!!, bool inherit)
{
- if (attributeType == null)
- throw new ArgumentNullException(nameof(attributeType));
-
if (attributeType.UnderlyingSystemType is not RuntimeType attributeRuntimeType)
throw new ArgumentException(SR.Arg_MustBeType, nameof(attributeType));
diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeFieldInfo.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeFieldInfo.cs
index 10605ef5f533c1..d2ddb1f36091c1 100644
--- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeFieldInfo.cs
+++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeFieldInfo.cs
@@ -61,22 +61,16 @@ public override object[] GetCustomAttributes(bool inherit)
return CustomAttribute.GetCustomAttributes(this, (typeof(object) as RuntimeType)!);
}
- public override object[] GetCustomAttributes(Type attributeType, bool inherit)
+ public override object[] GetCustomAttributes(Type attributeType!!, bool inherit)
{
- if (attributeType == null)
- throw new ArgumentNullException(nameof(attributeType));
-
if (attributeType.UnderlyingSystemType is not RuntimeType attributeRuntimeType)
throw new ArgumentException(SR.Arg_MustBeType, nameof(attributeType));
return CustomAttribute.GetCustomAttributes(this, attributeRuntimeType);
}
- public override bool IsDefined(Type attributeType, bool inherit)
+ public override bool IsDefined(Type attributeType!!, bool inherit)
{
- if (attributeType == null)
- throw new ArgumentNullException(nameof(attributeType));
-
if (attributeType.UnderlyingSystemType is not RuntimeType attributeRuntimeType)
throw new ArgumentException(SR.Arg_MustBeType, nameof(attributeType));
diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeMethodInfo.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeMethodInfo.CoreCLR.cs
index 43984c60a5468d..2b26b90cb7770f 100644
--- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeMethodInfo.CoreCLR.cs
+++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeMethodInfo.CoreCLR.cs
@@ -205,22 +205,16 @@ public override object[] GetCustomAttributes(bool inherit)
return CustomAttribute.GetCustomAttributes(this, (typeof(object) as RuntimeType)!, inherit);
}
- public override object[] GetCustomAttributes(Type attributeType, bool inherit)
+ public override object[] GetCustomAttributes(Type attributeType!!, bool inherit)
{
- if (attributeType == null)
- throw new ArgumentNullException(nameof(attributeType));
-
if (attributeType.UnderlyingSystemType is not RuntimeType attributeRuntimeType)
throw new ArgumentException(SR.Arg_MustBeType, nameof(attributeType));
return CustomAttribute.GetCustomAttributes(this, attributeRuntimeType, inherit);
}
- public override bool IsDefined(Type attributeType, bool inherit)
+ public override bool IsDefined(Type attributeType!!, bool inherit)
{
- if (attributeType == null)
- throw new ArgumentNullException(nameof(attributeType));
-
if (attributeType.UnderlyingSystemType is not RuntimeType attributeRuntimeType)
throw new ArgumentException(SR.Arg_MustBeType, nameof(attributeType));
@@ -417,12 +411,9 @@ public override Delegate CreateDelegate(Type delegateType, object? target)
DelegateBindingFlags.RelaxedSignature);
}
- private Delegate CreateDelegateInternal(Type delegateType, object? firstArgument, DelegateBindingFlags bindingFlags)
+ private Delegate CreateDelegateInternal(Type delegateType!!, object? firstArgument, DelegateBindingFlags bindingFlags)
{
// Validate the parameters.
- if (delegateType == null)
- throw new ArgumentNullException(nameof(delegateType));
-
RuntimeType? rtType = delegateType as RuntimeType;
if (rtType == null)
throw new ArgumentException(SR.Argument_MustBeRuntimeType, nameof(delegateType));
@@ -443,11 +434,8 @@ private Delegate CreateDelegateInternal(Type delegateType, object? firstArgument
#region Generics
[RequiresUnreferencedCode("If some of the generic arguments are annotated (either with DynamicallyAccessedMembersAttribute, or generic constraints), trimming can't validate that the requirements of those annotations are met.")]
- public override MethodInfo MakeGenericMethod(params Type[] methodInstantiation)
+ public override MethodInfo MakeGenericMethod(params Type[] methodInstantiation!!)
{
- if (methodInstantiation == null)
- throw new ArgumentNullException(nameof(methodInstantiation));
-
RuntimeType[] methodInstantionRuntimeType = new RuntimeType[methodInstantiation.Length];
if (!IsGenericMethodDefinition)
@@ -457,9 +445,7 @@ public override MethodInfo MakeGenericMethod(params Type[] methodInstantiation)
for (int i = 0; i < methodInstantiation.Length; i++)
{
Type methodInstantiationElem = methodInstantiation[i];
-
- if (methodInstantiationElem == null)
- throw new ArgumentNullException();
+ ArgumentNullException.ThrowIfNull(methodInstantiationElem, null);
RuntimeType? rtMethodInstantiationElem = methodInstantiationElem as RuntimeType;
diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeModule.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeModule.cs
index e8b52d01d5e0da..4b5760f14c713e 100644
--- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeModule.cs
+++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeModule.cs
@@ -385,22 +385,16 @@ public override object[] GetCustomAttributes(bool inherit)
return CustomAttribute.GetCustomAttributes(this, (typeof(object) as RuntimeType)!);
}
- public override object[] GetCustomAttributes(Type attributeType, bool inherit)
+ public override object[] GetCustomAttributes(Type attributeType!!, bool inherit)
{
- if (attributeType == null)
- throw new ArgumentNullException(nameof(attributeType));
-
if (attributeType.UnderlyingSystemType is not RuntimeType attributeRuntimeType)
throw new ArgumentException(SR.Arg_MustBeType, nameof(attributeType));
return CustomAttribute.GetCustomAttributes(this, attributeRuntimeType);
}
- public override bool IsDefined(Type attributeType, bool inherit)
+ public override bool IsDefined(Type attributeType!!, bool inherit)
{
- if (attributeType == null)
- throw new ArgumentNullException(nameof(attributeType));
-
if (attributeType.UnderlyingSystemType is not RuntimeType attributeRuntimeType)
throw new ArgumentException(SR.Arg_MustBeType, nameof(attributeType));
@@ -420,12 +414,10 @@ public override void GetObjectData(SerializationInfo info, StreamingContext cont
}
[RequiresUnreferencedCode("Types might be removed")]
- public override Type? GetType(string className, bool throwOnError, bool ignoreCase)
+ public override Type? GetType(
+ string className!!, // throw on null strings regardless of the value of "throwOnError"
+ bool throwOnError, bool ignoreCase)
{
- // throw on null strings regardless of the value of "throwOnError"
- if (className == null)
- throw new ArgumentNullException(nameof(className));
-
RuntimeType? retType = null;
object? keepAlive = null;
RuntimeModule thisAsLocal = this;
@@ -483,15 +475,9 @@ public override FieldInfo[] GetFields(BindingFlags bindingFlags)
}
[RequiresUnreferencedCode("Fields might be removed")]
- public override FieldInfo? GetField(string name, BindingFlags bindingAttr)
+ public override FieldInfo? GetField(string name!!, BindingFlags bindingAttr)
{
- if (name == null)
- throw new ArgumentNullException(nameof(name));
-
- if (RuntimeType == null)
- return null;
-
- return RuntimeType.GetField(name, bindingAttr);
+ return RuntimeType?.GetField(name, bindingAttr);
}
[RequiresUnreferencedCode("Methods might be removed")]
diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeParameterInfo.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeParameterInfo.cs
index 173caf6855a0aa..33777c745dbfcb 100644
--- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeParameterInfo.cs
+++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeParameterInfo.cs
@@ -507,11 +507,8 @@ public override object[] GetCustomAttributes(bool inherit)
return CustomAttribute.GetCustomAttributes(this, (typeof(object) as RuntimeType)!);
}
- public override object[] GetCustomAttributes(Type attributeType, bool inherit)
+ public override object[] GetCustomAttributes(Type attributeType!!, bool inherit)
{
- if (attributeType == null)
- throw new ArgumentNullException(nameof(attributeType));
-
if (MdToken.IsNullToken(m_tkParamDef))
return Array.Empty