platform/upstream/dotnet/runtime.git
19 months agoIssue correct Enable/Disable commands for EventSources with EventPipe (#81867)
David Mason [Fri, 3 Mar 2023 12:05:09 +0000 (04:05 -0800)]
Issue correct Enable/Disable commands for EventSources with EventPipe (#81867)

19 months agoAllow default AsyncFlowControls rather than throwing (#82912)
Stephen Toub [Fri, 3 Mar 2023 11:43:56 +0000 (06:43 -0500)]
Allow default AsyncFlowControls rather than throwing (#82912)

ExecutionContext.SuppressFlow currently throws an exception if flow is already suppressed.  This makes it complicated to use, as you need to check whether IsFlowSuppressed first and take two different paths based on the result.  If we instead just allow SuppressFlow to return a default AsyncFlowControl rather than throwing, and have AsyncFlowControl's Undo nop rather than throw if it doesn't contain a Thread, we can again make it simple to just always use SuppressFlow without any of the other complications.

19 months ago[Mono] Enable runtime tests running on arm64 with mini JIT (#82814)
Fan Yang [Fri, 3 Mar 2023 09:55:38 +0000 (04:55 -0500)]
[Mono] Enable runtime tests running on arm64 with mini JIT (#82814)

* Enable runtime tests running on arm64 with mini JIT

* Disable failed tests

* Add tracking issue link

* Disable one more failing test

19 months ago[jiterp] Perform a single unsigned bounds check for ldelema1 (#82919)
Katelyn Gadd [Fri, 3 Mar 2023 09:40:06 +0000 (01:40 -0800)]
[jiterp] Perform a single unsigned bounds check for ldelema1 (#82919)

Array and Span both have a uint32_t length field (at least as far as wasm is concerned). If index is signed and we do an unsigned index <= length then any negative index will be treated as a massive value. For arrays it appears to be safe to exploit this and not do the >= 0 check, and interp.c doesn't do it.

19 months agoFixing a bug that causes us to mistakenly demote a gen2 region to gen0 (#82413)
Maoni Stephens [Fri, 3 Mar 2023 08:38:01 +0000 (00:38 -0800)]
Fixing a bug that causes us to mistakenly demote a gen2 region to gen0 (#82413)

We are seeing a gen0 region that's almost fully occupied (< 24 bytes free) with one giant plug (ie, no free objects at all in the region). This causes allocate_in_condemned_generations to go into an infinite loop because in ephemeral generations we expect short plugs, ie, we should be able to allocate a min free object in front of each plug. And normally we can because when we allocate objects in gen0 we make sure to break up the allocation contexts with min free objects and when we compact into gen1 we form short plugs.

We are in this situation when all of the following conditions are true -

+ we did a gen2 compacting GC that generates a pinned plug in a gen2 region almost as big as the whole region. my guess for the reason why there's this giant pinned plug is because that gen2 region was already really compact so when we called allocate_in_condemned_generations on the non pinned plugs that are next to some pinned plugs in it we discovered we can't move the non pinned plugs anyway so we artificially pinned them and formed a giant pinned plug. and during this GC those objects were no longer pinned so we have one giant non pinned plug.
+ this gen2 region needs to be the last region with pinned plugs;
+ this gen2 region hasn't been consumed by allocate_in_condemned_generations yet so it was processed by process_remaining_regions;

Then in process_remaining_regions we'll set the plan_gen_num for that gen2 region to 0 because we are doing

set_region_plan_gen_num_sip (current_region, current_plan_gen_num);

and next time we do a GC, this plug is no longer pinned (and still survived) so we call  allocate_in_condemned_generations on it which causes the infinite loop.

instead of going through the demotion logic to decide whether we should demote this region or not.

19 months agoImplement interfaces in the non-generic enumerator base (#82923)
Michal Strehovský [Fri, 3 Mar 2023 04:19:26 +0000 (13:19 +0900)]
Implement interfaces in the non-generic enumerator base (#82923)

* Implement IDisposable in the non-generic enumerator base

...so that the interface implementation details go to the non-generic dispatch map.

Saves 1.5 kB on BasicMinimalApi.

* f

19 months agoFix a few async void tests to be async Task (#82914)
Stephen Toub [Fri, 3 Mar 2023 04:15:36 +0000 (23:15 -0500)]
Fix a few async void tests to be async Task (#82914)

19 months agoRevert "Enable symbol stripping for crossgen2 (#82698)" (#82881)
Adeel Mujahid [Fri, 3 Mar 2023 03:36:19 +0000 (05:36 +0200)]
Revert "Enable symbol stripping for crossgen2 (#82698)" (#82881)

This reverts commit 6a218ab799e56d4ebaffda550de06a9a73a88b14.

19 months agoImprove DateTime.ParseExact perf for invariant culture (#82877)
Stephen Toub [Fri, 3 Mar 2023 02:46:31 +0000 (21:46 -0500)]
Improve DateTime.ParseExact perf for invariant culture (#82877)

* Improve DateTime parsing perf for invariant culture

Speed up the handling of ddd, dddd, MMM, and MMMM parts of a date time format string when using the invariant culture, which is very commonly used in parsing.  Today, when one of these is encountered, the relevant array of comparison strings is retrieved from the DateTimeFormatInfo, and each is compared as a prefix against the current position in the input, using a linguistic ignore-case comparison.  But for the invariant culture, we don't need to consult any arrays, and can do the comparison much more quickly.  These parts dominate the processing of a format like that for RFC1123.

* Address PR feedback

19 months agoSubstitute out geopolitical term in TimeZoneInfo (#82916)
Mitchell Hwang [Fri, 3 Mar 2023 01:35:24 +0000 (20:35 -0500)]
Substitute out geopolitical term in TimeZoneInfo (#82916)

19 months agoDisable SupportedWindowsPlatforms_IsSupportedIsTrue on Windows Arm64 (#82902)
Natalia Kondratyeva [Thu, 2 Mar 2023 23:44:54 +0000 (00:44 +0100)]
Disable SupportedWindowsPlatforms_IsSupportedIsTrue on Windows Arm64 (#82902)

19 months ago[mono][aot] Emit cctor instantiations for classes referenced by gshared methods....
Zoltan Varga [Thu, 2 Mar 2023 23:38:58 +0000 (18:38 -0500)]
[mono][aot] Emit cctor instantiations for classes referenced by gshared methods. (#82900)

19 months ago[mono][aot] Emit a list of exported methods into the AOT image and load them when...
Zoltan Varga [Thu, 2 Mar 2023 23:38:35 +0000 (18:38 -0500)]
[mono][aot] Emit a list of exported methods into the AOT image and load them when the image is loaded. (#82809)

If there is a runtime attach function specified, these methods can call into the runtime
before its initialized. In order for this to work, the runtime attach function needs
to load all the AOT images containing such methods, and load_aot_module () will
load and initialize these methods using the newly emitted table.

19 months agoEventPipe env var to disable stack collection (#82470)
David Mason [Thu, 2 Mar 2023 23:02:42 +0000 (15:02 -0800)]
EventPipe env var to disable stack collection (#82470)

19 months agoMark some internal/private structs as readonly (#82415)
Stephen Toub [Thu, 2 Mar 2023 22:32:57 +0000 (17:32 -0500)]
Mark some internal/private structs as readonly (#82415)

* Mark some internal/private structs as readonly

* Address PR feedback

19 months ago[wasi] CI: Provision `wasi-sdk`, and `wasmtime` only when needed (#82454)
Ankit Jain [Thu, 2 Mar 2023 21:59:25 +0000 (16:59 -0500)]
[wasi] CI: Provision `wasi-sdk`, and `wasmtime` only when needed (#82454)

* [wasm] Install wasi-sdk, and wasmtime on CI only if needed

* Add generic support for staging helix payloads

For a directory specified as a helix correlation payload, the helix
tasks will attempt to write a `.payload` file to the directory. But if the
directory is not writable then we need to stage the payload in a
writable location, before passing the path to helix.

For example, if we have `wasi-sdk` installed on the system as:
    `WASI_SDK_PATH=/usr/local/wasi-sdk`

.. then we can stage it by copying to
`artifacts/obj/helix-staging/wasi-sdk`, and then using that staging path
for the helix correlation payload.

This was already being done for `EMSDK`, and `WasiSdk` in two separate
targets. And now needs to be done for `wasmtime` also. Instead of having
completely separate targets for all this, add a new mechanism to specify
helix dependencies to stage.

For example:
```xml
  <ItemGroup>
    <HelixDependenciesToStage Condition="'$(NeedsWasmtime)' == 'true'" SourcePath="$(WasmtimeDir)"   Include="$(WasmtimeDirForHelixPayload)" />
  </ItemGroup>
```

.. and the payload can use specified as
```xml
<HelixCorrelationPayload Include="$(WasmtimeDirForHelixPayload)" Destination="wasmtime" Condition="'$(NeedsWasmtime)' == 'true'" />
```

* [wasm] CI: Fix path for wasi artifacts

These were getting created with all the wasi builds sharing the same
prefixes causing them to get overwritten.

19 months ago[wasm] Fix tests substitution conditions (#82901)
Radek Doulik [Thu, 2 Mar 2023 21:55:28 +0000 (22:55 +0100)]
[wasm] Fix tests substitution conditions (#82901)

PR #82886 fixed it for user builds, we should fix it for tests as well.

19 months agoAdd dedicated empty array enumerator for footprint reduction (#82899)
Stephen Toub [Thu, 2 Mar 2023 21:19:51 +0000 (16:19 -0500)]
Add dedicated empty array enumerator for footprint reduction (#82899)

* Add dedicated empty array enumerator for footprint reduction

Its singleton can be used in places where it's less likely the consumer will otherwise be using a T[], such that it's less likely we'll need to generate code for T[].

* Address PR feedback

19 months agoIntroducing ValidateOptionsResultBuilder (#82749)
Tarek Mahmoud Sayed [Thu, 2 Mar 2023 21:15:32 +0000 (13:15 -0800)]
Introducing  ValidateOptionsResultBuilder (#82749)

19 months agoMark Microsoft.NET.ILLink as non-shipping (#82905)
Sven Boemer [Thu, 2 Mar 2023 19:59:08 +0000 (11:59 -0800)]
Mark Microsoft.NET.ILLink as non-shipping (#82905)

This package should not be published to nuget. It is only used by xamarin, and contains the API surface for custom illink steps.

19 months ago[iOS][maccatalyst] Disable MacCatalyst and Simulator CI runs (#82915)
Steve Pfister [Thu, 2 Mar 2023 19:58:37 +0000 (14:58 -0500)]
[iOS][maccatalyst] Disable MacCatalyst and Simulator CI runs (#82915)

The work items for these configurations are failing at a high rate and causing numerous retries. Disabling temporarily to see if that helps queue traffic stabilize.

19 months agoFix string allocation in DateTimeParse.ParseByFormat (#82861)
Stephen Toub [Thu, 2 Mar 2023 19:39:50 +0000 (14:39 -0500)]
Fix string allocation in DateTimeParse.ParseByFormat (#82861)

If a quote is encountered, the parser searches for the ending quote while also handling escaped characters.  It does by adding the interim characters to a temporary ValueStringBuilder.  But it then ToString's that builder to produce a temporary string that's examined.  This is unnecessary: we can just examine the span from the VSB directly.

19 months agoStore Parallel.ForEachAsync exceptions from cancellation callbacks (#82434)
Stephen Toub [Thu, 2 Mar 2023 19:28:06 +0000 (14:28 -0500)]
Store Parallel.ForEachAsync exceptions from cancellation callbacks (#82434)

* Store Parallel.ForEachAsync exceptions from cancellation callbacks

If a cancellation callback erroneously throws an exception, make sure we store it into the list of exceptions used to complete the resulting task. In most cases, this just means we may not be returning _all_ exceptions when there are multiple.  If, however, disposal of the enumerator throws an exception and a cancellation callback throws an exception and no exceptions were thrown from the loop body, without this change the task returned from ForEachAsync likely won't be marked completed.

* Update src/libraries/System.Threading.Tasks.Parallel/tests/ParallelForEachAsyncTests.cs

19 months agoStop storing the parsed RID fallback graph (#82811)
Elinor Fung [Thu, 2 Mar 2023 19:21:16 +0000 (11:21 -0800)]
Stop storing the parsed RID fallback graph (#82811)

After startup, we only need the RID fallback graph from the root framework for component dependency resolution (AssemblyDependencyResolver). This change stops storing that graph (which is decently large for portable linux) for all applications and switches to re-populating it on demand.

Removing this stored value also lines up with the plan to move to algorithmic RID selection rather than reading from the .deps.json.

19 months agodisable tests on Server 2022 with spanish locale (#82578)
Tomas Weinfurt [Thu, 2 Mar 2023 18:22:31 +0000 (10:22 -0800)]
disable tests on Server 2022 with spanish locale (#82578)

* disable tests on Server 2022 with spanish locale

* update name

19 months agoAppend version to RID only with valid characters (#81497)
Adeel Mujahid [Thu, 2 Mar 2023 17:44:02 +0000 (19:44 +0200)]
Append version to RID only with valid characters (#81497)

This is the `init-distro-rid.sh` counterpart of 31e4f404c218eae7ba999c4df5346d30f971451c.

In `amd64/archlinux` docker container, the non-portable RID auto-detection (without explicit `-p:TargetRid=arch-x64` arg or `__DistroRid=arch-x64` env var) looks like this:

Before: `__DistroRid: arch.TEMPLATE_VERSION_ID-x64`
After: `__DistroRid: arch-x64`

19 months ago[workloads] Upstream workload fixes from 7.0 (#82069)
Steve Pfister [Thu, 2 Mar 2023 17:22:38 +0000 (12:22 -0500)]
[workloads] Upstream workload fixes from 7.0 (#82069)

Upstreamed from #75486

- The updated task now provides metadata that will allow us to split the VSDROP generation into two separate archives.
  One which only contains workload packs (needed to share DROPs across VS versions to support multi-targeting) and
  another that only contains the manifest installers and workload components.

- The ZIP archive names have been updated to disambiguate its contents and support automatic drop creation during
   staging.

Most of the changes are in eng due to the Arcade update to obtain the latest copy of the workload build tasks. Those changes are unrelated to the workload fix, but appears to be necessary.

Co-authored-by: Jacques Eloff <joeloff@users.noreply.github.com>
19 months agoEventPipe lock implementation (#82790)
Lakshan Fernando [Thu, 2 Mar 2023 17:08:32 +0000 (09:08 -0800)]
EventPipe lock implementation (#82790)

* EventPipe lock implementation

* FB

19 months agoFix Icon(Stream) handling of partial reads (#82621)
Stephen Toub [Thu, 2 Mar 2023 17:04:28 +0000 (12:04 -0500)]
Fix Icon(Stream) handling of partial reads (#82621)

Icon's ctor assumes Read on a stream will always produce as much data as was asked for, and that's not guaranteed to be the case.

19 months agoFix SoundPlayer handling of partial reads on streams (#82612)
Stephen Toub [Thu, 2 Mar 2023 17:02:29 +0000 (12:02 -0500)]
Fix SoundPlayer handling of partial reads on streams (#82612)

SoundPlayer assumes that a Read on a stream will return everything asked for, and that's not the case.

19 months ago[wasm] Avoid unnecessary relinking when publishing a blazor project for AOT (#82748)
Ankit Jain [Thu, 2 Mar 2023 17:02:12 +0000 (12:02 -0500)]
[wasm] Avoid unnecessary relinking when publishing a blazor project for AOT (#82748)

* [wasm] Wasm.Build.Tests: Add blazor+aot run test

* cleanup

* [wasm] Wasm.Build.Tests: Use $(_IsPublishing) to avoid unncessary

.. relinking during "Build", when publishing.

`Publish` target triggers `Build` target to run. When publishing, we
don't want to run relinking step during the `Build`, as it will be run
for `Publish` anyway. Earlier there wasn't a good way to differentiate
the two cases of `build` when building, and `build` when publishing, but
now the sdk sets `$(_IsPublishing)=true`, which can be used here.

* fix blazor tests

* Wasm.Build.Tests: Add support for running published blazor projects

`dotnet run` uses the regular build output. Published blazor app, like
when using AOT, needs to be run more "manually" by starting a web server
in the publish folder. This is accomplished here by using the new
xharness command `wasm webserver`.

* Detect runtime assertions in blazor runs

* Update test to track changes

* cleanup

* Disable BlazorPublishRunTest because of https://github.com/dotnet/runtime/issues/82481

* Update test to track changes

* Update xharness dependency

Updating 'Microsoft.DotNet.XHarness.CLI': '1.0.0-prerelease.23117.1' => '1.0.0-prerelease.23151.1' (from build '20230301.1' of 'https://github.com/dotnet/xharness')
Updating 'Microsoft.DotNet.XHarness.TestRunners.Common': '1.0.0-prerelease.23117.1' => '1.0.0-prerelease.23151.1' (from build '20230301.1' of 'https://github.com/dotnet/xharness')
Updating 'Microsoft.DotNet.XHarness.TestRunners.Xunit': '1.0.0-prerelease.23117.1' => '1.0.0-prerelease.23151.1' (from build '20230301.1' of 'https://github.com/dotnet/xharness')

19 months agoAdd PeriodicTimer.Period property (#82560)
Stephen Toub [Thu, 2 Mar 2023 17:01:06 +0000 (12:01 -0500)]
Add PeriodicTimer.Period property (#82560)

19 months agoMove throw out of inlined CompositeFormat helper (#82543)
Stephen Toub [Thu, 2 Mar 2023 16:56:53 +0000 (11:56 -0500)]
Move throw out of inlined CompositeFormat helper (#82543)

Either this helper isn't getting inlined because of the throw, or it's getting inlined and increasing the size of all call sites where it is.

19 months agoCombine ExecutionContext/CapturedContext fields in ManualResetValueTaskSourceCore...
Stephen Toub [Thu, 2 Mar 2023 16:41:25 +0000 (11:41 -0500)]
Combine ExecutionContext/CapturedContext fields in ManualResetValueTaskSourceCore (#82181)

There's currently an _executionContext field and a _capturedContext field.  Both of these are for non-fast-path.  This not only means the struct is larger than is necessary for the common case, it also means when we reset the instance between operations we need to clear an extra field, and it means we have an extra branch on some paths to check both fields.

We can instead combine them into a single field.  We allocate an extra tuple object if there's both an ExecutionContext and a scheduler, but this is exceedingly rare: when used as part of awaits, there will never be an ExecutionContext, so this will only happen in situations where someone is directly using the awaiter's OnCompleted (not UnsafeOnCompleted) method and there's a scheduler and ConfigureAwait(false) wasn't used.  Such a situation not only is rare, it also already has additional overheads.

This also cleans up a bit about how exceptions are handled and moves more logic out of the generic type to avoid code bloat with generic instantiations.

19 months agoGlossary: Change SoS link to documentation and describe origin in description. (Was...
Kasper Fabæch Brandt [Thu, 2 Mar 2023 16:32:01 +0000 (17:32 +0100)]
Glossary: Change SoS link to documentation and describe origin in description. (Was: Change source for SoS to Wayback Machine link) (#81178)

* Glossary: Change source for SoS to Wayback Machine link

The page seems to have disappeared in the currently archived version of Jason Zander's blog at https://learn.microsoft.com/en-us/archive/blogs/jasonz/ - so replace it with a Wayback Machine link to an archived version.

* Link to official documentation for SOS instead and mention origin of name in the description.

19 months agodisable SendFileGetsCanceledByDispose also on Catalyst (#82782)
Tomas Weinfurt [Thu, 2 Mar 2023 16:31:38 +0000 (08:31 -0800)]
disable SendFileGetsCanceledByDispose also on Catalyst (#82782)

* disable SendFileGetsCanceledByDispose also on Catalyst

* Update src/libraries/System.Net.Sockets/tests/FunctionalTests/SendFile.cs

Co-authored-by: Radek Zikmund <32671551+rzikm@users.noreply.github.com>
* fix build

---------

Co-authored-by: Radek Zikmund <32671551+rzikm@users.noreply.github.com>
19 months agoUse shared IValueTaskSource implementation in AwaitableSocketAsyncEventArgs (#82147)
Stephen Toub [Thu, 2 Mar 2023 16:26:01 +0000 (11:26 -0500)]
Use shared IValueTaskSource implementation in AwaitableSocketAsyncEventArgs (#82147)

The upside here is we don't need a dedicated implementation with complicated logic inside of Socket.  The downside is this effectively increases the allocation for a Socket by a few fields, as the shared implementation has a few extra fields that go unused.

19 months agoPass wasi invariant mode through env variable (#82707)
Meri Khamoyan [Thu, 2 Mar 2023 15:32:05 +0000 (19:32 +0400)]
Pass wasi invariant mode through env variable (#82707)

Pass wasi invariant mode through env variable

19 months ago[mono][interp] Fix incorrect masking (#82890)
Vlad Brezae [Thu, 2 Mar 2023 14:32:21 +0000 (16:32 +0200)]
[mono][interp] Fix incorrect masking (#82890)

* [mono][interp] Fix incorrect masking

* [mono][interp] Fix warning

19 months agoActiveIssue for BuildInvalidSignatureTwice on mono interpreter. (#82864)
Kevin Jones [Thu, 2 Mar 2023 14:31:26 +0000 (09:31 -0500)]
ActiveIssue for BuildInvalidSignatureTwice on mono interpreter. (#82864)

19 months agoUpdate keywords. (#82896)
Ilona Tomkowicz [Thu, 2 Mar 2023 14:30:30 +0000 (15:30 +0100)]
Update keywords. (#82896)

19 months agoAdd MemoryExtensions.AsSpan(string, Index/Range) (#82794)
Stephen Toub [Thu, 2 Mar 2023 14:22:24 +0000 (09:22 -0500)]
Add MemoryExtensions.AsSpan(string, Index/Range) (#82794)

19 months agoSimplify IndexOfAnyAsciiByteValues for needles with 0 on X86 (#82866)
Miha Zupan [Thu, 2 Mar 2023 14:21:20 +0000 (15:21 +0100)]
Simplify IndexOfAnyAsciiByteValues for needles with 0 on X86 (#82866)

19 months agoHave bool and string implement ISpanParsable<T> (#82836)
Tanner Gooding [Thu, 2 Mar 2023 13:45:45 +0000 (05:45 -0800)]
Have bool and string implement ISpanParsable<T> (#82836)

19 months ago[wasm] Fix intrinsics substitution condition (#82886)
Radek Doulik [Thu, 2 Mar 2023 13:33:42 +0000 (14:33 +0100)]
[wasm] Fix intrinsics substitution condition (#82886)

Enable substitutions for SIMD only for AOT and not interpreter

19 months agoAvoid trying to get callstack[0] when it's empty like in an instrumentation pause...
Thays Grazia [Thu, 2 Mar 2023 13:25:52 +0000 (10:25 -0300)]
Avoid trying to get callstack[0] when it's empty like in an instrumentation pause (#82852)

19 months ago[mono] Move networking code to debugger component (#82785)
Alexander Köplinger [Thu, 2 Mar 2023 11:15:04 +0000 (12:15 +0100)]
[mono] Move networking code to debugger component (#82785)

The debugger is the only component left in Mono using the networking code, move the code there so we can avoid compiling it into the main runtime and also simplify it a bit.

19 months ago[browser] remove unused methods (#82865)
Pavel Savara [Thu, 2 Mar 2023 09:08:06 +0000 (10:08 +0100)]
[browser] remove unused methods (#82865)

19 months agoEnable symbol stripping for crossgen2 (#82698)
Adeel Mujahid [Thu, 2 Mar 2023 05:50:14 +0000 (07:50 +0200)]
Enable symbol stripping for crossgen2 (#82698)

19 months agoAdd OS/architecture specific CLRDEBUGINFO resource (#82863)
Mike McLaughlin [Thu, 2 Mar 2023 04:26:55 +0000 (20:26 -0800)]
Add OS/architecture specific CLRDEBUGINFO resource (#82863)

Issue: https://github.com/dotnet/runtime/issues/78282

19 months agoUnify Array enumerators between CoreCLR and NativeAOT (#82751)
Jan Kotas [Thu, 2 Mar 2023 04:00:33 +0000 (20:00 -0800)]
Unify Array enumerators between CoreCLR and NativeAOT (#82751)

* Unify Array enumerators between CoreCLR and NativeAOT

Contributes to #82732

Reduces BasicMinimalApi native AOT size on Windows x64 by 68kB

* Update AOT compiler

* Naming convention

Co-authored-by: Stephen Toub <stoub@microsoft.com>
19 months agoFixed name of frozen string dictionary files (#82482)
PascalSenn [Thu, 2 Mar 2023 02:34:06 +0000 (03:34 +0100)]
Fixed name of frozen string dictionary files (#82482)

* Fixed name of frozen string dictionary types

* Add missing file renames

19 months agoLocalized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 212592...
dotnet bot [Thu, 2 Mar 2023 02:13:48 +0000 (18:13 -0800)]
Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 2125925 (#82869)

19 months agoTry skipping generation of empty method dictionaries (#82591)
Michal Strehovský [Thu, 2 Mar 2023 01:15:31 +0000 (10:15 +0900)]
Try skipping generation of empty method dictionaries (#82591)

Say we're compiling `Foo<__Canon>.Method` for:

```csharp
class Foo<T>
{
    static void Method() => GenericMethod<List<T>>();
    static void GenericMethod<T>() { }
}
```

In the method body, we're generating a call to `GenericMethod<__Canon>` with a generic dictionary that we looked up from `Foo`s dictionary. But as you can see, the dictionary is empty because `GenericMethod` doesn't do anything with it's T. RyuJIT might even inline it.

The problem is that we computed how the dictionary will look like during scanning and we're forever stuck with instruction to generate a generic dictionary for every `Foo<T>` instantiation.

This is adding an optimization - if during scanning we find out that the dictionary layout of the target method is empty, we instruct RyuJIT to generate a null generic context pointer.

Saves 1.5% on BasicMinimalApi.

Cc @dotnet/ilc-contrib

19 months agoLocalized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 212215...
dotnet bot [Thu, 2 Mar 2023 00:24:07 +0000 (16:24 -0800)]
Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 2122151 (#81871)

Co-authored-by: Jeremy Koritzinsky <jekoritz@microsoft.com>
19 months agoImplement load_assembly delegate for hosting API (#82797)
Elinor Fung [Wed, 1 Mar 2023 22:50:04 +0000 (14:50 -0800)]
Implement load_assembly delegate for hosting API (#82797)

19 months ago[wasm] Implement more jiterpreter opcodes (#82849)
Katelyn Gadd [Wed, 1 Mar 2023 22:00:31 +0000 (14:00 -0800)]
[wasm] Implement more jiterpreter opcodes (#82849)

Implement the following opcodes:
* MINT_NEWSTR
* MINT_ARRAY_ELEMENT_SIZE
* MINT_DIV_I8
* MINT_REM_I8

19 months agoJIT: Unify arm64 and x64 GT_SELECT handling (#82610)
Jakob Botsch Nielsen [Wed, 1 Mar 2023 21:04:39 +0000 (22:04 +0100)]
JIT: Unify arm64 and x64 GT_SELECT handling (#82610)

This unifies GT_SELECT/GT_SELECTCC handling between arm64 and x64. The
arm64 backend no longer uses containment for compare chains; instead,
there is a new GT_CCMP node that both produces and consumes flags, and
lowering can lower GT_AND(op, relop) down to this node.

19 months agoCheck for pending IO in the portable thread pool's worker threads (#82245)
Koundinya Veluri [Wed, 1 Mar 2023 17:53:50 +0000 (09:53 -0800)]
Check for pending IO in the portable thread pool's worker threads (#82245)

* Check for pending IO in the portable thread pool's worker threads

- When Resource Monitor is attached, some async IO operations are bound to the thread that issued it even though the IO handle is bound to an IOCP. If the thread exits, the async IO operation is aborted. This can lead to hangs or unexpected exceptions.
- Added a check that was missing in the portable thread pool implementation to prevent exiting a worker thread when it has pending IO

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

19 months ago[wasm] Enable SIMD (#80797)
Radek Doulik [Wed, 1 Mar 2023 17:31:15 +0000 (18:31 +0100)]
[wasm] Enable SIMD (#80797)

* [wasm] Enable SIMD

* Let old V8 use simd

Co-authored-by: Ankit Jain <radical@gmail.com>
* [wasm] ManagedToNativeGenerator: Skip unmanaged dlls

.. instead crashing with an exception like:

```
src/mono/wasm/build/WasmApp.Native.targets(296,5): error MSB4018: (NETCORE_ENGINEERING_TELEMETRY=Build) The "ManagedToNativeGenerator" task failed unexpectedly.
System.BadImageFormatException: This PE image is not a managed executable.
   at System.Reflection.MetadataLoadContext.LoadFromStreamCore(Stream peStream)
   at System.Reflection.MetadataLoadContext.LoadFromAssemblyPath(String assemblyPath)
   at PInvokeTableGenerator.Generate(String[] pinvokeModules, String[] assemblies, String outputPath) in /_/src/tasks/WasmAppBuilder/PInvokeTableGenerator.cs:line 42
   at ManagedToNativeGenerator.ExecuteInternal() in /_/src/tasks/WasmAppBuilder/ManagedToNativeGenerator.cs:line 68
   at ManagedToNativeGenerator.Execute() in /_/src/tasks/WasmAppBuilder/ManagedToNativeGenerator.cs:line 53
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask)
```

The wasm targets currently are not able to differentiate the managed
assemblies from the unmanaged ones. so it needs to be handled here.

* [wasm] WasmApp.Native.targets: do not trigger relinking when WasmEnableSIMD=true

Instead, let the property be effective only for the AOT case.

* Use staging image with newer v8

* [wasm] WasmAppHost: Add support for host arguments

* [wasm] console template: Add --experimental-wasm-simd to node, and remove v8 config as that isn't supported

* [wasm] Pass --experiment-wasm-simd for aot library tests too

* Try to pass full path to v8

Also remove --experimental-wasm-simd option, which shouldn't be needed
for newer v8

* Use docker image for all wasm helix jobs

As we need newer v8

* Set DOTNET_CLI_HOME under workitem payload

The correlation payload is read only

* Revert "Try to pass full path to v8"

This reverts commit a15b3ef5dcab31b0abe2bc914eee6299df7cf56f.

* Use DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1

Let see whether it will avoid all the writes to correlation payload
path

* Set NeedsEMSDKNode to false

To try if we can use newer node in path

* Revert "Set DOTNET_CLI_HOME under workitem payload"

This reverts commit 5dec1aaab403f4cbbd7b0e9f03d965e96efde51c.

* Set DOTNET_CLI_HOME under workitem payload

The correlation payload is read only. And even with
`export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1` we have still many
failures.

* Reverse the test here as we don't relink anymore

* Set _ExtraTrimmerArgs for tests

So that linker substitution files are used

* Put the SIMD/trim related props in separate group

More changes from Ankit

* Add dynamic dependency

* Disable Vector128IsHardwareAcceleratedTest

Til we have the interpreter support in place

* Disable GenericVectorTests.IsHardwareAcceleratedTest

Til we have the interpreter support in place

* Disable check_no_intrinsic_cattr in emit_vector_2_3_4

And add note about opened issue

* [mono] Disable few quaternion intrinsics

For * and / operators as these are not the same as vector operations.
Opened https://github.com/dotnet/runtime/issues/82408 to implement
correct ones in future.

* Change comparison order

* Use stable images

* WBT: Add --engine-arg=--experimental-wasm-simd for node, and v8

* Do not skip dotnet 1st time experience anymore

---------

Co-authored-by: Ankit Jain <radical@gmail.com>
19 months ago[wasm] Add an internal GC lock API (#82646)
Aleksey Kliger (λgeek) [Wed, 1 Mar 2023 16:03:52 +0000 (11:03 -0500)]
[wasm] Add an internal GC lock API  (#82646)

The goal is to provide an API that can be called from JS to block a background GC from moving objects that may be accessed unsafely from JS.  Blazor does this during rendering - it traverses a set of rendering objects from JS in order to apply changes to the DOM.

Important notes for consumers of this API:
1. While the runtime GC lock is locked, calling any C# function or doing anything that may trigger managed allocation will block the runtime.
2. In a threaded build, only the main browser thread is allowed to call the `mono_wasm_gc_lock` function
3. The runtime lock is not recursive
4. Background threads initially continue running, so the managed object graph may change even while the GC lock is held (although objects may not move).  Background threads could mutate valuetype fields of reachable objects, even while the GC lock is held. However background threads will block as soon as they try to do any allocation.
5. The main browser thread may assume that managed heap objects will not move while the lock is held.

The corresponding aspnetcore API is https://github.com/dotnet/aspnetcore/pull/46909

* add wasm entrypoints to lock the GC from JS
* move gc lock api to INTERNAL object
* enter GC Unsafe before manipulating the locks

   This is an exported API, so we're normally in GC Safe mode on entry

19 months agoupdate msquic (#81742)
Tomas Weinfurt [Wed, 1 Mar 2023 15:59:38 +0000 (07:59 -0800)]
update msquic (#81742)

* update msquic

* Update src/libraries/System.Net.Quic/src/System.Net.Quic.csproj

Co-authored-by: Marie Píchová <11718369+ManickaP@users.noreply.github.com>
---------

Co-authored-by: Marie Píchová <11718369+ManickaP@users.noreply.github.com>
19 months ago[wasi+browser] bundle timezones into .wasm (#82250)
Pavel Savara [Wed, 1 Mar 2023 15:09:21 +0000 (16:09 +0100)]
[wasi+browser] bundle timezones into .wasm (#82250)

Co-authored-by: Ankit Jain <radical@gmail.com>
19 months ago[API] OperatingSystem.IsWasi() (#82817)
Pavel Savara [Wed, 1 Mar 2023 14:43:12 +0000 (15:43 +0100)]
[API] OperatingSystem.IsWasi() (#82817)

implement approved API https://github.com/dotnet/runtime/issues/78389

19 months agoFix test throwing from send (#82787)
Marie Píchová [Wed, 1 Mar 2023 13:31:36 +0000 (14:31 +0100)]
Fix test throwing from send (#82787)

19 months ago[QUIC] Disable failing test on arm machines (#82780)
Marie Píchová [Wed, 1 Mar 2023 13:30:01 +0000 (14:30 +0100)]
[QUIC] Disable failing test on arm machines (#82780)

* Disable failing test on arm machines

* Feedback

19 months ago[browser][icu][libraries] Load full ICU in library tests only when it's necessary...
Ilona Tomkowicz [Wed, 1 Mar 2023 12:57:24 +0000 (13:57 +0100)]
[browser][icu][libraries] Load full ICU in library tests only when it's necessary (#82619)

* Moved the flag to libs that really need it.

* Remaining libs.

* Property should not be set in ItemsGroup.

* Previos approach did not work, revert and try new one.

* Only placing it here does not trim the assigned value.

* Add comment to the workaround.

19 months agoFix build failure in pal_ssl (#82816)
Steve [Wed, 1 Mar 2023 12:29:50 +0000 (21:29 +0900)]
Fix build failure in pal_ssl (#82816)

19 months agoAdd more type-forwarders for Xamarin.Android compatibility to mscorlib.dll (#82618)
Alexander Köplinger [Wed, 1 Mar 2023 12:13:30 +0000 (13:13 +0100)]
Add more type-forwarders for Xamarin.Android compatibility to mscorlib.dll (#82618)

The legacy Xamarin.Android version of mscorlib.dll differed a bit compared to the .NET Framework mscorlib.dll, mostly because of additions for .NET Standard 2.1 support.

This meant that an assembly which was compiled against that mscorlib expects types there but since we didn't have type-forwarders in our mscorlib.dll shim to point them to the right assembly you'd get a TypeLoadException when running on modern .NET 6 Android.

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

19 months ago[mono] Raise soft RLIMIT_NOFILE on Linux (#82429)
Ulrich Weigand [Wed, 1 Mar 2023 11:57:24 +0000 (12:57 +0100)]
[mono] Raise soft RLIMIT_NOFILE on Linux (#82429)

Replace darwin_change_default_file_handles by a new routine increase_descriptor_limit, which mirrors the logic in the CoreCLR INIT_IncreaseDescriptorLimit routine.

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

19 months ago[browser] delete unused mono_wasm_* functions (#82767)
Pavel Savara [Wed, 1 Mar 2023 11:13:23 +0000 (12:13 +0100)]
[browser] delete unused mono_wasm_* functions (#82767)

* delete unused mono_wasm_get_icudt_name
* remove unused mono_wasm_array_length
* remove unused GlobalizationNative_GetICUDTName

19 months agoJIT: Enable interlocked profiling for basic block counts too (#82775)
Jakob Botsch Nielsen [Wed, 1 Mar 2023 08:53:57 +0000 (09:53 +0100)]
JIT: Enable interlocked profiling for basic block counts too (#82775)

19 months agoAnnotation changes only (part 3) (#82697)
Maoni Stephens [Wed, 1 Mar 2023 01:48:25 +0000 (17:48 -0800)]
Annotation changes only (part 3) (#82697)

* Annotation changes only (part 3)

+ moved the fields to be at the end of the gc_heap class arranged by their categories - instance fields before static fields. this also makes the gc_heap way easier to read in the debugger (so we don't see static fields mixed with instance fields). I also added in the comment the convention of how I organized each category.
+ made members that should be private actually private - most methods/fields on the gc_heap are private now
+ changed the bookkeeping fields from MAINTAINED to INIT to be more appropriate for regions
+ moved reset_mm_p into gc_heap class.
+ got rid of the frozen_object_p method - this shouldn't have been added, there's already an API on the GCHeap interface that provides this info
+ there are members that really don't need to be public but I'm trying to avoid too many kinds of changes at a time so I left them as public such as gc_started/wait_for_gc_done()/region_info enum. things like WaitLonger/stomp_write_barrier_ephemeral/reserved_memory_limit should really just be gc_heap methods

19 months agoRefactoring store liveness update (#80539)
Brian Bohe [Wed, 1 Mar 2023 01:36:18 +0000 (22:36 -0300)]
Refactoring store liveness update (#80539)

* Unifying var desc and liveness update on storeLclFld/Var

* Updating varDsc home after spill and refactoring

* Adding back function comment

* Forcing inline of store update on liveness

* Fixing format

19 months agoMake debug-only SafeHandle _ctorStackTrace coreclr-only (#82376)
Stephen Toub [Tue, 28 Feb 2023 22:43:01 +0000 (17:43 -0500)]
Make debug-only SafeHandle _ctorStackTrace coreclr-only (#82376)

19 months agoTweak IndexOfAnyValues.TryGetSingleRange (#82786)
Stephen Toub [Tue, 28 Feb 2023 22:21:25 +0000 (17:21 -0500)]
Tweak IndexOfAnyValues.TryGetSingleRange (#82786)

Move the instance creation logic to its callers.

19 months ago[wasm] Implement partial backward branch support in the Jiterpreter (#82756)
Katelyn Gadd [Tue, 28 Feb 2023 21:13:43 +0000 (13:13 -0800)]
[wasm] Implement partial backward branch support in the Jiterpreter (#82756)

Add partial backward branch support to the Jiterpreter
Disable early trace abort / trace transfer if back branches are enabled, since it impairs looping
Add back branch success rate statistic
Remove ldelem_ref write barrier

19 months agoDo not use ALC name for AssemblyName (#82754)
Buyaa Namnan [Tue, 28 Feb 2023 17:58:27 +0000 (09:58 -0800)]
Do not use ALC name for AssemblyName (#82754)

19 months ago[ComInterfaceGenerator] Rewrite exception handler if retval is a pointer (#82740)
Jackson Schuster [Tue, 28 Feb 2023 17:32:29 +0000 (09:32 -0800)]
[ComInterfaceGenerator] Rewrite exception handler if retval is a pointer (#82740)

19 months agoJIT: Revise DFS RPO computation (#82752)
Andy Ayers [Tue, 28 Feb 2023 16:09:45 +0000 (08:09 -0800)]
JIT: Revise DFS RPO computation (#82752)

Give block postorder numbers their customary meaning: the block's position
in the postorder, not in the reverse postorder.

Rename "InvPostOrder" to the more customary ReversePostorder. Also, compute
preorder numbers.

Preparatory work for running DFS RPO earlier to classify edges.

19 months agoPreserve OCE.CancellationToken in StreamPipeReader (#82745)
Stephen Halter [Tue, 28 Feb 2023 15:00:37 +0000 (07:00 -0800)]
Preserve OCE.CancellationToken in StreamPipeReader (#82745)

19 months ago[class] DIMs in the vtable of abstract classes may be overridden (#82556)
Aleksey Kliger (λgeek) [Tue, 28 Feb 2023 14:11:18 +0000 (09:11 -0500)]
[class] DIMs in the vtable of abstract classes may be overridden (#82556)

* [class]  treat slot as empty if it's filled in with a DIM

   Classes may override an interface method slot if it was filled in with a DIM, just as if it was empty.

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

19 months agoCorrect "abstact" to "abstract". (#82738)
Shawn Beachy [Tue, 28 Feb 2023 12:43:22 +0000 (07:43 -0500)]
Correct "abstact" to "abstract". (#82738)

19 months agotest retry logic (#82722)
Pavel Savara [Tue, 28 Feb 2023 11:10:36 +0000 (12:10 +0100)]
test retry logic (#82722)

19 months ago[jiterp] Remove write barrier from ldelem_ref (#82757)
Katelyn Gadd [Tue, 28 Feb 2023 09:10:22 +0000 (01:10 -0800)]
[jiterp] Remove write barrier from ldelem_ref (#82757)

19 months ago[main] Update dependencies from dotnet/arcade (#82599)
dotnet-maestro[bot] [Tue, 28 Feb 2023 09:01:39 +0000 (10:01 +0100)]
[main] Update dependencies from dotnet/arcade (#82599)

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Eric StJohn <ericstj@microsoft.com>
Co-authored-by: Elinor Fung <elfung@microsoft.com>
19 months ago[mono][interp] Add instrinsics for common Vector128 operations (#81782)
Vlad Brezae [Tue, 28 Feb 2023 08:07:07 +0000 (10:07 +0200)]
[mono][interp] Add instrinsics for common Vector128 operations (#81782)

* [mono][interp] Move defines from transform.c

* [mono][interp] Move more defines from transform.c

* [mono][interp] Add intrinsics for most common V128 operations

We add intrinsics for Vector128 intrinsics that are actively used within our bcl.

We declare a set of simd method names, the same way we do it with jit, in `simd-methods.def`. In `transform-simd.c` we lookup method names in the list of supported intrinsics for `Vector128` and `Vector128<T>`. Once we find a supported instrinsic, we generate code for it, typically a `MINT_SIMD_INTRINS_*` opcode. In order to avoid adding too many new opcodes to the interpreter, simd intrinsics are grouped by signature. So all simd intrinsics that receive a single argument and return a value, will be called through `MINT_SIMD_INTRINS_P_P`. This instruction will receive an index to get the intrinsic implementation and calls it indirectly.

Some of the intrinsics are implemented using the standard vector intrinsics, supported by gcc and clang. These do not fully expose the SIMD capabilities, so some intrinsics are implemented naively. This should still be faster than using nonvectorized approach from managed code. In the future we can add better implmentation, on platforms where we have low level support. This would both be faster and reduce code size.

* [mono][interp] Add option to disable simd intrinsics

* [mono][interp] Disable simd intrinsics by default on wasm

These intrinsics are not yet implemented on jiterpreter, making it slighty slower instead.

* [mono][interp] Replace v128_create with v128_ldc if possible

v128_create receives as an argument every single element of the vector. This method is typically used with constants. For a Vector128<short> this means that creating a constant vector required 8 ldc.i4 and a v128_create. We can instead use a single instruction and embed the vector value in the code stream directly.

* [mono][interp] Remove op_Division

It is actually not used in bcl, it is not really vectorized on any platforms and the codegen for the interp implementation is massive and inefficient.

* [mono][interp] Don't emit intrinsics for unsupported vector types

* [mono][interp] Vector extensions used in these intrinsics are a GNUC extension

19 months agoStop incrementing class profile counter once the reservoir table is full (#82723)
Andy Ayers [Tue, 28 Feb 2023 07:53:18 +0000 (23:53 -0800)]
Stop incrementing class profile counter once the reservoir table is full (#82723)

The counter in the class profile counter is used to determine when to
switch to probabilistic updates of the reservior table, but it is currently
not used to detemine the probability of an update. So there's no need to keep
incrementing it once the table is full.

Since the count is mutable shared state, bypassing updates should reduce cache
contention somewhat.

Contributes to #72387.

19 months agoTrim managed debugging support code (#82696)
Michal Strehovský [Tue, 28 Feb 2023 07:22:28 +0000 (16:22 +0900)]
Trim managed debugging support code (#82696)

NativeAOT is not debugged with a managed debugger that would be able to understand these. It's also questionable whether a possible future managed debugger would be using this (versus debugging with IL that gets embedded in debugging symbols like .NET Native does).

19 months agoAdd support for skipping workloads testing for previous versions (#82742)
Ankit Jain [Tue, 28 Feb 2023 03:04:58 +0000 (22:04 -0500)]
Add support for skipping workloads testing for previous versions (#82742)

* Add support for skipping workloads testing for previous versions

This will skip installing manifests for 6, and 7, for example, and
install only install the latest ones. This is because on release
branches the newest versions might not have public packages available
yet.

* Set $(WorkloadsTestPreviousVersions) in the yml

.. based on the branch. Set it to `true` only for `main`.

19 months agoBump main PreReleaseVersionIteration to 3 (#82658)
Carlos Sánchez López [Tue, 28 Feb 2023 00:47:31 +0000 (18:47 -0600)]
Bump main PreReleaseVersionIteration to 3 (#82658)

* Bump main PreReleaseVersionIteration to 3

* [wasm] Update emscripten dependencies to preview3

---------

Co-authored-by: carlossanlop <carlossanlop@users.noreply.github.com>
Co-authored-by: Ankit Jain <radical@gmail.com>
19 months agoSplit generic virtual method slot use and impl tracking (#82222)
Michal Strehovský [Mon, 27 Feb 2023 23:49:37 +0000 (08:49 +0900)]
Split generic virtual method slot use and impl tracking (#82222)

* Split generic virtual method slot use and impl tracking

I'm looking at generic virtual method again because of #80602.

The analysis of generic virtual methods within the compiler is an N * M algorithm where N is the number of unique generic virtual method instantiations called and M is the number of types that implement generic virtual methods.

We use dynamic dependencies within the dependency analysis engine to model this relationship.

It is important to try to limit the N and M. Looking at things, I realized the N we're currently operating on is bigger than it needs to be:

```csharp
Foo f = new Bar();
f.Blah<int>();
f = new Baz();
f.Blah<double>();

class Foo { public virtual void Blah<T>() { } }
class Bar : Foo { public override void Blah<T> { } }
class Baz : Foo { public override void Blah<T> { } }
```

Previously, the analysis would see M = 3 and N = 6 because we would track each of the overrides as something that needs to be considered for each M. This changes the analysis to only look at the definition of the slot, i.e. N = 2 (one for int, other for double).

The result of the analysis will still be same, it will just take less time. The new GenericVirtualMethodImpl node responds false to HasDynamicDependencies and doesn't participate in expensive activities.

19 months agoReplace IlcHostArch with SDK-computed value (#82645)
Adeel Mujahid [Mon, 27 Feb 2023 23:00:34 +0000 (01:00 +0200)]
Replace IlcHostArch with SDK-computed value (#82645)

* Replace IlcHostArch with SDK-computed value

* Respect TPI in targetOS calculation

* Keep using OSArchitecture on Windows

* Simplify host vs. target package prop name

* Avoid mixing host/target

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
* Avoid mixing host/target

* Use _targetOS and _targetArchitecture in conditions

* .

* Derive _targetOS from RuntimeIdentifier

* Fix copy/paste error

* Remove condition that always evaluates to true

* Revert "Remove condition that always evaluates to true"

This reverts commit c9e910eb3e4340c968b84ccc1ab95569d8447f03.

---------

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
19 months agoPrevent tests from importing "normal" NuGet props/targets (#80573)
SingleAccretion [Mon, 27 Feb 2023 21:08:08 +0000 (00:08 +0300)]
Prevent tests from importing "normal" NuGet props/targets (#80573)

We import them manually from a shared location.

Usually this is not a problem because batch build (via the build script)
does its own restore thing, but it is a problem in case the project is
restored on its own, such as when it is built with "dotnet build".

19 months agoFix a typo. (#78105)
Zoltan Varga [Mon, 27 Feb 2023 21:03:47 +0000 (16:03 -0500)]
Fix a typo. (#78105)

19 months agoJust create the C# file with colon on name on Linux, keep the csproj always there...
Thays Grazia [Mon, 27 Feb 2023 20:05:16 +0000 (17:05 -0300)]
Just create the C# file with colon on name on Linux, keep the csproj always there (#82724)

19 months ago[wasi] Build cross compiler for wasi. (#82702)
Zoltan Varga [Mon, 27 Feb 2023 20:01:53 +0000 (15:01 -0500)]
[wasi] Build cross compiler for wasi. (#82702)

* [wasi] Build cross compiler for wasi.

* Disable building the cross compiler on windows for now.

19 months ago[wasm] don't call export_internal twice (#82713)
Aleksey Kliger (λgeek) [Mon, 27 Feb 2023 18:20:40 +0000 (13:20 -0500)]
[wasm] don't call export_internal twice (#82713)

19 months agoFix pthread_cond_wait race on macOS (#82709)
Jan Vorlicek [Mon, 27 Feb 2023 17:29:55 +0000 (18:29 +0100)]
Fix pthread_cond_wait race on macOS (#82709)

The native runtime event implementations for nativeaot and GC use
pthread_cond_wait to wait for the event and pthread_cond_broadcast
to signal that the event was set. While the usage of the
pthread_cond_broadcast conforms with the documentation, it turns out
that glibc before 2.25 had a race in the implementation that can
cause the pthread_cond_broadcast to be unnoticed and the wait
waiting forever. It turns out that macOS implementation has the
same issue.
The fix for the issue is to call pthread_cond_broadcast while the
related mutex is taken.

This change fixes intermittent crossgen2 hangs with nativeaot build of
crossgen2 reported in #81570. I was able to repro the hang locally in
tens of thousands of iterations of running crossgen2 without any arguments
(the hang occurs when server GC creates threads). With this fix,
it ran without problems over the weekend, passing 5.5 million iterations.

19 months agoSet VSDebugger_ValidateDotnetDebugLibSignatures (#82710)
Viktor Hofer [Mon, 27 Feb 2023 16:55:41 +0000 (17:55 +0100)]
Set VSDebugger_ValidateDotnetDebugLibSignatures (#82710)

When using the `-vs` switch, disable signature validation. See https://github.com/dotnet/runtime/blob/main/docs/workflow/building/libraries/README.md#debugging for more details