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

Move Linker repo to Runtime repo #75278

Closed
16 of 18 tasks
tlakollo opened this issue Sep 8, 2022 · 9 comments
Closed
16 of 18 tasks

Move Linker repo to Runtime repo #75278

tlakollo opened this issue Sep 8, 2022 · 9 comments
Assignees
Labels
area-Tools-ILLink .NET linker development as well as trimming analyzers
Milestone

Comments

@tlakollo
Copy link
Contributor

tlakollo commented Sep 8, 2022

Move linker repo to runtime repo

This issue tracks progress and discussion for moving the dotnet/linker repo into dotnet/runtime repo.

Progress

  • Selected the location of the repository as runtime\src\tools\linker
  • Ability to transfer Linker history to runtime using the consolidation script
  • Add cecil as an arcade package in order to avoid having a submodule
    • Rename package to DotNet.Cecil
  • Be able to run dotnet format to apply runtime formatting to linker repo
  • Create subsets (tools.linker & tools.linkertests) in order to be able to run and test the repo
  • Run in CI
  • Add additional label
  • Rename linker to illink
  • Build a package from the new location or use live bits

Follow-up work

Motivation

  • Code Sharing. At this moment NativeAOT and linker share a lot of code via a straight copy. NativeAOT consumes the ILLink.Shared project which is a shared project between linker, trimming analyzer and NativeAOT. It also shares the same testing infrastructure and even shares additional files that are not included in the shared project since they are only shared between linker and NativeAOT (not for the trimming analyzer). The plan is that once we move the linker repository to runtime we can take advantage of having only one ILLink.Shared project, only one testing infrastructure, and we can improve code sharing between linker and NativeAOT, even having the same formats and analyzers applied to the codebases improve the current state of code sharing.
  • Versioning history. Backward compatibility of tools like linker and NativeAOT is an ongoing issue (see PublishTrimmed should use a linker that matches the TargetFramework linker#3029) having both repositories in the runtime simplifies the solution for both of the tools.

Select the location for the linker project

So far there have been some locations that seem relevant

  • src\coreclr\tools\ folder, although it would be closer to the AOT tools linker is not strictly a part of the coreclr
  • Create a new folder under src\tools for tools that are agnostic to the clr. Likely the best option.
  • Maybe somewhere in the mono partition?

Avoiding having a cecil submodule

Part of the linker workflow is to have a .gitmodules file that specifies a mono/cecil module, for runtime this won't fit the runtime needs. So we need to maybe ship cecil packages from mono/cecil and consume them in the runtime to later be used by linker

Linker style of code format

Currently, linker repo uses mono style of code. This makes already codesharing with NativeAOT more difficult since we cannot share code as is. Linker already transition from the mono space to the dotnet space, which leaves in the air if it should still use the mono guidelines. Once moving to the runtime repo and giving that we want to share code, the most likely solution is to just use runtime format for that repo. Note: mono directories under runtime still use the mono style of code guidelines.

Legs for execution

Need a definition on when should ci build linker and run linker tests. Most likely will remain as a subset just like currently clr.tools and clr.toolstests, and run only if changes in the linker repo are made. For source build, building and testing the linker repo seems inevitable unless we create a different leg that only runs linker.

Add an additional label

Add an additional label to runtime to identify linker issues

Keep a history of the linker changes

There are some scripts that were used to consolidate different repositories into runtime, although they are tailored to work with certain repositories we could configure it to keep the history from linker (see https://github.com/dotnet/consolidation)

Migration of github issues

Previous runtime consolidation work had the help of GitHub to migrate all issues from the different repos to the new dotnet/runtime repo, and then lock down creation of additional issues, such that the repos will no longer be used for issue management. They also inhibit the creation of PRs to the main branch, effectively making old repos an archive for read-only review of history. Plan is to do the same for linker

@tlakollo tlakollo added this to the 8.0.0 milestone Sep 8, 2022
@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@tlakollo
Copy link
Contributor Author

tlakollo commented Sep 8, 2022

cc @dotnet/linker-contrib @dotnet/ilc-contrib

@tlakollo
Copy link
Contributor Author

tlakollo commented Sep 8, 2022

cc @marek-safar @radekdoulik

@ghost
Copy link

ghost commented Sep 8, 2022

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

Issue Details

Move linker repo to runtime repo

This issue tracks progress and discussion for moving the dotnet/linker repo into dotnet/runtime repo.

Select the location for the linker project

So far there have some locations that seem relevant

  • src\coreclr\tools\ folder, although it would be closer to the AOT tools linker is not strictly a part of the coreclr
  • Create a new folder under src\tools for tools that are agnostic to the clr. Likely the best option.
  • Maybe somewhere in the mono partition?

Keep a history of the linker changes

There are some scripts that were used to consolidate different repositories into runtime, although they are tailored to work with certain repositories we could configure it to keep the history from linker (see https://github.com/dotnet/consolidation)

Avoiding having a cecil submodule

Part of the linker workflow is to have a .gitmodules file that specifies a mono/cecil module, for runtime this won't fit the runtime needs. So we need to maybe ship cecil packages from mono/cecil and consume them in the runtime to later be used by linker

Linker style of code format

Currently, linker repo uses mono style of code. This makes already codesharing with NativeAOT more difficult since we cannot share code as is. Linker already transition from the mono space to the dotnet space, which leaves in the air if it should still use the mono guidelines. Once moving to the runtime repo and giving that we want to share code, the most likely solution is to just use runtime format for that repo. Note: mono directories under runtime still use the mono style of code guidelines.

Legs for execution

Need a definition on when should ci build linker and run linker tests. Most likely will remain as a subset just like currently clr.tools and clr.toolstests, and run only if changes in the linker repo are made. For source build, building and testing the linker repo seems inevitable unless we create a different leg that only runs linker.

Add an additional label

Add an additional label to runtime to identify linker issues

Author: tlakollo
Assignees: -
Labels:

area-Meta

Milestone: 8.0.0

@jkotas
Copy link
Member

jkotas commented Sep 8, 2022

Create a new folder under src\tools

That looks better to me.

we need to maybe ship cecil packages from mono/cecil and consume them in the runtime to later be used by linker

We need to make sure that this is compatible with our servicing policies and source build. If we were to keep cecil in separate repo, I expect that we would need to move it to dotnet/cecil at least.

@vitek-karas
Copy link
Member

Moving Cecil to runtime repo is problematic. So far we've used mono/cecil as only a way to ship predictable bits and have a way to quickly fix issues without waiting for upstream merge. But we always send all our changes upstream and most of the time mono/cecil and upstream are identical. If we were to move cecil into runtime repo, it would have to be a mirror, which seems impractical.

@marek-safar
Copy link
Contributor

We need to make sure that this is compatible with our servicing policies and source build. If we were to keep cecil in separate repo, I expect that we would need to move it to dotnet/cecil at least.

I don't think mono/ org should be a problem for source build (we have or had sources used by source build there before) but I have no objection to creating another fork under dotnet/ org. We just need to be careful about versioning of the internal cecil package/dlls.

@tlakollo tlakollo self-assigned this Oct 26, 2022
This was referenced Nov 8, 2022
MichaelSimons referenced this issue in dotnet/installer Feb 6, 2023
Microsoft.DotNet.Common.ItemTemplates , Microsoft.DotNet.MSBuildSdkResolver , Microsoft.NET.Sdk , Microsoft.TemplateEngine.Cli
 From Version 8.0.100-alpha.1.23080.9 -> To Version 8.0.100-preview.2.23101.9

Dependency coherency updates

Microsoft.WindowsDesktop.App.Ref,VS.Redist.Common.WindowsDesktop.SharedFramework.x64.8.0,VS.Redist.Common.WindowsDesktop.TargetingPack.x64.8.0,VS.Redist.Common.NetCore.SharedFramework.x64.8.0,Microsoft.NETCore.App.Ref,VS.Redist.Common.NetCore.TargetingPack.x64.8.0,Microsoft.NETCore.App.Runtime.win-x64,Microsoft.NETCore.App.Host.win-x64,Microsoft.NETCore.DotNetHostResolver,Microsoft.NETCore.Platforms,Microsoft.AspNetCore.App.Ref,Microsoft.AspNetCore.App.Ref.Internal,Microsoft.AspNetCore.App.Runtime.win-x64,VS.Redist.Common.AspNetCore.SharedFramework.x64.8.0,dotnet-dev-certs,dotnet-user-jwts,dotnet-user-secrets,Microsoft.WindowsDesktop.App.Runtime.win-x64,Microsoft.Dotnet.WinForms.ProjectTemplates,Microsoft.WindowsDesktop.App.Runtime.win-x64,Microsoft.DotNet.Wpf.ProjectTemplates,Microsoft.FSharp.Compiler,Microsoft.SourceBuild.Intermediate.fsharp,Microsoft.NET.Test.Sdk,Microsoft.NET.ILLink.Tasks,Microsoft.Net.Compilers.Toolset,Microsoft.Build,NuGet.Build.Tasks
 From Version 8.0.0-alpha.1.23078.1 -> To Version 8.0.0-preview.2.23081.2 (parent: Microsoft.NET.Sdk
@ericstj ericstj added area-Tools-ILLink .NET linker development as well as trimming analyzers and removed area-Meta labels Aug 11, 2023
@ghost
Copy link

ghost commented Aug 11, 2023

Tagging subscribers to this area: @agocke, @sbomer, @vitek-karas
See info in area-owners.md if you want to be subscribed.

Issue Details

Move linker repo to runtime repo

This issue tracks progress and discussion for moving the dotnet/linker repo into dotnet/runtime repo.

Progress

  • Selected the location of the repository as runtime\src\tools\linker
  • Ability to transfer Linker history to runtime using the consolidation script
  • Add cecil as an arcade package in order to avoid having a submodule
    • Rename package to DotNet.Cecil
  • Be able to run dotnet format to apply runtime formatting to linker repo
  • Create subsets (tools.linker & tools.linkertests) in order to be able to run and test the repo
  • Run in CI
  • Add additional label
  • Rename linker to illink
  • Build a package from the new location or use live bits

Follow-up work

Motivation

  • Code Sharing. At this moment NativeAOT and linker share a lot of code via a straight copy. NativeAOT consumes the ILLink.Shared project which is a shared project between linker, trimming analyzer and NativeAOT. It also shares the same testing infrastructure and even shares additional files that are not included in the shared project since they are only shared between linker and NativeAOT (not for the trimming analyzer). The plan is that once we move the linker repository to runtime we can take advantage of having only one ILLink.Shared project, only one testing infrastructure, and we can improve code sharing between linker and NativeAOT, even having the same formats and analyzers applied to the codebases improve the current state of code sharing.
  • Versioning history. Backward compatibility of tools like linker and NativeAOT is an ongoing issue (see PublishTrimmed should use a linker that matches the TargetFramework linker#3029) having both repositories in the runtime simplifies the solution for both of the tools.

Select the location for the linker project

So far there have been some locations that seem relevant

  • src\coreclr\tools\ folder, although it would be closer to the AOT tools linker is not strictly a part of the coreclr
  • Create a new folder under src\tools for tools that are agnostic to the clr. Likely the best option.
  • Maybe somewhere in the mono partition?

Avoiding having a cecil submodule

Part of the linker workflow is to have a .gitmodules file that specifies a mono/cecil module, for runtime this won't fit the runtime needs. So we need to maybe ship cecil packages from mono/cecil and consume them in the runtime to later be used by linker

Linker style of code format

Currently, linker repo uses mono style of code. This makes already codesharing with NativeAOT more difficult since we cannot share code as is. Linker already transition from the mono space to the dotnet space, which leaves in the air if it should still use the mono guidelines. Once moving to the runtime repo and giving that we want to share code, the most likely solution is to just use runtime format for that repo. Note: mono directories under runtime still use the mono style of code guidelines.

Legs for execution

Need a definition on when should ci build linker and run linker tests. Most likely will remain as a subset just like currently clr.tools and clr.toolstests, and run only if changes in the linker repo are made. For source build, building and testing the linker repo seems inevitable unless we create a different leg that only runs linker.

Add an additional label

Add an additional label to runtime to identify linker issues

Keep a history of the linker changes

There are some scripts that were used to consolidate different repositories into runtime, although they are tailored to work with certain repositories we could configure it to keep the history from linker (see https://github.com/dotnet/consolidation)

Migration of github issues

Previous runtime consolidation work had the help of GitHub to migrate all issues from the different repos to the new dotnet/runtime repo, and then lock down creation of additional issues, such that the repos will no longer be used for issue management. They also inhibit the creation of PRs to the main branch, effectively making old repos an archive for read-only review of history. Plan is to do the same for linker

Author: tlakollo
Assignees: tlakollo
Labels:

area-Tools-ILLink

Milestone: 8.0.0

@agocke
Copy link
Member

agocke commented Aug 15, 2023

Closing as complete

@agocke agocke closed this as completed Aug 15, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Sep 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Tools-ILLink .NET linker development as well as trimming analyzers
Projects
None yet
Development

No branches or pull requests

7 participants