Skip to content

Conversation

@nagilson
Copy link
Member

@nagilson nagilson commented Jan 28, 2025

For #2059

@nagilson nagilson force-pushed the nagilson-fix-missing-dir branch from 281c44d to f320a62 Compare February 13, 2025 19:54


// The install script can leave behind a directory in an invalid install state. Make sure the executable is present at the very least.
if (this.fileUtilities.existsSync(installContext.installDir) && !this.fileUtilities.existsSync(path.join(installContext.installDir, getDotnetExecutable())))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if it failed to write all of the binary? might wanna check that executing this also gives a 0 status code like dotnet --info or smth if it does exist.

nagilson added a commit to nagilson/vscode-dotnet-runtime that referenced this pull request Apr 11, 2025
The dotnet install script has a bug where it wont do the install if the folder is not empty. Sometimes it will leave a partially done install, like if killed, in which case we get to a bad state.

This fixes that by cleaning up the directory, and or checking if dotnet.exe exists, whether it works.
dotnet --list-runtimes is a fast way to do this since it should only invoke the host and not need to invoke the SDK. doing just 'dotnet' will not work as that does not return 0.

Also, gets rid of the 'lock' exception since thats from the proper-lockfile lib which we don't use anymore.

Resolves: dotnet#2059
First scrapped attempt: dotnet#2106
@nagilson
Copy link
Member Author

closing in favor of the new issue

@nagilson nagilson closed this Apr 11, 2025
nagilson added a commit that referenced this pull request Apr 15, 2025
* Check if the dotnet install is valid

The dotnet install script has a bug where it wont do the install if the folder is not empty. Sometimes it will leave a partially done install, like if killed, in which case we get to a bad state.

This fixes that by cleaning up the directory, and or checking if dotnet.exe exists, whether it works.
dotnet --list-runtimes is a fast way to do this since it should only invoke the host and not need to invoke the SDK. doing just 'dotnet' will not work as that does not return 0.

Also, gets rid of the 'lock' exception since thats from the proper-lockfile lib which we don't use anymore.

Resolves: #2059
First scrapped attempt: #2106

* Add missing await

* Recursively delete the stuff

wipe dir only wipes the files, and the script looks at the folders

* Remove tests for deprecated code

The Install Multiple versions tests fails bc the deprecated sdk code installs everything into the same folder, so this new cleanup logic will wipe the older folder.

The uninstall logic fails because the original sdk code does not work with respect to finding a local sdk when a global sdk is on the machine (it finds a 7.0.4xx sdk), this code is not used by anything anymore so it is likely not worth investigating.

* Update changelog

* Changelog should mention min vscode version

* Check if dotnet meets the requirement of the install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant