Commit Graph
758 Commits
Author SHA1 Message Date
Ankit Jain f11c8ff5f5 [wasm] System.Data.Tests - add debug info, to help with the test failure (#56838)
`System.Data.Tests.AppDomainsAndFormatInfo.Bug55978` fails sometimes for
wasm:

```
Assert.Equal() Failure
Expected: 2
Actual:   3

Stack trace
   at System.Data.Tests.AppDomainsAndFormatInfo.Bug55978()
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
```

To debug the issue, this dumps some state when the test fails.

Issue: https://github.com/dotnet/runtime/issues/47968
2021-08-04 20:52:42 -04:00
Jeff Handley 895c99cc50 Remove old fwlink from Obsolete messages and make message improvements (#56690)
* Remove old fwlink from Obsolete messages and make message improvements

* Thorough review and update of Obsolete messages

* Cleanup

* Make messages about unsupported APIs more consistent

* Update RequiresUnreferencedCodeAttribute messages to be consistent between ref and src

* Cleanup

* Cleanup

* Use 'not supported' instead of 'no longer supported'

* Omit unnecessary error:false from Obsolete attributes. Fix message typo.

* Remove old comment

* PR feedback
2021-08-04 14:58:10 -04:00
a35aff789d [main] Update dependencies from mono/linker (#56593)
* Update linker warning suppressions

https://github.com/mono/linker/pull/2145 warns when accessing members
annotated with DynamicallyAccessedMembers using reflection, and
https://github.com/mono/linker/pull/2162 updates the warning origin of
warnings for DynamicallyAccessedMembers on types.

This adds suppressions for the new warnings.

* Add windows-specific suppressions

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

Microsoft.NET.ILLink.Tasks
 From Version 6.0.100-preview.6.21378.1 -> To Version 6.0.100-preview.6.21379.2

* Fix failures and address feedback

- Annotate mono's EnumBuilder and TypeBuilder
- Add (non-unique) readable short names to the warning codes

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

Microsoft.NET.ILLink.Tasks
 From Version 6.0.100-preview.6.21378.1 -> To Version 6.0.100-preview.6.21380.2

* Suppress IL2111

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

Microsoft.NET.ILLink.Tasks
 From Version 6.0.100-preview.6.21378.1 -> To Version 6.0.100-preview.6.21402.2

* Feedback

- Suppress IL2111 in trimming tests
- Remove unnecessary DynamicDependency
- Fix indentation

* Update readable warning names

Co-authored-by: Sven Boemer <[email protected]>
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2021-08-03 15:31:28 -07:00
Shay Rojansky cec198e2e9 API fix to System.Data batching API (#56525)
Allow implementations of DbBatchCommandCollection to hide the indexer
with a narrower-typed version for their own implementation of
DbBatchCommand, as elsewhere in ADO.NET.

Fixup for #54467, part of #28633
2021-07-29 22:38:03 +02:00
Viktor Hofer a6b9a63f35 Update libraries solution and NuGet.config files (#56430)
* Update slngen and invocation

* Update NuGet.config files

* Update solution files with slngen
2021-07-28 18:44:17 +02:00
aaba3c22eb [main] Update dependencies from mono/linker (#55813)
* Update dependencies from https://github.com/mono/linker build 20210715.1

Microsoft.NET.ILLink.Tasks
 From Version 6.0.100-preview.6.21362.3 -> To Version 6.0.100-preview.6.21365.1

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

Microsoft.NET.ILLink.Tasks
 From Version 6.0.100-preview.6.21362.3 -> To Version 6.0.100-preview.6.21366.2

* Suppress type hierarchy warnings

Suppress type hierarchy warnings for
DynamicallyAccessedMembers attribute on types that
have members with RequiresUnreferencedCode (or derived
types with such members).

* Feedback

Remove unnecessary local method

* Fix typo

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

Microsoft.NET.ILLink.Tasks
 From Version 6.0.100-preview.6.21362.3 -> To Version 6.0.100-preview.6.21369.3

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Sven Boemer <[email protected]>
2021-07-20 18:07:25 -07:00
c7dedccd96 Use more string interpolation (#55738)
* Use more string interpolation

I previously did a pass looking for opportunities.  Finding a few more, as well as fixing some misuse of existing methods.

* Update src/libraries/System.Diagnostics.Process/tests/ProcessStartInfoTests.cs

Co-authored-by: halgab <[email protected]>

* Apply suggestions from code review

Co-authored-by: Jan Kotas <[email protected]>

Co-authored-by: halgab <[email protected]>
Co-authored-by: Jan Kotas <[email protected]>
2021-07-16 06:38:51 -04:00
Stephen Toub dfd618dc64 Use interpolated strings in more places 2021-07-13 10:11:51 -04:00
Krzysztof Wicher fe44d588f2 Last set of ILLink annotations related to System.Data.Common (#55507)
* Last set of ILLink annotations related to System.Data.Common

* apply feedback
2021-07-13 10:05:43 +02:00
Krzysztof Wicher 413f0de990 ILLink annotation related to ISerializable and IBindingListView in System.Data.Common (#55394) 2021-07-10 06:57:01 +02:00
Krzysztof Wicher a54e25b674 Nullable annotations for the remainder of System.Data.Common (#55409) 2021-07-09 20:02:38 -04:00
Krzysztof Wicher 5af27a545d Remove few more ILLink warnings in System.Data.Common (#55335) 2021-07-09 12:41:14 +02:00
Krzysztof Wicher 885296a7da Add nullable annotations to System.ComponentModel.TypeConverter (#54961)
* Add nullable annotations to System.ComponentModel.TypeConverter

* Annotate System.Data.Common

* Annotations in depending projects

* address feedback
2021-07-08 16:18:06 +02:00
Krzysztof Wicher 7b0cdaf184 Fix ILLink warnings related to SchemaMapping.SetupSchema* in S.Data.Common (#54897)
* Fix ILLink warnings related to SchemaMapping.SetupSchemaWithoutKeyInfo in S.Data.Common

* address feedback

* remove ctor, clarify messages
2021-07-08 09:19:30 +02:00
Shay Rojansky 607f98c888 ADO.NET batching API (#54467)
Closes #28633
2021-07-04 10:49:14 +02:00
Krzysztof Wicher 5a238f8f72 Fix Activator.CreateInstance(GetType(), ...) related ILLink warnings in (#54680)
System.Data.Common
2021-06-24 19:20:36 +02:00
Krzysztof Wicher 2b7927faff Add ILLink annotations to S.D.Common related to DbConnectionStringBuilder (#54280)
* Add ILLink annotations to S.D.Common related to DbConnectionStringBuilder

* address some feedback

* Make GetEvents() safe

* make GetProperties safe

* Mark GetProperties with RUC
2021-06-23 14:02:37 +02:00
Krzysztof WicherandEric Erhardt c2f559cf0d Add trimmer annotations to System.Data.Common (#52046)
Add trimmer annotations to System.Data.Common

Co-authored-by: Eric Erhardt <[email protected]>
2021-06-11 08:47:48 +02:00
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