vscode-dotnet-runtime: Download of .NET fails because of cp warning

Describe the bug.

Latest versions of the cp command show a warning when the -n option is used. For some reason the procedure fails even if the copy works fine and the exit status is 0. Log follows:

tintoy.msbuild-project-tools requested to download the .NET Runtime.
Downloading .NET version(s) 8.0.1~x64 ......... Error!
Failed to download .NET 8.0.1~x64:
 cp: warning: behavior of -n is non-portable and may change in future; use --update=none instead
cp: warning: behavior of -n is non-portable and may change in future; use --update=none instead

 Error!
.NET Acquisition Failed: Installation failed: cp: warning: behavior of -n is non-portable and may change in future; use --update=none instead

Please attach log file(s) here if you have any.

1/11/2024, 11:17:59 AM DotnetAcquisitionStatusRequested 8.0 1d0905d45449fbd631f8f0862a26548f9c6a4309be237c0ceaa6fc1c4566dd68

1/11/2024, 11:17:59 AM WebRequestSent https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/releases-index.json

1/11/2024, 11:17:59 AM DotnetVersionResolutionCompleted 8.0 8.0.1

1/11/2024, 11:17:59 AM DotnetAcquisitionStatusUndefined 8.0.1~x64

1/11/2024, 11:17:59 AM DotnetCommandSucceeded acquireRuntimeStatus

1/11/2024, 11:17:59 AM DotnetRuntimeAcquisitionStarted 1d0905d45449fbd631f8f0862a26548f9c6a4309be237c0ceaa6fc1c4566dd68

1/11/2024, 11:17:59 AM DotnetAcquisitionRequested 8.0 1d0905d45449fbd631f8f0862a26548f9c6a4309be237c0ceaa6fc1c4566dd68

1/11/2024, 11:17:59 AM WebRequestSent https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/releases-index.json

1/11/2024, 11:17:59 AM DotnetVersionResolutionCompleted 8.0 8.0.1

1/11/2024, 11:17:59 AM DotnetInstallKeyCreatedEvent The requested version 8.0.1 is now marked under the install key: 8.0.1~x64.

1/11/2024, 11:17:59 AM DotnetAcquisitionPartialInstallation 8.0.1~x64

1/11/2024, 11:17:59 AM DotnetUninstallAllStarted

1/11/2024, 11:17:59 AM DotnetAcquisitionDeletion /home/fog/.config/Code/User/globalStorage/ms-dotnettools.vscode-dotnet-runtime/.dotnet

1/11/2024, 11:18:00 AM DotnetAcquisitionStarted 8.0.1~x64 8.0.1 1d0905d45449fbd631f8f0862a26548f9c6a4309be237c0ceaa6fc1c4566dd68

1/11/2024, 11:18:00 AM WebRequestSent https://dot.net/v1/dotnet-install.sh

1/11/2024, 11:18:00 AM DotnetFileWriteRequestEvent Request to write 2024-01-11T10:18:00.056Z 64e6545fbe80d206683895b969c848464d5235b361239b9144030d8fe4163f13

1/11/2024, 11:18:00 AM DotnetLockAttemptingAcquireEvent Lock Acquisition request to begin. 2024-01-11T10:18:00.057Z 506967bf8f9c9310e07d013dc267550bda19e95dbeb59b8e9fac3e9b9cb5a2fe 64e6545fbe80d206683895b969c848464d5235b361239b9144030d8fe4163f13

1/11/2024, 11:18:00 AM DotnetUninstallAllCompleted

1/11/2024, 11:18:00 AM DotnetLockAcquiredEvent Lock Acquired. 2024-01-11T10:18:00.224Z 506967bf8f9c9310e07d013dc267550bda19e95dbeb59b8e9fac3e9b9cb5a2fe 64e6545fbe80d206683895b969c848464d5235b361239b9144030d8fe4163f13

1/11/2024, 11:18:00 AM DotnetFileWriteRequestEvent File content is an exact match, not writing file. 2024-01-11T10:18:00.224Z 64e6545fbe80d206683895b969c848464d5235b361239b9144030d8fe4163f13

1/11/2024, 11:18:00 AM DotnetLockReleasedEvent Lock about to be released. 2024-01-11T10:18:00.225Z 506967bf8f9c9310e07d013dc267550bda19e95dbeb59b8e9fac3e9b9cb5a2fe 64e6545fbe80d206683895b969c848464d5235b361239b9144030d8fe4163f13

1/11/2024, 11:18:00 AM DotnetInstallScriptAcquisitionCompleted

1/11/2024, 11:18:06 AM DotnetAcquisitionScriptError cp: warning: behavior of -n is non-portable and may change in future; use --update=none instead cp: warning: behavior of -n is non-portable and may change in future; use --update=none instead

8.0.1~x64 Error Error: cp: warning: behavior of -n is non-portable and may change in future; use --update=none instead cp: warning: behavior of -n is non-portable and may change in future; use --update=none instead

at v.<anonymous> (/home/fog/.vscode/extensions/ms-dotnettools.vscode-dotnet-runtime-2.0.0/dist/extension.js:2:2730)
at Generator.next (<anonymous>)
at /home/fog/.vscode/extensions/ms-dotnettools.vscode-dotnet-runtime-2.0.0/dist/extension.js:2:356
at new Promise (<anonymous>)
at r (/home/fog/.vscode/extensions/ms-dotnettools.vscode-dotnet-runtime-2.0.0/dist/extension.js:2:101)
at /home/fog/.vscode/extensions/ms-dotnettools.vscode-dotnet-runtime-2.0.0/dist/extension.js:2:2032
at ChildProcess.exithandler (node:child_process:423:7)
at ChildProcess.emit (node:events:513:28)
at maybeClose (node:internal/child_process:1091:16)
at Socket.<anonymous> (node:internal/child_process:449:11)
at Socket.emit (node:events:513:28)
at Pipe.<anonymous> (node:net:322:12)

1/11/2024, 11:18:06 AM DotnetCommandFailed .NET Acquisition Failed: Installation failed: cp: warning: behavior of -n is non-portable and may change in future; use --update=none instead cp: warning: behavior of -n is non-portable and may change in future; use --update=none instead

acquire Error Error: .NET Acquisition Failed: Installation failed: cp: warning: behavior of -n is non-portable and may change in future; use --update=none instead cp: warning: behavior of -n is non-portable and may change in future; use --update=none instead

at /home/fog/.vscode/extensions/ms-dotnettools.vscode-dotnet-runtime-2.0.0/dist/extension.js:2:8501

1/11/2024, 11:18:06 AM DotnetRuntimeAcquisitionTotalSuccessEvent 8.0 8.0.1~x64 1d0905d45449fbd631f8f0862a26548f9c6a4309be237c0ceaa6fc1c4566dd68

Reproduction Steps

Just open VS Code on a Linux box with cp version 9.4+ from GNU coreutils, for example Debian sid.

Expected Behavior

Download of .NET should complete successfully.

Exceptions & Errors (if any)

No response

.NET Install Tool Version

v2.0.0

Your operating system? Please provide more detail, such as the version and or distro above.

Linux

VS Code Version

1.85.1

About this issue

  • Original URL
  • State: closed
  • Created 6 months ago
  • Comments: 15 (6 by maintainers)

Most upvoted comments

If you need any kind of help to diagnose this (more information, more logs, running modified/updated scripts on my system, etc.) just let me know.

@f-alizada can you take a look at this when you have a moment?

This should be fixed in 2.0.2 which will release hopefully in the next few days.

@fogzot thank you for willing to help! I was going to provide the script link, you have provided everything already 😃 Thank you for the confirmation! @nagilson is there a possibility from your side to verify if the extension considers the output warning from cp as an error therefore results the installation fail?

The script alone works and dotnet is correctly installed:

$ ~/Downloads/dotnet-install.sh -c 8.0 -i /tmp/dotnet
dotnet-install: Attempting to download using aka.ms link https://dotnetcli.azureedge.net/dotnet/Sdk/8.0.101/dotnet-sdk-8.0.101-linux-x64.tar.gz
dotnet-install: Remote file https://dotnetcli.azureedge.net/dotnet/Sdk/8.0.101/dotnet-sdk-8.0.101-linux-x64.tar.gz size is 214222713 bytes.
dotnet-install: Extracting zip from https://dotnetcli.azureedge.net/dotnet/Sdk/8.0.101/dotnet-sdk-8.0.101-linux-x64.tar.gz
cp: warning: behavior of -n is non-portable and may change in future; use --update=none instead
cp: warning: behavior of -n is non-portable and may change in future; use --update=none instead
cp: warning: behavior of -n is non-portable and may change in future; use --update=none instead
cp: warning: behavior of -n is non-portable and may change in future; use --update=none instead
cp: warning: behavior of -n is non-portable and may change in future; use --update=none instead
cp: warning: behavior of -n is non-portable and may change in future; use --update=none instead
cp: warning: behavior of -n is non-portable and may change in future; use --update=none instead
cp: warning: behavior of -n is non-portable and may change in future; use --update=none instead
cp: warning: behavior of -n is non-portable and may change in future; use --update=none instead
cp: warning: behavior of -n is non-portable and may change in future; use --update=none instead
cp: warning: behavior of -n is non-portable and may change in future; use --update=none instead
cp: warning: behavior of -n is non-portable and may change in future; use --update=none instead
cp: warning: behavior of -n is non-portable and may change in future; use --update=none instead
cp: warning: behavior of -n is non-portable and may change in future; use --update=none instead
cp: warning: behavior of -n is non-portable and may change in future; use --update=none instead
cp: warning: behavior of -n is non-portable and may change in future; use --update=none instead
cp: warning: behavior of -n is non-portable and may change in future; use --update=none instead
cp: warning: behavior of -n is non-portable and may change in future; use --update=none instead
cp: warning: behavior of -n is non-portable and may change in future; use --update=none instead
cp: warning: behavior of -n is non-portable and may change in future; use --update=none instead
cp: warning: behavior of -n is non-portable and may change in future; use --update=none instead
cp: warning: behavior of -n is non-portable and may change in future; use --update=none instead
dotnet-install: Downloaded file size is 214222713 bytes.
dotnet-install: The remote and local file sizes are equal.
dotnet-install: Installed version is 8.0.101
dotnet-install: Adding to current process PATH: `/tmp/dotnet`. Note: This change will be visible only when sourcing script.
dotnet-install: Note that the script does not resolve dependencies during installation.
dotnet-install: To check the list of dependencies, go to https://learn.microsoft.com/dotnet/core/install, select your operating system and check the "Dependencies" section.
dotnet-install: Installation finished successfully.
$ echo $status
0
$ ls /tmp/dotnet
dotnet*  host/  LICENSE.txt  packs/  sdk/  sdk-manifests/  shared/  templates/  ThirdPartyNotices.txt