Fix version parsing in bootstrapper - #17099
Conversation
|
This PR has Quantification details
Why proper sizing of changes matters
Optimal pull request sizes drive a better predictable PR flow as they strike a
What can I do to optimize my changes
How to interpret the change counts in git diff output
Was this comment helpful? 👍 :ok_hand: :thumbsdown: (Email) |
|
General question around this, is the version parsed like this on purpose to know the latest exact version installed on the system? I remember having problems when my version is newer than what PowerShell needs, but I haven't touched this repo for a while, so I don't remember the exact details. I'd propose using |
|
This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days. |
|
Ilya (@iSazonov) Friendly ping on this. |
This comment was marked as outdated.
This comment was marked as outdated.
1 similar comment
|
/rebase |
|
This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days. |
|
Travis Plunk (@TravisEz13) I think this one can be superseded by #17198 |
|
Yup, it is the same fix. 🙂 |
PR Summary
Some versions of .NET preview were released with version that don't have a number following the preview suffix, and your pattern won't match them correctly. It will include spaces and fail with FormatException when parsing. The pattern is unnecessarily strict about the format, and not properly escaped. Replacing the pattern with simpler one, and trimming whitespace.
The existing pattern
\d*.\d*.\d*(-\w*\.\d*.\d*.\d*)?does not escape the dots between numbers, and so the last.will match space.PR Context
I have many .NET previews installed and don't want to remove them from my system to be able to build PS.
PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWIP:or[ WIP ]to the beginning of the title (theWIPbot will keep its status check atPendingwhile the prefix is present) and remove the prefix when the PR is ready.(which runs in a different PS Host).