GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Update PowerShell to build with .NET Core SDK 2.1.300-rc1-008662 by iSazonov · Pull Request #6718 · PowerShell/PowerShell Conversation
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Working with dotnetcore team to figure out crossgen issue. Temporarily turned |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
3e071a6 to
1e60cd9
Compare
|
A bunch of webcmdlet tests are failing because the User-Agent string has a regression in dotnetcore 2.1-preview2. Looks like they already fixed it though. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
6eae8be to
7b5c542
Compare
There was an error while loading. Please reload this page.
|
Locally I tried use the older HttpClientHandler adding AppContext.SetSwitch("System.Net.Http.UseSocketsHttpHandler", false); and other web cmdlet tests failed. It seems better not to use the former HttpClientHandler and investigate current test failures. Mark Kraus (@markekraus) Could you please help? We could set pending for User-Agent tests until we move to .Net Core 2.1 RC. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
I see that another test completes abnormally.
I'm fixing the test, but it seems that it can cause problems in scripts and not only in this case because other APIs can also be extended. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Ilya (@iSazonov) Steve Lee (@SteveL-MSFT) I looked into the authorization issues. It looks like there is a change in HttpClient's behavior between 2.0 and 2.1 WRT authorization headers on redirect. using this code in 6.0.2 and a build from Ilya (@iSazonov) branch: $Handler = [System.Net.Http.HttpClientHandler]::new() $client = [System.Net.Http.HttpClient]::new($Handler) $req = [System.Net.Http.HttpRequestMessage]::new() $req.Headers.Add('Authorization','test') $req.RequestUri = 'https://httpbin.org/redirect-to?url=https://httpbin.org/get' $res = $client.SendAsync($req).GetAwaiter().GetResult() $res.Content.ReadAsStringAsync().GetAwaiter().GetResult() in 6.0.2 (using dotnet 2.0): {
"args": {},
"headers": {
"Authorization": "test",
"Connection": "close",
"Host": "httpbin.org"
},
"origin": "173.239.232.139",
"url": "https://httpbin.org/get"
}in the build of this PR (dotnet 2.1): {
"args": {},
"headers": {
"Connection": "close",
"Host": "httpbin.org"
},
"origin": "173.239.232.139",
"url": "https://httpbin.org/get"
}So it appears HttpClient no longer sends Authorization headers on redirect. We can handle this in the web cmdlets with some change in logic. But I'd like to find out if this is a regression or |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Mark Kraus (@markekraus) Many thanks! Could you please look https://stackoverflow.com/questions/28564961/authorization-header-is-lost-on-redirect ? My understanding is that a http client remove authorization headers by default because of security. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
ac8906f to
12da43b
Compare
|
Ilya (@iSazonov) Yes. In .NET Framework (which is what that link is about) HttpClient did strip authorization by default. You can see this for yourself in Windows PowerShell 5.1 with the same code after running In .NET Core 1.0-2.0, however, Authorization was not stripped by default. Code was added to the cmdlets to handle that. By default, we intercept the response if the authorization header is present. The pwsh web cmdlets do that by default and it can be overridden with If the change in 2.1 is |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Ilya (@iSazonov) Steve Lee (@SteveL-MSFT) ugh.. the change in the https://docs.microsoft.com/en-us/dotnet/api/system.string.contains?view=netcore-2.1 I hope there is something we can point users to in our release notes for 6.1 to changes in 2.1 APIs. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Clear Authorization Headers on Redirect dotnet/corefx#26864 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Ilya (@iSazonov) thanks for finding that. It seems clear this is an intentional change so we will need to modify or logic. The good news is that the current way was fragile (we fixed 2 issues with it since 6.0.0) and since it was default it ran more often. Now we can rely on .NET and the fragile code will run less often. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
cff8bdc to
4ec4f91
Compare
|
created #6728 to track the authorization logic changes needed. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
0fa3ed9 to
1f4ea23
Compare
|
My thought is that we shouldn't move to dotnetcore until PSCore6+2.1 is as good or better than current PSCore6 build. So I would wait until the fixes are available to pick up in this PR than get into a state where some things work and some things don't and we accidentally miss something on release of 6.1. I would be fine moving ahead to something newer than 2.1-Preview2 since it appears dotnetcore is moving towards RC and the window of opportunity to get them to fix issues in 2.1 before they declare GA is getting smaller. For this reason, I prefer not to mark tests as |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
1f4ea23 to
f4bbdf2
Compare
| @@ -732,6 +732,7 @@ namespace NativeMsh | |||
| "System.Globalization.Extensions", | |||
| "System.IO", | |||
| "System.IO.Compression", | |||
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
It seems System.ComponentModel.Composition.dll is gone. Then it should be removed from this list now.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
A note about Microsoft.CodeAnalysis.VisualBasic.dll we added from the Add-Type refactoring. Since we plan to remove the VB support, we shouldn't add that dll in this list.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I'll take care of this #Closed.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| <add key="dotnet-core" value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" /> | ||
| <add key="nuget.org" value="https://api.nuget.org/v3/index.json" /> | ||
| </packageSources> | ||
| </configuration> |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This nuget.config file doesn't introduce a new feed. Do we need it only because we need to try dotnet-core before nuget.org?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| $Script:Options.Runtime -ne $Runtime -or ## Last build wasn't for the required RID | ||
| $Script:Options.Configuration -ne $Configuration -or ## Last build was with configuration other than 'Release' | ||
| $Script:Options.Framework -ne "netcoreapp2.0") ## Last build wasn't for CoreCLR | ||
| $Script:Options.Framework -ne "netcoreapp2.1") ## Last build wasn't for CoreCLR |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I see other places using netcoreapp2.0. They all need to be updated.
PS:103> dir *.psm1 -Recurse | sls -SimpleMatch netcoreapp2.0 test\tools\OpenCover\OpenCover.psm1:627: [parameter()]$PowerShellExeDirectory = "${script:psRepoPath}/src/powershell-win-core/bin/CodeCoverage/netcoreapp2.0/win7-x64/publish", tools\packaging\packaging.psm1:2221: New-MSIPackage -Verbose -ProductCode (New-Guid) -ProductSourcePath '.\src\powershell-win-core\bin\Debug\netcoreapp2.0\win7-x64\publish' -ProductTargetArchitecture x64 -ProductVersion '1.2.3' build.psm1:560: # publish netcoreapp2.0 reference assemblies
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Fixed. #Closed.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| throw "crossgen is not available for this platform" | ||
| } | ||
|
|
||
| $dotnetRuntimeVersion = $dotnetCLIRequiredVersion -match "(\d\.\d)\..*" | ForEach-Object { $matches[1] } |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This will give us the Major.Minor version of the sdk, not the runtime. The sdk version is different from the runtime version, e.g. we use sdk 2.1.4 currently with runtime version 2.0. It may happen in future that sdk moved to 2.2 while we are still using 2.1 runtime.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Seems we need review this after .Net Core 2.1 release because it introduce new policy - always use latest version. It is still not work for Preview versions. And seems they want adjust this versions for simplicity.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
It is still not work for Preview versions.
What is not working for preview versions?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
The problem we had in CI w/o this is that we pick up the first version that matches which was crossgen 2.2 (some preview version) which is not compatible with the 2.1 built binaries.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I wonder how come we have the 2.2 runtime packages in our CI runs ... I wish we can figure this out.
This line of script gets the Major.Minor of the sdk version, not the runtime version, which is not what we really want (not future-proof). Maybe explicitly use 2.1* for now (which is also not future-proof, but at least intuitive than the regex matching)?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Perhaps we should rename the variable to $dotnetSdkVersion. Keeping this regex would mean that when we move to 2.2, but there's a 2.3 preview out we won't be broken.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
It also means that when we move to sdk 2.2 but still building against runtime 2.1 (similar to what we have today: sdk 2.1.4, runtime 2.0), we will be broken.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Using dotnet --list-runtimes shows Microsoft.NETCore.App 2.1.0-rc1-26423-06 which matches the runtime version of crossgen we need. So perhaps we can use dotnet --list-runtimes and select the newest one and match that runtime version to find appropriate crossgen.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
We can use $Script:Options.Framework to get the runtime version. The framework will always be netcoreapp2.1 until we update it again.
$dotnetRuntimeVersion = $script:Options.Framework -replace 'netcoreapp'
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
What is not working for preview versions?
I meant that .Net Core starting with 2.0 has new model and always uses latest runtime versions (roll-forward minor versions) with dotnet publish but it is not working for preview versions.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| # 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 } | ` |
There was a problem hiding this comment.
The 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):
PS:107> dir crossgen.exe -Recurse | ? FullName -Match win-x64 | sort -Property FullName -Descending | select -First 1
Directory: C:\Users\dongbow\.nuget\packages\runtime.win-x64.microsoft.netcore.app\2.1.0-rc1-26423-06\tools
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 4/23/2018 9:07 AM 2916176 crossgen.exe
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This was happening in CI. #Closed.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…sFromRAR' when moving to new sdk
|
We also need to update the versions of the dotnet NuGet packages referred by Note that, we should pick the |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
LGTM.
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Ilya (@iSazonov) I'm not familiar with the issue regarding web cmdlet proxy tests and workaround for curl. You probably have more context, so can you please open a tracking issue for that? As to packaging review, do you have any specific concerns about how this change would affect packaging? Steve Lee (@SteveL-MSFT), Aditya Patwardhan (@adityapatwardhan) and Mark Kraus (@markekraus), since new commits were pushed after you signed off, could you please take another look at this PR? Thanks! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Dongbo Wang (@daxian-dbw) I agree with starting a release build after this is merged. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
About the Visual Studio build, I don't know if it will still work after this merge ... Travis Plunk (@TravisEz13) Does VS2017 allow configuring which dotnet sdk to use? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
For Visual Studio you cannot specify the SDK. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
This has been a long thread, Ilya (@iSazonov) can you summarize the proxy issue with the webcmdlet tests? I changed the tests as they were originally just wrong and incomplete. I think we should probably remove the tests for http_proxy env var which we skip on Windows because that is a side effect of corefx taking dependency on libcurl for non-Windows and not something supported explicitly by corefx nor the webcmdlets. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Currently I agree to remove this proxy tests. But I'll look this in depth only tomorrow. If I'll discover something important I'll open new tracking Issue. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
The PR LGTM. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Ilya (@iSazonov) just to be clear, only the proxy tests for the |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
PR merged. Thanks everyone for getting this done! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks everyone for this work! Maybe it's a good experience of working together. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…erShell#6718) * Build Update - Change `TargetFramework` to `netcoreapp2.1` and removed unnecessary `RuntimeFrameworkVersion` from `PowerShell.Common.props` - Update dotnet SDK to 2.1.300-rc1-008662 - Update `TypeGen` target in `Build.psm1` to work with 2.1 - Rename macOS runtime to `osx-x64` as the old build logic expects 10.12 and breaks running on 10.13 system. - Remove `PackageReference` to `System.Memory` as it's part of dotnetcore 2.1 - Update search for `crossgen` executable to find the matching version * Test Update - Update test tools `WebListener` to latest `asp.net core` - Marked `AuthHeader Redirect` tests as `Pending` due to change in CoreFX
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.