platform/upstream/dotnet/runtime.git
4 years agoUse Package suffix instead of PackageId and Version suffix instead of PackageVersion...
Viktor Hofer [Fri, 1 Nov 2019 17:27:23 +0000 (18:27 +0100)]
Use Package suffix instead of PackageId and Version suffix instead of PackageVersion (dotnet/corefx#42289)

* Use Package suffix instead of PackageId

* Manual darc update from build '20191101.2'

Commit migrated from https://github.com/dotnet/corefx/commit/931f79e4670cb73c9347e14714fd892907be6630

4 years agoAdd new method for parameterless Listen() (dotnet/corefx#42262)
Mohammed Adenwala [Fri, 1 Nov 2019 16:23:40 +0000 (11:23 -0500)]
Add new method for parameterless Listen() (dotnet/corefx#42262)

* Add new method for parameterless Listen()

This adds a parameterless overload for Listen(int) which passes in int.MaxValue as the default value. I changed existing tests that were explicitly using int.MaxValue or a random value to use the new overload with no parameter.

* Update src/System.Net.Sockets/src/System/Net/Sockets/Socket.cs

Co-Authored-By: Stephen Toub <stoub@microsoft.com>
Commit migrated from https://github.com/dotnet/corefx/commit/8bdfd53bd23f7242a96c72f152bed5e2adf684fc

4 years ago Use clonefile for CopyFile, if available (dotnet/corefx#37583)
Filip Navara [Fri, 1 Nov 2019 16:22:48 +0000 (17:22 +0100)]
 Use clonefile for CopyFile, if available (dotnet/corefx#37583)

* Rework SystemNative_CopyFile to use paths instead of file descriptors

Use clonefile for CopyFile, if available

* Bail out in SystemNative_CopyFile if access fails. We don't want to proceed if the destination file is read-only.

* Handle a race condition where clonefile can result in EEXIST error

* Update comment about fcopyfile

* Update PathInternal.TrimEndingDirectorySeparator to Path.TrimEndingDirectorySeparator

* Add missing close(outFd) call

* Remove unnecessary ! operator

* Save errno around close(outFd) calls

* access already sets EACCESS errno, just keep it

* Remove fcopyfile support

* Open destination file with O_CLOEXEC

* Return correct error code for source == destination

* Rearrange error handling a bit

* Remove forgotten HAVE_FCOPYFILE

Commit migrated from https://github.com/dotnet/corefx/commit/5f45a8d5aa116d688f92952a1de72abd8b30f1a7

4 years agoConsolidate .netcoreapp.cs files because System.Text.Encoding project is no longer...
Roman Marusyk [Fri, 1 Nov 2019 13:58:20 +0000 (14:58 +0100)]
Consolidate .netcoreapp.cs files because System.Text.Encoding project is no longer cross-compiled (dotnet/corefx#42282)

Commit migrated from https://github.com/dotnet/corefx/commit/1394f2df79628c9f18f8de0dd4bbd6ce4984d807

4 years agoHonor dictionary key policy when entry value is null (dotnet/corefx#42267)
Layomi Akinrinade [Fri, 1 Nov 2019 02:27:18 +0000 (19:27 -0700)]
Honor dictionary key policy when entry value is null (dotnet/corefx#42267)

* Honor dictionary key policy when entry value is null

* Address review feedback

* Remove reverse Json checks

Commit migrated from https://github.com/dotnet/corefx/commit/a24db0ba5666f46f50649810fe698ad267b60331

4 years agoImprove LINQ diagnosability and startup performance (dotnet/corefx#42187)
David Wrighton [Fri, 1 Nov 2019 01:08:45 +0000 (18:08 -0700)]
Improve LINQ diagnosability and startup performance (dotnet/corefx#42187)

* - Generate LINQ interpreter Thunks with unique names
- Instead of generating thunks, for common cases, use a pre-compiled C# method.
  - This results in using generic sharing for many instead of requiring exact compiled code
* Give Compiled LINQ lambda expressions unique names

Commit migrated from https://github.com/dotnet/corefx/commit/4410ec0ce84a5773a76b1302b59565da1e0c4337

4 years agoExtend BOM test (dotnet/corefx#42279)
Steve Harter [Fri, 1 Nov 2019 00:48:02 +0000 (19:48 -0500)]
Extend BOM test (dotnet/corefx#42279)

Commit migrated from https://github.com/dotnet/corefx/commit/5d92ba3e6bf4bf8f211f43ad4717572a2a3b4539

4 years agoHttpStress: add docker documentation (dotnet/corefx#42268)
Eirik Tsarpalis [Thu, 31 Oct 2019 22:46:28 +0000 (22:46 +0000)]
HttpStress: add docker documentation (dotnet/corefx#42268)

* httpstress: add documentation on dockerized stress runs

* fix stress yml issue

* fix doc issues

* remove commented out code

* remove accidental change

* yaml pipeline variables naming consistency

* Update eng/pipelines/stress/http-linux.yml

Co-Authored-By: Stephen Halter <halter73@gmail.com>
Commit migrated from https://github.com/dotnet/corefx/commit/4c3bd8a0533a2e35df371b91045a1a5f0ada7d54

4 years agoChange master from testing Ubuntu 19.04 to Ubuntu 19.10
Jeremy Barton [Thu, 31 Oct 2019 22:26:18 +0000 (15:26 -0700)]
Change master from testing Ubuntu 19.04 to Ubuntu 19.10

Commit migrated from https://github.com/dotnet/corefx/commit/f87d27dbf7017f2d5ac62576fe4f82e9cc2955a6

4 years agoAnnotate System.Text.RegularExpressions for nullability (dotnet/corefx#42132)
Eirik Tsarpalis [Thu, 31 Oct 2019 22:08:58 +0000 (22:08 +0000)]
Annotate System.Text.RegularExpressions for nullability (dotnet/corefx#42132)

* Annotate System.Text.RegularExpressions for nullability

* fix release build

* address feedback

* address feedback

* disable compiler warning in TryGetValue annotation

* change annotation to MaybeNullWhen()

* Revert "change annotation to MaybeNullWhen()"

This reverts commit dotnet/corefx@542404ffb147dfc5cc40a6acb4a1e101317aef8a.

* remove redundant comment

* update reference source

* disable nullability warning in reference source

* remove outdated comment

* replace bangs with single Debug.Assert() at top of method body

Commit migrated from https://github.com/dotnet/corefx/commit/d9ed01e65181a88d09ffa864b68353d622f75e89

4 years agoUpdate developer-guide.md
Viktor Hofer [Thu, 31 Oct 2019 21:18:35 +0000 (22:18 +0100)]
Update developer-guide.md

Commit migrated from https://github.com/dotnet/corefx/commit/f1115d4c008b12db69a47c0473aee8ae8c79b204

4 years agoFix ILLink when run from VS/desktop/direct (dotnet/corefx#42266)
Eric StJohn [Thu, 31 Oct 2019 19:43:54 +0000 (12:43 -0700)]
Fix ILLink when run from VS/desktop/direct (dotnet/corefx#42266)

ILLink needs the path to dotnet.exe and was relying on an optional
environment variable to find it.

Instead use the NetCoreRoot property set by the SDK.

This is a direct copy of
https://github.com/dotnet/sdk/blob/dotnet/corefx@b28a8efbfb30d84019351abb3aa9a2b15e008662/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.ILLink.targets#L74-L80

We should try to eliminate our custom illink.targets and just configure
the built in ones if we can.

Commit migrated from https://github.com/dotnet/corefx/commit/18d2d60caa5ddfc89f9a8bce6568cf207b4d1c24

4 years agoUse PackageLicenseExpression instead of URL (dotnet/corefx#42271)
Eric StJohn [Thu, 31 Oct 2019 19:42:42 +0000 (12:42 -0700)]
Use PackageLicenseExpression instead of URL (dotnet/corefx#42271)

* Use PackageLicenseExpression instead of URL

* Cleanup packaging properties from Directory.Build.props

Commit migrated from https://github.com/dotnet/corefx/commit/987158f576e4ac4db1a4c1058cbbd5607ab22e69

4 years agoImport root D.B.targets and set condition (dotnet/corefx#42261)
Viktor Hofer [Thu, 31 Oct 2019 16:40:32 +0000 (17:40 +0100)]
Import root D.B.targets and set condition (dotnet/corefx#42261)

Commit migrated from https://github.com/dotnet/corefx/commit/34e4c520baa8535432011bb5ea527b8b81422b4d

4 years agoUpdate System.Reflection.TypeExtensions ref assembly for nullable (dotnet/corefx...
Santiago Fernandez Madero [Thu, 31 Oct 2019 11:37:23 +0000 (05:37 -0600)]
Update System.Reflection.TypeExtensions ref assembly for nullable (dotnet/corefx#42256)

Commit migrated from https://github.com/dotnet/corefx/commit/4fb7feaa9ce6010207c9e42b0b3076c3db2f8af0

4 years agoFix System.Composition.* public key (dotnet/corefx#42232)
Eric StJohn [Thu, 31 Oct 2019 06:43:12 +0000 (23:43 -0700)]
Fix System.Composition.* public key (dotnet/corefx#42232)

Commit migrated from https://github.com/dotnet/corefx/commit/18e82cabc1d2cddad8ff07ae96edb7296d9fad9d

4 years agoUpdate analyzer versions (dotnet/corefx#42249)
Stephen Toub [Thu, 31 Oct 2019 04:27:10 +0000 (00:27 -0400)]
Update analyzer versions (dotnet/corefx#42249)

* Update analyzer packages to latest NuGet versions

* Fix new warnings

Commit migrated from https://github.com/dotnet/corefx/commit/51686cbf80a980f187a144fa02cf3730ef16ba00

4 years agoFix inefficient string manipulations in RegularExpressions tests (dotnet/corefx#42241)
Jan Kotas [Thu, 31 Oct 2019 01:57:48 +0000 (18:57 -0700)]
Fix inefficient string manipulations in RegularExpressions tests (dotnet/corefx#42241)

* Fix inefficient string manipulations in RegularExpressions tests

* CR feedback

* Consistent style

Commit migrated from https://github.com/dotnet/corefx/commit/54efc1141aba6c1572f3128372ee8835d063c850

4 years agoImprove test failure msg (dotnet/corefx#42247)
Dan Moseley [Thu, 31 Oct 2019 01:54:28 +0000 (18:54 -0700)]
Improve test failure msg (dotnet/corefx#42247)

Commit migrated from https://github.com/dotnet/corefx/commit/253f0d565c132bc98d9cf52c04c662a3373b49c4

4 years agoClean up Uri.UnescapeDataString (dotnet/corefx#42225)
Stephen Toub [Thu, 31 Oct 2019 00:00:25 +0000 (20:00 -0400)]
Clean up Uri.UnescapeDataString (dotnet/corefx#42225)

- Use string.IndexOf rather than an open-coded, unsafe loop.
- Avoid an unnecessary SequenceEquals at the end: we're only at this point if a `%` was found highlighting that something escaped was found.
- Use stack memory for smaller inputs if possible, to avoid unnecessary ArrayPool interaction
- Remove an unnecessary argument to a helper function.
- Fix ValueStringBuilder.Grow to only copy the contained data.

Commit migrated from https://github.com/dotnet/corefx/commit/04f79d96e8ce89e738e7f8f595f43a52e9cdd4a4

4 years agoDelete PlatformHelper class (dotnet/corefx#42230)
Stephen Toub [Wed, 30 Oct 2019 23:59:22 +0000 (19:59 -0400)]
Delete PlatformHelper class (dotnet/corefx#42230)

Commit migrated from https://github.com/dotnet/corefx/commit/d2a34404d4161de27db1c99908296f0f6100820f

4 years agoMerge pull request dotnet/corefx#42242 from wfurt/outerloop_42231
David Shulman [Wed, 30 Oct 2019 23:01:16 +0000 (16:01 -0700)]
Merge pull request dotnet/corefx#42242 from wfurt/outerloop_42231

Move CertificateValidationRemoteServer_EndToEnd_Ok to outerloop

Commit migrated from https://github.com/dotnet/corefx/commit/ba0e3f73e61c4fd6fcce00ab08e55acef1cebaa9

4 years agomove CertificateValidationRemoteServer_EndToEnd_Ok to outerloop
wfurt [Wed, 30 Oct 2019 22:32:39 +0000 (15:32 -0700)]
move CertificateValidationRemoteServer_EndToEnd_Ok to outerloop

Commit migrated from https://github.com/dotnet/corefx/commit/394c370434ee286659dbcd563076080850bbd074

4 years agoFix deserialize issue with a large Stream containing a BOM (dotnet/corefx#42206)
Steve Harter [Wed, 30 Oct 2019 22:00:33 +0000 (17:00 -0500)]
Fix deserialize issue with a large Stream containing a BOM (dotnet/corefx#42206)

Commit migrated from https://github.com/dotnet/corefx/commit/9009ad1ebf44656a60f306a114ecdbd64c6a1d23

4 years agoFix System.Net.WebUtility.HtmlDecode issue (dotnet/corefx#42227)
Eirik Tsarpalis [Wed, 30 Oct 2019 19:05:45 +0000 (19:05 +0000)]
Fix System.Net.WebUtility.HtmlDecode issue (dotnet/corefx#42227)

Fix WebUtility.HtmlDecode bug

Commit migrated from https://github.com/dotnet/corefx/commit/fd454581475dd32b88ed45d38976855f24bd6751

4 years agoAdd tests for custom JavaScriptEncoder to cover the virtual code paths in TextEncoder...
Ahson Khan [Wed, 30 Oct 2019 18:05:12 +0000 (11:05 -0700)]
Add tests for custom JavaScriptEncoder to cover the virtual code paths in TextEncoder, and address previous feedback. (dotnet/corefx#42064)

* Move using directive within ifdef to make it clear when its used.

* Add more tests for custom text encoder case.

* Fix typo in comment gaurd -> guard

* Fix up the using directives that got removed during merge conflict
resolution.

* Address feedback - fix 0x7F case, rename vectors to be self-documenting.

Commit migrated from https://github.com/dotnet/corefx/commit/62e6ccfa09322db02d6c043226bd382debc915c4

4 years agoAdd file creation method that takes an ACL (dotnet/corefx#42099)
Carlos Sanchez Lopez [Tue, 29 Oct 2019 22:48:49 +0000 (15:48 -0700)]
Add file creation method that takes an ACL (dotnet/corefx#42099)

Approved API Proposal: dotnet/corefx#41614
Related change for directory creation method that takes an ACL: dotnet/corefx#41834 -merged and ported to 3.1 Prev2

Description
We have extension methods in System.IO.FileSystem.AclExtensions that let the user get and set ACLs for existing files, but we do not have methods that create files with predefined ACLs.
.NET ACL (Access Control List) support is Windows specific. This change will reside inside the System.IO.FileSystem.AccessControl assembly.

Customer impact
Before this change, customers had to create a file or filestream, then set its ACLs. This presents a few problems:

Potential security hole as files can be accessed between creation and modification.
Porting difficulties as there isn't a 1-1 API replacement
Stability issues with background processes (file filters) can prevent modifying ACLs right after creation (typically surfaces as a security exception).
This change addresses those problems by adding a new extension method that allows creating a file and ensuring the provided ACLs are set during creation.
This change is expected to be backported to 3.1.

Commit migrated from https://github.com/dotnet/corefx/commit/508cbc4f1021e260b52981b8510cc5a5881441d3

4 years agoHandle binary formatted payloads with ResX mangled generic type names (dotnet/corefx...
Eric StJohn [Tue, 29 Oct 2019 22:01:50 +0000 (15:01 -0700)]
Handle binary formatted payloads with ResX mangled generic type names (dotnet/corefx#42102)

* Handle binary formatted payloads with ResX mangled generic type names

ResXSerializationBinder on desktop corrupted type names for generic parameters
in the binary formatted payload.  It would also undo this in the reader,
but we don't benefit from that in .NETCore since we don't deserialize
during build: we just copy the preserialized payload into the resources.

To handle this, we use a serialization binder to un-mangle the type names
in a way similar to ResXSerializationBinder.  We do it slightly differently
so that we only do it when needed, since relying on the binder to resolve
the type bypasses the type cache in BinaryFormatter.

* Respond to feedback.

Commit migrated from https://github.com/dotnet/corefx/commit/feebf02c8ef122bf0ea47b05d432aa080a49503b

4 years agoFix typo in sourcelink targets import (dotnet/corefx#42198)
Viktor Hofer [Tue, 29 Oct 2019 18:32:28 +0000 (19:32 +0100)]
Fix typo in sourcelink targets import (dotnet/corefx#42198)

Fixes https://github.com/dotnet/corefx/issues/42196

Commit migrated from https://github.com/dotnet/corefx/commit/7a686d120078e74d056f5de6dde1f5b4c348671a

4 years agoAvoid duplicated message in WebException (dotnet/corefx#42195)
Stephen Toub [Tue, 29 Oct 2019 17:52:12 +0000 (13:52 -0400)]
Avoid duplicated message in WebException (dotnet/corefx#42195)

In a bunch of places, including in HttpClient, when a new exception instance is created to wrap an inner exception, the inner exception's message is then used as the message for the wrapping exception.  WebRequest.CreateCompatibleException is taking such an HttpRequestException and concatenating the outer and inner exception's messages, which means it's often duplicating the exact same message twice.

Since we're including the exception as the inner exception, there's no need for such duplication... we can just follow suit and use the outer exception's message without concatenation.

Commit migrated from https://github.com/dotnet/corefx/commit/d7fbeca702660476d955911ea1cfc5e78c27df2e

4 years agoUse docker-compose for running stress tests (dotnet/corefx#42186)
Eirik Tsarpalis [Tue, 29 Oct 2019 16:46:09 +0000 (16:46 +0000)]
Use docker-compose for running stress tests (dotnet/corefx#42186)

HttpStress: add docker-compose scenario

Commit migrated from https://github.com/dotnet/corefx/commit/df648522fd1a1bfaa14e9d1ae7c2eaf4a9c87a7c

4 years agoPrepare corefx for repo consolidation (dotnet/corefx#42175)
Viktor Hofer [Tue, 29 Oct 2019 11:44:25 +0000 (12:44 +0100)]
Prepare corefx for repo consolidation (dotnet/corefx#42175)

* Prepare corefx for repo consolidation into runtime

Commit migrated from https://github.com/dotnet/corefx/commit/e160dd972d958fbe9594dc1001da4d1b94bba949

4 years agoConsolidate .netcoreapp.cs test files in System.Runtime.Extensions (dotnet/corefx...
Roman Marusyk [Tue, 29 Oct 2019 00:58:42 +0000 (01:58 +0100)]
Consolidate .netcoreapp.cs test files in System.Runtime.Extensions (dotnet/corefx#42184)

* Consolidate .netcoreapp.cs files because System.Runtime.Extensions project is no longer cross-compiled

* Fix AppDomainTests

Commit migrated from https://github.com/dotnet/corefx/commit/15e1ea023d2818b6083a61c7447a720ff3779482

4 years agoFix build break
Stephen Toub [Mon, 28 Oct 2019 21:11:10 +0000 (17:11 -0400)]
Fix build break

Commit migrated from https://github.com/dotnet/corefx/commit/be5f981716d921976d1f2271d872cac63ef6e9d8

4 years agoRemove ILLinkTrim.xml from System.Data.Common (dotnet/corefx#42165)
Stephen Toub [Mon, 28 Oct 2019 20:41:12 +0000 (16:41 -0400)]
Remove ILLinkTrim.xml from System.Data.Common (dotnet/corefx#42165)

Commit migrated from https://github.com/dotnet/corefx/commit/f706c6522e6b4641fc8f95e14c4f9f7e0d6835fa

4 years agoRemove several entries from ILLinkTrim.xml in System.ComponentModel.TypeConverter...
Stephen Toub [Mon, 28 Oct 2019 20:40:43 +0000 (16:40 -0400)]
Remove several entries from ILLinkTrim.xml in System.ComponentModel.TypeConverter (dotnet/corefx#42182)

Commit migrated from https://github.com/dotnet/corefx/commit/9c8245c74cac2f3d07c22b04dfa23f3a740efd25

4 years agoAdd support to produce WebAssembly runtime assets (dotnet/corefx#42128)
Santiago Fernandez Madero [Mon, 28 Oct 2019 20:00:38 +0000 (14:00 -0600)]
Add support to produce WebAssembly runtime assets (dotnet/corefx#42128)

* Add support to produce WebAssembly runtime assets

* Add support to build in OSX and address PR feedback

* Change AND -> and in Directory.Build.props change region

* PR Feedback: run build in rolling CI builds as well

* Add TODO comment for WebAssembly OSGroup

* Fix indentation.

* Fix wrong #include as apis defined in that include are used outside of ETHTOOL_H #if-def

Commit migrated from https://github.com/dotnet/corefx/commit/179013357896ab947523bdf9961c02f8504db6ff

4 years agoMove PreserveDependencyAttribute to shared (dotnet/corefx#42174)
Stephen Toub [Mon, 28 Oct 2019 17:47:23 +0000 (13:47 -0400)]
Move PreserveDependencyAttribute to shared (dotnet/corefx#42174)

We need to use it in corelib, too.

Commit migrated from https://github.com/dotnet/corefx/commit/51f11ec4e94f0f7b7b8bacc8e7233c0578ebd39d

4 years agoRemove ILLinkTrim.xml from System.Linq.Expressions (dotnet/corefx#42158)
Stephen Toub [Mon, 28 Oct 2019 12:52:34 +0000 (08:52 -0400)]
Remove ILLinkTrim.xml from System.Linq.Expressions (dotnet/corefx#42158)

* Remove ILLinkTrim.xml from System.Linq.Expressions

* Address PR feedback

Commit migrated from https://github.com/dotnet/corefx/commit/80ec55f39f587fa2ebb92982c32723ba80b8e247

4 years agoUpdate project-guidelines.md (dotnet/corefx#42169)
Eirik Tsarpalis [Mon, 28 Oct 2019 10:10:10 +0000 (10:10 +0000)]
Update project-guidelines.md (dotnet/corefx#42169)

Commit migrated from https://github.com/dotnet/corefx/commit/ffb94ad2c2d7c14fd9be82d365a28a60725b4f9f

4 years agoDelete ILLinkTrim.xml (and associated dead code) from System.Text.Encodings.Web ...
Stephen Toub [Mon, 28 Oct 2019 03:47:48 +0000 (23:47 -0400)]
Delete ILLinkTrim.xml (and associated dead code) from System.Text.Encodings.Web (dotnet/corefx#42166)

This is all stale/dead code from before the relevant functionality was made public.

Commit migrated from https://github.com/dotnet/corefx/commit/17c14aa2b50cfb5920d03ea8835c9a4932b5359c

4 years agoAvoid referencing LightCompiler if only Compile() is used (dotnet/corefx#42163)
Stephen Toub [Mon, 28 Oct 2019 03:24:35 +0000 (23:24 -0400)]
Avoid referencing LightCompiler if only Compile() is used (dotnet/corefx#42163)

Invert the dependency between Compile() and Compile(bool) to avoid rooting the LightCompiler if only Compile() is used.

Commit migrated from https://github.com/dotnet/corefx/commit/bb725e42e48b816a1041c83f610bed711a5f4f41

4 years agoConsolidate .netcoreapp.cs test files in System.Runtime (dotnet/corefx#42100)
Roman Marusyk [Mon, 28 Oct 2019 03:22:40 +0000 (04:22 +0100)]
Consolidate .netcoreapp.cs test files in System.Runtime (dotnet/corefx#42100)

* Consolidate .netcoreapp.cs files because System.Runtime project is no longer cross-compiled

Commit migrated from https://github.com/dotnet/corefx/commit/d6dac9e6a7875862b91139334c8ec620f599cd4d

4 years agoAnnotate System.Reflection.TypeExtensions for nullable references (dotnet/corefx...
Dan Moseley [Sun, 27 Oct 2019 20:47:34 +0000 (13:47 -0700)]
Annotate System.Reflection.TypeExtensions for nullable references (dotnet/corefx#42159)

* merge

* CR

* typo

* msbuild /t:GenerateReferenceSource

Commit migrated from https://github.com/dotnet/corefx/commit/1597b894a2e9cac668ce6e484506eca778a85197

4 years agoUpdate illink.targets to keep PreserveDependencyAttribute (dotnet/corefx#42157)
Stephen Toub [Sun, 27 Oct 2019 20:46:54 +0000 (16:46 -0400)]
Update illink.targets to keep PreserveDependencyAttribute (dotnet/corefx#42157)

* Update illink.targets to keep PreserveDependencyAttribute

* Update illink.targets

Commit migrated from https://github.com/dotnet/corefx/commit/2db6db4a51ab72078126ce288c8c39ad7bbb459f

4 years agoRemove ILLinkTrim.xml from System.Net.Security (dotnet/corefx#42156)
Stephen Toub [Sun, 27 Oct 2019 20:46:04 +0000 (16:46 -0400)]
Remove ILLinkTrim.xml from System.Net.Security (dotnet/corefx#42156)

* Fix NetEventSource in System.Net.Security to properly delegate to events

Two events were set up in correctly, resulting in them getting trimmed away.  The ILLinkTrim.xml was then putting a bandaid on the problem.

* Fix System.Net.Mail.Unit.Tests to not use System.Net.Security internals

The unit tests are currently set up to test internals, and to do so by compiling in the product source.  My thoughts on this aside, it's currently incomplete as it's compiling in some code but then depending on other code via reflection to a completely different assembly.  We shouldn't be combining such approaches.  Delete the reflection code from the unit tests, and update the tests .csproj to include the additional files necessary (we should later revisit this whole scheme).

That lets us delete the ILLinkTrim.xml for the production System.Net.Security assembly.

Commit migrated from https://github.com/dotnet/corefx/commit/f98b0d9cfdcdba0fd424ceb6077a8f91a1ca00c3

4 years agoRemove versionless netstandard target group (dotnet/corefx#41984)
Viktor Hofer [Sun, 27 Oct 2019 16:08:59 +0000 (17:08 +0100)]
Remove versionless netstandard target group (dotnet/corefx#41984)

Commit migrated from https://github.com/dotnet/corefx/commit/26d7b6626ab0385a1158e674855f81ab73f628e0

4 years agoUpdate public-signing.md (dotnet/corefx#42129)
John Zabroski [Sat, 26 Oct 2019 21:35:20 +0000 (17:35 -0400)]
Update public-signing.md (dotnet/corefx#42129)

@jaredpar Updated this doc based on comments on Twitter discussion with you and @dsplaisted

Commit migrated from https://github.com/dotnet/corefx/commit/cf28b7896a762f71c990a5896a160a4138d833c9

4 years agoRemove ILLinkTrim.xml from System.Diagnostics.DiagnosticSource (dotnet/corefx#42124)
Stephen Toub [Sat, 26 Oct 2019 21:08:45 +0000 (17:08 -0400)]
Remove ILLinkTrim.xml from System.Diagnostics.DiagnosticSource (dotnet/corefx#42124)

- Use PreserveDependencyAttribute for ctors used via reflection by FetcherForProperty
- Remove reflection use entirely when looking up Activity events

Commit migrated from https://github.com/dotnet/corefx/commit/a5d7583c1dc46a0bbf97ba89791079fffd4f1755

4 years agoClean up use of PreserveDependencyAttribute in System.Text.Json (dotnet/corefx#42146)
Stephen Toub [Sat, 26 Oct 2019 20:03:21 +0000 (16:03 -0400)]
Clean up use of PreserveDependencyAttribute in System.Text.Json (dotnet/corefx#42146)

It's not necessary to specify the assembly name when the consumer is in the same assembly.

Commit migrated from https://github.com/dotnet/corefx/commit/e13b93bb645db8a2b77b9ee7663b56c3af6f2fbd

4 years agoRemove ILLinkTrim.xml from System.Net.Http (dotnet/corefx#42126)
Stephen Toub [Sat, 26 Oct 2019 20:02:39 +0000 (16:02 -0400)]
Remove ILLinkTrim.xml from System.Net.Http (dotnet/corefx#42126)

The file was there to keep anonymous types used by DiagnosticsHandler from having their getters removed.  But a) it was relying on the implementation detail name generated by Roslyn, and b) it was keeping alive other state from other anonymous types in the assembly.  I changed it to use concrete types instead.  This also happens to result in less code, because we don't need the generated Equals/GetHashCode methods generated for anonymous types.

Commit migrated from https://github.com/dotnet/corefx/commit/b8a21f62f29ca98394c30151bdd72ff36f10765c

4 years agoFix build break
Jan Kotas [Sat, 26 Oct 2019 15:02:42 +0000 (08:02 -0700)]
Fix build break

Commit migrated from https://github.com/dotnet/corefx/commit/3e6e68f17c9f75f131528c1c2e0642c4d07c9fd5

4 years agoDelete a few more instances of StringBuilderCache (dotnet/corefx#42139)
Jan Kotas [Sat, 26 Oct 2019 14:57:37 +0000 (07:57 -0700)]
Delete a few more instances of StringBuilderCache (dotnet/corefx#42139)

Commit migrated from https://github.com/dotnet/corefx/commit/bc78f93494ea732a5852ce46aded6ecfc5135731

4 years ago[master] Update dependencies from dotnet/coreclr (dotnet/corefx#42121)
dotnet-maestro[bot] [Sat, 26 Oct 2019 06:17:44 +0000 (06:17 +0000)]
[master] Update dependencies from dotnet/coreclr (dotnet/corefx#42121)

* Update dependencies from https://github.com/dotnet/coreclr build 20191025.1

- Microsoft.NET.Sdk.IL - 5.0.0-alpha1.19525.1
- Microsoft.NETCore.ILAsm - 5.0.0-alpha1.19525.1
- Microsoft.NETCore.Runtime.CoreCLR - 5.0.0-alpha1.19525.1

* remove Stopwatch.*.cs from System.Runtime.Extensions build

* Disable tests against CoreCLR bug

Commit migrated from https://github.com/dotnet/corefx/commit/8245ee1e8f6063ccc7a3a60cafe821d29e85b02f

4 years agoMerge pull request dotnet/corefx#42122 from yukiwongky/readonlycol
Yuki Wong [Fri, 25 Oct 2019 20:59:01 +0000 (13:59 -0700)]
Merge pull request dotnet/corefx#42122 from yukiwongky/readonlycol

Fix getting readonly column metadata

Commit migrated from https://github.com/dotnet/corefx/commit/c78b7189eabe20c6f4c8d386ca18b68fea513189

4 years agoRevert "Add support to produce WebAssembly runtime assets (dotnet/corefx#41777)"...
Santiago Fernandez Madero [Fri, 25 Oct 2019 20:41:15 +0000 (15:41 -0500)]
Revert "Add support to produce WebAssembly runtime assets (dotnet/corefx#41777)" (dotnet/corefx#42127)

This reverts commit dotnet/corefx@c57cba795a0e0a2905f6ce48009cde1d23cd7a19.

Commit migrated from https://github.com/dotnet/corefx/commit/76cfbcfb7f6204b77eabc21f0bfbd83b7cf1cf80

4 years agoAnnotate System.Reflection.DispatchProxy for nullable (dotnet/corefx#41904)
buyaa-n [Fri, 25 Oct 2019 19:23:06 +0000 (12:23 -0700)]
Annotate System.Reflection.DispatchProxy for nullable (dotnet/corefx#41904)

* Nullable annotation for System.IO.Compression

* Revert "Nullable annotation for System.IO.Compression"

* Annotate System.Reflection.DispatchProxy for nullable

* Applying feedback

* Applying feedback

* Banging some null assertions causing error on CI

* Banging some more to clean CI build

Commit migrated from https://github.com/dotnet/corefx/commit/720e74ae7dd8b70b80e7d9eaeddb149b947582d5

4 years agoAdd support to produce WebAssembly runtime assets (dotnet/corefx#41777)
Santiago Fernandez Madero [Fri, 25 Oct 2019 19:19:34 +0000 (14:19 -0500)]
Add support to produce WebAssembly runtime assets (dotnet/corefx#41777)

* Add support to produce WebAssembly runtime assets

* Add support to build in OSX and address PR feedback

* Change AND -> and in Directory.Build.props change region

* PR Feedback: run build in rolling CI builds as well

* Add TODO comment for WebAssembly OSGroup

Commit migrated from https://github.com/dotnet/corefx/commit/c57cba795a0e0a2905f6ce48009cde1d23cd7a19

4 years agoFix getting readonly column metadata
v-kaywon [Fri, 25 Oct 2019 19:08:24 +0000 (12:08 -0700)]
Fix getting readonly column metadata

Commit migrated from https://github.com/dotnet/corefx/commit/d162452c75d4e63063f3441f9e746d752ed1173d

4 years agoRemove ILLinkTrim.xml from System.Text.Json (dotnet/corefx#42118)
Stephen Toub [Fri, 25 Oct 2019 18:05:19 +0000 (14:05 -0400)]
Remove ILLinkTrim.xml from System.Text.Json (dotnet/corefx#42118)

* Remove ILLinkTrim.xml from System.Text.Json

Instead use PreserveDependencyAttribute.

* Address PR feedback

Commit migrated from https://github.com/dotnet/corefx/commit/567241af05d1e43142d04572dee84870b78761aa

4 years agoAnnotate System.Linq.Parallel for nullable ref types (dotnet/corefx#41533)
buyaa-n [Fri, 25 Oct 2019 16:35:56 +0000 (09:35 -0700)]
Annotate System.Linq.Parallel for nullable ref types (dotnet/corefx#41533)

* Nullable annotation for System.Linq.Parallel

Commit migrated from https://github.com/dotnet/corefx/commit/4a863a6232477c673f7a41aae656f5054f9dbc78

4 years agoUse NameOf in Conversion.vb (dotnet/corefx#42117)
Youssef Victor [Fri, 25 Oct 2019 15:55:35 +0000 (18:55 +0300)]
Use NameOf in Conversion.vb (dotnet/corefx#42117)

Commit migrated from https://github.com/dotnet/corefx/commit/be6bcd6cd996cc8e0e003e15a645e4c2f32e5249

4 years agoUpdate the S.T.E.W configurations to explicitly target a versioned TFM (nc3.0). ...
Ahson Khan [Fri, 25 Oct 2019 03:05:48 +0000 (20:05 -0700)]
Update the S.T.E.W configurations to explicitly target a versioned TFM (nc3.0). (dotnet/corefx#42069)

* Update the S.T.E.W configurations to explicitly target a versioned TFM
(nc3.0).

* Use custom defined constant like S.T.Json - Building_Inbox_Library

* Update config.props to use package config and leave netcoreapp as a build config

* Add back netcoreapp specific config to the src csproj

* Revert "Use custom defined constant like S.T.Json - Building_Inbox_Library"

This reverts commit dotnet/corefx@8648cf6d7f5cbe54a6b1facdebc3f33c255572a1.

* Remove extra new line.

Commit migrated from https://github.com/dotnet/corefx/commit/0954a975f972546314bd3ac4eb6e0a6380a85701

4 years agoUpdate SDL validation to use values from corefx-sdl-validation variable group (dotnet...
Santiago Fernandez Madero [Fri, 25 Oct 2019 00:30:59 +0000 (17:30 -0700)]
Update SDL validation to use values from corefx-sdl-validation variable group (dotnet/corefx#42098)

Commit migrated from https://github.com/dotnet/corefx/commit/cc81928acb2907ff0ae207630f82c2dfa37a9f89

4 years agoHttpStress: Add Stress Pipelines (dotnet/corefx#41833)
Eirik Tsarpalis [Thu, 24 Oct 2019 23:02:30 +0000 (00:02 +0100)]
HttpStress: Add Stress Pipelines (dotnet/corefx#41833)

Commit migrated from https://github.com/dotnet/corefx/commit/f41ba828c76126a871d986cb5b7e9c44ddf6f3d7

4 years agoAdd tests to verify that JSON deserializer doesn't do any multiplication or addition...
Eugene Samoylov [Thu, 24 Oct 2019 22:52:56 +0000 (03:52 +0500)]
Add tests to verify that JSON deserializer doesn't do any multiplication or addition on the string length (dotnet/corefx#41754)

* Add deserialization tests for very long input strings (dotnet/corefx#41687)

* Fix tests

* Add deserialization tests for the maximum possible string length

* Improve long strings creation in deserialization tests for netcoreapp

* Extract common logic from if/def block

* Fix assertion

* Remove unnecessary test cases

* Remove other extra test cases

Commit migrated from https://github.com/dotnet/corefx/commit/7105528014425ca7f042e05e8d57e9e243931a62

4 years agoUse ValueStringBuilder in UriHelper.UnescapeString (dotnet/corefx#41684)
Alexander Nikolaev [Thu, 24 Oct 2019 22:51:16 +0000 (00:51 +0200)]
Use ValueStringBuilder in UriHelper.UnescapeString (dotnet/corefx#41684)

* UriExt.UnescapeDataString avoids a new string allocation for an unmodified unescaped string

* Original dest array reuse fixed

* ValueStringBuilder is used instead of PooledCharArray

* Remove unused type

* Changes to ValueStringBuilder reverted

* IsStringSame replaced with SequenceEqual

* Array returned from buffer is cleared

* - Indexer-based assignment is replaced with Append method
- Explicit pooled array cleaning is removed

* .sln file changes reverted

* Build fixed

* UnescapeString always copies the result to dest array

* Unused code removed

* Original string reuse fixed

* Heap validation fixed

* - Small optimizations
- Code style fixes

* By-char append is replaced with span-based one

* SequenceEqual is invoked against the original string

* Revert "By-char append is replaced with span-based one"

This reverts commit dotnet/corefx@e5919e3dbe4be0681540c5084fce23d026149957.

Commit migrated from https://github.com/dotnet/corefx/commit/dacc2557066141357674b4311c83457de35df9d0

4 years ago[master] Update dependencies from dotnet/coreclr (dotnet/corefx#42094)
dotnet-maestro[bot] [Thu, 24 Oct 2019 22:29:50 +0000 (22:29 +0000)]
[master] Update dependencies from dotnet/coreclr (dotnet/corefx#42094)

* Update dependencies from https://github.com/dotnet/coreclr build 20191024.2

- Microsoft.NET.Sdk.IL - 5.0.0-alpha1.19524.2
- Microsoft.NETCore.ILAsm - 5.0.0-alpha1.19524.2
- Microsoft.NETCore.Runtime.CoreCLR - 5.0.0-alpha1.19524.2

* Update ref/System.Runtime.Intrinsics.Experimental.cs corresponding to https://github.com/dotnet/coreclr/pull/27382/

* Updating System.Numerics.Vectors to type forward to S.P.Corelib

* Regenerating the System.Runtime.Intrinsics ref assembly for existing APIs

* Regenerating the System.Runtime.Intrinsics ref assembly for new APIs

* Removing DefaultTargets="Build" from the S.R.I and S.N.V Configurations.props

Commit migrated from https://github.com/dotnet/corefx/commit/9a58cfa732994294b0d65fd115378ea98b3177e8

4 years agoSupport PinChangedEvent on Unix (dotnet/corefx#40383)
Krzysztof Wicher [Thu, 24 Oct 2019 22:06:34 +0000 (15:06 -0700)]
Support PinChangedEvent on Unix (dotnet/corefx#40383)

* Support PinChangedEvent on Unix

* address PR feedback

* Fix typo in RaisePinChanged

Commit migrated from https://github.com/dotnet/corefx/commit/3dae29b60e6f0707b60f831ce77286de75ef8958

4 years agoFix non-netcoreapp builds
Stephen Toub [Thu, 24 Oct 2019 18:29:03 +0000 (14:29 -0400)]
Fix non-netcoreapp builds

Commit migrated from https://github.com/dotnet/corefx/commit/bd5ff7a1f86be8b44697d2e6ab93be1510158e90

4 years agoimprove performance of GetAllNetworkInterfaces on Linux (dotnet/corefx#41490)
Tomas Weinfurt [Thu, 24 Oct 2019 20:36:01 +0000 (13:36 -0700)]
improve performance of GetAllNetworkInterfaces on Linux (dotnet/corefx#41490)

* improve GetLinuxNetworkInterfaces

* more improvements to GetAllNetworkInterfaces()

* fix compilation

* update ethtool to support older kernels

* fix osx

* more platform fixes

* put PrefixLengthToSubnetMask back as it was

* normalize units properlry

* fix constant

* feedback from review

* fix log initialization

Commit migrated from https://github.com/dotnet/corefx/commit/8bd0eb37f048375f038954fe444f7abd7b5681b6

4 years agoClean up some X509FilesystemTests tests (dotnet/corefx#42089)
Jeremy Barton [Thu, 24 Oct 2019 20:26:54 +0000 (13:26 -0700)]
Clean up some X509FilesystemTests tests (dotnet/corefx#42089)

* Make all of the Fact methods public
* Improve the assert messages in VerifyCrlCache
* Make VerifyCrlCache understand offline revocation unknown asserts two flags now.

Commit migrated from https://github.com/dotnet/corefx/commit/4494e09e68d1546dd69c8ef4bc44a32479e940d6

4 years agoUpdate ILLink.Tasks (dotnet/corefx#39287)
Sven Boemer [Thu, 24 Oct 2019 19:37:31 +0000 (12:37 -0700)]
Update ILLink.Tasks (dotnet/corefx#39287)

* Update ILLink.Tasks

* Don't import linker nuget package targets

We use custom targets to invoke the linker.

* Don't pass directories as assembly paths

Instead pass them as extra linker args. To avoid issues with the
response file parsing logic, we remove trailing slashes.

* Update to linker version with unusedinterfaces opt

* Update System.Text.Json with more ctor roots

Commit migrated from https://github.com/dotnet/corefx/commit/e715ba830fa52e7cede03abb5bb702e53429bbf1

4 years agoDiagnosticSourceEventSource fixes/improvements for distributed tracing (dotnet/corefx...
Noah Falk [Thu, 24 Oct 2019 19:29:54 +0000 (12:29 -0700)]
DiagnosticSourceEventSource fixes/improvements for distributed tracing (dotnet/corefx#41943)

* DiagnosticSourceEventSource fixes for distributed tracing

1) There is no existing mechanism for DiagnosticSourceEventSource to fetch the current activity object. By convention it is not passed as an event argument, but rather stored in the async-local property Activity.Current. This was fixed by adding a well-known "*Activity" property that returns the result of Activity.Current regardless what object it is applied to.

2) DiagnosticSourceEventSource fails to evaluate properties on value types, such as DateTime.Ticks. Calling MethodInfo.CreateDelegate
needs to use a different signature for ref and value type properties and previously the code always used the ref-style signature. Fixed by adding ValueTypedFetchProperty that does the proper CreateDelegate and delegate invocation for structs.

3) There is no mechanism for DiagnosticSourceEventSource to enumerate the tags on an activity. This change adds the *Enumerate well-known property which will iterate any IEnumerable`1, invoke ToString() on each element, then join it as a string.

Commit migrated from https://github.com/dotnet/corefx/commit/ef563159787f3976ab47b9f304d58a7505828591

4 years agoFix RegionInfo.DisplayName test (dotnet/corefx#42088)
Tarek Mahmoud Sayed [Thu, 24 Oct 2019 18:43:50 +0000 (11:43 -0700)]
Fix RegionInfo.DisplayName test (dotnet/corefx#42088)

Commit migrated from https://github.com/dotnet/corefx/commit/974fe33fbdfc1b8a47671070ce99bc1114eec2a8

4 years agoEnsure serializer throws JsonException when deserializing incompatible JSON into...
Layomi Akinrinade [Thu, 24 Oct 2019 18:40:46 +0000 (11:40 -0700)]
Ensure serializer throws JsonException when deserializing incompatible JSON into collections (dotnet/corefx#42066)

* Ensure serializer throws JsonException when deserializing incompatible JSON into collections

* Address review feedback

Commit migrated from https://github.com/dotnet/corefx/commit/8c92fa400f7a96d08c0d35cf14d91446e58d3512

4 years agoadd entries for new FreeBSD releases (dotnet/corefx#41794)
Tomas Weinfurt [Thu, 24 Oct 2019 17:19:39 +0000 (10:19 -0700)]
add entries for new FreeBSD releases (dotnet/corefx#41794)

Commit migrated from https://github.com/dotnet/corefx/commit/32d103eecf9d1e9648e6b1ed063860fed00bcc8f

4 years agoNormalize Linux and Windows X.509 Revocation Statuses (dotnet/corefx#41956)
Jeremy Barton [Thu, 24 Oct 2019 13:01:53 +0000 (06:01 -0700)]
Normalize Linux and Windows X.509 Revocation Statuses (dotnet/corefx#41956)

* Add CrlCrl test before revocation support

* Add revocation tests

* Add lots of tests with revocation

* Make Linux download respect time remaining

* Use synchronous wait so Linux gets an answer

* Use IPv4Loopback name instead of localhost for stability (IPv4 vs IPv6)

* Some tracing improvements

* Add a lot more tests

* Linux multi-OCSP and revocation normalization support

* Even more tests, mainly invalid responses

* Respect CorruptRevocationIssuerName

* Fix the "no timeout" overflow.

* Treat OfflineRevocation as always suppressed

* Finish some half-finished tests

* De-spaghetti Linux OCSP processing

* Check what happens for testing the root directly

* Native changes for Linux multi-layer OCSP

* Make Linux portable build work

* Mitigate issue 41969 in tests

* Support decoding incorrect encoding of OCSPRequest

Also fix an exact-tag vs loose-tag check.

* Disable DynamicRevocationTests on macOS

* Disable designated responder tests on RHEL6.

* Cache the error string for each error code

* Self-review cleanup

* Disable designated OCSP responder tests on Win7

* Re-enable WIn7 designated responder tests, increase timeouts.

* Running locally on Win7 the designated responder tests pass
* Observation of the intermittent CI failures shows they were always in excess of 5 seconds.
  * Running locally the longest test was 1 second, and that includes generating several RSA keys.

* Apply review feedback

* Move DynamicRevocationTests to OuterLoop

Commit migrated from https://github.com/dotnet/corefx/commit/471c93883f24c22513387217890136d7fa7248b6

4 years agoMoving StopWatch to `src\Common\src\Corelib` (dotnet/corefx#42072)
Vladimir Sadov [Thu, 24 Oct 2019 12:23:17 +0000 (05:23 -0700)]
Moving StopWatch to `src\Common\src\Corelib` (dotnet/corefx#42072)

Commit migrated from https://github.com/dotnet/corefx/commit/681c3f138d6bcf1eeed8841ac7c3552c6e886e8d

4 years agoAdd cgroup v2 support to Interop.cgroups (dotnet/corefx#39686)
Omair Majid [Thu, 24 Oct 2019 12:12:22 +0000 (08:12 -0400)]
Add cgroup v2 support to Interop.cgroups (dotnet/corefx#39686)

* Add cgroup v2 support to Interop.cgroups

Fix up code to adjust cgroup v1 assumptions and check cgroup v2 paths,
locations and values.

Continue using the older cgroup v1 terminology for APIs.

* Clean up new tests

Commit migrated from https://github.com/dotnet/corefx/commit/8d18e3c9ed8ec205429fb061aae676a70af71c50

4 years agoRecombine files ProcessTests.cs and ProcessTests.netcoreapp.cs (dotnet/corefx#42063)
Roman Marusyk [Thu, 24 Oct 2019 01:32:12 +0000 (03:32 +0200)]
Recombine files ProcessTests.cs and ProcessTests.netcoreapp.cs (dotnet/corefx#42063)

* Recombine files ProcessTests.cs and ProcessTests.netcoreapp.cs that aren't supported anymore

* Add namespaces

Commit migrated from https://github.com/dotnet/corefx/commit/bd18c12df9e5dd365a8b708cc2e7e0488b8177c1

4 years agoOptimize Enumerable.SkipLast() for IPartition and IList (dotnet/corefx#41342)
Tim [Wed, 23 Oct 2019 22:09:43 +0000 (06:09 +0800)]
Optimize Enumerable.SkipLast() for IPartition and IList (dotnet/corefx#41342)

* Optimize Enumerable.SkipLast() for IPartition and IList

* Convert to conditional expression

* Add parameter name

* Revert "Convert to conditional expression"

This reverts commit 7c7908fb

* Format conditional expression

Commit migrated from https://github.com/dotnet/corefx/commit/bdd33976fe3713cc3e78b83cf2a1176c70b793be

4 years agoReduce the number of syscalls when converting Ticks to TimeSpan (dotnet/corefx#41989)
Grisha Kotler [Wed, 23 Oct 2019 20:01:57 +0000 (23:01 +0300)]
Reduce the number of syscalls when converting Ticks to TimeSpan (dotnet/corefx#41989)

* Reduce the number of syscalls when converting Ticks to TimeSpan

* Remove the usage of Lazy

* Fix build

Commit migrated from https://github.com/dotnet/corefx/commit/81a551c219041cacdb6c5f77ff1dd588e8bebd01

4 years agoDelete duplicative exception add in SourceCore (dotnet/corefx#42035)
Stephen Toub [Wed, 23 Oct 2019 18:05:54 +0000 (14:05 -0400)]
Delete duplicative exception add in SourceCore (dotnet/corefx#42035)

Commit migrated from https://github.com/dotnet/corefx/commit/be22fd85b2ceb377de87e6bda006f819569fec3a

4 years agoRegenerating the ref assembly for System.Runtime.Intrinsics.Experimental
Tanner Gooding [Wed, 23 Oct 2019 01:29:14 +0000 (18:29 -0700)]
Regenerating the ref assembly for System.Runtime.Intrinsics.Experimental

Commit migrated from https://github.com/dotnet/corefx/commit/a3f71bfe819463e388fa7afe77a579ebf99ac866

4 years agoRemove Socket.InnerSafeCloseSocket (dotnet/corefx#41888)
Tom Deseyn [Wed, 23 Oct 2019 13:50:26 +0000 (15:50 +0200)]
Remove Socket.InnerSafeCloseSocket (dotnet/corefx#41888)

* Remove Socket.InnerSafeCloseSocket

* Move IsInvalid checks in SetHandle function

* PR feedback

* Remove unnecessary 'SocketPal.'

* Remove SafeSocketHandle.SetHandle

Commit migrated from https://github.com/dotnet/corefx/commit/092dff2a5a660ac6cf1668e8feabc236bb045813

4 years agoEvent log retries (dotnet/corefx#42017)
Dan Moseley [Wed, 23 Oct 2019 13:36:52 +0000 (06:36 -0700)]
Event log retries (dotnet/corefx#42017)

Commit migrated from https://github.com/dotnet/corefx/commit/6249535d47b1679b8a7021aed2fcdb3af792e387

4 years agoRemove unused locals in System.Data.Common and keep some logic using discard (dotnet...
Eriawan Kusumawardhono [Wed, 23 Oct 2019 13:33:22 +0000 (20:33 +0700)]
Remove unused locals in System.Data.Common and keep some logic using discard (dotnet/corefx#41962)

* remove unused locals in System.Data.Common and keep some logic using discard

* revert the HandleTable(element) removal as PR feedback. Use discard as return value is ignored.

Commit migrated from https://github.com/dotnet/corefx/commit/ae71c86289d759318e212144b94c58d0a586a33c

4 years agoAdd test for SafeHandle handling in Socket.Select (dotnet/corefx#42018)
Stephen Toub [Wed, 23 Oct 2019 13:30:24 +0000 (09:30 -0400)]
Add test for SafeHandle handling in Socket.Select (dotnet/corefx#42018)

Commit migrated from https://github.com/dotnet/corefx/commit/57c3a5490eb4d9235f824544b37cdbb21ac88c39

4 years agoMove Matrix3x2/4x4, Plan, and Quaternion to the shared CoreLib partition (dotnet...
Tanner Gooding [Wed, 23 Oct 2019 12:44:26 +0000 (05:44 -0700)]
Move Matrix3x2/4x4, Plan, and Quaternion to the shared CoreLib partition (dotnet/corefx#42021)

Commit migrated from https://github.com/dotnet/corefx/commit/8c037f4c21bd8a9bb0f9d218f9581a933d5bac95

4 years agoWhen encoder is null, use JavaScriptEncoder.Default to check for NeedsEscaping (dotne...
Ahson Khan [Wed, 23 Oct 2019 08:09:34 +0000 (01:09 -0700)]
When encoder is null, use JavaScriptEncoder.Default to check for NeedsEscaping (dotnet/corefx#42023)

* When encoder is null, use JavaScriptEncoder.Default to check for
NeedsEscaping.

* Remove unnecessary unsafe keyword and add comment to using directive.

* Address feedback.

* Remove gotos and move the IsEmpty check outside the fixed block.

Commit migrated from https://github.com/dotnet/corefx/commit/daadeef2eef255f86b301ded57996dda25618e90

4 years agoJsonSerializer.Serialize should check whether the passed-in (dotnet/corefx#42026)
Ahson Khan [Wed, 23 Oct 2019 07:27:40 +0000 (00:27 -0700)]
JsonSerializer.Serialize should check whether the passed-in (dotnet/corefx#42026)

Utf8JsonWriter is null.

Commit migrated from https://github.com/dotnet/corefx/commit/b8cb521e83456bd81dc314c0625d6236d7955bd9

4 years agoFix several Socket tests to not dispose an event (dotnet/corefx#42020)
Stephen Toub [Wed, 23 Oct 2019 03:08:01 +0000 (23:08 -0400)]
Fix several Socket tests to not dispose an event (dotnet/corefx#42020)

When I run these tests locally, due to my network configuration they sometimes fail.  If they fail and the test is disposing of the ManualResetEvent, the async callback may try to set the event after it's already been disposed, which throws an exception that crashes the test process.  The easy fix is to just dispose of these MRE instances on success and let their finalizers clean up for them if the tests fail.

Commit migrated from https://github.com/dotnet/corefx/commit/623703d941115131a7f269f9e23560f6d937837c

4 years agoAdd directory creation method that takes an ACL (dotnet/corefx#41834)
Carlos Sanchez Lopez [Wed, 23 Oct 2019 02:42:48 +0000 (19:42 -0700)]
Add directory creation method that takes an ACL (dotnet/corefx#41834)

* First commit

* Fix OperationCanceledException dependency error, revert nullable indication

* Only Directory files

* Unit tests verifications

* Split FileSystem.Windows into two additional files instead of one. Fix pinning.

* Remove dead comment, add actual UT verifications

* User WellKnownSidType

* Make method unsafe, nit comments addressed.

* Remove irrelevant comment

* Add additional exceptions to triple slash

* Add unit tests for additional exceptions

* Remove FileSystem.cs, it has one obsolete method. Replace all calls of that removed method.

* Second pass on required strings.resx resources

* Remove unused dependency cs files

* Move shared files to Common

* Add the missing braces

* Add nulcheck for this argument, add exception, document exception in triple slash, add unit test.

* Fix netstandard CI build failure

* Fix Microsoft.IO.Redist build issue with NetStandard

* Remove unnecessary assert in ut

* Fix build problem in Windows Packaging All Configurations x64_Debug, System.Runtime needs to be included to recognize NotNullIfNotNullAttribute, consumed in Path.Internal.cs

* Additional file splitting and dependency addition to fix netstandard/netfx build problems

* Fix netstandard and netcoreapp build issues

* Remove unused file

* nit cleaning

* Minimal unit tests

* Remove unused unit test code and spacing fix

* Add full framework condition to unit test

* Additional fix for full framework

Commit migrated from https://github.com/dotnet/corefx/commit/5ed2e98718700ba37ed95c34ee04960b5aba1aa0

4 years agoSimplify LOGFONT marshalling (dotnet/corefx#42011)
Jan Kotas [Wed, 23 Oct 2019 01:41:21 +0000 (18:41 -0700)]
Simplify LOGFONT marshalling (dotnet/corefx#42011)

Commit migrated from https://github.com/dotnet/corefx/commit/86972eac7ce0707073b724d71be2927fc1fe225f

4 years agoSocket.Select: increase ref count while the handle is in use (dotnet/corefx#41763)
Tom Deseyn [Wed, 23 Oct 2019 01:01:59 +0000 (03:01 +0200)]
Socket.Select: increase ref count while the handle is in use (dotnet/corefx#41763)

* Socket.Select: increase ref count while the handle is in use

* PR feedback

* Use Socket.InternalSafeHandle for ref/release.

* Socket.Windows: SelectFileDescriptor: add missing unrefs

Commit migrated from https://github.com/dotnet/corefx/commit/6c62c7ffc1496d1b262b8e5809412a222809b173

4 years agoOptimize FindFirstCharToEncode for JavaScriptEncoder.Default and Relaxed using Sse2...
Ahson Khan [Wed, 23 Oct 2019 00:34:24 +0000 (17:34 -0700)]
Optimize FindFirstCharToEncode for JavaScriptEncoder.Default and Relaxed using Sse2 intrinsics. (dotnet/corefx#41933)

* Optimize FindFirstCharToEncode for JavaScriptEncoder.Default and Relaxed
using Sse2 intrinsics.

* Create an Sse2Helper and improve perf of TextEncoder and
AllowedCharactersBitmap

* Loop unroll FindFirstCharacterToEncode

* Improve code coverage.

* Add more tests for surrogate pairs and fix call to WillEncode.

* Address PR feedback - remove some code duplication.

* Move DefaultJavaScriptEncoder to separate file and override EncodeUtf8
with better caching.

* Add default replacement character as a test.

* Address nits.

Commit migrated from https://github.com/dotnet/corefx/commit/c4b93b6768a5edd6416145de108c584a855aef26

4 years agoMove Vector2/3/4 to the shared CoreLib partition (dotnet/corefx#42005)
Tanner Gooding [Tue, 22 Oct 2019 22:53:10 +0000 (15:53 -0700)]
Move Vector2/3/4 to the shared CoreLib partition (dotnet/corefx#42005)

Commit migrated from https://github.com/dotnet/corefx/commit/edc00837f7e59ea18aa9cfd26c0de3d918714782

4 years agoAdding Unsafe.SkipInit (dotnet/corefx#41995)
Tanner Gooding [Tue, 22 Oct 2019 22:53:01 +0000 (15:53 -0700)]
Adding Unsafe.SkipInit (dotnet/corefx#41995)

* Adding Unsafe.SkipInit

* Removing the "where T : struct" constraint from Unsafe.SkipInit

* Adding tests for Unsafe.SkipInit

Commit migrated from https://github.com/dotnet/corefx/commit/cd97cf573c9c30f56437d0c05c489a8e1fa97c4b

4 years agoAdd Encoding extensions which work with sequences (dotnet/corefx#41810)
Levi Broderick [Tue, 22 Oct 2019 22:18:05 +0000 (15:18 -0700)]
Add Encoding extensions which work with sequences (dotnet/corefx#41810)

Commit migrated from https://github.com/dotnet/corefx/commit/6696f1665bb01bb571a3fc333f85a0ab0945fddf