-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Update PowerShell to build with .NET Core SDK 2.1.300-rc1-008662 #6718
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
Changes from all commits
b90a136
e1893aa
eb8a491
6d01ec3
aad2298
878538f
9411a6f
24f434a
0ab7128
82c592f
5b0b937
70ac19a
0117ea8
fa9e81b
95457e4
06590bd
3eb9e42
09731a6
2c3a06e
d139fe3
3e3f3ed
582fe2c
89971d6
e756916
0a85f68
9d58e1d
1dcba5f
752e133
d322c46
fcbed2d
183def7
11e18bf
e042397
4956c77
cb41ffc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -402,7 +402,7 @@ function Start-PSBuild { | |
| # If this parameter is not provided it will get determined automatically. | ||
| [ValidateSet("win7-x64", | ||
| "win7-x86", | ||
| "osx.10.12-x64", | ||
| "osx-x64", | ||
| "linux-x64", | ||
| "linux-arm", | ||
| "win-arm", | ||
|
|
@@ -557,7 +557,7 @@ Fix steps: | |
| Pop-Location | ||
| } | ||
|
|
||
| # publish netcoreapp2.0 reference assemblies | ||
| # publish netcoreapp2.1 reference assemblies | ||
| try { | ||
| Push-Location "$PSScriptRoot/src/TypeCatalogGen" | ||
| $refAssemblies = Get-Content -Path $incFileName | Where-Object { $_ -like "*microsoft.netcore.app*" } | ForEach-Object { $_.TrimEnd(';') } | ||
|
|
@@ -706,15 +706,15 @@ function New-PSOptions { | |
| [ValidateSet("Linux", "Debug", "Release", "CodeCoverage", "")] | ||
| [string]$Configuration, | ||
|
|
||
| [ValidateSet("netcoreapp2.0")] | ||
| [ValidateSet("netcoreapp2.1")] | ||
| [string]$Framework, | ||
|
|
||
| # These are duplicated from Start-PSBuild | ||
| # We do not use ValidateScript since we want tab completion | ||
| [ValidateSet("", | ||
| "win7-x86", | ||
| "win7-x64", | ||
| "osx.10.12-x64", | ||
| "osx-x64", | ||
| "linux-x64", | ||
| "linux-arm", | ||
| "win-arm", | ||
|
|
@@ -773,28 +773,26 @@ function New-PSOptions { | |
| Write-Verbose "Top project directory is $Top" | ||
|
|
||
| if (-not $Framework) { | ||
| $Framework = "netcoreapp2.0" | ||
| $Framework = "netcoreapp2.1" | ||
| Write-Verbose "Using framework '$Framework'" | ||
| } | ||
|
|
||
| if (-not $Runtime) { | ||
| if ($Environment.IsLinux) { | ||
| $Runtime = "linux-x64" | ||
| } elseif ($Environment.IsMacOS) { | ||
| $Runtime = "osx-x64" | ||
| } else { | ||
| $RID = dotnet --info | ForEach-Object { | ||
| if ($_ -match "RID") { | ||
| $_ -split "\s+" | Select-Object -Last 1 | ||
| } | ||
| } | ||
|
|
||
| if ($Environment.IsWindows) { | ||
| # We plan to release packages targetting win7-x64 and win7-x86 RIDs, | ||
| # which supports all supported windows platforms. | ||
| # So we, will change the RID to win7-<arch> | ||
| $Runtime = $RID -replace "win\d+", "win7" | ||
| } else { | ||
| $Runtime = $RID | ||
| } | ||
| # We plan to release packages targetting win7-x64 and win7-x86 RIDs, | ||
| # which supports all supported windows platforms. | ||
| # So we, will change the RID to win7-<arch> | ||
| $Runtime = $RID -replace "win\d+", "win7" | ||
| } | ||
|
|
||
| if (-not $Runtime) { | ||
|
|
@@ -1462,10 +1460,9 @@ function Start-PSxUnit { | |
| } | ||
| } | ||
|
|
||
| # '-fxversion' workaround required due to https://github.com/dotnet/cli/issues/7901#issuecomment-343323674 | ||
| # Run sequential tests first, and then run the tests that can execute in parallel | ||
| dotnet xunit -fxversion 2.0.5 -configuration $Options.configuration -xml $SequentialTestResultsFile -namespace "PSTests.Sequential" -parallel none | ||
| dotnet xunit -fxversion 2.0.5 -configuration $Options.configuration -xml $ParallelTestResultsFile -namespace "PSTests.Parallel" -nobuild | ||
| dotnet xunit -configuration $Options.configuration -xml $SequentialTestResultsFile -namespace "PSTests.Sequential" -parallel none | ||
| dotnet xunit -configuration $Options.configuration -xml $ParallelTestResultsFile -namespace "PSTests.Parallel" -nobuild | ||
| } | ||
| finally { | ||
| Pop-Location | ||
|
|
@@ -1927,13 +1924,19 @@ function Start-TypeGen | |
| # Add .NET CLI tools to PATH | ||
| Find-Dotnet | ||
|
|
||
| # This custom target depends on 'ResolveAssemblyReferencesDesignTime', whose definition can be found in the sdk folder. | ||
| # To find the available properties of '_ReferencesFromRAR' when switching to a new dotnet sdk, follow the steps below: | ||
| # 1. create a dummy project using the new dotnet sdk. | ||
| # 2. build the dummy project with this command: | ||
| # dotnet msbuild .\dummy.csproj /t:ResolveAssemblyReferencesDesignTime /fileLogger /noconsolelogger /v:diag | ||
| # 3. search '_ReferencesFromRAR' in the produced 'msbuild.log' file. You will find the properties there. | ||
| $GetDependenciesTargetPath = "$PSScriptRoot/src/Microsoft.PowerShell.SDK/obj/Microsoft.PowerShell.SDK.csproj.TypeCatalog.targets" | ||
| $GetDependenciesTargetValue = @' | ||
| <Project> | ||
| <Target Name="_GetDependencies" | ||
| DependsOnTargets="ResolveAssemblyReferencesDesignTime"> | ||
| <ItemGroup> | ||
| <_RefAssemblyPath Include="%(_ReferencesFromRAR.ResolvedPath)%3B" Condition=" '%(_ReferencesFromRAR.Type)' == 'assembly' And '%(_ReferencesFromRAR.PackageName)' != 'Microsoft.Management.Infrastructure' " /> | ||
| <_RefAssemblyPath Include="%(_ReferencesFromRAR.HintPath)%3B" Condition=" '%(_ReferencesFromRAR.NuGetPackageId)' != 'Microsoft.Management.Infrastructure' "/> | ||
| </ItemGroup> | ||
| <WriteLinesToFile File="$(_DependencyFile)" Lines="@(_RefAssemblyPath)" Overwrite="true" /> | ||
| </Target> | ||
|
|
@@ -2140,7 +2143,7 @@ function Start-CrossGen { | |
| [Parameter(Mandatory=$true)] | ||
| [ValidateSet("win7-x86", | ||
| "win7-x64", | ||
| "osx.10.12-x64", | ||
| "osx-x64", | ||
| "linux-x64", | ||
| "linux-arm", | ||
| "win-arm", | ||
|
|
@@ -2215,9 +2218,12 @@ function Start-CrossGen { | |
| throw "crossgen is not available for this platform" | ||
| } | ||
|
|
||
| $dotnetRuntimeVersion = $script:Options.Framework -replace 'netcoreapp' | ||
|
|
||
| # Get the CrossGen.exe for the correct runtime with the latest version | ||
| $crossGenPath = Get-ChildItem $script:Environment.nugetPackagesRoot $crossGenExe -Recurse | ` | ||
| Where-Object { $_.FullName -match $crossGenRuntime } | ` | ||
| Where-Object { $_.FullName -match $dotnetRuntimeVersion } | ` | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this really necessary? I didn't try on Linux and macOS, but on Windows, the 2.1 folder is the first one after sort (I have 2.0.6, 2.0.5 and 2.0.0 runtime package installed):
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was happening in CI. #Closed. |
||
| Sort-Object -Property FullName -Descending | ` | ||
| Select-Object -First 1 | ` | ||
| ForEach-Object { $_.FullName } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| { | ||
| "sdk": { | ||
| "version": "2.1.4" | ||
| "version": "2.1.300-rc1-008662" | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -704,7 +704,6 @@ namespace NativeMsh | |
| "System.Configuration", | ||
| "System.ComponentModel", | ||
| "System.ComponentModel.Annotations", | ||
| "System.ComponentModel.Composition", | ||
| "System.ComponentModel.DataAnnotations", | ||
| "System.ComponentModel.EventBasedAsync", | ||
| "System.ComponentModel.Primitives", | ||
|
|
@@ -732,6 +731,7 @@ namespace NativeMsh | |
| "System.Globalization.Extensions", | ||
| "System.IO", | ||
| "System.IO.Compression", | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A note about
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll take care of this #Closed. |
||
| "System.IO.Compression.Brotli", | ||
| "System.IO.Compression.FileSystem", | ||
| "System.IO.Compression.ZipFile", | ||
| "System.IO.FileSystem", | ||
|
|
@@ -743,12 +743,14 @@ namespace NativeMsh | |
| "System.IO.MemoryMappedFiles", | ||
| "System.IO.Packaging", | ||
| "System.IO.Pipes", | ||
| "System.IO.Pipes.AccessControl", | ||
| "System.IO.UnmanagedMemoryStream", | ||
| "System.Linq", | ||
| "System.Linq.Expressions", | ||
| "System.Linq.Parallel", | ||
| "System.Linq.Queryable", | ||
| "System.Management.Automation", | ||
| "System.Memory", | ||
| "System.Net", | ||
| "System.Net.Http", | ||
| "System.Net.Http.WinHttpHandler", | ||
|
|
||
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.
@iSazonov for my own education, how did you figure out this change?
Uh oh!
There was an error while loading. Please reload this page.
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.
No useful results. (Although I made sure that this target still exists)
Star monitoring 😄
dotnet msbuild /fileLogger /noconsolelogger /verbosity:diagmsbuild1.logLook assigned properties
Uh oh!
There was an error while loading. Please reload this page.
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.
You don't have to build powershell to find out this. Use a simple project that targets netcoreapp2.1, then run this:
Then you can inspect the properties of
_ReferencesFromRARinmsbuild.log. I think we should add comment here to describe this process.Comment added. #Closed.