Skip to content

Remove P/invoke marshalling pregeneration from ReadyToRun. #69758

Open

Description

@teo-tsirpanis

https://github.com/dotnet/runtime/blob/4cc3808d9e3ad6a23fc8b0f1b167f532e9e2b067/docs/design/features/readytorun-pinvoke.md describes a mechanism where P/Invoke marshalling code for some common cases is generated ahead of time during ReadyToRun compilation.

Judging from the document this mechanism seems fragile and hard to maintain. Now that we have the LibraryImport source generator which is easier for ordinary R2R to take advantage of, this optimization is getting less relevant and maybe you should consider removing it for simplicity and ease of maintenance.

Activity

  1. ghost added
    untriagedNew issue has not been triaged by the area owner
    on May 24, 2022
  2. removed
    untriagedNew issue has not been triaged by the area owner
    on Jun 20, 2022
  3. added this to the 7.0.0 milestone on Jun 20, 2022
  4. trylek commented on Jun 20, 2022

    @trylek
    Member

    @jkoritzinsky, can you please clarify the delta between the PR you merged in and this issue i.o.w. what remains to be done here?

  5. jkoritzinsky commented on Jun 20, 2022

    @jkoritzinsky
    Member

    The remaining work is to actually remove the P/Invoke emit infra from crossgen2 (including blittable stub support), but this work depends on #70109.

  6. modified the milestones: 7.0.0, 8.0.0 on Jul 27, 2022
  7. mangod9 commented on Jun 23, 2023

    @mangod9
    Member

    @jkoritzinsky is there work still pending around this which will be done in 8 or should this be moved to later?

  8. trylek commented on Jun 23, 2023

    @trylek
    Member

    Please note that according to Jeremy the final work is blocked on #70109 and the last comment on that issue is one from @AaronRobinsonMSFT from last August where he suggests moving the issue from .NET 7 to .NET 8.

  9. jkoritzinsky commented on Jun 23, 2023

    @jkoritzinsky
    Member

    The rest of this work depends on either doing #70109 or #79125. I'll mark this as blocked Issue/PR is blocked on something - see comments and Future for now.

  10. modified the milestones: 8.0.0, Future on Jun 23, 2023
  11. added
    blockedIssue/PR is blocked on something - see comments
    on Jun 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-ReadyToRunblockedIssue/PR is blocked on something - see comments

    Type

    No type

    Projects

    • Status
      No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions