platform/upstream/dotnet/runtime.git
12 months ago[PERF] Use script instead of powershell to set DOTNET_ROOT (#89123)
Parker Bibus [Wed, 19 Jul 2023 17:02:22 +0000 (10:02 -0700)]
[PERF] Use script instead of powershell to set DOTNET_ROOT (#89123)

Use script for non-windows and powershell for windows.
Use the proper path separators for non-windows and windows.

12 months agoFix failures around blittable collections with [Out] and chars (#89149)
Jeremy Koritzinsky [Wed, 19 Jul 2023 16:49:18 +0000 (09:49 -0700)]
Fix failures around blittable collections with [Out] and chars (#89149)

12 months agoJIT: Ensure last-use copy omission candidates are marked with GTF_GLOB_REF (#89088)
Jakob Botsch Nielsen [Wed, 19 Jul 2023 16:24:18 +0000 (18:24 +0200)]
JIT: Ensure last-use copy omission candidates are marked with GTF_GLOB_REF (#89088)

Last-use copy omission allows the JIT to avoid creating copies of struct
values that are passed implicitly by-ref when the value is a last-use of
a local. When we do this we effectively address expose the
local for the lifetime of the call, so we mark the local as address
exposed as part of doing so.

However, there is a problem where morph may reorder two uses of a such a
local and break the last use information. For example, consider the
following case:

```
[000015] --CXG------      ▌  CALL      void   Program:Foo(int,int)
[000010] ----------- arg0 ├──▌  LCL_FLD   int    V00 loc0         [+0]
[000012] --CXG------ arg1 └──▌  CALL      int    Program:Bar(S):int
[000011] ----------- arg0    └──▌  LCL_VAR   struct<S, 32> V00 loc0          (last use)
```

V00 is used both at [000010] and at [000011], the latter as a last use.
Since we only address expose V00 when we get to [000011] we do not mark
[000010] with GTF_GLOB_REF; the net effect is the following call args
morphing, where we have reordered the two occurrences illegally:

```
[000015] --CXG+-----             ▌  CALL      void   Program:Foo(int,int)
[000037] DACXG------ arg1 setup  ├──▌  STORE_LCL_VAR int    V04 tmp3
[000012] --CXG+-----             │  └──▌  CALL      int    Program:Bar(S):int
[000011] -----+----- arg0 in rcx │     └──▌  LCL_ADDR  long   V00 loc0         [+0]
[000038] ----------- arg1 in rdx ├──▌  LCL_VAR   int    V04 tmp3
[000010] -----+----- arg0 in rcx └──▌  LCL_FLD   int   (AX) V00 loc0         [+0]
```

This change fixes the problem by running a separate pass over the IR
before morph to identify and address expose the candidates for last-use
copy omission. The net result is then the following correct IR:

```
[000015] --CXG+-----             ▌  CALL      void   Runtime_85611:Foo(int,int)
[000039] DA--G------ arg0 setup  ├──▌  STORE_LCL_VAR int    V05 tmp4
[000010] ----G+-----             │  └──▌  LCL_FLD   int   (AX) V00 loc0         [+0]
[000037] DACXG------ arg1 setup  ├──▌  STORE_LCL_VAR int    V04 tmp3
[000012] --CXG+-----             │  └──▌  CALL      int    Runtime_85611:Bar(Runtime_85611+S):int
[000011] ----G+----- arg0 in rcx │     └──▌  LCL_ADDR  long   V00 loc0         [+0]
[000038] ----------- arg1 in rdx ├──▌  LCL_VAR   int    V04 tmp3
[000040] ----------- arg0 in rcx └──▌  LCL_VAR   int    V05 tmp4
```

The pass has some TP impact but it is mitigated since we only need to
visit statements with GTF_CALL and since we can use the locals tree list
to prune which statements we visit.

Fix #85611

12 months agoAvoid generating internal static classes with constant names in Options Source gen...
Tarek Mahmoud Sayed [Wed, 19 Jul 2023 15:33:39 +0000 (08:33 -0700)]
Avoid generating internal static classes with constant names in Options Source gen (#89148)

12 months ago[wasm] Use source generator for results data json serialization (#89177)
Radek Doulik [Wed, 19 Jul 2023 13:26:54 +0000 (15:26 +0200)]
[wasm] Use source generator for results data json serialization (#89177)

This fixes problem with posting results, where we crashed with:

    MONO_WASM:    at System.Text.Json.ThrowHelper.ThrowInvalidOperationException_JsonSerializerOptionsNoTypeInfoResolverSpecified()
       at System.Text.Json.JsonSerializerOptions.MakeReadOnly()
       at System.Text.Json.JsonSerializerOptions.ConfigureForJsonSerializer()
       at System.Text.Json.JsonSerializer.GetTypeInfo(JsonSerializerOptions , Type )
       at System.Text.Json.JsonSerializer.GetTypeInfo[JsonResultsData](JsonSerializerOptions )
       at System.Text.Json.JsonSerializer.Serialize[JsonResultsData](JsonResultsData , JsonSerializerOptions )
       at Sample.Test.GetJsonResults()
       at Sample.Test.GetFullJsonResults()
       at Sample.Test.__Wrapper_GetFullJsonResults_234275758(JSMarshalerArgument* __arguments_buffer)
    ManagedError@http://localhost:8781/_framework/dotnet.runtime.js:3:29628
    vr@http://localhost:8781/_framework/dotnet.runtime.js:3:34757
    Ao@http://localhost:8781/_framework/dotnet.runtime.js:3:52015
    To/U</<@http://localhost:8781/_framework/dotnet.runtime.js:3:50790
    init@http://localhost:8781/main.js:118:19
    setTimeout handler*yieldBench/<@http://localhost:8781/main.js:129:49
    yieldBench@http://localhost:8781/main.js:129:16
    init@http://localhost:8781/main.js:108:45
    setTimeout handler*yieldBench/<@http://localhost:8781/main.js:129:49
    yieldBench@http://localhost:8781/main.js:129:16
    init@http://localhost:8781/main.js:108:45

12 months agoFix broken runtime tests build (second attempt) (#89176)
Viktor Hofer [Wed, 19 Jul 2023 12:39:12 +0000 (14:39 +0200)]
Fix broken runtime tests build (second attempt) (#89176)

* Fix broken runtime tests build (second attempt)

Continuation of https://github.com/dotnet/runtime/pull/89115

* Update build-test-job.yml

12 months agoFix outerloop tests in System.Formats.Tar (#89172)
Alexander Köplinger [Wed, 19 Jul 2023 12:01:05 +0000 (14:01 +0200)]
Fix outerloop tests in System.Formats.Tar (#89172)

The change from https://github.com/dotnet/runtime/pull/88280 caused an issue when discovering the test:

```
System.InvalidOperationException : An appropriate member 'ManualTestsEnabled' could not be found. The conditional method needs to be a static method, property, or field on the type System.Formats.Tar.Tests.ManualTestsAsync or any ancestor, of any visibility, accepting zero arguments, and having a return type of Boolean.
```

12 months agoRemove unnecessary closures from Logging{Scope}HttpMessageHandler.SendCoreAsync ...
Stephen Toub [Wed, 19 Jul 2023 11:18:41 +0000 (07:18 -0400)]
Remove unnecessary closures from Logging{Scope}HttpMessageHandler.SendCoreAsync (#89160)

* Avoid unnecessary closure in LoggingHttpMessageHandler.SendCoreAsync

* Remove unnecessary closure in LoggingScopeHttpMessageHandler.SendCoreAsync

12 months agoExpose `MarkStep.ScopeStack` (#89120)
Mike Voorhees [Wed, 19 Jul 2023 10:45:52 +0000 (06:45 -0400)]
Expose `MarkStep.ScopeStack` (#89120)

We need access to this during our mark step.

12 months agoFix ILVerifier holding files open (#89127)
Mike Voorhees [Wed, 19 Jul 2023 10:41:22 +0000 (06:41 -0400)]
Fix ILVerifier holding files open (#89127)

There were a couple things to fix

1) `PEReader` implements `IDisposable` and needs to be disposed.  Not least because it is managing the lifetime of the streams opened by `File.OpenRead` calls inside `ILVerifier`

2) In order to dispose of of the pereaders, add `IDisposable` to `ILVerifier` and add a `using` to the caller that creates a new instance.

(1) and (2) fix the issues with files being held open.

While looking at the code, I didn't see a reason why `TryLoadAssemblyFromFolder` couldn't check the `_assemblyCache` before creating a opening a new stream and creating a new pereader.  I don't think this was causing any issues.  It just seemed like a harmless just-in-case change.

12 months ago[libs][iOS] Unify `System.Linq.Expression.dll` build for all platforms (#88723)
Ivan Povazan [Wed, 19 Jul 2023 08:05:26 +0000 (10:05 +0200)]
[libs][iOS] Unify `System.Linq.Expression.dll` build for all platforms (#88723)

- Ship a single assembly for all platforms, and have better compatibility between our AOT engines
- Size of the shipped assembly for iOS-like platforms is increased by ~113Kb
- The fullAOT + UseInterpreter=true configurations with Mono are now interpreting Ref.Emit generated code instead of using Reflection
- To prevent size regressions with Mono https://github.com/xamarin/xamarin-macios/pull/18555 needs to be merged

12 months agoFix building the reproNative.vcxproj project (#89159)
Michal Strehovský [Wed, 19 Jul 2023 07:33:50 +0000 (16:33 +0900)]
Fix building the reproNative.vcxproj project (#89159)

This got broken in #74623.

12 months ago[mono][interp] Fix memory leaks for interpreted dynamic methods. (#88892)
Zoltan Varga [Wed, 19 Jul 2023 05:41:38 +0000 (01:41 -0400)]
[mono][interp] Fix memory leaks for interpreted dynamic methods. (#88892)

* [mono] Set the 'dynamic' flag on method builders on creation so a MonoDynamicMethod is allocated instead of a MonoMethodWrapper.

* [mono][interp] Fix memory leaks for interpreted dynamic methods.

* Add a mempool to MonoDynamicMethod.
* Modify the intepreter code to allocate from this mempool when
  interpreting dynamic methods.

12 months ago[mono] Register static rgctx trampolines in the JIT info tables. (#89142)
Zoltan Varga [Wed, 19 Jul 2023 05:41:17 +0000 (01:41 -0400)]
[mono] Register static rgctx trampolines in the JIT info tables. (#89142)

mini_init_delegate () needs to do a reverse lookup from address
to method, and its possible for the address to be a static rgctx
trampoline if the address is the result of mono_ldftn ().

Fixes https://github.com/dotnet/runtime/issues/89076.

12 months agoImprove JsonSourceGenerationOptionsAttribute xml documentation. (#89082)
Eirik Tsarpalis [Wed, 19 Jul 2023 04:11:21 +0000 (05:11 +0100)]
Improve JsonSourceGenerationOptionsAttribute xml documentation. (#89082)

12 months agoFix EqualsIgnoreCaseUtf8_Scalar (#89152)
Egor Bogatov [Wed, 19 Jul 2023 03:59:33 +0000 (05:59 +0200)]
Fix EqualsIgnoreCaseUtf8_Scalar (#89152)

* Fix EqualsIgnoreCaseUtf8_Scalar

* revert change

* Remove activeissue

12 months agoDisable the "casts between generated and built-in COM interop" analyzer when the...
Jeremy Koritzinsky [Wed, 19 Jul 2023 00:08:13 +0000 (17:08 -0700)]
Disable the "casts between generated and built-in COM interop" analyzer when the "enable interop between generated COM interop and built-in COM interop" feature is enabled. (#89125)

12 months agoFix binding logic for dictionaries with complex elements (#89117)
Layomi Akinrinade [Wed, 19 Jul 2023 00:05:20 +0000 (17:05 -0700)]
Fix binding logic for dictionaries with complex elements (#89117)

* Fix binding logic for dictionaries with complex elements

* Remove interace impls not relevant to test and causing issues

12 months agoAdd docs on using Bionic with NativeAOT (#88817)
Michal Strehovský [Wed, 19 Jul 2023 00:05:06 +0000 (09:05 +0900)]
Add docs on using Bionic with NativeAOT (#88817)

Resolves #87340.

12 months agoReact to HttpRequestError API changes (#89124)
Miha Zupan [Tue, 18 Jul 2023 23:45:39 +0000 (01:45 +0200)]
React to HttpRequestError API changes (#89124)

* React to HttpRequestError API changes

* Use InvalidResponse for net_http_invalid_response_multiple_status_codes

* Use HttpRequestError.Unknown for the rest

* Add simple tests for the HttpRequestError property

* Fix the inner exception being removed by mistake

12 months ago[main] Update dependencies from dotnet/icu dotnet/emsdk dotnet/hotreload-utils (...
dotnet-maestro[bot] [Tue, 18 Jul 2023 23:18:01 +0000 (18:18 -0500)]
[main] Update dependencies from dotnet/icu dotnet/emsdk dotnet/hotreload-utils (#89075)

* Update dependencies from https://github.com/dotnet/icu build 20230717.1

Microsoft.NETCore.Runtime.ICU.Transport
 From Version 8.0.0-preview.7.23360.1 -> To Version 8.0.0-preview.7.23367.1

* Update dependencies from https://github.com/dotnet/emsdk build 20230717.1

Microsoft.NET.Workload.Emscripten.Current.Manifest-8.0.100.Transport
 From Version 8.0.0-preview.7.23362.1 -> To Version 8.0.0-preview.7.23367.1

* Update dependencies from https://github.com/dotnet/hotreload-utils build 20230717.4

Microsoft.DotNet.HotReload.Utils.Generator.BuildTool
 From Version 8.0.0-alpha.0.23360.1 -> To Version 8.0.0-alpha.0.23367.4

---------

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
12 months agoImprove GC pause counter naming (#89052)
Andrew Au [Tue, 18 Jul 2023 23:04:16 +0000 (16:04 -0700)]
Improve GC pause counter naming (#89052)

12 months agoExpose the left-handed matrix creation APIs (#88930)
Tanner Gooding [Tue, 18 Jul 2023 22:44:06 +0000 (15:44 -0700)]
Expose the left-handed matrix creation APIs (#88930)

12 months ago[hot_reload] Check for added fields earlier in compute_class_bitmap (#89121)
Aleksey Kliger (λgeek) [Tue, 18 Jul 2023 22:33:52 +0000 (18:33 -0400)]
[hot_reload] Check for added fields earlier in compute_class_bitmap (#89121)

Added fields don't contribute to the class bitmap, and they also might not have their type resolved yet - move the "is from update" check before we need to access the field's type

Fixes #86172

* Add regression test

* [hot_reload] Check for added fields earlier in compute_class_bitmap and in mono_class_create_runtime_vtable

12 months agoImprove choice of IndexOfXx routine for some TryFindNextStartingPosition implementati...
Stephen Toub [Tue, 18 Jul 2023 21:38:16 +0000 (17:38 -0400)]
Improve choice of IndexOfXx routine for some TryFindNextStartingPosition implementations (#89099)

Earlier in .NET 8, we updated the Regex compiler and source generator to be able to vectorize a search for any set, not just simple ones.  When one of the main routines couldn't be used, we emit a specialized IndexOfAny helper that uses SearchValues to search for any matching ASCII character or a Unicode character, and if it encounters a Unicode character, it falls back to a linear scan.  This meant that a bunch of sets that wouldn't previously have taken these paths now do, but some of those sets have more efficient means of searching; for example, for the set `[^aA]` that searches case-insensitive for anything other than an 'A', with these scheme we'll emit a whole routine that uses SearchValues with a fallback, but we could just use IndexOfAnyExcept('A', 'a').  This fixes the compiler / source generator to prefer such helpers instead when available.

12 months agoLight up Ascii.Equality.Equals and Ascii.Equality.EqualsIgnoreCase with Vector512...
Khushal Modi [Tue, 18 Jul 2023 21:18:10 +0000 (14:18 -0700)]
Light up Ascii.Equality.Equals and Ascii.Equality.EqualsIgnoreCase with Vector512 code path (#88650)

* merging with main
Enabling AVX512 for ASCII.Equals

* Correcting defects in the new Equals for AVX512 case

* Correcting defects

* Upgrading ASCII.Equality.EqualsIgnoreCase

* Using intrinsics in AllCharsInVectorAreAscii

* Using intrinsics in AllCharsInVectorAreAscii

* Removing check for AVX512F and adding a check for Vector512 because the library is not using any functions from AVX512F

* Removing check for CompExactlyDependsOn(AVX512F) from AllCharsInVectorAreAscii for Vector 512. Also checking for Vector512 support and not AVX512F in ASCIIEquality.Equals

* Correcting the Tloader.Count512 for ushort

* resolving merge errors

* Adding TLoader method for Vector512 for EqualAndAscii

* Updating Load512 for WideningLoader for performance increase

* addressing review comments

* Addressing review changes. Changing Widen to WidenLower for Load512

12 months agoOpenSSL ENGINE support (#88656)
Krzysztof Wicher [Tue, 18 Jul 2023 20:29:49 +0000 (22:29 +0200)]
OpenSSL ENGINE support (#88656)

* OpenSSL ENGINE support

* Remove trailing spaces on README file

* Address PR feedback

* Test for PNSE and run tests on all platforms supporting OSSL

* Update IsOpenSslSupported

* s/IsOpenSslSupported/OpenSslPresentOnSystem

* Fix OpenSslNotPresentOnSystem on Windows

* Add preventive OpenSslIsAvailable check for better error handling

12 months agoAdd opt-in support for GeneratedComInterface/ComImport RCW interop (#87583)
Jeremy Koritzinsky [Tue, 18 Jul 2023 20:27:37 +0000 (13:27 -0700)]
Add opt-in support for GeneratedComInterface/ComImport RCW interop (#87583)

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
12 months ago[mono] Align HOST_TVOS/TARGET_TVOS defines with the rest of the repo (#89085)
Alexander Köplinger [Tue, 18 Jul 2023 20:04:55 +0000 (22:04 +0200)]
[mono] Align HOST_TVOS/TARGET_TVOS defines with the rest of the repo (#89085)

In the mono build we've been setting HOST_IOS/TARGET_IOS when targeting tvOS which differs from the other runtime repo build systems and caused confusion. This aligns the defines so we only set the iOS ones on iOS and not on tvOS.

Also removes mono_dl_get_system_dir() since it was not actually used.

12 months agoReenable a test on iOS/tvOS/Browser that was disabled (#89083)
Alexander Köplinger [Tue, 18 Jul 2023 20:04:37 +0000 (22:04 +0200)]
Reenable a test on iOS/tvOS/Browser that was disabled (#89083)

12 months agoAdd more details in PlatformNotSupportedException (#89112)
Marie Píchová [Tue, 18 Jul 2023 19:32:36 +0000 (21:32 +0200)]
Add more details in PlatformNotSupportedException (#89112)

12 months agoJSON: Add support for Int128, UInt128 and Half (#88962)
David Cantú [Tue, 18 Jul 2023 19:29:40 +0000 (14:29 -0500)]
JSON: Add support for Int128, UInt128 and Half (#88962)

* JSON: Add support for Int128, UInt128 and Half and add Number support for Utf8JsonReader.CopyString(...)

* Remove parsing limits on Read and move Number support of CopyString to an internal helper

* Fix AllowNamedFloatingPointLiterals on Write for Half

* Specify InvariantCulture on TryParse and TryFormat
Fix handling of floating-point literals on HalfConverter
Remove CopyString tests related to Number support

* Add test for invalid number input format

* Fix net6.0 build error about missing Half.TryParse overload

* Move rentedCharBuffer logic to TryParse helper

* Address feedback

* Disable test for OSX

12 months agoUse Span.CopyTo(Span) in BigInteger's add and subtract (#83951), fixes #83457
Alexander Speshilov [Tue, 18 Jul 2023 19:20:19 +0000 (22:20 +0300)]
Use Span.CopyTo(Span) in BigInteger's add and subtract (#83951), fixes #83457

* Use Span.CopyTo(Span) in BigInteger's add and subtract

In BigIntegerCalculator methods Add and Subtract, if sizes of arguments
differ, after processing the part of size of the right (small) argument,
there was loop of add/sub carry value. When the carry value once become
zero, in fact the rest of the larger argument can be copied to the result.

With this commit the second loop is interrupted when carry become zero
and applies fast Span.CopyTo(Span) to the rest part.

This optimization applied only when size of the greatest argument is more
or equal to const CopyToThreshold introduced in this commit. This const
is 8 now.
See #83457 for details.

Co-authored-by: Adam Sitnik <adam.sitnik@gmail.com>
12 months agoFix broken runtime tests build (#89115)
Viktor Hofer [Tue, 18 Jul 2023 18:51:43 +0000 (20:51 +0200)]
Fix broken runtime tests build (#89115)

* Fix broken runtime tests build

Follow-up on https://github.com/dotnet/runtime/pull/89005

* Update build-test-job.yml

* Update sfx-ref.proj

12 months agoEnable SxS workload manifests (#88781)
Jacques Eloff [Tue, 18 Jul 2023 18:47:28 +0000 (11:47 -0700)]
Enable SxS workload manifests (#88781)

12 months agoDisable reflection in source gen tests and fix AOT testing. (#89105)
Eirik Tsarpalis [Tue, 18 Jul 2023 18:36:18 +0000 (19:36 +0100)]
Disable reflection in source gen tests and fix AOT testing. (#89105)

12 months ago[Android] Use NDK toolchain instead of CMake for library mode (#88886)
Steve Pfister [Tue, 18 Jul 2023 18:23:15 +0000 (11:23 -0700)]
[Android] Use NDK toolchain instead of CMake for library mode (#88886)

This change switches from relying on CMake to clang directly for Android library mode. The intent is to keep the number of build dependencies to a minimum.

12 months agoFixing concurrency issue in ManagedWebSocket where calling Dispose could corrupt...
Ivan Zlatanov [Tue, 18 Jul 2023 17:46:59 +0000 (20:46 +0300)]
Fixing concurrency issue in ManagedWebSocket where calling Dispose could corrupt state if there is pending send or receive operation and compression is enabled. (#87966)

12 months agoMark final types as exact (#88163)
Michał Petryka [Tue, 18 Jul 2023 17:46:32 +0000 (19:46 +0200)]
Mark final types as exact (#88163)

Co-authored-by: Andy Ayers <andya@microsoft.com>
12 months agoFold BOX+ISINST to null if possible (#88989)
Egor Bogatov [Tue, 18 Jul 2023 17:30:48 +0000 (19:30 +0200)]
Fold BOX+ISINST to null if possible (#88989)

12 months agoEnable Nullable compilation on the Options source gen (#88973)
Tarek Mahmoud Sayed [Tue, 18 Jul 2023 17:26:56 +0000 (10:26 -0700)]
Enable Nullable compilation on the Options source gen (#88973)

Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
12 months agoFix FailedRequests_ConnectionClosedWhileReceivingHeaders_Recorded (#89047)
Anton Firszov [Tue, 18 Jul 2023 17:10:00 +0000 (19:10 +0200)]
Fix FailedRequests_ConnectionClosedWhileReceivingHeaders_Recorded (#89047)

12 months agoFix treating dotnet.wasm or dotnet.native.wasm as native asset (#89079)
Marek Fišera [Tue, 18 Jul 2023 17:02:16 +0000 (19:02 +0200)]
Fix treating dotnet.wasm or dotnet.native.wasm as native asset (#89079)

12 months agounroll byref struct copies (#86820)
Mark Plesko [Tue, 18 Jul 2023 16:57:26 +0000 (09:57 -0700)]
unroll byref struct copies (#86820)

If a struct contains a byref, then it is known to be on the stack/regs (not in the heap), so GC write barriers are not required.  This adds that case to lower*.cpp and attempts to make the code more similar.  I didn't actually factor them (especially with a few subtle differences such as the call to `getUnrollThreshold`).

This partially handles #80086.  It improves the code for common cases, but since the strategy is not always used, the correctness issue in it is not completely handled.  Next step is to apply the fix for that and see how bad the regressions are; this change will reduce the impact.

Example:

``` C#
static Span<int> Copy1(Span<int> s) => s;
```
``` asm
G_M44162_IG01:  ;; offset=0000H
       vzeroupper
;; size=3 bbWeight=1 PerfScore 1.00
G_M44162_IG02:  ;; offset=0003H
       vmovdqu  xmm0, xmmword ptr [rdx]
       vmovdqu  xmmword ptr [rcx], xmm0
;; size=8 bbWeight=1 PerfScore 6.00
G_M44162_IG03:  ;; offset=000BH
       mov      rax, rcx
;; size=3 bbWeight=1 PerfScore 0.25
G_M44162_IG04:  ;; offset=000EH
       ret
;; size=1 bbWeight=1 PerfScore 1.00

; Total bytes of code 15, prolog size 3, PerfScore 9.75, instruction count 5, allocated bytes for code 15 (MethodHash=4d5b537d) for method
```

Platform      | Overall | MinOpts | FullOpts
--------------|---------|---------|---------
linux arm64   |  -5,232 |  -3,260 |   -1,972
linux x64     |  -1,142 |    -750 |     -392
osx arm64     |  -5,732 |  -3,276 |   -2,456
windows arm64 |  -4,416 |  -2,580 |   -1,836
windows x64   |  -8,993 |  -5,772 |   -3,221
linux arm     | -13,518 |  -9,530 |   -3,988
windows x86   |       0 |       0 |        0

12 months agoUpdate script to replace the BDN version being used in the PerfBDN app to the same...
Parker Bibus [Tue, 18 Jul 2023 16:51:03 +0000 (09:51 -0700)]
Update script to replace the BDN version being used in the PerfBDN app to the same version we use for all BDN tests and in BDN extensions. (#89057)

12 months agoUpdate dependencies from https://github.com/dotnet/roslyn build 20230716.1 (#89077)
dotnet-maestro[bot] [Tue, 18 Jul 2023 16:12:30 +0000 (11:12 -0500)]
Update dependencies from https://github.com/dotnet/roslyn build 20230716.1 (#89077)

Microsoft.CodeAnalysis , Microsoft.CodeAnalysis.CSharp , Microsoft.Net.Compilers.Toolset
 From Version 4.7.0-3.23361.9 -> To Version 4.7.0-3.23366.1

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
12 months agoBump semver from 7.3.7 to 7.5.4 in /src/mono/sample/wasm/node-webpack (#88833)
dependabot[bot] [Tue, 18 Jul 2023 16:00:44 +0000 (12:00 -0400)]
Bump semver from 7.3.7 to 7.5.4 in /src/mono/sample/wasm/node-webpack (#88833)

Bumps [semver](https://github.com/npm/node-semver) from 7.3.7 to 7.5.4.
- [Release notes](https://github.com/npm/node-semver/releases)
- [Changelog](https://github.com/npm/node-semver/blob/main/CHANGELOG.md)
- [Commits](https://github.com/npm/node-semver/compare/v7.3.7...v7.5.4)

---
updated-dependencies:
- dependency-name: semver
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
12 months ago[wasm] Fix perf pipeline (#89091)
Ankit Jain [Tue, 18 Jul 2023 15:47:12 +0000 (11:47 -0400)]
[wasm] Fix perf pipeline (#89091)

Passing arguments to bdn as `"--wasmArgs=--expose_wasm --module"` broke
with the latest update. Now this gets incorrectly parsed. Instead, what
works is: `--wasmArgs "--expose_wasm --module"`.

12 months agoBuild the shim assemblies as part of libs.sfx (#89005)
Viktor Hofer [Tue, 18 Jul 2023 15:24:35 +0000 (17:24 +0200)]
Build the shim assemblies as part of libs.sfx (#89005)

* Build the shim assemblies as part of libs.sfx

The shims build was intentionally kept out of the libs.sfx subset as
some shims reference out-of-band assemblies that also need to be built.

Since that change was made, the shim assemblies now don't reference all out-of-band
assemblies by default anymore and instead use fine grained dependencies.
Because of that, the number of out-of-band projects referenced and built
as part of the shims build is much smaller (~10 projects).

This fixes issues with ouf-of-band source generators not being able to
target the live targeting pack. These source generators need the shims
(more precisely the netstandard.dll shims) as some of the referenced
Microsoft.CodeAnalysis packages don't provide a .NETCoreApp assembly.

* Add fake assemblies for out-of-band type forward destinations

* Fix issues with nested classes and wrong type destinations

* Disable binplacing

* Make stubs private

* Disable symbols for stubs

* Add build protection to validate API compatibility of shims

12 months ago[workloads] Add linux-arm64 support for wasm and wasi (#89068)
Steve Pfister [Tue, 18 Jul 2023 15:06:19 +0000 (08:06 -0700)]
[workloads] Add linux-arm64 support for wasm and wasi (#89068)

Since https://github.com/dotnet/emsdk/pull/343, we are now able to support native linux-arm64 on wasm. This change adds linux-arm64 to wasm-tools and wasi-experimental workloads.

12 months agoRestructure NegotiateAuthentication implementation (#87930)
Filip Navara [Tue, 18 Jul 2023 14:02:49 +0000 (16:02 +0200)]
Restructure NegotiateAuthentication implementation (#87930)

* Change NegotiateAuthentication implementation to use indirection through NegotiateAuthenticationPal to the actual implementation.

The PAL implementation are merged from different sources to follow the same structure:
- NTAuthentication.Managed.cs -> NegotiateAuthenticationPal.Managed.cs
- NTAuthentication.Common.cs + NegotiateStreamPal.Windows.cs -> NegotiateAuthenticationPal.Windows.cs
- NTAuthentication.Common.cs + NegotiateStreamPal.Unix.cs -> NegotiateAuthenticationPal.Unix.cs

This split allows to delete ContextFlagsPal, SafeDeleteNegoContext, and SafeFreeNegoCredentials abstractions that were used in NegotiateStreamPal.

* Unify impersonation level validation between Windows and Unix pllatforms

* Split managed NTLM and managed SPNEGO implementations; add UseManagedNtlm switch on Unix platforms

* Remove debug cruft

* Fix couple of errors in managed SPNEGO

* Remove debug print

* Fix message sequence in managed NTLM; remove unused method

* Fix fallbacks on macOS GSSAPI

* Cleanup and fallbacks for missing NTLM, GSSAPI

* Adjust tests to assume that NTLM is always available on Unix

* Don't claim NTLM support on Browser

* Revert "Don't claim NTLM support on Browser"

This reverts commit 87d0c56f67a5269d9b334ab17887338ac4cfe49b.

* Attempt to fix the browser tests

* Revert "Attempt to fix the browser tests"

This reverts commit 91d7ce289a7274b682803b1d5dfdf418a5c2120c.

* Browser test suppression

* Respect UseManagedNtlm=false on platforms without NTLM GSSAPI provider

* Update src/libraries/System.Net.Security/src/System/Net/NegotiateAuthenticationPal.Unix.cs

* Revert all the fallback code paths, System.Net.Security.UseManagedNtlm has to be enabled explicitly; NativeAOT on Linux Bionic does that by default because it doesn't have GSSAPI and native shim

12 months agoDisable GCStress for Deserialize due to 88618 (#89072)
Mark Plesko [Tue, 18 Jul 2023 13:43:24 +0000 (06:43 -0700)]
Disable GCStress for Deserialize due to 88618 (#89072)

12 months agoAnnotate Trace.Assert/Fail with [DoesNotReturn{If}] (#89066)
Stephen Toub [Tue, 18 Jul 2023 13:38:21 +0000 (09:38 -0400)]
Annotate Trace.Assert/Fail with [DoesNotReturn{If}] (#89066)

As with Debug.Assert/Fail, by default failures result in fail fasts.  It's possible for other trace listeners to be plugged in instead, but there's no way to model that with nullable reference types.  There's no reason Trace should be on a different plan from Debug, so this moves it to having the same annotations Debug has had for years.

12 months agoImplement HttpRequestError (#88974)
Anton Firszov [Tue, 18 Jul 2023 13:30:47 +0000 (15:30 +0200)]
Implement HttpRequestError (#88974)

Fixes #76644, fixes #82168.

12 months ago[aot] Build cross compilers targeting x64/x86 hosted on arm64 (#89027)
Aleksey Kliger (λgeek) [Tue, 18 Jul 2023 13:22:12 +0000 (09:22 -0400)]
[aot] Build cross compilers targeting x64/x86 hosted on arm64 (#89027)

This PR allows an `osx-arm64` or `osx-x64` machine to produce a `mono-aot-cross` compiler that will run on the following host and create AOT images for the following targets:

| Host | Target | Test App runs |
|--------|--------|--------|
| osx-arm64 | iossimulator-x64 | ✅  |
| osx-arm64 | android-x64 | ✅   |
| osx-arm64 | android-x86 | ✅  - depends on a hack for https://github.com/dotnet/runtime/issues/89039 |

Additionally a `linux-x64` or `linux-arm64` machine can build a `mono-aot-cross` compiler for these host/target pairs:

| Host | Target | Test App runs |
|--------|--------|--------|
| linux-arm64 | android-x64 | :question: |
| linux-arm64 | linux_musl-x64 | :question: |
| linux-arm64 | android-x86 | :question: |

Related to https://github.com/dotnet/runtime/issues/82495

* [aot][ios] Build cross-compilers targeting x64 hosted on arm64

* Use MONO_CROSS_COMPILE instead of host checks

* [android][x86] Build mono-aot-cross hosted on osx-arm64 targeting android-x86

* fix build of mono-aot-cross hosted on linux-arm64 targeting android-x64

* runtime pipeline changes to build arm64 artifacts on x64 hardware

* Fix linux_musl-arm64 builds

---------

Co-authored-by: Jo Shields <directhex@apebox.org>
12 months agoDedup OnWriteResume between {ReadOnly}Memory converters (#89049)
Stephen Toub [Tue, 18 Jul 2023 11:24:19 +0000 (07:24 -0400)]
Dedup OnWriteResume between {ReadOnly}Memory converters (#89049)

12 months agoExtend SocketsHttpHandler Connection and Request telemetry (#88853)
Anton Firszov [Tue, 18 Jul 2023 11:03:39 +0000 (13:03 +0200)]
Extend SocketsHttpHandler Connection and Request telemetry (#88853)

Fixes #63159, fixes #85729.

12 months agoAdd NativeAOT runtime pack builds for osx x64/arm64 (#89018)
Alexander Köplinger [Tue, 18 Jul 2023 10:59:36 +0000 (12:59 +0200)]
Add NativeAOT runtime pack builds for osx x64/arm64 (#89018)

12 months ago[RISC-V][JIT] Fix DevDiv_718151 test (#88404)
Dong-Heon Jung [Tue, 18 Jul 2023 09:59:03 +0000 (18:59 +0900)]
[RISC-V][JIT] Fix DevDiv_718151 test (#88404)

* [RISC-V][JIT] Fix DevDiv_718151 test

* Remove HFA check on RISC-V

* [RISC-V][JIT] Update

- Update PUTARG_SPLIT
- Remove converting in PUTARG_STK

12 months agoRevert "Fix binding logic for dictionaries with complex elements (#89045)" (#89071)
Viktor Hofer [Tue, 18 Jul 2023 09:54:30 +0000 (11:54 +0200)]
Revert "Fix binding logic for dictionaries with complex elements (#89045)" (#89071)

This reverts commit 9fedcc558e8496424ee6af9fd3062c27ea3fd6e7.

12 months agoImprove text for OpenSsl primitives when OpenSSL is not available (#89046)
Kevin Jones [Tue, 18 Jul 2023 09:23:54 +0000 (05:23 -0400)]
Improve text for OpenSsl primitives when OpenSSL is not available (#89046)

* Improve text for OpenSsl primitives when OpenSSL is not available

* Update src/libraries/System.Security.Cryptography/src/Resources/Strings.resx

Co-authored-by: Stephen Toub <stoub@microsoft.com>
---------

Co-authored-by: Stephen Toub <stoub@microsoft.com>
12 months agoAdd switch: Do not resolve URLs by defaults for XML (#84169)
Krzysztof Wicher [Tue, 18 Jul 2023 09:13:18 +0000 (11:13 +0200)]
Add switch: Do not resolve URLs by defaults for XML (#84169)

* Add switch: Do not resolve URLs by defaults for XML

* feedback, test

* rename switch per API review

* Apply missed feedback, fix test failure

* Fix typo in IgnoreEmptyKeySequences

Co-authored-by: David Cantú <dacantu@microsoft.com>
* Update src/libraries/System.Private.Xml/tests/TrimmingTests/XmlUrlResolverDefaults.IsNetworkingEnabledByDefault.cs

Co-authored-by: David Cantú <dacantu@microsoft.com>
---------

Co-authored-by: David Cantú <dacantu@microsoft.com>
12 months agoImplement support for `UnsafeAccessor` in the trimmer (#88268)
Vitek Karas [Tue, 18 Jul 2023 07:33:40 +0000 (00:33 -0700)]
Implement support for `UnsafeAccessor` in the trimmer (#88268)

The core of the change is that `UnsafeAccessor` creates a code dependency from the accessor method to the target specified by the attribute. The trimmer needs to follow this dependency and preserve the target. Additionally, because the trimmer operates at the IL level, it needs to make sure that the target will keep its name and some other properties intact (so that the runtime implementation of the `UnsafeAccessor` can still work).

Implementation choices:
* The trimmer will mark the target as "accessed via reflection", this is a simple way to make sure that name and other properties about the target are preserved. This could be optimized in the future, but the savings are probably not that interesting.
* The implementation ran into a problem when trying to precisely match the signature overload resolution. Due to Cecil issues and the fact that Cecil's resolution algorithm is not extensible, it was not possible to match the runtime's behavior without adding lot more complexity (currently it seems we would have to reimplement method resolution in the trimmer). So, to simplify the implementation, trimmer will mark all methods of a given name. This means it will mark more than necessary. This is fixable by adding more complexity to the code base if we think there's a good reason for it.
* Due to the above choices, there are some behavioral differences:
  * Trimmer will warn if the target has data flow annotations, always. There's no way to "fix" this in the code without a suppression.
  * Trimmer will produce different warning codes even if there is a true data flow mismatch - this is because it treats the access as "reflection access" which produces different warning codes from direct access.
  * These differences are fixable, but it was not deemed necessary right now.
* We decided that analyzer will not react to the attribute at all, and thus will not produce any diagnostics around it.

The guiding reason to keep the implementation simple is that we don't expect the unsafe accessor to be used by developers directly, instead we assume that vast majority of its usages will be from source generators. So, developer UX is not as important.

Test changes:
* Adds directed tests for the marking behavior
* Adds tests to verify that `Requires*` attributes behave correctly
* Adds tests to verify that data flow annotations behave as expected (described above)
* The tests are effectively a second validation of the NativeAOT implementation as they cover NativeAOT as well.

Fixes in CoreCLR/NativeAOT:
This change fixes one bug in the CoreCLR/NativeAOT implementation, unsafe accessor on a instance method of a value type must use "by-ref" parameter for the `this` parameter. Without the "by-ref" the accessor is considered invalid and will throw.
This change also adds some tests to the CoreCLR/NativeAOT test suite.

Part of https://github.com/dotnet/runtime/issues/86161.
Related to https://github.com/dotnet/runtime/issues/86438.
Feature design in https://github.com/dotnet/runtime/issues/81741.

12 months agoLocalized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 222410...
dotnet bot [Tue, 18 Jul 2023 06:39:28 +0000 (08:39 +0200)]
Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 2224107 (#89058)

* Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 2223937

* Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 2223937

12 months agoAddress Sanitizer support in CoreCLR (#74623)
Jeremy Koritzinsky [Tue, 18 Jul 2023 03:32:03 +0000 (20:32 -0700)]
Address Sanitizer support in CoreCLR (#74623)

* Enable AddressSanitizer in CoreCLR, Libs, and Host and update runtime-sanitized to run tests with ASAN on Linux and Mac

* Unify on HAS_ADDRESS_SANITIZER define name

Centralize setting up sanitizer flags.

Remove last usage of CLR_CMAKE_ENABLE_ASAN outside of eng/native

Remove unnecessary diffs

Use the cpuid intrinsic and enable ASAN on InitJitHelpers1.

Add comments for the places where we have ASAN disabled

Undo changes to src/coreclr/jit/CMakeLists.txt

Add docs and fix the docs in the build script.

Add docs for the SkipVCEnvInit hook

* Remove CRT runtime changes. We won't need this when we finally onboard to Windows with some changes they have coming down the pipeline, so remove them for now to reduce the diff of this PR.

* Remove suppression now that we've fixed the underlying issue.

* Remove some Windows-only sanitizer CMake that we won't need when ASAN is ready for us to consume on Windows.

* Set schedule for runtime-sanitized pipeline

* Remove workaround in JIT memory set/copy helpers now that the JIT bug has been fixed.

* Add missing helix queues setup template.

* Fix missing command to build nativeaot runtime tests as nativeaot.

* Add a scenario name to trigger the extended timeout in the libraries test helix configuration.

* Remove extraneous whitespace.

* Fix using the cross-targetting ILC when sanitizers are enabled. Also pass through our TargetOS and TargetArchitecture variables to the publish command for our native sanitizers targets to correctly do their extra logic.

* Disable LSAN on the CustomMain test.

* Disable some tests on sanitized runtimes.

* Copy the sanitizer runtime for OSX NativeAOT runtime tests.

* A little cleanup to try to get the build right now that we are always doing cross-builds on Linux.

* Fix crossgen-corelib.proj syntax.

* Fix cross-os dac builds to not include the host architecture in the output path.

* Split the debugger components into a separate component and make the "unsanitized cross components" build into an "unsanitized debugger components" build as it can't be part of the regular cross-components build

* Always write out the host-arch path on Windows and update the cross-dac build script to expect that.

* Change to use the dynamic runtime on Windows, as ASAN in VS is moving to a dynamic-only model.

* Update docker images to include the sanitizer runtimes in the crossrootfs images.

* Fix explicit image tags

* The unsanitized build should be of the target architecture, not the host architecture. As a result, we still need a cross-arch build for the cross-arch use cases when sanitized, as well as an unsanitized target arch build for the debugger tools.

* Turn off using the sigaltstack for NativeAOT tests that don't use the asansupport.cpp default options

* Make sure the shared ASAN runtime is present for the nativeaot/SmokeTests/SharedLibrary test.

* Disable crossgen2 tests with sanitizers as they don't get us interesting coverage.

* Fix custom default options and disable some more crossgen2-based tests.

* Simplify lookup of asan runtime on mac and fix copying the shared runtime for the SharedLibrary NativeAOT test.

* Disable test that's failing for weird reasons.

* Fix one more alloc-dealloc mismatch that only started to show up after test merging increased allocations in the runtime

* Disable the System.Text.Json test suite on sanitized builds as it causes SO failures on Mac

* Fix test exclusion

* PR feedback.

* Fix mac build

* Do review changes

* Add libbootstrapper object files to the platform manifest now that NativeAOT has

* Disable tests that check size on sanitized builds

* Use the built-in `include_guard` option

* Disable use-after-return checking in ASAN. CoreCLR doesn't do well with parallel stacks.

* Only pass the no UAR flag on C and CXX with Clang (not AppleClang).

12 months ago[mini] Enter GC Unsafe mode in handle_signal_exception (#88436)
Aleksey Kliger (λgeek) [Tue, 18 Jul 2023 03:16:21 +0000 (23:16 -0400)]
[mini] Enter GC Unsafe mode in handle_signal_exception (#88436)

When the runtime needs to turn some kinds of signals into managed
exceptions (for example: SIGINT turns into
`new ExecutionEngineException ("Interrupted (SIGINT)")`, and some
SIGFPE turn into `DivideByZeroException`, and some SIGSEGV turn into a
`NullReferenceException`) instead of unwinding the stack from inside a
signal handler it instead adjusts the normal stack so that when the
signal handler returns, execution will resume in
`handle_signal_exception`.

That means that if the runtime was in GC Safe mode when the signal
was raised, even if the signal handler code transitions to GC Unsafe
mode, by the time the `handle_signal_exception` runs, we will have
undone the GC Unsafe transition and will be back in GC Safe.

That means if the code in `handle_signal_exception` (notably
`mono_handle_exception`) calls anything that tries to do a transition
to GC Safe, we may get an assertion.

Fixes https://github.com/dotnet/runtime/issues/88405

12 months agoRemove `#if NETCOREAPP` There is nothing net core specific about the assertions...
Mike Voorhees [Tue, 18 Jul 2023 03:07:41 +0000 (23:07 -0400)]
Remove `#if NETCOREAPP`   There is nothing net core specific about the assertions in this test.  No other tests in the `PreserveDependencies` folder have kept attributes inside of `#if NETCOREAPP` (#89041)

`DynamicDependencyOnUnusedMethodInNonReferencedAssemblyWithCopyUsedAction` is the same scenario and doesn't need the #ifs either

12 months agoFix binding logic for dictionaries with complex elements (#89045)
Layomi Akinrinade [Tue, 18 Jul 2023 02:54:52 +0000 (19:54 -0700)]
Fix binding logic for dictionaries with complex elements (#89045)

12 months agoDisable stackoverflowtester test for win-x86 (#89062)
Bruce Forstall [Tue, 18 Jul 2023 02:53:18 +0000 (19:53 -0700)]
Disable stackoverflowtester test for win-x86 (#89062)

Tracking: https://github.com/dotnet/runtime/issues/84911

12 months agofix pooled array leak (#88810)
Dan Moseley [Tue, 18 Jul 2023 02:52:06 +0000 (21:52 -0500)]
fix pooled array leak (#88810)

* ntlm

* test base

* qpack

* FileSys

* JSON

* interp tests

* fix NTAuthentication leak

* More in JSON

* more tests

* ntlmserver disposable

* more tests

* more tests

* tar tests

* feedback

12 months agoFeedback on regex parser PR (#89060)
Dan Moseley [Tue, 18 Jul 2023 02:27:04 +0000 (21:27 -0500)]
Feedback on regex parser PR (#89060)

12 months agoRemove createdump's DAC dependency for the PAL for NativeAOT (#88802)
Mike McLaughlin [Tue, 18 Jul 2023 02:05:53 +0000 (19:05 -0700)]
Remove createdump's DAC dependency for the PAL for NativeAOT (#88802)

* Remove createdump's DAC dependency for the PAL for NativeAOT

* Code review feedback - use utf16 mini pal functions

* Fix OSX build break

* Code review feedback

12 months agoAvoid unnecessary string allocations in Get/SetMsQuicParameter (#89050)
Stephen Toub [Tue, 18 Jul 2023 01:13:00 +0000 (21:13 -0400)]
Avoid unnecessary string allocations in Get/SetMsQuicParameter (#89050)

12 months agoFix Globalization Tests (#88969)
Tarek Mahmoud Sayed [Mon, 17 Jul 2023 23:28:07 +0000 (16:28 -0700)]
Fix Globalization Tests (#88969)

12 months agoLight up core ASCII.Utility methods with Vector256/Vector512 code paths. (#88532)
anthonycanino [Mon, 17 Jul 2023 22:23:26 +0000 (15:23 -0700)]
Light up core ASCII.Utility methods with Vector256/Vector512 code paths. (#88532)

* Lib upgrade for ToUtf16

* Upgrade NarrowUtf16ToAscii with Vector512

* Complete the upgrade in NarrowUtf16ToAscii method
with Vector512 and Vector256 APIs.

* Adding VectorXX paths to `GetIndexOfFirstNonAscii` functions.

* Adding optimization to Vecto256 VectorContainsNonAsciiChar method.

* Code path refactoring and cleanup.

* Code changes based on the review:
1. turn some variables into explicitly specified const.
2. removed some helper functions and inlined them.

* Resolve comments

* revert the changes at GetIndexOfFirstNonAsciiByte

---------

Co-authored-by: Ruihan-Yin <ruihan.yin@intel.com>
12 months agoTar: Fix PAX regression when handling the size of really long unseekable data streams...
Carlos Sánchez López [Mon, 17 Jul 2023 22:19:08 +0000 (15:19 -0700)]
Tar: Fix PAX regression when handling the size of really long unseekable data streams (#88280)

* Fix regression introduced by https://github.com/dotnet/runtime/pull/84279 preventing PAX entries with really long data streams to get its size correctly stored in the extended attributes when the data stream is unseekable.

* Move tests for large files to a new manual tests project.

12 months agowrap exceptions from callbacks in QuicError.CallbackError (#88614)
Tomas Weinfurt [Mon, 17 Jul 2023 22:08:01 +0000 (16:08 -0600)]
wrap exceptions from callbacks in QuicError.CallbackError (#88614)

* wrap exceptions from callbacks in QuicError.CallbackError

* feedback

12 months agoRegister a callback that tries to load other versions Open LDAP library if the defaul...
Buyaa Namnan [Mon, 17 Jul 2023 21:03:43 +0000 (14:03 -0700)]
Register a callback that tries to load other versions Open LDAP library if the default is failed (#88851)

* Register a callback to AssemblyLoadContext.Default.ResolvingUnmanagedDll event that tries to load other libraries

* Do not throw when library not found

* Check version 2.6 first

12 months agoEnable CA1863 (Use 'CompositeFormat') as suggestion (#89029)
Stephen Toub [Mon, 17 Jul 2023 20:52:57 +0000 (16:52 -0400)]
Enable CA1863 (Use 'CompositeFormat') as suggestion (#89029)

I ran it over runtime, and the only things flagged were for exceptional cases where it's not worth using.  Rather than a bunch of suppressions, I'm just enabling it as info-level.

12 months agoUse a HashSet instead of Dictionary in XNodeValidator (#89030)
Stephen Toub [Mon, 17 Jul 2023 20:52:24 +0000 (16:52 -0400)]
Use a HashSet instead of Dictionary in XNodeValidator (#89030)

12 months agoPrevent Arm64 CrossDac builds running on Arm64. (#88467)
C272 [Mon, 17 Jul 2023 20:43:20 +0000 (20:43 +0000)]
Prevent Arm64 CrossDac builds running on Arm64. (#88467)

* Prevent Arm64 CrossDac builds running on Arm64.

Currently, when building the CLR on win-arm64, CrossDac builds for
Linux with an (incorrect) host arch of x64 are attempted, failing
the build. This patch prevents those builds running on systems with
an identical host architecture to the cross target.

* Revert to simpler strategy of simply ignoring when arch != x86|x64.

12 months agoAdd collection literal support for immutable collections (#88470)
Stephen Toub [Mon, 17 Jul 2023 20:31:17 +0000 (16:31 -0400)]
Add collection literal support for immutable collections (#88470)

* Add collection literal support for immutable collections

Add the CollectionBuilderAttribute and use it on the supported immutable collections

* Address feedback

12 months ago[wasm][debugger] Check client version to send debugger message (#89025)
Thays Grazia [Mon, 17 Jul 2023 19:51:50 +0000 (16:51 -0300)]
[wasm][debugger] Check client version to send debugger message (#89025)

* Checking that BrowserDebugProxy is waiting for this new format to avoid incompatibility

* Fix compilation error

* fix message format

* Fix indentation

12 months agoDelete `VerifyExpectModifiedAttributesWork`. This test has bit rotted since being...
Mike Voorhees [Mon, 17 Jul 2023 19:41:20 +0000 (15:41 -0400)]
Delete `VerifyExpectModifiedAttributesWork`.  This test has bit rotted since being made netfx only and now fails due to etw feature removal logic no longer existing. (#89017)

This test dates back to earlier days when the linker had few mechanisms that modified bodies and UnityLinker had many.  I added this test to make sure that test framework support for this attribute didn't break since we depended on it.  Now days, the linker has many mechanisms that modify bodies and `[ExpectBodyModified]` is heavily used in tests.  I don't think there is any value in updating this test to use a different code pattern that results in needing `[ExpectBodyModified]`.

12 months agoDelete com removal tests (#89012)
Mike Voorhees [Mon, 17 Jul 2023 19:40:33 +0000 (15:40 -0400)]
Delete com removal tests (#89012)

12 months agoRemove the ignore from `CustomStepCanResolveTypesAfterSweep` (#89016)
Mike Voorhees [Mon, 17 Jul 2023 19:39:53 +0000 (15:39 -0400)]
Remove the ignore from `CustomStepCanResolveTypesAfterSweep` (#89016)

This ignore is pointless. `#if` cannot be used to ignore a test. Tests are collected from whatever version of `Mono.Linker.Tests.Cases` is handy.  It could be a net7 build.  It could be net471.

12 months agoAdd JsonSourceGenerationOptions.UseStringEnumConverter (#88984)
Eirik Tsarpalis [Mon, 17 Jul 2023 19:27:48 +0000 (20:27 +0100)]
Add JsonSourceGenerationOptions.UseStringEnumConverter (#88984)

* Add JsonSourceGenerationOptions.UseStringEnumConverter.

* Fix failing tests in browser-wasm

12 months ago[Mono] Add coreclr_shutdown to mono (#88594)
Giridhar Trivedi [Mon, 17 Jul 2023 19:21:40 +0000 (00:51 +0530)]
[Mono] Add coreclr_shutdown to mono  (#88594)

* [Mono] Add coreclr_shutdown to mono

   There was a crash seen in netcordbg due to unavailability of coreclr_shutdown in mono. Implemented it for mono.

---------

Co-authored-by: Giridhar Trivedi <giridhar.trivedi@ibm.com>
12 months agoUpdate dependencies from https://github.com/dotnet/roslyn-analyzers build 20230714...
dotnet-maestro[bot] [Mon, 17 Jul 2023 18:26:12 +0000 (13:26 -0500)]
Update dependencies from https://github.com/dotnet/roslyn-analyzers build 20230714.2 (#88948)

Microsoft.CodeAnalysis.Analyzers , Microsoft.CodeAnalysis.NetAnalyzers
 From Version 3.11.0-beta1.23363.2 -> To Version 3.11.0-beta1.23364.2

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
12 months agoUpdate host RID in missing runtime/framework URL (#88359)
Elinor Fung [Mon, 17 Jul 2023 18:22:01 +0000 (11:22 -0700)]
Update host RID in missing runtime/framework URL (#88359)

12 months agoIntrinsify Array GetArrayDataReference for SZ arrays (#87374)
Michał Petryka [Mon, 17 Jul 2023 18:06:43 +0000 (20:06 +0200)]
Intrinsify Array GetArrayDataReference for SZ arrays (#87374)

12 months agoStandardize `AddBodySubstituterStep` (#89013)
Mike Voorhees [Mon, 17 Jul 2023 17:51:07 +0000 (13:51 -0400)]
Standardize `AddBodySubstituterStep` (#89013)

12 months agoRelaxing IsConnected Check for Datagram Sockets (#87916)
Ahmet Ibrahim Aksoy [Mon, 17 Jul 2023 17:38:25 +0000 (20:38 +0300)]
Relaxing IsConnected Check for Datagram Sockets (#87916)

* Relaxing IsConnected Check for Datagram Sockets

* Adding Listener inside Test

* Add relaxing to every Connect Path and invert condition to SocketType.Stream

* Make test theory and pass ipv4 ipv6 data

* Add LoopbacksAndAny

* Fix forgotten usage of parameter

* Handle OSX case

* Review feedback

12 months agoAdd SocketsHttpHandler requests-queue-duration metrics (#88981)
Miha Zupan [Mon, 17 Jul 2023 17:21:26 +0000 (19:21 +0200)]
Add SocketsHttpHandler requests-queue-duration metrics (#88981)

* Add SocketsHttpHandler requests-queue-duration metrics

* Use the IsDefaultPort helper in more places

* PR feedback

* Simplify queueStartingTimestamp logic in Http3Connection

12 months agoEnable ExtendedProtectionPolicy in generic System.Net.Security build (#88871)
Filip Navara [Mon, 17 Jul 2023 17:18:28 +0000 (19:18 +0200)]
Enable ExtendedProtectionPolicy in generic System.Net.Security build (#88871)

* Enable ExtendedProtectionPolicy in generic System.Net.Security build (used on browser)

* Update tests

12 months agoRevert "[wasm][debugger] Remove usage of GeneratedRegex (#86911)" (#89022)
Thays Grazia [Mon, 17 Jul 2023 17:09:57 +0000 (14:09 -0300)]
Revert "[wasm][debugger] Remove usage of GeneratedRegex (#86911)" (#89022)

This reverts commit 3fc0f5fd610f73f0397cf40f68bf6e13787a8f2c.

12 months agoUpdate dependencies from https://github.com/dotnet/runtime build 20230714.11 (#88997)
dotnet-maestro[bot] [Mon, 17 Jul 2023 16:34:00 +0000 (11:34 -0500)]
Update dependencies from https://github.com/dotnet/runtime build 20230714.11 (#88997)

Microsoft.NET.ILLink.Tasks , Microsoft.NET.Sdk.IL , Microsoft.NETCore.App.Runtime.win-x64 , Microsoft.NETCore.ILAsm , runtime.native.System.IO.Ports , System.Text.Json
 From Version 8.0.0-preview.7.23359.3 -> To Version 8.0.0-preview.7.23364.11

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
12 months agoFix naming conflict resolution algorithm for linear interface hierarchies. (#88916)
Eirik Tsarpalis [Mon, 17 Jul 2023 16:12:07 +0000 (17:12 +0100)]
Fix naming conflict resolution algorithm for linear interface hierarchies. (#88916)

12 months agoAscii.Equals: remove redundant OR (#88993)
Adam Sitnik [Mon, 17 Jul 2023 16:07:27 +0000 (18:07 +0200)]
Ascii.Equals: remove redundant OR (#88993)

both inputs are equal here so if one of them is non ASCII, then the other one is too

12 months agoSimplify KeyAnalyzer (#88709)
Marc Brooks [Mon, 17 Jul 2023 15:14:13 +0000 (10:14 -0500)]
Simplify KeyAnalyzer (#88709)

The assignment `bool canSwitchIgnoreCaseToCaseSensitive = ignoreCase;` can just be `bool canSwitchIgnoreCaseToCaseSensitive = true;` since we're just tested that value a couple lines up