templating icon indicating copy to clipboard operation
templating copied to clipboard

Investigate issues on template preparation for test layout

Open vlada-shubina opened this issue 1 year ago • 2 comments

Background: https://github.com/dotnet/sdk/blob/3c407ae54b6715d0f68a45bf774c19525f0a3459/src/Layout/redist/targets/OverlaySdkOnLKG.targets#L17-L45

During sdk layout preparation templates are copied from stage 0 as well as just built packages is used. The step errors out when templates of more than one version exist. This may happen when changing from .NET 7 branch to .NET8 or vice versa.

Investigate the issue, consider removing the old templates before the copy step. The issue is low priority as has workaround: remove artifacts folder before the build (anyway recommended), as other issues may occur as well.

vlada-shubina avatar Mar 24 '23 14:03 vlada-shubina

Removing the old templates before the copy step could bring in another problem. After switching back to previous branch it will not get deleted templates installed again because the install script detects .net core runtime is already installed. For example, I first build branch release/7.0.1xx, then switch to branch release/8.0.1xx-preview5 and build. Given that old templates(.NET 7) are deleted and building branch release/8.0.1xx-preview5 succeeds, I switch back to branch release/7.0.1xx and build, the output is similar to the following and the templates are not installed back.

Attempting to install dotnet from public location.
dotnet-install: Using alternate version 7.0.5 found in https://dotnetcli.azureedge.net/dotnet/Runtime/7.0.5-servicing.23174.5/runtime-productVersion.txt
dotnet-install: .NET Core Runtime with version '7.0.5' is already installed.
dotnet-install: Adding to current process PATH: "F:\WS\fork\temp\sdk\.dotnet\". Note: This change will not be visible if PowerShell was run as a child process.
  Determining projects to restore...

I'm wondering if there is a way to get the template folder name(the version) from associated sdk version instead of the folder path. I explored and found <repo root>\.dotnet\sdk\<sdk version>\Microsoft.NETCoreSdk.BundledVersions.props might have some useful info, but not sure which exactly it was. This needs an expert's help.

GangWang01 avatar Jun 13 '23 09:06 GangWang01

@joeloff please take a look

YuliiaKovalova avatar Jun 15 '23 15:06 YuliiaKovalova