Skip to content
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

Start building a universal System.Linq.Expressions library #61952

Merged
merged 4 commits into from
Dec 1, 2021

Commits on Nov 23, 2021

  1. Start building a universal System.Linq.Expressions library

    System.Linq.Expressions currently offers multiple build time definitions to build different flavors of the library:
    
    * `FEATURE_COMPILE` (defined everywhere except iOS/tvOS/Catalyst, and NativeAOT) - enables Reflection.Emit-based expression tree compiler.
    * `FEATURE_INTERPRET` (always defined and not actually possible to build without) - enables the expression interpreter
    * `FEATURE_DLG_INVOKE` (defined everywhere except NativeAOT, but we likely need to be able to run without it on iOS too because there's uninvestigated bugs around it ActiveIssue'd in dotnet#54970) - in the interpreter, use a delegate to invoke `CallInstructions` instead of `MethodInfo.Invoke`. The delegate might have to be Reflection.Emitted if it's not supportable with `Func`/`Action` (that's the uninvestigated iOS/tvOS/Catalyst bug).
    
    For dotnet#61231, we need to be able to build a single System.Linq.Expression library that can switch between these build-time configurations _at publish time_ since we don't want to build a separate S.L.Expressions library for NativeAOT. There are advantages in having this setup for non-NativeAOT scenarios too. This pull request accomplishes that by mechanically changing the `#define`s into feature switches.
    
    The feature switch is placed in the last proposed location for dotnet#17973. I expect we'll want such API to be public at some point; now that Xamarin and NativeAOT use this formerly .NET Native-only thing the API request became relevant again.
    
    This pull request is focused on the mechanical replacement of `#defines` with feature switches and it's already a lot bigger than I'm comfortable with.
    
    There's some obvious "`!FEATURE_COMPILE` means this is .NET Native with everything what that meant" that I did not touch because this is meant to be a mechanical change. Some cleanup will be needed at some point. Right now this just mostly means we're running fewer tests than we could.
    
    Validation:
    * Verified that we're still running the same number of tests with CoreCLR as we previously were and they're all passing.
    * Verified we're getting mostly the same size of the S.L.Expressions library on iOS (433 kB grew to 437 kB, the diffs are expected).
    * Verified things work on the NativeAOT side as well.
    MichalStrehovsky committed Nov 23, 2021
    Configuration menu
    Copy the full SHA
    726c0da View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    c836ba6 View commit details
    Browse the repository at this point in the history

Commits on Nov 24, 2021

  1. Disable ipconstprop

    MichalStrehovsky committed Nov 24, 2021
    Configuration menu
    Copy the full SHA
    050cae3 View commit details
    Browse the repository at this point in the history

Commits on Dec 1, 2021

  1. Review feedback

    MichalStrehovsky committed Dec 1, 2021
    Configuration menu
    Copy the full SHA
    d2ba72d View commit details
    Browse the repository at this point in the history