dotnet / source-build

A repository to track efforts to produce a source tarball of the .NET Core SDK and all its components
MIT License
266 stars 132 forks source link

Source-built SDK fails to load workload manifest #2489

Closed MichaelSimons closed 3 years ago

MichaelSimons commented 3 years ago

Smoke-test fail with the following exception:

  Could not find a part of the path '/tarball/testing-smoke/builtCli/sdk-manifests'.
     at System.IO.Enumeration.FileSystemEnumerator`1.CreateDirectoryHandle(String path, Boolean ignoreNotFound)
     at System.IO.Enumeration.FileSystemEnumerator`1.Init()
     at System.IO.Enumeration.FileSystemEnumerator`1..ctor(String directory, Boolean isNormalized, EnumerationOptions options)
     at System.IO.Enumeration.FileSystemEnumerable`1..ctor(String directory, FindTransform transform, EnumerationOptions options, Boolean isNormalized)
     at System.IO.Enumeration.FileSystemEnumerableFactory.UserDirectories(String directory, String expression, EnumerationOptions options)
     at System.IO.Directory.InternalEnumeratePaths(String path, String searchPattern, SearchTarget searchTarget, EnumerationOptions options)
     at System.IO.Directory.GetDirectories(String path, String searchPattern, EnumerationOptions enumerationOptions)
     at System.IO.Directory.GetDirectories(String path)
     at Microsoft.NET.Sdk.WorkloadManifestReader.SdkDirectoryWorkloadManifestProvider.FallbackForMissingManifest(String manifestId)
     at Microsoft.NET.Sdk.WorkloadManifestReader.SdkDirectoryWorkloadManifestProvider.GetManifestDirectories()
     at Microsoft.NET.Sdk.WorkloadManifestReader.SdkDirectoryWorkloadManifestProvider.GetManifests()+MoveNext()
     at Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadResolver.LoadManifestsFromProvider(IWorkloadManifestProvider manifestProvider)
     at Microsoft.NET.Sdk.WorkloadManifestReader.WorkloadResolver.Create(IWorkloadManifestProvider manifestProvider, String dotnetRootPath, String sdkVersion, String userProfileDir)
     at Microsoft.DotNet.TemplateLocator.TemplateLocator.GetDotnetSdkTemplatePackages(String sdkVersion, String dotnetRootPath, String userProfileDir)
     at Microsoft.DotNet.Tools.New.OptionalWorkloadProvider.GetAllTemplatePackagesAsync(CancellationToken cancellationToken)
     at Microsoft.TemplateEngine.Edge.Settings.TemplatePackageManager.<>c__DisplayClass21_0.<EnsureProvidersLoaded>b__2()
     at System.Threading.Tasks.Task`1.InnerInvoke()
     at System.Threading.Tasks.Task.<>c.<.cctor>b__271_0(Object obj)
     at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
  --- End of stack trace from previous location ---
     at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
     at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
  --- End of stack trace from previous location ---
     at Microsoft.TemplateEngine.Edge.Settings.TemplatePackageManager.GetTemplatePackagesAsync(Boolean force, CancellationToken cancellationToken)
     at Microsoft.TemplateEngine.Edge.Settings.TemplatePackageManager.UpdateTemplateCacheAsync(Boolean needsRebuild, CancellationToken cancellationToken)
     at Microsoft.TemplateEngine.Edge.Settings.TemplatePackageManager.GetTemplatesAsync(CancellationToken cancellationToken)
     at Microsoft.TemplateEngine.Cli.TemplateResolution.BaseTemplateResolver.GetTemplateGroupsAsync(CancellationToken cancellationToken)
     at Microsoft.TemplateEngine.Cli.TemplateResolution.InstantiateTemplateResolver.ResolveTemplatesAsync(INewCommandInput commandInput, String defaultLanguage, CancellationToken cancellationToken)
     at Microsoft.TemplateEngine.Cli.TemplateInvocationCoordinator.CoordinateInvocationAsync(INewCommandInput commandInput, CancellationToken cancellationToken)
     at Microsoft.TemplateEngine.Cli.New3Command.EnterTemplateManipulationFlowAsync(INewCommandInput commandInput)
     at Microsoft.TemplateEngine.Cli.New3Command.ExecuteAsync(INewCommandInput commandInput)
     at Microsoft.TemplateEngine.Cli.New3Command.ActualRun(String commandName, ITemplateEngineHost host, ITelemetryLogger telemetryLogger, New3Callbacks callbacks, String[] args, String hivePath)

This is a regression caused by https://github.com/dotnet/installer/pull/12231

dotnet-issue-labeler[bot] commented 3 years ago

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.

MichaelSimons commented 3 years ago

@sfoslund, Can you provide some guidance on how this should be handled for source-build?

sfoslund commented 3 years ago

I believe @dsplaisted fixed this in recent builds, is that correct?

dsplaisted commented 3 years ago

This does look like the failure that was fixed with https://github.com/dotnet/sdk/pull/21358.

However, I don't believe that it was right to disable including the workload manifests in source build. I think that will probably break installing the wasm-tools workload, as well as correctly failing to build projects that require a given workload.

The workload manifests should only include text files (json and MSBuild .targets files). Is there a way we can include them in source build, since it's more like source code delivered via a NuGet package rather than a prebuilt binary?

MichaelSimons commented 3 years ago

Thanks for responding @dsplaisted and @sfoslund, yes we could handle these the manifests as text-only packages that are included in source-build.

dsplaisted commented 3 years ago

I don't know how you handle text-only packages, but you may want some validation that they only include text if you don't already have a process for that. The manifests are supposed to only have text, but someone could author them to include an MSBuild task DLL that the .targets would load.