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

Use script to install ARM version of .NET on ARM because of a UseDotNet bug #3037

Open
wants to merge 28 commits into
base: main
Choose a base branch
from

Conversation

MichelZ
Copy link
Contributor

@MichelZ MichelZ commented Nov 26, 2024

Looks like there's a bug in the UseDotNet Azure DevOps functionality and it installs x86 .NET on ARM:
microsoft/azure-pipelines-tasks#20300

Adding an install script to resolve this and install the proper version on ARM.
Also, the steps were added twice as prebuild and build. Removed one.

Here you can find the logs showing the x86 install:
https://dev.azure.com/sqlclientdrivers/public/_build/results?buildId=102454&view=logs&j=f62ec789-9893-5f91-3293-e8a10244adaa&t=83eb4f36-b8e6-57c5-1c44-e749ef0d4796

Starting: Initialize job
Agent name: 'ADO-CI-PUBLIC-ARM64-1ES-EUS-POOL 4'
Version 9.0.100 was not found in cache.
Getting URL to download .NET Core sdk version: 9.0.100.
Detecting OS platform to find correct download package for the OS.
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoLogo -Sta -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command "& 'D:\a\_work\_tasks\UseDotNet_b0ce7256-7898-45d3-9cb5-176b752bfea6\2.248.1\externals\get-os-platform.ps1'"
Primary:win-x86
Detected platform (Primary): win-x86
Downloading: https://download.visualstudio.microsoft.com/download/pr/d7af32e6-aaec-4fcd-aabe-0d927fa73a6d/80bbc4143ee82e40b8b4341795e92f4e/dotnet-sdk-9.0.100-win-x86.zip
Extracting downloaded package D:\a\_work\_temp\5c2afe6a-65ec-4414-ad1a-8368aeaecbe9.
Extracting archive

Note: This needs new packages added to the azure devops feed cache:
- microsoft.netcore.app.host.win-arm64 (I guess 8.0 & 9.0?)

##[error]tools\GenAPI\Microsoft.DotNet.GenAPI\Microsoft.DotNet.GenAPI.csproj(0,0): Error NU1301: Failed to retrieve information about 'Microsoft.NETCore.App.Host.win-arm64' from remote source 'https://sqlclientdrivers.pkgs.visualstudio.com/904996cc-6198-4d39-8540-eca72bdf0b7b/_packaging/e8fc87e8-fcf4-4bb0-a818-96a9fdd52378/nuget/v3/flat2/microsoft.netcore.app.host.win-arm64/index.json'.

@MichelZ MichelZ changed the title Use script to install .NET because of ARM bug WIP - Please ignore | Use script to install .NET because of ARM bug Nov 26, 2024
@ErikEJ
Copy link
Contributor

ErikEJ commented Nov 27, 2024

@MichelZ Maybe you can use the VS Code AzureDevops YAML validator 😄 ?

@MichelZ
Copy link
Contributor Author

MichelZ commented Nov 27, 2024

@MichelZ Maybe you can use the VS Code AzureDevops YAML validator 😄 ?

Today I learned.... Thanks!

@ErikEJ
Copy link
Contributor

ErikEJ commented Nov 27, 2024

@MichelZ it just got too painful watching 😆

@MichelZ MichelZ changed the title WIP - Please ignore | Use script to install .NET because of ARM bug Use script to install ARM version of .NET on ARM because of a UseDotNet bug Nov 27, 2024
@MichelZ
Copy link
Contributor Author

MichelZ commented Feb 11, 2025

@David-Engel Is this something that's interesting or shall I abandon this one?
The ARM build is still using the x86 compat layer instead of native:
https://sqlclientdrivers.visualstudio.com/public/_build/results?buildId=107325&view=logs&jobId=f62ec789-9893-5f91-3293-e8a10244adaa&j=f62ec789-9893-5f91-3293-e8a10244adaa&t=83eb4f36-b8e6-57c5-1c44-e749ef0d4796

Primary:win-x86
Detected platform (Primary): win-x86
Downloading: https://download.visualstudio.microsoft.com/download/pr/139daba9-b797-4dc9-a5a3-873604311459/90623d54cab92d97f66343147e318d6a/dotnet-sdk-9.0.102-win-x86.zip

If it's interesting, some packages need to be cached in the nuget source:
e.g. Microsoft.NETCore.App.Host.win-arm64
and the pipeline needs to be re-run

@David-Engel
Copy link
Contributor

This is more up the alley of @benrr101 or @mdaigle. I'm sure it'll annoy them to see yet another pipeline problem that we should address. Squeaky wheel gets the grease. 😄

@mdaigle
Copy link
Contributor

mdaigle commented Feb 14, 2025

/azp run

Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@benrr101
Copy link
Contributor

Considering all the ARM64 pipeline runs are failing, I am curious if this might resolve it, since I can't repro it on an ARM64 vm.

Fingers crossed I added the required packages to the internal feed in time for the pipeline to run.

@MichelZ
Copy link
Contributor Author

MichelZ commented Feb 17, 2025

As far as I can tell the problems started after the latest .NET SDK updates for 9.0.200, so this somehow feels like a .NET SDK bug

@MichelZ
Copy link
Contributor Author

MichelZ commented Feb 17, 2025

While I haven't found an exact match, here's another macOS specific issue with dotnet restore:
dotnet/sdk#46857

@benrr101
Copy link
Contributor

@MichelZ well the good news is we fixed the issue with the CI pipeline (rebuilding our ARM64 VM images to get newer version of VS that is compatible with dotnet 9.0.200). So hopefully we can finally get some joy running these tests

Copy link
Contributor

@benrr101 benrr101 left a comment

Choose a reason for hiding this comment

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

I like the idea, but I'd be nice to polish it up a bit

Write-Host "##vso[task.setvariable variable=DOTNET_ROOT]${NEW_DOTNET_ROOT}"
Write-Host "##vso[task.prependpath]${NEW_DOTNET_ROOT}"
Remove-Item dotnet-install.ps1 -ErrorAction:Ignore
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
Copy link
Contributor

Choose a reason for hiding this comment

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

How about instead of doing this as a condition buried in the task definition, let's move this a level higher and use the ${{ if eq(variables.Agent.OS, 'Windows_NT') }}: to conditionally include the tasks.

# See the LICENSE file in the project root for more information. #
#################################################################################
parameters:
- name: version
Copy link
Contributor

Choose a reason for hiding this comment

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

Since we're working on improving our pipelines (and I'm pushing for some degree of uniformity), can we have these with:

  • 4 space indents at each level
  • Extra line between parameter definitions and tasks
  • Sort parameters alphabetically

- name: version
type: number
default: 9
- name: sdk
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not just have this as a string with values of 'sdk' and 'runtime' - that way when it's passed into the later tasks, we don't have to have if expressions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants