-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Support updated WSL implementation #9525
Conversation
…hell" is not available
Adds compatibility support for legacy lxrun generated WSL installation which is a single install at a known path location. This allows earlier versions of Windows 10 to continue working as expected while still supporting the recent updates allowing for multiple instances.
logger.debug("checking registry for WSL installation path") | ||
paths += PowerShell.execute_cmd( | ||
'(Get-ChildItem HKCU:\Software\Microsoft\Windows\CurrentVersion\Lxss ' \ | ||
'| ForEach-Object {Get-ItemProperty $_.PSPath}).BasePath').to_s.split("\r\n").map(&:strip) |
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.
Should we put a rescue in place here, in case the execute_cmd
fails and returns nil? Otherwise we'll get an exception that nil.map
is undefined. We could also run the command first before running map on it and adding it to paths and check the result of the Powershell command.
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.
The #to_s
call will force the type so there's no need to rescue here.
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
This is an extension of great work provided by @BR0kEN- in #9300. Updated to support the old lxrun generated WSL instances as well as the new store installed instances. Included some spec coverage on the behavior as well.