Skip to content

Add Windows Compat Pack 2.0.0 to PSCore6 and update package references to final versions including dotnetcore 2.1 - #6958

Merged
Dongbo Wang (daxian-dbw) merged 11 commits into
PowerShell:masterfrom
SteveL-MSFT:add-wcp
Jun 4, 2018
Merged

Dongbo Wang (daxian-dbw) merged 11 commits into
PowerShell:masterfrom
SteveL-MSFT:add-wcp

Conversation

@SteveL-MSFT

@SteveL-MSFT Steve Lee (SteveL-MSFT) commented May 30, 2018 •

Copy link
Copy Markdown
Member

PR Summary

To support PowerShell Modules built with .Net Windows Compatibility Pack, we decided that it was best to ship the WCP assemblies with PSCore6. This also adds many new .Net apis be default while only adding ~3.5 MB additional disk footprint (to a ~137 MB install currently).

Added ref to WCP 2.0.0 to SDK csproj.

Updated all refs of 4.5.0-RC1 to 4.5.0 final.

Update dotnetcore2.1 to final build

Update WebListener to aspnetcore.app 2.1.0 final
(Microsoft.VisualStudio.Web.CodeGeneration.Tools is not final yet, so no change)

PR Checklist

<PackageReference Include="PSDesiredStateConfiguration" Version="6.0.0-beta.8" />
<PackageReference Include="PowerShellHelpFiles" Version="1.0.0-*" />
<PackageReference Include="psrp.windows" Version="6.1.0-*" />
<PackageReference Include="Microsoft.Windows.Compatibility" Version="2.0.0" />

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this reference should be put in SDK.csproj with a Condition attribute, like <PackageReference Include="Microsoft.Windows.Compatibility" Version="2.0.0" Condition=" '$(IsWindows)' != 'true' " />. In this way, application that refernce to SDK nuget package will get those extended pack too.

IsWindows is defined in https://github.com/PowerShell/PowerShell/blob/master/PowerShell.Common.props#L113

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

/cc Aditya Patwardhan (@adityapatwardhan), in case I'm wrong about the SDK reference part.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Actually, I don't know if we should even have the condition part. Some of the compat assemblies work on Unix platforms too.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yes, this should be part of SDK, so apps hosting PowerShell can use the modules with WCP.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Perhaps we don't need the condition as Dongbo Wang (@daxian-dbw) is correct that some of the assemblies from the WCP meta-package work on non-Windows so we should make those available. I'll make the change.

updated all refs of 4.5.0-RC1 to 4.5.0 final
@daxian-dbw

Dongbo Wang (daxian-dbw) commented May 30, 2018 •

Copy link
Copy Markdown
Member

Ha, it looks dotnet core 2.1 is officially out: https://www.nuget.org/packages/Microsoft.NETCore.App/2.1.0
Shall we update our build to use the official 2.1?

@SteveL-MSFT Steve Lee (SteveL-MSFT) changed the title Add Windows Compat Pack 2.0.0 to PSCore6 Add Windows Compat Pack 2.0.0 to PSCore6 and update package references to final versions including dotnetcore 2.1 May 30, 2018
@markekraus

Copy link
Copy Markdown
Contributor

Steve Lee (@SteveL-MSFT) Can you push a commit with [feature] to ensure that the version bump didn't cause any regressions?

@bergmeister

Christoph Bergmeister (bergmeister) commented May 30, 2018 •

Copy link
Copy Markdown
Contributor

Steve Lee (@SteveL-MSFT) I believe you also need to update the installer for .Net Core 2.1 RTM and cleanup comments, see my commit here

update cache names for CI
update files.wxs to reflect new versions
@iSazonov

Copy link
Copy Markdown
Collaborator

We have a issue with System.Text.Encoding.CodePages. Maybe not still published.

@iSazonov

Copy link
Copy Markdown
Collaborator

We could use Version="4.5.*" for packages.

@iSazonov

Copy link
Copy Markdown
Collaborator

we decided that it was best to ship the WCP assemblies with PSCore6

Can we use it directly - to access registry, perfcounters and so on?

@SteveL-MSFT

Copy link
Copy Markdown
Member Author

Ilya (@iSazonov) System.Text.Encoding.CodePages 4.5.0 is published: https://www.nuget.org/packages/System.Text.Encoding.CodePages/

update pwrshplugin.dll trusted assembly list
"Microsoft.CodeAnalysis",
"Microsoft.CodeAnalysis.CSharp",
"Microsoft.CodeAnalysis",
"Microsoft.CodeAnalysis.VisualBasic",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do we want to include this one? I think we will remove VB support before 6.1 RC. If we include it here now, we will have to update the windows.psrp package again when removing the VB support.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Will remove. We can always add it back later if needed.

</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Windows.Compatibility" Version="2.0.0" />

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If we don't know the source location of this package, maybe put it at the end, in the section with the comment the source could not be found for the following package(s), along with Microsoft.NETCore.Windows.ApiSets

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Ok

address Dongbo's feedback
@SteveL-MSFT

Copy link
Copy Markdown
Member Author

Can't tell why System.Text.Encoding.CodePages is failing to load as the signature matches the assembly.

@iSazonov

Copy link
Copy Markdown
Collaborator

I suspect this is a publishing error. Could you ask .Net team?

@SteveL-MSFT

Copy link
Copy Markdown
Member Author

Ilya (@iSazonov) that xunit test passes fine on my desktop machine, just not in AppVeyor though

@daxian-dbw

Copy link
Copy Markdown
Member

I see the following from Start-PSxUnit:

            $requiredDependencies = @(
                $nativeLib,
                "$Content/Microsoft.Management.Infrastructure.dll",
                "$Content/System.Text.Encoding.CodePages.dll"
            )

The codepages.dll line is suspicious to me. But I haven't spent time digging further yet.

Removed unncessary dep ref for psxunit on System.Text.Encoding.CodePages.dll
Updated packaging nupkg dep assembly versions
@iSazonov

Copy link
Copy Markdown
Collaborator

Errors in Appveyor tests:

[00:21:47]   Describing CmsMessage cmdlets thorough tests
[00:21:48] +++++++++++++++++++?+
[00:21:48] 
[00:21:48] New-Item : The directory specified, 'Modules', is not a subdirectory of 'C:\'.
[00:21:48] Parameter name: path
[00:21:48] At C:\projects\powershell\test\powershell\Modules\Microsoft.PowerShell.Security\ConstrainedLanguageRestriction.Tests.ps1:87 char:21
[00:21:48] + ...          $null = New-Item -ItemType Directory $moduleDirectory -Force
[00:21:48] +                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[00:21:48] + CategoryInfo          : InvalidArgument: (C:\Modules:String) [New-Item], ArgumentException
[00:21:48] + FullyQualifiedErrorId : CreateDirectoryArgumentError,Microsoft.PowerShell.Commands.NewItemCommand
[00:22:22]   Describing Invoke-Item basic tests
[00:22:22] 
[00:22:22]     Context Invoke a text file on Unix
[00:22:22] !!
[00:22:22] Get-Process : Cannot find a process with the name "notepad". Verify the process name and call the cmdlet again.
[00:22:22] At C:\projects\powershell\test\powershell\Modules\Microsoft.PowerShell.Utility\Invoke-Item.Tests.ps1:70 char:17
[00:22:22] +                 Get-Process -Name $notepadProcessName | Stop-Process  ...
[00:22:22] +                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[00:22:22] + CategoryInfo          : ObjectNotFound: (notepad:String) [Get-Process], ProcessCommandException
[00:22:22] + FullyQualifiedErrorId : NoProcessFoundForGivenName,Microsoft.PowerShell.Commands.GetProcessCommand
[00:37:57] new file {$(env.ProductSourcePath)\Microsoft.Win32.SystemEvents.dll} need to be added to {C:\projects\powershell\tools\packaging\..\..\assets\Files.wxs}
[00:37:57] new file {$(env.ProductSourcePath)\System.CodeDom.dll} need to be added to {C:\projects\powershell\tools\packaging\..\..\assets\Files.wxs}
[00:37:57] new file {$(env.ProductSourcePath)\System.ComponentModel.Composition.dll} need to be added to {C:\projects\powershell\tools\packaging\..\..\assets\Files.wxs}
[00:37:57] new file {$(env.ProductSourcePath)\System.Configuration.ConfigurationManager.dll} need to be added to {C:\projects\powershell\tools\packaging\..\..\assets\Files.wxs}
[00:37:57] new file {$(env.ProductSourcePath)\System.Data.DataSetExtensions.dll} need to be added to {C:\projects\powershell\tools\packaging\..\..\assets\Files.wxs}
[00:37:57] new file {$(env.ProductSourcePath)\System.Data.Odbc.dll} need to be added to {C:\projects\powershell\tools\packaging\..\..\assets\Files.wxs}
[00:37:57] new file {$(env.ProductSourcePath)\System.Diagnostics.PerformanceCounter.dll} need to be added to {C:\projects\powershell\tools\packaging\..\..\assets\Files.wxs}
[00:37:57] new file {$(env.ProductSourcePath)\System.DirectoryServices.AccountManagement.dll} need to be added to {C:\projects\powershell\tools\packaging\..\..\assets\Files.wxs}
[00:37:57] new file {$(env.ProductSourcePath)\System.DirectoryServices.dll} need to be added to {C:\projects\powershell\tools\packaging\..\..\assets\Files.wxs}
[00:37:57] new file {$(env.ProductSourcePath)\System.DirectoryServices.Protocols.dll} need to be added to {C:\projects\powershell\tools\packaging\..\..\assets\Files.wxs}
[00:37:57] new file {$(env.ProductSourcePath)\System.Drawing.Common.dll} need to be added to {C:\projects\powershell\tools\packaging\..\..\assets\Files.wxs}
[00:37:57] new file {$(env.ProductSourcePath)\System.IO.Ports.dll} need to be added to {C:\projects\powershell\tools\packaging\..\..\assets\Files.wxs}
[00:37:57] new file {$(env.ProductSourcePath)\System.Management.dll} need to be added to {C:\projects\powershell\tools\packaging\..\..\assets\Files.wxs}
[00:37:57] new file {$(env.ProductSourcePath)\System.Runtime.Caching.dll} need to be added to {C:\projects\powershell\tools\packaging\..\..\assets\Files.wxs}
[00:37:57] new file {$(env.ProductSourcePath)\System.Security.Cryptography.ProtectedData.dll} need to be added to {C:\projects\powershell\tools\packaging\..\..\assets\Files.wxs}
[00:37:57] new file {$(env.ProductSourcePath)\System.Security.Cryptography.Xml.dll} need to be added to {C:\projects\powershell\tools\packaging\..\..\assets\Files.wxs}
[00:37:57] new file {$(env.ProductSourcePath)\System.ServiceModel.Syndication.dll} need to be added to {C:\projects\powershell\tools\packaging\..\..\assets\Files.wxs}
[00:37:57] 

@SteveL-MSFT

Steve Lee (SteveL-MSFT) commented Jun 1, 2018 •

Copy link
Copy Markdown
Member Author

Ok, figured out the problem with System.Text.Encoding.CodePages.dll. The nupkg doesn't contain unix runtime only Windows. Older version has both. Created https://github.com/dotnet/corefx/issues/30059

Moving back to v4.3.0 fixes that issue. Will update files.wxs and submit new commit. (v4.4.0 also doesn't have unix runtime)

revert ref to System.Text.Encoding.CodePages to 4.3.0 as newer versions don't have Unix runtime
updated files.wxs
Steve Lee (POWERSHELL) and others added 2 commits June 1, 2018 15:13
revert CodePages back to 4.5.0-rc1
@daxian-dbw

Copy link
Copy Markdown
Member

PSXunit tests passed on my machine (consistently failing previously) after I update the xunit packages. So push a change to see if that also fixes the issue in CI.

@SteveL-MSFT

Copy link
Copy Markdown
Member Author

AppVeyor failure is due to recent PR to migrate the install docs, the aka.ms link now returned 404. I updated the aka.ms link so restarting AppVeyor.

@daxian-dbw Dongbo Wang (daxian-dbw) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@iSazonov Ilya (iSazonov) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Leave a comment

<PackageReference Include="System.Text.Encoding.CodePages" Version="4.5.0" />
<!-- the following package(s) are from the powershell org -->
<PackageReference Include="Microsoft.Management.Infrastructure" Version="1.0.0-alpha*" />
<PackageReference Include="PowerShell.Core.Instrumentation" Version="6.0.0-beta*" />

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Have we this APIs in WCP?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

These are pkgs PowerShell Team publishes

@iSazonov Ilya (iSazonov) Jun 3, 2018 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Should we migrate to WCP assemblies if we have them on long time?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

You mean include them in WCP? Probably not.

"Microsoft.ApplicationInsights",
"Microsoft.CodeAnalysis",
"Microsoft.CodeAnalysis.CSharp",
"Microsoft.CodeAnalysis",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why was the order changed?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The list was generated rather than trying to insert a large number of new assemblies into the list. Sort-Object seems to prefer the period over end of string.

<!-- DotNetCliToolReference element specifies the CLI tool that the user wants to restore in the context of the project. -->
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.1" />
<PackageReference Include="Xunit.SkippableFact" Version="1.3.3" />
<DotNetCliToolReference Include="dotnet-xunit" Version="2.4.0-beta.1.build3958" />

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think we should open new tracking issue to update the beta to release.
And Microsoft.VisualStudio.Web.CodeGeneration.Tools too.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Created #6977

'Microsoft.PowerShell.Commands.Management' {
$deps.Add([tuple]::Create([tuple]::Create('id', 'Microsoft.PowerShell.Security'), [tuple]::Create('version', $PackageVersion))) > $null
$deps.Add([tuple]::Create([tuple]::Create('id', 'System.ServiceProcess.ServiceController'), [tuple]::Create('version', '4.4.1'))) > $null
$deps.Add([tuple]::Create([tuple]::Create('id', 'System.ServiceProcess.ServiceController'), [tuple]::Create('version', '4.5.0'))) > $null

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Not related the PR - why we set the versions manually and do not take from csproj files?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Comment thread assets/files.wxs
<DirectoryRef Id="$(var.ProductDirectoryName)">
<Component Id="cmpCBE3857586454EB3B634B118E8EBD1D1" Guid="{CBE38575-8645-4EB3-B634-B118E8EBD1D1}">
<File Id="filCBE3857586454EB3B634B118E8EBD1D1" KeyPath="yes" Source="$(env.ProductSourcePath)\Microsoft.Win32.SystemEvents.dll" />
</Component>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I lost understanding - why do we update the file manually? Can we generate it automatically?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The WiX tools will break patching. When you build, I added errors to tell you what to add or remove, but didn't fully automate the update. I updated the issue with the requirements of the update.

@iSazonov

Copy link
Copy Markdown
Collaborator

Newtonsoft.Json latest version is 11.0.1
https://github.com/JamesNK/Newtonsoft.Json/releases

NJsonSchema latest version is 9.10.50
https://www.nuget.org/packages/NJsonSchema/

update Newtonsoft.Json and NJsonSchema to latest versions
@daxian-dbw
Dongbo Wang (daxian-dbw) merged commit 5dc7a6c into PowerShell:master Jun 4, 2018
@SteveL-MSFT
Steve Lee (SteveL-MSFT) deleted the add-wcp branch June 5, 2018 01:15
Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj-contribs/PowerShell that referenced this pull request Aug 6, 2026
…l .NET Core 2.1 (PowerShell#6958)

To support PowerShell modules built with .NET Windows Compatibility Pack, we decided that it was best to ship the WCP assemblies with PS Core. This also adds many new .NET APIs be default while only adding ~3.5 MB additional disk footprint (to a ~137 MB install currently).
Also update the build to adopt the official .NET Core 2.1.
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.

7 participants