-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Pull PSReadLine from PSGallery #5759
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
Conversation
bcc9f11 to
5847e3e
Compare
|
I tested these changes locally and had no problems building (I didn't run tests though.) The CI failures show 2 problems:
I'd like some feedback on |
build.psm1
Outdated
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.
This is causing failures
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.
Yes, I know, see my request for feedback here.
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.
Also, We should only do this (restore a PreRelease module) if needed.
|
It is very difficult to use NuGet directly across platforms. Please update |
|
I think we can take this early for 6.1.0, but we should stick with the released version of PSReadline for 6.0.0-GA |
e890b8d to
3f39977
Compare
Instead of building PSReadLine from this repo, pull it from the gallery. Fix PowerShell#996
3f39977 to
75bee72
Compare
|
@TravisEz13 - I tried updating PowerShellGet, but in the end it was easier to use nuget (indirectly, via a csproj) and copy out of the nuget cache. It looks like everything passes now, so I think this can be merged. Note that PSReadLine will no longer be cross-gen'd after this PR, so if you merge, I'd open an issue to track adding a call to crossgen for PSReadLine - I'm not sure when I'll get a chance to do that. |
|
|
||
| Remove-Item -Force -ErrorAction Ignore -Recurse "$Destination/$name" | ||
| New-Item -Path $dest -ItemType Directory -Force -ErrorAction Stop > $null | ||
| $dontCopy = '*.nupkg', '*.nupkg.sha512', '*.nuspec', 'System.Runtime.InteropServices.RuntimeInformation.dll' |
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.
This is replicating powershellget behavior which may change over time. I'd rather not do this if we don't have to.
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.
Yeah, I get that, but this was easier to make work and has less impact on the user's environment or build machine.
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.
Also notice how much less code there is doing it this way - I think that's valuable too.
|
What was the issue with PowerShellGet? Can we investigate and fix that issue? |
build.psm1
Outdated
| # These modules are restored to the global nuget package cache at the | ||
| # same time we restore nuget packages to build PowerShell, we just | ||
| # copy them from the cache to the final layout location now. | ||
| $modules = @( |
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.
$modules seems not used anywhere.
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.
Right, I'll remove it.
| <ProjectReference Include="..\Microsoft.PowerShell.ConsoleHost\Microsoft.PowerShell.ConsoleHost.csproj" /> | ||
| <ProjectReference Include="..\Microsoft.PowerShell.Security\Microsoft.PowerShell.Security.csproj" /> | ||
| <ProjectReference Include="..\System.Management.Automation\System.Management.Automation.csproj" /> | ||
| <ProjectReference Include="..\Modules\PSGalleryModules.csproj" /> |
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.
When building nuget packages for individual assemblies, I think this reference will cause a nuget package to be generated for PSGalleryModules.csproj and the generated Microsoft.PowerShell.SDK package will have a reference to the PSGalleryModules nuget package. We should avoid creating the unneeded PSGalleryModules nuget package.
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.
Indeed, I'll remove this and do the restore on PSGalleryModules.csproj explicitly.
|
PowerShellGet would update successfully, but I would get errors from PackageManagement, presumably because it is a binary module and the newly installed version wasn't being picked up. I considered "fixing" that by running the update in a child process, but:
|
|
I updated to address the feedback. I don't plan on changing back to using PowerShellGet - I think this approach could be turned on by default - we can rely on the nuget cache instead of fetching from the network on every build. Also regarding this approach versus using PowerShellGet - in my opinion:
|
|
Reverting this change as Console tests are failing on non-windows. The failure is: |
This reverts commit beffdcf.
PR Summary
Instead of building PSReadLine from this repo, pull it from the gallery.
This pulls v2.0 of PSReadLine which does have documented breaking changes from v1.2, but the risk is small - the features that have changed are typically only used in a profile and aren't used all that often anyway.
Fix #996
Hardcodes version of modules pulled from PSGallery
PR Checklist
Note: Please mark anything not applicable to this PR
NA.[feature]if the change is significant or affectes feature testsWIP:to the beginning of the title and remove the prefix when the PR is ready.