Commit Graph
998 Commits
Author SHA1 Message Date
Steve Pfister 8c6aeea1d8 Bring up full library test CI runs on iOS / tvOS devices (#59503)
This change enables device runs on CI by building each test app on the helix instance it was deployed to. In past attempts, we looked at enhancing what takes place on the build machine via build tricks, compressing / cleaning up files early, etc and we could not overcome the need for excessively long timeouts and far more disk space.

The change also adopts the patterns established in the wasm test build, giving us the opportunity to support different scenario runs as well as workloads testing in the future.
2021-11-02 07:43:15 -04:00
Jeremy Barton df5b118c6f Seed the unified System.Security.Cryptography.dll
* All of System.Security.Cryptography.Primitives has been moved
* AsymmericKeyExchangeFormatter moved from S.S.C.Algorithms
* This just starts the process to keep the infrastructure pieces separate from code layout pieces.
2021-11-01 22:30:26 -07:00
Viktor Hofer 0964be0ae9 Update slngen and solution files (#60871)
Update slngen tooling to latest stable version and solution files since
a lot changed since the last time they were updated:
- NET7 (removal of older TFMs)
- Source Generators
2021-10-26 21:23:54 +02:00
kronicandkronic 854992ff94 Refactoring XmlReader{Async} (#59337)
* -

* -

* remove goto

* use nameof

* feedback

* -

* -

* review feedback

* review feedback

* fix scope

Co-authored-by: kronic <[email protected]>
2021-10-05 16:18:48 +02:00
Huo Yaoyuan 68226dade8 Cleanup XPath.StringToDouble (#55867)
* Cleanup StringToDouble.

* Remove members used by StringToDouble.
2021-10-05 11:58:22 +02:00
kronicandkronic 2d20036de8 Refactoring XmlReaderSettings (#59409)
* Refactoring

* review feedback

* review feedback

* review feedback

Co-authored-by: kronic <[email protected]>
2021-10-05 11:54:02 +02:00
kronicandkronic ca4ffa8775 Refactoring XmlWriterSettings (#59467)
* Refactoring XmlWriterSettings

* revert part

* review feedback

* review feedback

Co-authored-by: kronic <[email protected]>
2021-10-04 22:34:58 +02:00
kronicandkronic 03e90a540c Refactoring XslCompiledTransform (#59475)
* Refactoring XslCompiledTransform

* remove unused methods

* review feedback

Co-authored-by: kronic <[email protected]>
2021-10-01 17:56:06 +02:00
Eric Erhardt 9114f773aa XmlSerializer support for IsDynamicCodeSupported=false (#59386)
* XmlSerializer support for IsDynamicCodeSupported=false

Add more checks to XmlSerializer to check the SerializationMode. Don't try to use Reflection.Emit if the SerializationMode is ReflectionOnly.

These changes were ported from
* https://github.com/dotnet/runtimelab/pull/593
* https://github.com/dotnet/runtimelab/pull/600

Fix #59167

* Fix a bug in XmlSerializer.CanDeserialize when in ReflectionOnly mode.

* Port UAP code for CanDeserialize

* PR feedback

* Add a linker test to ensure linker option '--enable-opt sealer' works when IsDynamicCodeSupported==false.
2021-09-22 20:10:40 -05:00
kronicandkronic 6c9921d2ad Bring XmlReader{Async} to one behavior (#51736)
* Replace XmlUntypedStringConverter to XmlUntypedConverter

* Add more test

* add more tests

* remove unssoprt test

* feedback review

Co-authored-by: kronic <[email protected]>
2021-09-20 11:21:09 +02:00
kronicandkronic 6579e5e3db Refactor XmlWriter{Async} (#58105)
* Refactor XmlWriter

* Refactor XmlWriterAsync

* -

* review feedback

Co-authored-by: kronic <[email protected]>
2021-09-17 12:25:11 +02:00
Andrii Kurdiumov 5588f94924 Remove usused rd.xml files (#59201)
Closes #51112
2021-09-16 16:53:54 -06:00
Viktor Hofer 36b6247cc7 Update solution files for correct ordering of elements (#58655)
With the newest udpate of slngen, the order of elements (configuration, folders, etc.) is in sync with how Visual Studio arranges them.
Also the order is now deterministic.

Based on that, updating all solution files to have the correct ordering of elements. This change also unblocks adding CI protection for
making sure that solution files are up-to-date in regards to their dependencies as slngen is now generating the files deterministically.
2021-09-04 00:16:15 +02:00
kronicandkronic a67259dfe4 Refactor XmlQualifiedName (#57646)
* Refactor

* feedback

* feedback

* done

Co-authored-by: kronic <[email protected]>
2021-08-25 10:11:57 +02:00
Steve Molloy 078af6bd13 Use Type.GetTypeCode() instead of private extension (#57540)
* Use official Type.GetTypeCode() instead of the extension that was added to fill the gap in the earlier days of .Net Core.
* Bring reflection-based serializer in line with RefEmit behavior for 'object' serialization.
2021-08-17 11:11:38 -07:00
Steve Molloy 393819de33 41431 improve performance and usage of xml serializer namespaces (#56438)
* Allow easier creation of correctly sized dictionaries in scenarios with lots of known namespaces.

* Stop passing internal dictionaries around.

* Reduce enumerations, and immutable-ish improvements.

* PR feedback.

* Use ValueCollection directly instead of IEnumerable<> to avoid virtual calls.

* Update XmlSerializerNamespaces.cs
2021-08-12 14:24:44 -07:00
Viktor Hofer b12fa3b572 Strong name key id cleanup and pkg testing move (#57044)
* Move src/libraries/pkg/test to src/libraries/testPackages

* Remove default StrongNameKeyId Open properties
2021-08-09 19:20:11 +02:00
Steve Molloy 880e67dbb8 56014 xml writer.create perf regression (#56524)
* Use non-indented XmlWriter to avoid perf hit.
* Add test for issue #46974 which was also fixed by original PR that caused this regression.
2021-08-04 16:43:38 -07: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
Maxim Lipnin b3ab2eb4db Use ReflectionOnly as serialization mode in case dynamic code runtime feature is not supported (#56604) 2021-08-03 12:27:15 +03:00
Larry Ewing 30a1a3a421 Enable #59244 on wasm (#56675) 2021-07-31 22:17:37 -05:00
Larry Ewing ea4a3b6e20 Enable tests marked with https://github.com/dotnet/runtime/issues/51911 (#56673) 2021-07-31 20:39:22 -05:00
Mitchell Hwang dcacebb9ed [libraries][Android] Reenable tests failing from feature switches being improperly set (#56635)
Fixes #50576
Fixes #50881
Fixes #50916
Fixes #50917
Fixes #50918
Fixes #50919
Fixes #50927
Fixes #50928
Fixes #50944
Fixes #50945
Fixes #50946
Fixes #50947
Fixes #50948
Fixes #50999

When setting up functional tests for mobile, the feature switches being used for the tests were misplaced in a broader project, affecting the library tests and causing failures. After moving the feature switches to the scope of functional tests as done in #53253, these test suites no longer fail and can be re-enabled.
2021-07-30 17:17:27 -04: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
Krzysztof WicherandBuyaa Namnan fdead97195 Fix: XmlWriterSettings.Encoding must be registered in static Encoding (#56164)
* Fix: XmlWriterSettings.Encoding must be registered in static Encoding

* Update src/libraries/System.Private.Xml/src/System/Xml/Core/XmlEncodedRawTextWriter.cs

Co-authored-by: Buyaa Namnan <[email protected]>

Co-authored-by: Buyaa Namnan <[email protected]>
2021-07-23 15:28:13 +02:00
Stephen ToubandChristopher Watford 6ca2a9456e Replace a few unnecessary uses of Convert.ToString (#55831)
* Replace a few unnecessary uses of Convert.ToString

* Update src/libraries/System.Private.Xml/src/System/Xml/Schema/ContentValidator.cs

Co-authored-by: Christopher Watford <[email protected]>

Co-authored-by: Christopher Watford <[email protected]>
2021-07-20 09:29:20 -04:00
Tal AloniandStephen Toub e8be7f26cb Bugfix: System.Xml.Serialization: Compiler.GetTempAssemblyName is not deterministic under .NET Core (#46499)
* Bugfix: System.Xml.Serialization: Compiler.GetTempAssemblyName is not persistent under .NET Core

The implementation of String.GetHashCode() was persistent by default in .NET Framework. allowing to predictably name an XmlSerializers.{HashCode}.dll containing the pre-generated serializers.
In .NET Core / .NET 5, String.GetHashCode() is no longer persistent, so the value of ns.GetHashCode() will change during each run, preventing it from picking up the XmlSerializers dll correctly.

* Remove trailing whitespace

* Use truncated SHA512

* Fixed compilation

* Dispose SHA512 instance

* Fixed compilation

* Update src/libraries/System.Private.Xml/src/System/Xml/Serialization/Compiler.cs

Co-authored-by: Stephen Toub <[email protected]>

* Update src/libraries/System.Private.Xml/src/System/Xml/Serialization/Compiler.cs

Co-authored-by: Stephen Toub <[email protected]>

* Update Compiler.cs

Co-authored-by: Stephen Toub <[email protected]>
2021-07-18 14:18:25 +00: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
Steve Molloy 19b1b48625 XmlSerializer dont skip date time offset (#55101)
* Add DateTimeOffset as a primitive for XmlSerializer.

* Fix DefaultValueAttribute handling for DTO.

* Add tests for DateTimeAttribute and XmlSerializer.

* Missed a 'KnownType' spot.

* Update SGen tests to use current dotnet.exe from build.

* Unbreak runtimeconfig creation for testing.

* Debugging failure to resolve CoreCLR path.

* Test fixup.

* More test cleanup.

* Temporarily disable generator tests.

* Use InitObj instead of constructors for DateTimeOffset and TimeSpan.
2021-07-15 13:37:37 -07:00
Steve MolloyandStephen Toub ab219299db Use XmlWriter.Create instead of XmlTextWriter (#54949)
* Use a different XmlWriter which will check for invalid characters like null.

* Bring our XmlReader use into the 21st century as well.

* Update src/libraries/System.Private.Xml/src/System/Xml/Serialization/XmlSerializer.cs

Co-authored-by: Stephen Toub <[email protected]>

* Update src/libraries/System.Private.Xml/src/System/Xml/Serialization/XmlSerializer.cs

Co-authored-by: Stephen Toub <[email protected]>

* Update src/libraries/System.Private.Xml/src/System/Xml/Serialization/XmlSerializer.cs

Co-authored-by: Stephen Toub <[email protected]>

* Don't need to specify options that are defaults on XmlWriter.

Co-authored-by: Stephen Toub <[email protected]>
2021-07-14 21:01:07 -04:00
Eric Erhardt 3150bfa506 Combine System.Private.Xml TrimmingTests projects (#55606)
For some reason we have 2 of them, and only need 1.
2021-07-14 03:14:39 +00:00
Stephen Toub dfd618dc64 Use interpolated strings in more places 2021-07-13 10:11:51 -04:00
Steve Molloy c8b3051399 Keep looking up derived chain for Property.Get if it doesn't exist. (#52509) 2021-07-13 00:27:06 -07:00
Steve Molloy 1749deb1cb Use scopes to resolve array naming issue. (#55451)
* Use scope to avoid using duplicate names for arrays in ILGen serializer.

* Remove comment.
2021-07-13 00:18:55 -07:00
Steve Molloy 88112bcd97 Handle nullable primitives before passing them to WritePrimitive which expects non-null values. (#54800) 2021-07-13 00:18:13 -07:00
Fan Yang a291fabdad Preserve necessary type and method (#54932)
* Preserve necessary type and method

* Change the way of getting the type

* Inline the constants

* Enable NonValidated_ValidAndInvalidValues_DictionaryMembersWork

* Enable TransformStrStrResolver3
2021-07-01 13:11:09 -04:00
xtqqczze 99f7bae2a2 Use Span<T>.Fill implementation for Array.Fill (#52590) 2021-06-29 21:05:04 -07:00
Tal Aloni 53e6b47441 Sgen: Update progress when importing types (#46415)
* Sgen: Update progress when importing types
* Null check
* Remove trailing whitespace
* Updated Strings.resx
* Sgen: Use string resource
2021-06-29 12:07:52 -07:00
Stephen Toub 39e8a6e0b0 Avoid allocating unused prefix/localName in XmlCharCheckingReader.ValidateQName (#54836) 2021-06-29 08:05:01 -04:00
Stephen Toub 91599fff26 Avoid per-XmlSchemaValidator PositionInfo allocation (#54356)
It can easily use a static singleton, as the instance is immutable and exists purely to provide a "I don't have line info" / (0,0) value if anyone queries for position.
2021-06-28 10:31:45 +02:00
Stephen Toub 61e250a189 Lazy-allocate ValidationState.CurPos (#54346)
The array is only used for a subset of validators; no point in paying for this array for every ValidationState instance even if it's not going to be used.
2021-06-17 19:58:30 -04:00
Stephen Toub 034986bfaf Fix lots of unnecessary XmlValueGetter delegate allocations (#54344) 2021-06-17 19:57:43 -04:00
Stephen Toub bbc3366a79 Remove some overhead from XmlNode.SelectSingleNode (#54299)
* Remove unnecessary cost from XmlNode.SelectSingleNode

It's currently implemented by delegating to SelectSingleNodes and returning the first one.  While the list is lazily-populated, this still entails creating an `XPathNodeList`, creating a `List<XmlNode>`, storing the enumerated into the list, and then returning the element from the list, which is then thrown away.  With just a few lines, we can cut through all of that.

* Make XPathScanner and XPathParser into structs

No need for these to be allocated classes.  They can just live on the stack where they're created.

* Reduce ScanName overhead

This shows up on the hot path of parsing the xpath expression.  We can use a span to avoid bounds checking.

* Avoid bounds check in NextChar

NextChar is used by lots of routines to advance to the next character.  We can streamline it to avoid the bounds check when indexing into the string.

* Optimize SkipSpace for there not being any

The typical case is there isn't any whitespace, so inline that fast check.  This was showing up as a few percentage of a simple scenario.
2021-06-17 11:27:09 -04:00
Alexander Köplinger 74374a0596 Disable SynchronizationContextCurrent_NotUsedForAsyncOperations on Mono (#53997)
It seems to hang for some reason.

https://github.com/dotnet/runtime/issues/53987
2021-06-10 17:44:07 +02:00
MichalPetryka 36a7e76f71 Add unsigned variants for BitConverter float bit APIs (#53784)
* Add unsigned variants for BitConverter bit APIs

Adds DoubleToUInt64Bits, UInt64BitsToDouble, SingleToUInt32Bits,
UInt32BitsToSingle, HalfToUInt16Bits and UInt16BitsToHalf.

Implementations were based on existing signed integer variants.

Convert usages of existing APIs to unsigned variants when appropriate.

Fix #36469

* Revert comment change

Reverted a comment change made in the existing code by mistake.

* Use existing code for implementations

Use the existing signed methods with a cast, less code with the same codegen.

* Cast correction

Corrected the type used in a cast.
2021-06-08 16:46:57 -07:00
Steve MacLean 4a6c13a1cd Apple Silicon reenable 49365 (#52197) 2021-06-08 16:05:25 -04:00
Levi Broderick ad41de4096 Add string.ReplaceLineEndings and MemoryExtensions.EnumerateLines (#53115) 2021-06-07 13:29:51 -07:00
Jan Kotas c69254f3dc Convert some uses of ArrayList to List<T> (#53515)
ArrayList.ToArray(Type) has to lookup the array type in the type loader structures. It makes it slow and potentially AOT unfriendly since the code required to support the array type may not exist.
Convert most uses of ArrayList.ToArray in libraries to use List<T> if possible, or ArrayList.CopyTo if the conversion to List<T> was not straightforward.

Simplified a few other places that created arrays while I was on it.
2021-06-01 11:58:02 -07:00
Viktor Hofer 78fd895afd Remove WSL checks and platform detection (#53526)
WSL1 isn't a supported build or execution environment for dotnet/runtime.
Because of that removing the checks and platform detection for it as
that code path isn't necessary for WSL2 anymore as it contains a fully
featured kernel which behaves just a like a usual Linux distro.

Fixes https://github.com/dotnet/runtime/issues/18258
2021-06-01 14:40:41 +00:00
Stephen Toub 72ff0df463 Enable recently added Microsoft.CodeAnalysis.NetAnalyzers rules (#53158) 2021-05-28 14:46:46 -04:00