-
Notifications
You must be signed in to change notification settings - Fork 774
Preparing for System.Linq.AsyncEnumerable #2240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The main job at this stage was to ensure it can still compile. This starts the job of separating out the duplicated and different APIs, but most of that remains to be done.
Turns out the solution doesn't build the ref assemblies and they weren't building. I also needed to modify the async code generator to correctly handle #if-ed out code. Turns out it was stripping the directives and then copying the disabled block of text in as leading trivia! This had the effect of copying #if-ed out methods into the generated code, making them reappear. I've also worked through the first four files of operators.
This is more complex than anything else so far for a couple of reasons. First this uses T4 templates to generate code which in turn contains the [GenerateAsyncOverload] attribute, so we have two levels of code generation. Second, System.Linq.AsyncEnumerable has elected not to implement all of the functionality available in System.Linq.Async (e.g. overloads taking selector callbacks).
Fix erroneous doc comment on ZIP
The ref System.Linq.Async had different frameworks from the runtime one! System.Interactive.Async now has responsibility for supplying the transitive dependency on Microsoft.Bcl.AsyncInterfaces when required. (System.Linq.Async used to do this, but we've inverted the dependency between these tow packages, and also we want people to stop using System.Linq.Async. Now that System.Interactive.Async is the leaf of the dependency tree, it's the one that has to add this reference.) Also, I've added comments explaining why some projects have net10.0 but not net8.0 targets. (Since I very nearly incorrectly reverted that in a review just now, I think it's safe to say the reason behind this isn't entirely self-evident.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR modifies the System.Linq.Async library to prepare for coexistence with the new .NET 10 System.Linq.AsyncEnumerable package. The changes enable System.Linq.Async to work alongside the official Microsoft implementation while providing binary compatibility.
- Updates project files to use .NET 10.0 runtime and removes .NET 6.0 dependencies
- Conditionally compiles most LINQ operators using the
INCLUDE_SYSTEM_LINQ_ASYNCENUMERABLE_DUPLICATES
flag - Marks overlapping functionality as obsolete with migration guidance to System.Linq.AsyncEnumerable
- Moves unique functionality that isn't in System.Linq.AsyncEnumerable to System.Interactive.Async
Reviewed Changes
Copilot reviewed 119 out of 120 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
azure-pipelines.ix.yml | Updates build pipeline to use .NET 10.x SDK and .NET 8.0 runtime |
version.json | Bumps version from 6.1.0 to 7.0.0 preview |
refs/System.Linq.Async/*.csproj | Updates target frameworks from net6.0 to net10.0/net8.0 and adds project references |
Tests.System.Interactive.ApiApprovals/*.csproj | Updates test packages to newer versions and adds System.Linq.AsyncEnumerable reference with alias |
System.Linq.Async/System/Linq/Operators/*.cs | Conditionally compiles duplicate LINQ operators and marks async callback variants as obsolete |
Comments suppressed due to low confidence (1)
Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Sum.Generated.tt:1
- Corrected spelling of 'usef' to 'used'.
<#@ template debug="false" hostspecific="false" language="C#" #>
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
.NET 10 includes
System.Linq.AsyncEnumerable
(and this is available for older .NET runtimes as a NuGet package). This provides LINQ forIAsyncEnumerable<T>
, which is the primary raison d'être of theSystem.Linq.Async
package that is built as part of Ix.NET.The current version of
System.Linq.Async
(v6) causes problems if you use it in a project whereSystem.Linq.AsyncEnumerable
is also in use (e.g., any .NET 10.0 project).This modifies
System.Linq.Async
to enable it to coexist withSystem.Linq.AsyncEnumerable
(by removing most of the functionality from the public API visible in its ref assemblies, while leaving everything present in the runtime assemblies for binary compatibility). The small amount of functionality inSystem.Linq.Async
that has not been recreated inSystem.Linq.AsyncEnumerable
moves intoSystem.Interactive.Async
. The goal is for projects to be able to removeSystem.Linq.Async
, and for us to deprecate this package.The various oddly-named overloads that take async callbacks (with suffixes such as
Await
andWithCancellation
) remain but have been marked as[Obsolete]
with messages recommending that the developer move over to their more conventionally named equivalents fromSystem.Linq.AsyncEnumerable
.Resolves #2239