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

Runtime support for multi-architecture installations #50798

Closed
7 of 11 tasks
agocke opened this issue Apr 6, 2021 · 8 comments
Closed
7 of 11 tasks

Runtime support for multi-architecture installations #50798

agocke opened this issue Apr 6, 2021 · 8 comments
Milestone

Comments

@agocke
Copy link
Member

agocke commented Apr 6, 2021

The fundamental architectural difference here is that some platforms provide support for multiple architectures, e.g. they run ARM natively, but provide an emulator for amd64.

There are a couple areas we need provide support for:

  1. Installations of shared frameworks with multiple architectures
  2. Deployment of standalone apps with multiple architectures

There are two OSes we want to focus on: Windows and Mac OS.

We now have proposed designs for the shared framework/global install of .NET:

Work items:

  • Agree on the path format for the architecture-specific default install locations.
  • Embed the default install location for each different architecture into the apphost.
  • Add a mechanism into the apphost to retrieve the OS architecture in which the process is running.
  • Extend the global install location config file (macOS and Linux)
    • Add support for downlevel apphost compat: installers should keep the first line of the config file as is, while adding architecture-specific lines.
    • Add logic for picking up the correct installation (search for the arch-prefixed line matching the current architecture and fallback to the non-prefixed line if none was found).
  • Modify apphost to pick the correct arch-specific DOTNET_ROOT_ARCH env variable first and fallback to the default DOTNET_ROOT if it wasn't found.
  • Add multi-arch support for self-registered installations using Windows Registry.
  • Include all architectures in commands line dotnet --info - Host should inform user about other installed archs on the system #51101
  • Include all architectures in errors about missing runtime/framework - Host should inform user about different archs when failing to find framework #51102
  • Extend test infra to easily mock the OS and architecture so that testing can be done anywhere.
@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged New issue has not been triaged by the area owner label Apr 6, 2021
@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.

@agocke agocke added area-Host and removed untriaged New issue has not been triaged by the area owner labels Apr 6, 2021
@ghost
Copy link

ghost commented Apr 6, 2021

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

Issue Details

The fundamental architectural difference here is that some platforms provide support for multiple architectures, e.g. they run ARM natively, but provide an emulator for amd64.

There are a couple areas we need provide support for:

  1. Installations of shared frameworks with multiple architectures
  2. Deployment of standalone apps with multiple architectures

There are two OSes we want to focus on: Windows and Mac OS.

The questions are:

  • Some OSes (Mac OS) provide support for building universal binaries. Do we want to use that?
    • Which files do we want to use universal binaries? Single-file support?
  • How to install multiple frameworks side-by-size in a shared install directory such that the muxer can find the appropriate arch?
Author: agocke
Assignees: -
Labels:

area-Host

Milestone: -

@agocke agocke added this to the 6.0.0 milestone Apr 6, 2021
@vitek-karas
Copy link
Member

dotnet --info behavior improvement: #51101
Note that this is an existing problem for Windows x86/x64, Apple M1 and future Windows arm64 are just more examples of the same.

@vitek-karas
Copy link
Member

dotnet app.dll behavior improvement: #51102
Just like above, this is an existing problem on Windows x86/x64.

@mateoatr
Copy link
Contributor

mateoatr commented May 20, 2021

Some work items based on the approved design:

  • Agree on the path format for the architecture-specific default install locations.
  • Embed the default install location for each different architecture into the apphost.
  • Add a mechanism into the apphost to retrieve the OS architecture in which the process is running.
  • Extend the global install location config file (macOS and Linux)
    • Add support for downlevel apphost compat: installers should keep the first line of the config file as is, while adding architecture-specific lines.
    • Add logic for picking up the correct installation (search for the arch-prefixed line matching the current architecture and fallback to the non-prefixed line if none was found).
  • Modify apphost to pick the correct arch-specific DOTNET_ROOT_ARCH env variable first and fallback to the default DOTNET_ROOT if it wasn't found.

@agocke
Copy link
Member Author

agocke commented May 20, 2021

LGTM -- @mateoatr feel free to add this information to the issue directly and change it how you like.

@vitek-karas
Copy link
Member

Looks good - couple of test ideas:

  • As we discussed develop a way to mock the "OS architecture" so that we can test this on any OS ideally.
  • Extend the Windows tests to cover ARM64 (it should work already, but we probably don't have any test coverage)
  • Validate that 3.1 apphost correctly picks up the default location even if the config file contains architecture specific lines in it

@agocke
Copy link
Member Author

agocke commented Jul 13, 2022

Closing as complete. We can track individual items separately if we still feel they're useful.

@agocke agocke closed this as completed Jul 13, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Aug 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Archived in project
Development

No branches or pull requests

3 participants