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

[release/6.0] Use x64 directory if running x64 process on arm64 apphost #68583

Merged
merged 2 commits into from
May 4, 2022

Conversation

elinor-fung
Copy link
Member

@elinor-fung elinor-fung commented Apr 27, 2022

Backport of #59890 and #68671

Issues:

Customer Impact

When running an x64 application via apphost on arm64 (Windows or macOS), the application looks for a .NET install at a default path corresponding to an arm64 install rather than an x64 install. This means that:

  1. If only arm64 is installed, the application will try and fail to load the arm64 hostfxr
  2. If both arm64 and x64 are installed and the arm64 runtime version is a better match for the application (for example, a higher patch version), the application will try and fail to load the arm64 hostpolicy if multi-level lookup is enabled (default on Windows)

On Windows, (2) also occurs when running via the x64 dotnet. This includes running SDK commands. For example, running \Program Files\dotnet\x64\dotnet.exe build (or even --info) will fail to load the arm64 hostpolicy.

In every case, the result is a confusing error about failing to load one of our hosting components.

Testing

Manual validation

  • arm64 installed, x64 not installed
    • we report that no runtime is installed (instead of trying to load the arm64 hostfxr)
  • arm64 installed, x64 installed, arm64 is a better version match
    • we use the x64 runtime (instead of trying to load the arm64 hostpolicy on Windows)
  • arm64 installed, x64 at the default location, but not registered
    • we can find the x64 runtime (instead of trying to load the arm64 hostfxr)
  • arm64 not installed, x64 at the default location, but not registered
    • we can find the x64 runtime (instead of reporting that no runtime is installed)

Risk

The fix for macOS has been in main for about 6 months. The fix for Windows is targeted to only affect x64 hosting binaries running on non-x64 systems.

@ghost
Copy link

ghost commented Apr 27, 2022

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

Issue Details

Backport of #59890

Customer Impact

Testing

Risk

Author: elinor-fung
Assignees: elinor-fung
Labels:

area-Host

Milestone: -

@elinor-fung elinor-fung marked this pull request as draft April 28, 2022 15:50
@elinor-fung elinor-fung marked this pull request as ready for review April 29, 2022 18:11
Copy link
Member

@jeffschwMSFT jeffschwMSFT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved. We will take for consideration in 6.0.x

@JulieLeeMSFT JulieLeeMSFT added this to the 6.0.x milestone May 2, 2022
@JulieLeeMSFT JulieLeeMSFT added the Servicing-consider Issue for next servicing release review label May 2, 2022
@leecow leecow added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels May 3, 2022
@leecow leecow modified the milestones: 6.0.x, 6.0.6 May 3, 2022
Copy link
Member

@carlossanlop carlossanlop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@elinor-fung @vitek-karas the CI has failures. Can you confirm if the errors are related to this change? If not, let me know so I can merge this.

@ghost ghost added the needs-author-action An issue or pull request that requires more info or actions from the author. label May 3, 2022
@elinor-fung
Copy link
Member Author

The failures are unrelated:

@ghost ghost removed the needs-author-action An issue or pull request that requires more info or actions from the author. label May 4, 2022
@carlossanlop carlossanlop merged commit cc3b551 into dotnet:release/6.0 May 4, 2022
@elinor-fung elinor-fung deleted the backport59890 branch May 4, 2022 17:41
@ghost ghost locked as resolved and limited conversation to collaborators Jun 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Host Servicing-approved Approved for servicing release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants