sdk icon indicating copy to clipboard operation
sdk copied to clipboard

NuGet config not copied when running the workload command under sudo on Arm64

Open ivdiazsa opened this issue 3 years ago • 1 comments

Describe the bug

Follow-up of https://github.com/dotnet/runtime/issues/72308. When one runs dotnet workload under sudo in an Arm64 machine, it will only work once, and then fail any subsequent times.

To Reproduce

Run sudo dotnet workload list on any macOS or Linux arm64 machine twice in a row. The second one will fail. Up to the latest nightly build as of August 8th, it still reproduced.

Exceptions (if any)

Segmentation Fault if using an official build, DirectoryNotFoundException if using a local build from this repo.

Further technical details

Dotnet Info (Nightly):

.NET SDK:
 Version:   7.0.100-rc.1.22407.1
 Commit:    8f639696e6

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  12.5
 OS Platform: Darwin
 RID:         osx.12-arm64
 Base Path:   /Users/ivdiazsa186/Development/NightlyBuild/sdk/7.0.100-rc.1.22407.1/

Host:
  Version:      7.0.0-rc.1.22403.8
  Architecture: arm64
  Commit:       26a71c61fb

.NET SDKs installed:
  7.0.100-rc.1.22407.1 [/Users/ivdiazsa186/Development/NightlyBuild/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 7.0.0-rc.1.22404.6 [/Users/ivdiazsa186/Development/NightlyBuild/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 7.0.0-rc.1.22403.8 [/Users/ivdiazsa186/Development/NightlyBuild/shared/Microsoft.NETCore.App]

Other architectures found:
  None

Environment variables:
  Not set

global.json file:
  Not found

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download

ivdiazsa avatar Aug 08 '22 18:08 ivdiazsa

As discussed back here (https://github.com/dotnet/runtime/issues/72308#issuecomment-1200036996), the cause of this problem is that the NuGet config is attempted to be copied into the dotnet_sudo_home directory, but its full destination path is never created.

The code suggested in the comment referenced above in SudoEnvironmentDirectoryOverride.cs is a possible fix to this problem.

ivdiazsa avatar Aug 08 '22 18:08 ivdiazsa

sudo home doesn't exist anymore with yesterday's release and the code has changed a lot. Please try again.

marcpopMSFT avatar Oct 12 '22 20:10 marcpopMSFT