-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix userlocal #41735
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 userlocal #41735
Conversation
It looks like the two changes are in the main dotnet.dll and the resolver dll, right? So it could be a viable test to
|
Conceptually, it worries me how many distinct places you had to touch to fix this. It feels like we need some abstraction/mediator that we can ask for what this path should be to ensure that no code has the wrong idea. |
I think this is an excellent point. What makes this hard is that all the load-bearing changes are pretty clearly in one of three buckets: related to the install state, related to workload sets, or related to garbage collection, and for the first two cases, at least, even if something perfect existed, I wouldn't have known to reference it. There are a few rare cases in which we really do want the not-userlocal dotnet path regardless, notably as a fallback path in the resolver, so we can't just fully replace dotnetPath with dotnetOrUserLocalPath... |
simplification idea: remove dotnetPath argument from WorkloadInfoHelper and directly call |
Hold for the workload set PR but this looks good otherwise |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I think we'll need some sort of user-local test coverage to be confident that it works and doesn't regress when we make changes.
There are conflicts with the refactoring PR that need to be resolved.
@@ -86,6 +87,7 @@ internal abstract class InstallingWorkloadCommand : WorkloadCommandBase | |||
_userProfileDir = creationResult.UserProfileDir; | |||
_sdkVersion = creationResult.SdkVersion; | |||
_sdkFeatureBand = new SdkFeatureBand(creationResult.SdkVersion); | |||
_workloadRootDir = WorkloadFileBasedInstall.IsUserLocal(_dotnetPath, _sdkFeatureBand.ToString()) ? _userProfileDir : _dotnetPath; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at the implementation of WorkloadFileBasedInstall.IsUserLocal
, it has its own logic to calculate the feature band (in GetUserInstallFilePath
). We should get rid of that and use SdkFeatureBand
instead to keep everything consistent.
ReleaseVersion currentSdkReleaseVersion = new(currentSdkVersion ?? Product.Version); | ||
_currentSdkFeatureBand = new SdkFeatureBand(currentSdkReleaseVersion); | ||
|
||
_targetSdkVersion = targetSdkVersion; | ||
userProfileDir ??= CliFolderPathCalculator.DotnetUserProfileFolderPath; | ||
DotnetPath = dotnetDir ?? (WorkloadFileBasedInstall.IsUserLocal(Path.GetDirectoryName(Environment.ProcessPath), _currentSdkFeatureBand.ToString()) ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than setting the DotnetPath to the user local workload folder, I think we should have a separate property for the workload root. In some contexts we still want the actual dotnet root folder, for example when creating the SdkDirectoryWorkloadManifestProvider
and workload resolver. These constructors have separate arguments to specify the user profile directory.
@@ -110,7 +110,7 @@ public override int Execute() | |||
{ | |||
return; | |||
} | |||
UpdateWorkloads(false, manifestUpdates, offlineCache, context); | |||
UpdateWorkloadsWithInstallRecord(_sdkFeatureBand, manifestUpdates, false, context, offlineCache); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this method doesn't exist after the refactoring, so you'll have to go back and deal with the conflicts.
What I did to test this version:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Make sure to look at and hopefully address the comments from this review and the previous one (from before the rebase).
@@ -61,6 +61,8 @@ internal class WorkloadInfoHelper : IWorkloadInfoHelper | |||
shouldLog: false); | |||
|
|||
WorkloadRecordRepo = workloadRecordRepo ?? Installer.GetWorkloadInstallationRecordRepository(); | |||
|
|||
DotnetPath = dotnetDir ?? (WorkloadFileBasedInstall.IsUserLocal(DotnetPath, _currentSdkFeatureBand.ToString()) ? userProfileDir : DotnetPath); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Re-commenting since my previous comment lost its home in the rebase:
Rather than setting the DotnetPath to the user local workload folder, I think we should have a separate property for the workload root. In some contexts we still want the actual dotnet root folder, for example when creating the SdkDirectoryWorkloadManifestProvider
and workload resolver. These constructors have separate arguments to specify the user profile directory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll throw out that we don't currently use this in any context in which we'd want the real dotnet root folder, but I can make the change anyway to avoid confusion down the line.
|
||
var newModeString = newMode == null ? "<null>" : (newMode.Value ? WorkloadConfigCommandParser.UpdateMode_WorkloadSet : WorkloadConfigCommandParser.UpdateMode_Manifests); | ||
_reporter.WriteLine(string.Format(LocalizableStrings.UpdatedWorkloadMode, newModeString)); | ||
} | ||
|
||
private void UpdateInstallState(SdkFeatureBand sdkFeatureBand, Action<InstallStateContents> update) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice refactoring. 👍
_sdkVersionBand = new SdkFeatureBand(sdkVersion); | ||
_workloadSetVersionFromConstructor = workloadSetVersion; | ||
_globalJsonPathFromConstructor = globalJsonPath; | ||
|
||
var knownManifestIdsFilePath = Path.Combine(_sdkRootPath, "sdk", sdkVersion, "KnownWorkloadManifests.txt"); | ||
string? userManifestsRoot = userProfileDir is null ? null : Path.Combine(userProfileDir, "sdk-manifests"); | ||
string dotnetManifestRoot = Path.Combine(_sdkOrUserLocalPath, "sdk-manifests"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I'm following the code correctly, at this point there is no difference between _sdkRootPath
and _sdkOrUserLocalPath
, and _sdkOrUserLocalPath
may change later. So I think it would be clearer to use the value that doesn't change:
string dotnetManifestRoot = Path.Combine(_sdkOrUserLocalPath, "sdk-manifests"); | |
string dotnetManifestRoot = Path.Combine(_sdkRootPath, "sdk-manifests"); |
It might also be clearer to move the initialization of _sdkOrUserLocalPath
closer to where it may be set to the user local path, or to set it to null initially and then set it to _sdkRootPath
after the following if statement.
var knownManifestIdsFilePath = Path.Combine(_sdkOrUserLocalPath, "sdk", sdkVersion, "KnownWorkloadManifests.txt"); | ||
if (!File.Exists(knownManifestIdsFilePath)) | ||
{ | ||
knownManifestIdsFilePath = Path.Combine(_sdkRootPath, "sdk", sdkVersion, "IncludedWorkloadManifests.txt"); | ||
knownManifestIdsFilePath = Path.Combine(_sdkOrUserLocalPath, "sdk", sdkVersion, "IncludedWorkloadManifests.txt"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that KnownWorkloadManifests.txt
and IncludedWorkloadManifests.txt
are files that are part of the SDK installation, and would not be expected to be in the user local path. So I think we should probably still use _sdkRootPath
when constructing these paths. Does that make sense?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't know anything about them, so I thought they might be writable, in which case they should be in the user local folder, but if they don't go there, I can move it back to _sdkRootPath.
This is a blocker for us. We use nix flakes on macOS, as devs can just run In addition, it seems harmful from a security perspective to require root permissions just to install workloads. userlocal nicely solves this problem. It would be great if this fix is backported into the next Net8 SDK release. |
Some additional context - Nix can be used a package manager on Linux and macOS, and in either case uses our tarball releases to drive the installation: https://github.com/NixOS/nixpkgs/blob/cf05eeada35e122770c5c14add958790fcfcbef5/pkgs/development/compilers/dotnet/versions/8.0.nix#L156 |
this is still failing on nixos with dotnet-sdk reproduction repository is still here > dotnet --info
.NET SDK:
Version: 9.0.100-preview.7.24407.12
Commit: d672b8a045
Workload version: 9.0.100-manifests.ad7d8b9c
MSBuild version: 17.12.0-preview-24374-02+48e81c6f1
Runtime Environment:
OS Name: nixos
OS Version: 24.11
OS Platform: Linux
RID: linux-x64
Base Path: /nix/store/k3pwldrpihar4j8d4i7c464nzdczbk5b-dotnet-sdk-9.0.100-preview.7.24407.12/sdk/9.0.100-preview.7.24407.12/
.NET workloads installed:
Configured to use loose manifests when installing new manifests.
[maui-android]
Installation Source: SDK 9.0.100-preview.7
Manifest Version: 9.0.0-preview.7.24407.4/9.0.100-preview.7
Manifest Path: /home/a/.dotnet/sdk-manifests/9.0.100-preview.7/microsoft.net.sdk.maui/9.0.0-preview.7.24407.4/WorkloadManifest.json
Install Type: FileBased
Host:
Version: 9.0.0-preview.7.24405.7
Architecture: x64
Commit: static
.NET SDKs installed:
9.0.100-preview.7.24407.12 [/nix/store/iciqfvy2ppdyxiz7n1lxkns04k7m5294-dotnet-core-combined/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 9.0.0-preview.7.24406.2 [/nix/store/iciqfvy2ppdyxiz7n1lxkns04k7m5294-dotnet-core-combined/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 9.0.0-preview.7.24405.7 [/nix/store/iciqfvy2ppdyxiz7n1lxkns04k7m5294-dotnet-core-combined/shared/Microsoft.NETCore.App]
Other architectures found:
None
Environment variables:
DOTNET_ROOT [/nix/store/iciqfvy2ppdyxiz7n1lxkns04k7m5294-dotnet-core-combined]
global.json file:
Not found
Learn more:
https://aka.ms/dotnet/info
Download .NET:
https://aka.ms/dotnet/download
> ls -al /nix/store/iciqfvy2ppdyxiz7n1lxkns04k7m5294-dotnet-core-combined/metadata/workloads/9.0.100/userlocal
.r--r--r-- 0 root 31 Dec 1969 /nix/store/iciqfvy2ppdyxiz7n1lxkns04k7m5294-dotnet-core-combined/metadata/workloads/9.0.100/userlocal
> dotnet workload update
Skipping NuGet package signature verification.
Skipping NuGet package signature verification.
Skipping NuGet package signature verification.
Skipping NuGet package signature verification.
Skipping NuGet package signature verification.
Skipping NuGet package signature verification.
Skipping NuGet package signature verification.
Skipping NuGet package signature verification.
Updated advertising manifest microsoft.net.sdk.tvos.
Updated advertising manifest microsoft.net.workload.mono.toolchain.net6.
Updated advertising manifest microsoft.net.workload.mono.toolchain.net7.
Updated advertising manifest microsoft.net.sdk.android.
Updated advertising manifest microsoft.net.workload.mono.toolchain.current.
Updated advertising manifest microsoft.net.workload.emscripten.current.
Updated advertising manifest microsoft.net.workload.emscripten.net8.
Updated advertising manifest microsoft.net.workload.emscripten.net6.
Updated advertising manifest microsoft.net.workload.emscripten.net7.
Updated advertising manifest microsoft.net.sdk.aspire.
Updated advertising manifest microsoft.net.sdk.macos.
Updated advertising manifest microsoft.net.sdk.maccatalyst.
Updated advertising manifest microsoft.net.sdk.maui.
Updated advertising manifest microsoft.net.sdk.ios.
Updated advertising manifest microsoft.net.workload.mono.toolchain.net8.
Installing workload manifest microsoft.net.sdk.aspire version 8.1.0...
Workload installation failed. Rolling back installed packs...
Workload update failed: Read-only file system : '/nix/store/iciqfvy2ppdyxiz7n1lxkns04k7m5294-dotnet-core-combined/metadata/workloads/X64'
> dotnet workload list
Installed Workload Id Manifest Version Installation Source
-----------------------------------------------------------------------------------------------
maui-android 9.0.0-preview.7.24407.4/9.0.100-preview.7 SDK 9.0.100-preview.7
Use `dotnet workload search` to find additional workloads to install.
> dotnet restore
Determining projects to restore...
/nix/store/k3pwldrpihar4j8d4i7c464nzdczbk5b-dotnet-sdk-9.0.100-preview.7.24407.12/sdk/9.0.100-preview.7.24407.12/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1147: To build this project, the following workloads must be installed: maui-android [/home/a/projects/maui-on-nix/src/MauiOnNix.csproj::TargetFramework=net8.0-android]
/nix/store/k3pwldrpihar4j8d4i7c464nzdczbk5b-dotnet-sdk-9.0.100-preview.7.24407.12/sdk/9.0.100-preview.7.24407.12/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1147: To install these workloads, run the following command: dotnet workload restore [/home/a/projects/maui-on-nix/src/MauiOnNix.csproj::TargetFramework=net8.0-android] |
because it was not included in p7. it was included in rc1. |
> dotnet --info
.NET SDK:
Version: 9.0.100-rc.1.24452.12
Commit: 81a714c6d3
Workload version: 9.0.100-manifests.2acaa684
MSBuild version: 17.12.0-preview-24422-09+d17ec720d
Runtime Environment:
OS Name: nixos
OS Version: 24.11
OS Platform: Linux
RID: linux-x64
Base Path: /nix/store/xrbswlskla2qi3hqf2j2543k1qwq10l0-dotnet-sdk-9.0.100-rc.1.24452.12/sdk/9.0.100-rc.1.24452.12/
.NET workloads installed:
Configured to use loose manifests when installing new manifests.
[maui-android]
Installation Source: SDK 9.0.100-rc.1
Manifest Version: 9.0.0-rc.1.24453.9/9.0.100-rc.1
Manifest Path: /home/a/.dotnet/sdk-manifests/9.0.100-rc.1/microsoft.net.sdk.maui/9.0.0-rc.1.24453.9/WorkloadManifest.json
Install Type: FileBased
Host:
Version: 9.0.0-rc.1.24431.7
Architecture: x64
Commit: static
.NET SDKs installed:
9.0.100-rc.1.24452.12 [/nix/store/s8b9hyrb5gdsam9nay59nxcz7k4jb2aj-dotnet-core-combined/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 9.0.0-rc.1.24452.1 [/nix/store/s8b9hyrb5gdsam9nay59nxcz7k4jb2aj-dotnet-core-combined/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 9.0.0-rc.1.24431.7 [/nix/store/s8b9hyrb5gdsam9nay59nxcz7k4jb2aj-dotnet-core-combined/shared/Microsoft.NETCore.App]
Other architectures found:
None
Environment variables:
DOTNET_ROOT [/nix/store/s8b9hyrb5gdsam9nay59nxcz7k4jb2aj-dotnet-core-combined]
global.json file:
Not found
Learn more:
https://aka.ms/dotnet/info
Download .NET:
https://aka.ms/dotnet/download
> dotnet workload restore
Installing workloads: maui-android
Skipping NuGet package signature verification.
Installing workload manifest microsoft.net.sdk.aspire version 8.2.1...
Workload(s) 'maui-android' are already installed.
Installing pack Microsoft.AspNetCore.Components.WebView.Maui version 9.0.0-rc.1.24453.9...
Pack Microsoft.AspNetCore.Components.WebView.Maui version 9.0.0-rc.1.24453.9 is already installed.
Writing workload pack installation record for Microsoft.AspNetCore.Components.WebView.Maui version 9.0.0-rc.1.24453.9...
Installing pack Microsoft.Maui.Sdk version 9.0.0-rc.1.24453.9...
Pack Microsoft.Maui.Sdk version 9.0.0-rc.1.24453.9 is already installed.
Writing workload pack installation record for Microsoft.Maui.Sdk version 9.0.0-rc.1.24453.9...
Installing pack Microsoft.Maui.Sdk version 8.0.82...
Pack Microsoft.Maui.Sdk version 8.0.82 is already installed.
Writing workload pack installation record for Microsoft.Maui.Sdk version 8.0.82...
Installing pack Microsoft.Maui.Graphics version 9.0.0-rc.1.24453.9...
Pack Microsoft.Maui.Graphics version 9.0.0-rc.1.24453.9 is already installed.
Writing workload pack installation record for Microsoft.Maui.Graphics version 9.0.0-rc.1.24453.9...
Installing pack Microsoft.Maui.Resizetizer version 9.0.0-rc.1.24453.9...
Pack Microsoft.Maui.Resizetizer version 9.0.0-rc.1.24453.9 is already installed.
Writing workload pack installation record for Microsoft.Maui.Resizetizer version 9.0.0-rc.1.24453.9...
Installing pack Microsoft.Maui.Templates.net9 version 9.0.0-rc.1.24453.9...
Pack Microsoft.Maui.Templates.net9 version 9.0.0-rc.1.24453.9 is already installed.
Writing workload pack installation record for Microsoft.Maui.Templates.net9 version 9.0.0-rc.1.24453.9...
Installing pack Microsoft.Maui.Templates.net8 version 8.0.82...
Pack Microsoft.Maui.Templates.net8 version 8.0.82 is already installed.
Writing workload pack installation record for Microsoft.Maui.Templates.net8 version 8.0.82...
Installing pack Microsoft.Maui.Core version 9.0.0-rc.1.24453.9...
Pack Microsoft.Maui.Core version 9.0.0-rc.1.24453.9 is already installed.
Writing workload pack installation record for Microsoft.Maui.Core version 9.0.0-rc.1.24453.9...
Installing pack Microsoft.Maui.Controls version 9.0.0-rc.1.24453.9...
Pack Microsoft.Maui.Controls version 9.0.0-rc.1.24453.9 is already installed.
Writing workload pack installation record for Microsoft.Maui.Controls version 9.0.0-rc.1.24453.9...
Installing pack Microsoft.Maui.Controls.Build.Tasks version 9.0.0-rc.1.24453.9...
Pack Microsoft.Maui.Controls.Build.Tasks version 9.0.0-rc.1.24453.9 is already installed.
Writing workload pack installation record for Microsoft.Maui.Controls.Build.Tasks version 9.0.0-rc.1.24453.9...
Installing pack Microsoft.Maui.Controls.Core version 9.0.0-rc.1.24453.9...
Pack Microsoft.Maui.Controls.Core version 9.0.0-rc.1.24453.9 is already installed.
Writing workload pack installation record for Microsoft.Maui.Controls.Core version 9.0.0-rc.1.24453.9...
Installing pack Microsoft.Maui.Controls.Xaml version 9.0.0-rc.1.24453.9...
Pack Microsoft.Maui.Controls.Xaml version 9.0.0-rc.1.24453.9 is already installed.
Writing workload pack installation record for Microsoft.Maui.Controls.Xaml version 9.0.0-rc.1.24453.9...
Installing pack Microsoft.Maui.Controls.Compatibility version 9.0.0-rc.1.24453.9...
Pack Microsoft.Maui.Controls.Compatibility version 9.0.0-rc.1.24453.9 is already installed.
Writing workload pack installation record for Microsoft.Maui.Controls.Compatibility version 9.0.0-rc.1.24453.9...
Installing pack Microsoft.Maui.Essentials version 9.0.0-rc.1.24453.9...
Pack Microsoft.Maui.Essentials version 9.0.0-rc.1.24453.9 is already installed.
Writing workload pack installation record for Microsoft.Maui.Essentials version 9.0.0-rc.1.24453.9...
Installing pack Microsoft.Android.Sdk.Linux version 35.0.0-rc.1.80...
Pack Microsoft.Android.Sdk.Linux version 35.0.0-rc.1.80 is already installed.
Writing workload pack installation record for Microsoft.Android.Sdk.Linux version 35.0.0-rc.1.80...
Installing pack Microsoft.Android.Sdk.Linux version 34.0.138...
Pack Microsoft.Android.Sdk.Linux version 34.0.138 is already installed.
Writing workload pack installation record for Microsoft.Android.Sdk.Linux version 34.0.138...
Installing pack Microsoft.Android.Ref.35 version 35.0.0-rc.1.80...
Pack Microsoft.Android.Ref.35 version 35.0.0-rc.1.80 is already installed.
Writing workload pack installation record for Microsoft.Android.Ref.35 version 35.0.0-rc.1.80...
Installing pack Microsoft.Android.Runtime.35.android-arm version 35.0.0-rc.1.80...
Pack Microsoft.Android.Runtime.35.android-arm version 35.0.0-rc.1.80 is already installed.
Writing workload pack installation record for Microsoft.Android.Runtime.35.android-arm version 35.0.0-rc.1.80...
Installing pack Microsoft.Android.Runtime.35.android-arm64 version 35.0.0-rc.1.80...
Pack Microsoft.Android.Runtime.35.android-arm64 version 35.0.0-rc.1.80 is already installed.
Writing workload pack installation record for Microsoft.Android.Runtime.35.android-arm64 version 35.0.0-rc.1.80...
Installing pack Microsoft.Android.Runtime.35.android-x86 version 35.0.0-rc.1.80...
Pack Microsoft.Android.Runtime.35.android-x86 version 35.0.0-rc.1.80 is already installed.
Writing workload pack installation record for Microsoft.Android.Runtime.35.android-x86 version 35.0.0-rc.1.80...
Installing pack Microsoft.Android.Runtime.35.android-x64 version 35.0.0-rc.1.80...
Pack Microsoft.Android.Runtime.35.android-x64 version 35.0.0-rc.1.80 is already installed.
Writing workload pack installation record for Microsoft.Android.Runtime.35.android-x64 version 35.0.0-rc.1.80...
Installing pack Microsoft.Android.Templates version 35.0.0-rc.1.80...
Pack Microsoft.Android.Templates version 35.0.0-rc.1.80 is already installed.
Writing workload pack installation record for Microsoft.Android.Templates version 35.0.0-rc.1.80...
Installing pack Microsoft.NETCore.App.Runtime.Mono.android-arm version 8.0.8...
Pack Microsoft.NETCore.App.Runtime.Mono.android-arm version 8.0.8 is already installed.
Writing workload pack installation record for Microsoft.NETCore.App.Runtime.Mono.android-arm version 8.0.8...
Installing pack Microsoft.NETCore.App.Runtime.Mono.android-arm64 version 8.0.8...
Pack Microsoft.NETCore.App.Runtime.Mono.android-arm64 version 8.0.8 is already installed.
Writing workload pack installation record for Microsoft.NETCore.App.Runtime.Mono.android-arm64 version 8.0.8...
Installing pack Microsoft.NETCore.App.Runtime.Mono.android-x64 version 8.0.8...
Pack Microsoft.NETCore.App.Runtime.Mono.android-x64 version 8.0.8 is already installed.
Writing workload pack installation record for Microsoft.NETCore.App.Runtime.Mono.android-x64 version 8.0.8...
Installing pack Microsoft.NETCore.App.Runtime.Mono.android-x86 version 8.0.8...
Pack Microsoft.NETCore.App.Runtime.Mono.android-x86 version 8.0.8 is already installed.
Writing workload pack installation record for Microsoft.NETCore.App.Runtime.Mono.android-x86 version 8.0.8...
Installing pack Microsoft.NET.Runtime.MonoAOTCompiler.Task version 8.0.8...
Pack Microsoft.NET.Runtime.MonoAOTCompiler.Task version 8.0.8 is already installed.
Writing workload pack installation record for Microsoft.NET.Runtime.MonoAOTCompiler.Task version 8.0.8...
Installing pack Microsoft.NET.Runtime.MonoTargets.Sdk version 8.0.8...
Pack Microsoft.NET.Runtime.MonoTargets.Sdk version 8.0.8 is already installed.
Writing workload pack installation record for Microsoft.NET.Runtime.MonoTargets.Sdk version 8.0.8...
Installing pack Microsoft.NETCore.App.Runtime.AOT.linux-x64.Cross.android-x86 version 8.0.8...
Pack Microsoft.NETCore.App.Runtime.AOT.linux-x64.Cross.android-x86 version 8.0.8 is already installed.
Writing workload pack installation record for Microsoft.NETCore.App.Runtime.AOT.linux-x64.Cross.android-x86 version 8.0.8...
Installing pack Microsoft.NETCore.App.Runtime.AOT.linux-x64.Cross.android-x64 version 8.0.8...
Pack Microsoft.NETCore.App.Runtime.AOT.linux-x64.Cross.android-x64 version 8.0.8 is already installed.
Writing workload pack installation record for Microsoft.NETCore.App.Runtime.AOT.linux-x64.Cross.android-x64 version 8.0.8...
Installing pack Microsoft.NETCore.App.Runtime.AOT.linux-x64.Cross.android-arm version 8.0.8...
Pack Microsoft.NETCore.App.Runtime.AOT.linux-x64.Cross.android-arm version 8.0.8 is already installed.
Writing workload pack installation record for Microsoft.NETCore.App.Runtime.AOT.linux-x64.Cross.android-arm version 8.0.8...
Installing pack Microsoft.NETCore.App.Runtime.AOT.linux-x64.Cross.android-arm64 version 8.0.8...
Pack Microsoft.NETCore.App.Runtime.AOT.linux-x64.Cross.android-arm64 version 8.0.8 is already installed.
Writing workload pack installation record for Microsoft.NETCore.App.Runtime.AOT.linux-x64.Cross.android-arm64 version 8.0.8...
Installing pack Microsoft.NETCore.App.Runtime.Mono.android-arm version 9.0.0-rc.1.24431.7...
Pack Microsoft.NETCore.App.Runtime.Mono.android-arm version 9.0.0-rc.1.24431.7 is already installed.
Writing workload pack installation record for Microsoft.NETCore.App.Runtime.Mono.android-arm version 9.0.0-rc.1.24431.7...
Installing pack Microsoft.NETCore.App.Runtime.Mono.android-arm64 version 9.0.0-rc.1.24431.7...
Pack Microsoft.NETCore.App.Runtime.Mono.android-arm64 version 9.0.0-rc.1.24431.7 is already installed.
Writing workload pack installation record for Microsoft.NETCore.App.Runtime.Mono.android-arm64 version 9.0.0-rc.1.24431.7...
Installing pack Microsoft.NETCore.App.Runtime.Mono.android-x64 version 9.0.0-rc.1.24431.7...
Pack Microsoft.NETCore.App.Runtime.Mono.android-x64 version 9.0.0-rc.1.24431.7 is already installed.
Writing workload pack installation record for Microsoft.NETCore.App.Runtime.Mono.android-x64 version 9.0.0-rc.1.24431.7...
Installing pack Microsoft.NETCore.App.Runtime.Mono.android-x86 version 9.0.0-rc.1.24431.7...
Pack Microsoft.NETCore.App.Runtime.Mono.android-x86 version 9.0.0-rc.1.24431.7 is already installed.
Writing workload pack installation record for Microsoft.NETCore.App.Runtime.Mono.android-x86 version 9.0.0-rc.1.24431.7...
Installing pack Microsoft.NET.Runtime.MonoAOTCompiler.Task version 9.0.0-rc.1.24431.7...
Pack Microsoft.NET.Runtime.MonoAOTCompiler.Task version 9.0.0-rc.1.24431.7 is already installed.
Writing workload pack installation record for Microsoft.NET.Runtime.MonoAOTCompiler.Task version 9.0.0-rc.1.24431.7...
Installing pack Microsoft.NET.Runtime.MonoTargets.Sdk version 9.0.0-rc.1.24431.7...
Pack Microsoft.NET.Runtime.MonoTargets.Sdk version 9.0.0-rc.1.24431.7 is already installed.
Writing workload pack installation record for Microsoft.NET.Runtime.MonoTargets.Sdk version 9.0.0-rc.1.24431.7...
Installing pack Microsoft.NETCore.App.Runtime.AOT.linux-x64.Cross.android-x86 version 9.0.0-rc.1.24431.7...
Pack Microsoft.NETCore.App.Runtime.AOT.linux-x64.Cross.android-x86 version 9.0.0-rc.1.24431.7 is already installed.
Writing workload pack installation record for Microsoft.NETCore.App.Runtime.AOT.linux-x64.Cross.android-x86 version 9.0.0-rc.1.24431.7...
Installing pack Microsoft.NETCore.App.Runtime.AOT.linux-x64.Cross.android-x64 version 9.0.0-rc.1.24431.7...
Pack Microsoft.NETCore.App.Runtime.AOT.linux-x64.Cross.android-x64 version 9.0.0-rc.1.24431.7 is already installed.
Writing workload pack installation record for Microsoft.NETCore.App.Runtime.AOT.linux-x64.Cross.android-x64 version 9.0.0-rc.1.24431.7...
Installing pack Microsoft.NETCore.App.Runtime.AOT.linux-x64.Cross.android-arm version 9.0.0-rc.1.24431.7...
Pack Microsoft.NETCore.App.Runtime.AOT.linux-x64.Cross.android-arm version 9.0.0-rc.1.24431.7 is already installed.
Writing workload pack installation record for Microsoft.NETCore.App.Runtime.AOT.linux-x64.Cross.android-arm version 9.0.0-rc.1.24431.7...
Installing pack Microsoft.NETCore.App.Runtime.AOT.linux-x64.Cross.android-arm64 version 9.0.0-rc.1.24431.7...
Pack Microsoft.NETCore.App.Runtime.AOT.linux-x64.Cross.android-arm64 version 9.0.0-rc.1.24431.7 is already installed.
Writing workload pack installation record for Microsoft.NETCore.App.Runtime.AOT.linux-x64.Cross.android-arm64 version 9.0.0-rc.1.24431.7...
Garbage collecting for SDK feature band(s) 9.0.100-rc.1...
Uninstalling workload manifest microsoft.net.sdk.aspire version 8.2.1/8.0.100...
Successfully installed workload(s) .
> dotnet build
Determining projects to restore...
/nix/store/xrbswlskla2qi3hqf2j2543k1qwq10l0-dotnet-sdk-9.0.100-rc.1.24452.12/sdk/9.0.100-rc.1.24452.12/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1147: To build this project, the following workloads must be installed: maui-android [/home/a/projects/maui-on-nix/src/MauiOnNix.csproj::TargetFramework=net8.0-android]
/nix/store/xrbswlskla2qi3hqf2j2543k1qwq10l0-dotnet-sdk-9.0.100-rc.1.24452.12/sdk/9.0.100-rc.1.24452.12/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1147: To install these workloads, run the following command: dotnet workload restore [/home/a/projects/maui-on-nix/src/MauiOnNix.csproj::TargetFramework=net8.0-android]
Build FAILED.
/nix/store/xrbswlskla2qi3hqf2j2543k1qwq10l0-dotnet-sdk-9.0.100-rc.1.24452.12/sdk/9.0.100-rc.1.24452.12/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1147: To build this project, the following workloads must be installed: maui-android [/home/a/projects/maui-on-nix/src/MauiOnNix.csproj::TargetFramework=net8.0-android]
/nix/store/xrbswlskla2qi3hqf2j2543k1qwq10l0-dotnet-sdk-9.0.100-rc.1.24452.12/sdk/9.0.100-rc.1.24452.12/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.ImportWorkloads.targets(38,5): error NETSDK1147: To install these workloads, run the following command: dotnet workload restore [/home/a/projects/maui-on-nix/src/MauiOnNix.csproj::TargetFramework=net8.0-android]
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.41 |
Fixes #41420 and #41726
This attempts to find everywhere that we currently assume not-userlocal (where it's supported) and changes it to respect userlocal if specified.
As far as testing, I tried to do
dotnet workload update
with an SDK without this update, and it broke. I then tried it with these changes, and it succeeded.I'm not very knowledgeable about what scenarios I should target. I'll keep testing things I can think of, but do either of you have a suggestion on where to focus my testing energy @baronfel @tmds?