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

Make crossgen trimmable #60016

Closed
5 tasks done
agocke opened this issue Oct 5, 2021 · 4 comments
Closed
5 tasks done

Make crossgen trimmable #60016

agocke opened this issue Oct 5, 2021 · 4 comments

Comments

@agocke
Copy link
Member

agocke commented Oct 5, 2021

There are a couple of prerequisites here:

  • Crossgen needs to be able to publish itself during the build:
  • Crossgen needs to use COMWrappers for all COM calls
@dotnet-issue-labeler dotnet-issue-labeler bot added area-CrossGen/NGEN-coreclr untriaged New issue has not been triaged by the area owner labels Oct 5, 2021
@agocke agocke added area-Infrastructure-coreclr and removed area-CrossGen/NGEN-coreclr untriaged New issue has not been triaged by the area owner labels Oct 5, 2021
@ghost
Copy link

ghost commented Oct 5, 2021

Tagging subscribers to this area: @hoyosjs
See info in area-owners.md if you want to be subscribed.

Issue Details

There are a couple of prerequisites here:

  • Crossgen needs to be able to publish itself during the build:
  • Crossgen needs to use COMWrappers for all COM calls
Author: agocke
Assignees: -
Labels:

area-Infrastructure-coreclr

Milestone: -

@agocke agocke added this to the 7.0.0 milestone Oct 5, 2021
@agocke
Copy link
Member Author

agocke commented Oct 5, 2021

Work in progress here: https://github.com/agocke/runtime/tree/crossgen-trim

@MichalStrehovsky
Copy link
Member

Crossgen needs to use COMWrappers for all COM calls

AFAIK crossgen is only using COM to read (non-portable) PDBs. It calls into .NET Framework APIs to do so. As a side effect, crossgen will ignore non-portable PDBs on any system that doesn't come with .NET Framework (be it Linux, mac, or even some Windows). That's a very subtle crosscompilation problem.

It might be worth looking into just replacing the COM in crossgen2 with a managed PDB reader - Cecil and CCI have code we might be able to just take.

@agocke
Copy link
Member Author

agocke commented Oct 6, 2021

Seems theoretically possible to re-implement in managed code, but I think there's more than just PDB reading, there's a writer too -- https://github.com/dotnet/runtime/blob/main/src/coreclr/tools/aot/ILCompiler.Diagnostics/ISymNGenWriter.cs

@agocke agocke closed this as completed in 0d1e04b Apr 1, 2022
agocke added a commit to agocke/runtime that referenced this issue Apr 6, 2022
…5948)

Publishes crossgen as an AOT binary on Windows+Linux x64+ARM64, otherwise publishes as an R2R single file.

Closes dotnet#60016

(cherry picked from commit 0d1e04b)
agocke added a commit that referenced this issue Apr 26, 2022
Brings back the earlier change to publish crossgen as AOT with a fix for restore flakiness (#65948)

Closes #60016

(cherry picked from commit 0d1e04b)

Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com>
Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
@ghost ghost locked as resolved and limited conversation to collaborators May 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants