Commit Graph
740 Commits
Author SHA1 Message Date
Levi Broderick ad41de4096 Add string.ReplaceLineEndings and MemoryExtensions.EnumerateLines (#53115) 2021-06-07 13:29:51 -07:00
Miha Zupan e8c1965caf Fix DataCommonEventSource EnterScope (#53043) 2021-05-21 02:45:15 +00:00
Santiago Fernandez Madero 2a00d034b8 React to API Compat bug fix around attribute diffing in members (#52629) 2021-05-12 11:15:58 -07:00
5297337e5b [iOS][libraries] Skip failing iOS tests with ActiveIssues and proj level skips (#51491)
In effort to assess the state of the iOS library tests, a number of tests will be skipped

Test suites that crash, hang, or have a significant number of failures (mostly 20+ failing unique test methods) are skipped on at the `tests.proj` level. Otherwise, `[ActiveIssue]` attributes have been attached to either the individual test methods that fail or the entire class if the whole test class fails. Any pre-existing `ActiveIssue` attribute associated with iOS had been reassessed to either remain or be closed.

A few test suites have been skipped because they fail with some form of `PlatformNotSupportedException`. `[SkipOnPlatform]` attributes are attached to the failing test methods.

All of the Issues can be tracked at https://github.com/dotnet/runtime/projects/48#column-9236436

The ActiveIssues and `tests.proj` exclusions have been tested on https://github.com/dotnet/runtime/pull/49917 as well.

-----------
This PR makes the following changes in the following files:
`src/libraries/System.IO.Ports/tests/System.IO.Ports.Tests.csproj` - Removed `$(NetCoreAppCurrent)-iOS` from target frameworks as it is stated to currently only supported on Windows.

`src/libraries/tests.proj` - Update the test suites that need to be skipped at the project level, reducing the number and categorizing as a skip due to PNSE, a skip due to numerous failures, and a skip due to the suite crashing.

The remaining files changed are either:
`[ActiveIssue("<issue-url>", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)]`
`[SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.tvOS, "Not supported on iOS or tvOS.")]`

Co-authored-by: Mitchell Hwang <[email protected]>
Co-authored-by: Tammy Qiu <[email protected]>
2021-05-12 17:40:55 +02:00
hrrrrustic 7a8f4d8393 System.Data.* missed Equals nullable annotations (#52165) 2021-05-06 18:08:58 +02:00
Ankit Jain f372f6b5fd [wasm][tests] Fix test failures due to trimming (#51697)
- Both EAT, and AOT builds are completely green now.
- Number of tests for EAT goes from 147 -> 185
- Number of tests for AOT goes from 147 -> 174 (the difference is because of aot only failures)
- Test run on a regular wasm build runs 206 libraries
2021-04-28 15:19:10 -04:00
Alexander Köplinger bc9f00c226 Cleanup PlatformSpecific/SkipOnMono attributes that skip a platform (#50907)
We have a bunch of test assemblies that don't make sense on some platforms, e.g. Browser.
Right now we're skipping them via `[SkipOnMono("reason", TestPlatforms.Browser)]` but there's nothing that inherently ties this to Mono other than the current implementation.

The more generic `SkipOnPlatform` attribute can be used instead.
We can also use it in places where we do `[PlatformSpecific(~TestPlatforms....)]` to avoid the double inversion.
2021-04-09 13:20:18 +02:00
Andy GockeandJose Perez Rodriguez b3e3db9662 Annotate APIs in System.Private.Xml (#49682)
Mostly adds RequiresUnreferencedCode, and propagates the results
outward.

Co-authored-by: Jose Perez Rodriguez <[email protected]>
2021-04-05 11:59:41 -07:00
Jan JahodaandDan Moseley 78f980384f Credentials fix (#50230)
* Port of https://github.com/dotnet/corefx/pull/43051

* Shrink suppression file

* Fix another bugs

* Bump System.Net.TestData version

* Fix typo

* Revert casing in connection string

* Fix connection string case

* more fixes

* Change suppression messages

* Fix typo

* Remove false positive

* Fix usersecrets

Co-authored-by: Dan Moseley <[email protected]>
2021-03-25 21:18:38 -07:00
kronicandkronic 62170c1147 remove repetitions ';' (#50236)
Co-authored-by: kronic <[email protected]>
2021-03-25 20:59:08 -04:00
Stephen Toub 0817e748b7 Seal internal types in libraries (#50225) 2021-03-25 20:50:33 -04:00
Stephen Toub 184a5b103c Enable CA1052 (static holder types should be static) (#50047)
* Enable CA1052 (static holder types should be static)

* Fix a few additional warnings in 'all configurations'
2021-03-23 10:04:52 -04:00
Stephen Toub 48679143aa Seal private classes in libraries (#49969) 2021-03-23 06:14:55 -04:00
Eric Erhardt cbc6aa617b Resolve ILLink warnings in System.ComponentModel.TypeConverter (Round 3) (#49786)
* Resolve ILLink warnings in System.ComponentModel.TypeConverter (Round 3)

Contributes to #45623

* Mark GetProperties as RequiresUnreferencedCode.

PropertyDescriptors are not trim compatible because we can't guarantee the PropertyType is annotated as DynamicallyAccessedMembers.All.

* Mark GetConverter as RequiresUnreferencedCode.

NullableConverter requires the underlying type to be annotated with DynamicallyAccessedMembers.All, but it cannot be statically annotated.

* Mark GetDefaultEvent and GetDefaultProperty as RequiresUnreferencedCode.

GetDefaultProperty is not trim compatible because it calls GetProperties, which isn't trim compatible since the PropertyType can't be annotated.

GetDefaultEvent can technically be considered trim compatible when not passing in an object "instance" and only a Type. But this would require trim warning suppressions which aren't worth the risk since most of ICustomTypeDescriptor is already RequiresUnreferencedCode.
2021-03-22 20:13:08 -05:00
Eric Erhardt ddff65b4d1 Resolve ILLink warnings in System.ComponentModel.TypeConverter (Round 2) (#49467)
* Resolve ILLink warnings in System.ComponentModel.TypeConverter (Round 2)

Contributes to #45623

* Change ComNativeDescriptorProxy so the linker can see the Type (when it is available) by using Type.GetType.
2021-03-15 15:45:26 -05:00
Santiago Fernandez Madero 689bac6222 Fix APICompat errors for atttributes on parameters (#49408) 2021-03-11 00:03:10 -08:00
Eric Erhardt e0bbfa0f55 Resolve ILLink warnings in System.ComponentModel.TypeConverter (Round 1) (#48890)
* Resolve ILLink warnings in System.ComponentModel.TypeConverter (Round 1)

Contributes to #45623

* Update the AttributeCollection message

* Add trimming test for SimplePropertyDescriptor.IsReadOnly

* Update the ref source with DynamicallyAccessedMembers attributes
2021-03-09 12:49:25 -06:00
Stephen Toub 831c061e03 Add new MemoryExtensions.SequenceEqual overloads (#48677)
* Add new MemoryExtensions.SequenceEqual overloads

* Use MemoryExtensions.SequenceEqual in Enumerable.SequenceEqual

* Use MemoryExtensions.SequenceEqual in a few more places
2021-02-26 14:21:44 -05:00
bbf9b676bd [master] Update dependencies from mono/linker (#47709)
* Update dependencies from https://github.com/mono/linker build 20210201.1

Microsoft.NET.ILLink.Tasks
 From Version 6.0.0-alpha.1.21079.1 -> To Version 6.0.0-alpha.1.21101.1

* Update dependencies from https://github.com/mono/linker build 20210201.2

Microsoft.NET.ILLink.Tasks
 From Version 6.0.0-alpha.1.21079.1 -> To Version 6.0.0-alpha.1.21101.2

* Update dependencies from https://github.com/mono/linker build 20210203.1

Microsoft.NET.ILLink.Tasks
 From Version 6.0.0-alpha.1.21079.1 -> To Version 6.0.0-alpha.1.21103.1

* Add warnings to baseline

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Mateo Torres Ruiz <[email protected]>
Co-authored-by: Marek Safar <[email protected]>
2021-02-04 14:05:26 +01:00
Charles Stoner 589d0dc326 Updates for conditional expression type breaking change (#47738) 2021-02-03 11:02:41 -08:00
Eric Erhardt 8f9edb350d Resolve ILLink warnings in System.Runtime.Serialization.Formatters (#46964)
* Resolve ILLink warnings in System.Runtime.Serialization.Formatters

Contributes to #45623
2021-01-19 16:57:49 -06:00
Jan Kotas 10381a2cdc Find&Replace coreclr/src -> coreclr (#45761) 2020-12-08 10:40:17 -08:00
Shay Rojansky 2f8959aa82 Correct nullability annotation for IDataRecord (#44938)
Fixes #44886
2020-11-21 09:11:41 +02:00
Viktor Hofer ed295782bf Add workflow to update solution files with SlnGen and update them initially (#44703)
* Add slngen infra

* Update all solution files
2020-11-17 18:23:30 +01:00
Krzysztof Wicher 25e9990056 Fix/remove TODO-NULLABLE in System.Private.Xml (#44149)
* Fix/remove TODO-NULLABLE in System.Private.Xml

* update contract for System.Xml.ReaderWriter

* follow up changes
2020-11-03 13:18:46 +00:00
Stephen Toub a112379a67 Add Stream argument validation helpers and use throughout dotnet/runtime (#43968)
* Add Stream argument validation helpers and use throughout dotnet/runtime

* Delete unnecessary code in Stream

Stream.Null was using BlockingBegin/EndRead/Write, but the operations are nops (they don't even do argument validation), so the functionality was unnecessary complication.  We can just use TaskToApm instead, with already completed tasks, and then also delete the SynchronousAsyncResult that was used by these operations.

Also, the Begin/EndRead/Write methods were checking CanRead/Write and throwing if they return false, but this is a private sealed type with CanRead/Write hardcoded to return true! Delete.

Finally added consistency across Stream.Null to checking for cancellation.

* Clean up some style on Stream

Also consolidate a few resources and use a few existing ThrowHelpers where appropriate.

* Fix a few issues, and remove duplicative tests missed in conformance tests rollout

* Address PR feedback
2020-10-30 05:50:49 -04:00
Layomi Akinrinade 994dca6f34 Add granular suppressions for linker warnings (#40691)
* Add granular suppressions for linker warnings

* Add suppressions for mono SPC

* Misc additions

* Add suppressions for Debug config

* Fix Android xml file

* Include System.ComponentModel.Annotations suppressions

* Add suppressions for System.Security.Cryptography.X509Certificates on Linux

* Fix TargetOs exists check

* Add IL2077 to System.Security.Cryptography.X509Certificates on Android

* Generalize some System.Security.Cryptography.X509Certificates suppressions to 'NonWindows'

* Remove ref to catch-all System.Security.Cryptography.X509Certificates file

* Misc clean up and some feedback

* Use ILLinkDirectory in CreateRuntimeRootILLinkDescriptorFile.targets

* Update paths for directories

* Set TargetPath as part of include

* Delete bin-placing TODO

* Include more xml files during per-library run

* Include more xml files during per-library run, pt 2

* Include more xml files during per-library run, pt 3

* Try including System.ComponentModel.Annotations based on BuildingNETCoreAppVertical

* Switch to BuildAllConfigurations

* Include xml extension in file paths

* Remove version number from assembly suppression files

* Delete ILLink.Suppressions.xml

* Try removing IL2035 nowarn

* Remove version from Microsoft.VisualBasic.Core assemly name
2020-09-30 09:06:25 -05:00
Stephen Toub 6b5b9f7242 Enable several more IDE analyzer warnings (#42692)
* Enable IDE0062: Make local functions static

* Enable IDE0079: Remove unnecessary suppression

* Enable IDE0082: Convert typeof to nameof

* Enable IDE0043: Validate format string

* Enable IDE0041: Use is null check
2020-09-25 06:33:07 -04:00
Stephen Toub 8473b0a1a5 Redo annotation of Enumerable.Cast and friends to use oblivious TResult (#42215)
* Revert "Make Enumerable.Cast<T> and friends return IEnumerable<T?> (#40929)"

This reverts commit e756708893.

* Redo annotation of Enumerable.Cast and friends to use oblivious T

Some folks aren't happy with the fallout of Cast being annotated to return a `TResult?`, and others aren't happy with having it be `TResult`.  Consensus is to make the TResult oblivious, such that we don't declare one way or another what it is, since there's no good way to annotate it appropriately.
2020-09-14 15:08:03 -07:00
Krzysztof Wicher 3ac170acc8 Ensure <Nullable>enable<Nullable> on System.IO.Packaging and S.Resources.Extensions (#41731)
Fix src ref diffs
2020-09-09 09:15:30 -07:00
381c16487e Add nullable annotations for XmlDataDocument (#41541)
* Add nullable annotations for XmlDataDocument

* Address code review feedback

* More code review feedback

* Address Eric's feedback

* Annotate _dataSet as not null when AttachDataSet is called

* Fix GetElementById return type annotation

In order to match with src

Co-authored-by: Jeff Handley <[email protected]>
Co-authored-by: David Cantú <[email protected]>
2020-08-31 18:09:41 -07:00
David Cantú c587f9d15d Port nullability annotations to refs XmlDocument and XmlSerializer (#41474)
* Port nullability annotations to refs XmlDocument and XmlSerializer

* Fix new System.Data.Common nullability related errors

* Switch nullability of parameter in SoapElementAttribute ctor
2020-08-28 09:58:46 +00:00
David CantúandKrzysztof Wicher 031368a853 Port nullability annotations to System.Xml.ReaderWriter contract (#41083)
* Port nullability annotations to System.Xml.ReaderWriter contract assembly

* Port annotations of recently updated members in Xml/Serialization

* Fix anontations on XmlElement discovered while updating System.Data.Common Xml related annotations

* Fix Xml related annotations on System.Data.Common

* address feedback

Co-authored-by: Krzysztof Wicher <[email protected]>
2020-08-27 13:03:46 -07:00
Santiago Fernandez Madero 3130ac980c Move Editor Attribute to S.CM.Primitives and apply to types that had it in netfx (#41145)
* Move EditorAttribute to System.ComponentModel.Primitives

* Add EditorAttribute to types that had it in netfx and fix some DesignerSerializableAttributes

* PR Feedback

* PR Feedback
2020-08-22 17:23:57 -07:00
Shay Rojansky ab225ee74c Annotate DbDataReader.GetSchemaTable as nullable (#41082)
Reverts decision made in #509
2020-08-21 12:38:54 +03:00
Santiago Fernandez Madero 26a71f95b7 Add Designer attributes to types that had it in full framework (part 2) (#40966)
* Move DesignerSerializerAttribute to S.CM.Primitives and add to StringDictionary

* Add TolboxItemAttribute to types that had it in Desktop

* Remove TypeDescriptionProviderAttribute from DefaultGenApiDocIds

* PR Feedback, fix build
2020-08-19 12:08:39 -07:00
Eirik Tsarpalis e756708893 Make Enumerable.Cast<T> and friends return IEnumerable<T?> (#40929)
* Make IEnumerable.Cast<TResult>() annotation admit nullable elements

* Make ImmutableArray cast method annotations report nullable elements

* fix System.Data nullability warnings
2020-08-17 16:48:40 +01:00
Jared Parsons 321e5eb7cb Fix annotation in DataTableReaderListnener (#40855)
When running the new nullable constructor analysis on runtime we
discovered what appears to be a missing annotation in
`DataTableReaderListener`.

Note: the second `if` check in the constructor seems like dead code.
It's checking for the field to be non-null before ever setting the field
to a value. Probably could be deleted.
2020-08-15 05:44:43 -04:00
Stephen Toub e7204f5d6f Use T? for unconstrained nullable types (#40197)
* Temporarily upgrade compiler version for T? support

* Use T? for unconstrained nullable types
2020-08-07 11:25:42 -04:00
Santiago Fernandez Madero a81e48ffb1 Add DesignerAttribute to types that had it in full framework (#40425)
* Add DesignerAttribute to types that had it in full framework

* Move DesignerAttributeTests to Primitives and fix test errors

* Remove DesignerAttribute.cs from TypeConverter
2020-08-06 22:03:19 -05:00
Shay Rojansky 8250b0a24f Add savepoint API to DbTransaction (#34561)
Closes #33397
2020-08-05 22:02:13 +03:00
0bd3ae0b24 [Wasm] Enable System.Data.Common tests (#39463)
Disable the tests that require SQL Server.

Co-authored-by: Steve Pfister <[email protected]>
Co-authored-by: Maxim Lipnin <[email protected]>
2020-08-04 11:44:58 +02:00
Shay Rojansky ea96ee3d86 Annotate System.Data.{Odbc,OleDb} for nullability (#39597)
* Annotate System.Data.Odbc for nullability
* Annotate System.Data.OleDb for nullability
* Suppress nullable warnings on netcoreapp < 3.0
* Mark System.Data.DataSetExtensions as null-annotated
* Fix null-check bug in System.Data.OleDb
2020-07-27 12:09:50 +03:00
Viktor Hofer 809a06f451 Remove depprojs in favor of PackageReferences (#35606)
- Remove depprojs which currently binplace external references into the RefPath folders in favor of PackageReference and PackageDownload items.
- Build all configurations by default when building an individual project (either on the CLI or inside VS) same as with the official SDK. This enables .NETFramework Test Explorer support.
- Centrally define libraries that compose the shared framework instead of in each Directory.Build.props file to be able to build the targeting pack first and consume it in the OOB libraries.
- Use ProjectReferences to reference OOB projects. Compile against the reference assembly but use the implementation assembly app-local during runtime.
- Remove OOBs from the testhost and remove the testhost folder for .NETFramework as it isn't required anymore.
- Only binplace for $(NetCoreAppCurrent) to compose a) the targeting pack, b) the runtime pack, c) the testhost, d) a full closure for the shims.
- Use Targeting Packs for OOB projects (with their implicit assembly references) but still explicitly define granular references for .NETCoreApp configurations (DisableImplicitAssemblyReferences switch). Use the implicit targeting pack references in some Microsoft.Extensions.* cases.
- Remove placeholder configurations as they aren't needed anymore with explicit P2Ps vs Targeting Pack references.
- Remove implicit assembly references (ie for .NETFramework, mscorlib)
- Remove AssemblySearchPath hacks that were introduced with b7c4cb7 as the targeting pack is now used by default.
- Reduce unnecessary .NETFramework configurations that were added to run tests in favor of the already existing ref&src configurations.
- Stop hardcoding the paths for wasm assemblies and use the returned TargetPath of the ProjectReferences.
- Addressed formatting (ItemGroups, References at the bottom of the project file, ordering of references, use LibrariesProjectRoot instead of a relative path, unnecessary AssemblyName and RootNamespace properties which are identical to the project name, ordering of tfms)
- Revert "fix clean (#33758)"
2020-07-23 17:20:26 +02:00
Jeff Handley 329f0dbfa3 Mark Obsoletions for .NET 5 (#39269)
* Mark new obsoletions for .NET 5; update existing obsoletions

* Exclude DirectoryServicesPermission/DirectoryServicesPermissionAttribute from obsoletions for now

* No need to restore SYSLIB0003 at end of Forwards files

* Use a common Obsoletions.cs file for all SYSLIB obsoletions

* Resurrect CER code behind #ifdef in EventSource

* Mark GlobalAssemblyCache overrides as Obsolete

* Suppress Thread.Abort() error in ImageAnimator.Unix.cs

* Unconditionally mark RoAssembly.GlobalAssemblyCache as obsolete

* Rename MSLIB0001 to SYSLIB0001 in ref assembly

* Suppress obsoletion warnings in tests

* Adopt a uniform #ifdef for NET50_OBSOLETIONS

* Fix BinaryFormatter obsoletion message after the rebase

* Use SYSTEM_PRIVATE_CORELIB constant instead of NETCOREAPP

* Remove the code comment on the ifdef

* Apply feedback related to CER obsoletions

* Apply feedback related to CAS

* Update ref assembly to reflect SecurityManager obsoletion

* Fix regression in System.IO.Pipes.NamedPipeServerStream.Windows.RunAsClient
2020-07-17 17:09:29 -07:00
Levi Broderick 37cf387bda Disallow unrestricted polymorphic deserialization in DataSet (#39304)
Fixes CVE-2020-1147
https://portal.msrc.microsoft.com/en-us/security-guidance/advisory/CVE-2020-1147
See also https://go.microsoft.com/fwlink/?linkid=2132227.
2020-07-14 23:50:33 -07:00
Levi Broderick 324c6c7f12 Obsolete BinaryFormatter.Serialize and BinaryFormatter.Deserialize (#39324) 2020-07-14 23:32:07 -07:00
Anirudh Agnihotry e94cd90ad1 Adding attribute keyword to all the attributes in the ref (#39255) 2020-07-14 10:03:52 -07:00
Shay Rojansky 8a94c7bc54 Nullability annotations for System.Data (#38810)
Following ec73c56fb8.
A few corners have been left annotated because of dependencies.
2020-07-13 10:49:23 +02:00
Shay Rojansky 1b8d1dc4bc Add SqlState and IsTransient to DbException (#39157)
Closes #35601
Closes #34817
2020-07-12 21:34:44 +02:00