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

Fix common.lib.ps1 use correct dotnet on ARM64 devices. #3986

Merged
merged 2 commits into from
Sep 1, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions scripts/common.lib.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,18 @@ function Install-DotNetCli
$dotnetInstallPath = Join-Path $env:TP_TOOLS_DIR "dotnet"
New-Item -ItemType directory -Path $dotnetInstallPath -Force | Out-Null

$x64Architecture = "x64"
if ($env:PROCESSOR_ARCHITECTURE -eq "ARM64")
{
$x64Architecture = "arm64"
Copy link
Member

Choose a reason for hiding this comment

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

What about x86, shall we have some similar logic?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't know, I don't have a device to test it.

Copy link
Member

Choose a reason for hiding this comment

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

Let's keep it as-is for now then.

}

# Runtime versions installed usually need to be kept in sync with the ones installed in build.sh
& $dotnetInstallScript -InstallDir "$dotnetInstallPath" -Runtime 'dotnet' -Channel '2.1' -Architecture x64 -NoPath # Install the latest patch
& $dotnetInstallScript -InstallDir "$dotnetInstallPath" -Runtime 'dotnet' -Channel '3.1' -Architecture x64 -NoPath # Install the latest patch
& $dotnetInstallScript -InstallDir "$dotnetInstallPath" -Runtime 'dotnet' -Channel '5.0' -Architecture x64 -NoPath # Install the latest patch
& $dotnetInstallScript -InstallDir "$dotnetInstallPath" -Runtime 'dotnet' -Channel '6.0' -Architecture x64 -NoPath # Install the latest patch
& $dotnetInstallScript -InstallDir "$dotnetInstallPath" -Channel '7.0' -Architecture x64 -NoPath -Version $env:DOTNET_CLI_VERSION
& $dotnetInstallScript -InstallDir "$dotnetInstallPath" -Runtime 'dotnet' -Channel '2.1' -Architecture $x64Architecture -NoPath # Install the latest patch
& $dotnetInstallScript -InstallDir "$dotnetInstallPath" -Runtime 'dotnet' -Channel '3.1' -Architecture $x64Architecture -NoPath # Install the latest patch
& $dotnetInstallScript -InstallDir "$dotnetInstallPath" -Runtime 'dotnet' -Channel '5.0' -Architecture $x64Architecture -NoPath # Install the latest patch
& $dotnetInstallScript -InstallDir "$dotnetInstallPath" -Runtime 'dotnet' -Channel '6.0' -Architecture $x64Architecture -NoPath # Install the latest patch
& $dotnetInstallScript -InstallDir "$dotnetInstallPath" -Channel '7.0' -Architecture $x64Architecture -NoPath -Version $env:DOTNET_CLI_VERSION

& $dotnetInstallScript -InstallDir "${dotnetInstallPath}_x86" -Runtime 'dotnet' -Channel '2.1' -Architecture x86 -NoPath # Install the latest patch
& $dotnetInstallScript -InstallDir "${dotnetInstallPath}_x86" -Runtime 'dotnet' -Channel '3.1' -Architecture x86 -NoPath # Install the latest patch
Expand All @@ -126,7 +132,7 @@ function Install-DotNetCli
"---- dotnet environment variables"
Get-ChildItem "Env:\dotnet_*"

"`n`n---- x64 dotnet"
"`n`n---- $x64Architecture dotnet"
Invoke-Exe "$env:DOTNET_ROOT\dotnet.exe" -Arguments "--info"

"`n`n---- x86 dotnet"
Expand Down