Skip to content

Upgrade from .Net Core SDK 1.1 to 2.1.4 #854

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

Merged
merged 3 commits into from
Jan 22, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@ Exit

### From Source

#### Requirements
* [.NET Core 1.1.5 SDK](https://github.com/dotnet/core/blob/master/release-notes/download-archives/1.1.5.md)
* [.NET Core 2.1.4 SDK](https://github.com/dotnet/core/blob/master/release-notes/download-archives/2.0.5-download.md)
* [PlatyPS 0.5.0 or greater](https://github.com/PowerShell/platyPS)
* Optionally but recommended for development: [Visual Studio 2017](https://www.visualstudio.com/downloads/)

Expand Down
7 changes: 5 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,20 @@ install:
}
- ps: |
# the legacy WMF4 image only has the old preview SDKs of dotnet
if (-not ((dotnet --version).StartsWith('1.1')))
if (-not ((dotnet --version).StartsWith('2.1.4')))
{
Invoke-WebRequest 'https://dot.net/v1/dotnet-install.ps1' -OutFile dotnet-install.ps1
.\dotnet-install.ps1 -Channel 1.1
.\dotnet-install.ps1 -Version 2.1.4
}

build_script:
- ps: |
$PSVersionTable
Push-Location C:\projects\psscriptanalyzer
dotnet --version
# Test build using netstandard to test whether APIs are being called that are not available in .Net Core. Remove output afterwards.
.\buildCoreClr.ps1 -Framework netstandard1.6 -Configuration Release -Build
git clean -dfx
C:\projects\psscriptanalyzer\buildCoreClr.ps1 -Framework net451 -Configuration $env:BuildConfiguration -Build
C:\projects\psscriptanalyzer\build.ps1 -BuildDocs
Pop-Location
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"Rules"
],
"sdk": {
"version": "1.1.5"
"version": "2.1.4"
Copy link
Contributor

Choose a reason for hiding this comment

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

PowerShell core sdk version isn't at 2.1.4, but only 2.0.2. I would rather not get in front of PowerShell core - https://github.com/PowerShell/PowerShell/blob/master/global.json, what do you think?

Copy link
Collaborator Author

@bergmeister bergmeister Jan 21, 2018

Choose a reason for hiding this comment

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

I was originally asking the same question in the PowerShell core repo here and it seems that starting with netcore2, the sdk and runtime are decoupled now so that one can use an older sdk but a newer runtime. I could try doing it like they do in the PowerShell Core repo by specifying the runtime in the csproj files but at the moment, the SDK was chosen to match the 2.0.5. runtime that it contains.
Maybe the best solution is to use the latest SDK but hardcode the runtime target in the csproj. WDYT?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm still not clear on the CI system for PSSA, does it actually do a run against Core as well as full? Can the test automation help up here?

Copy link
Contributor

@JamesWTruher JamesWTruher Jan 21, 2018

Choose a reason for hiding this comment

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

I'm still not clear on the CI system for PSSA, does it actually do a run against Core as well as full? Can the test automation help us here? The worst thing would be to cause a break with core, i expect that full is not going to be an issue at all.

Copy link
Collaborator Author

@bergmeister bergmeister Jan 21, 2018

Choose a reason for hiding this comment

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

Me neither but as far as I understand PSSA gets first built using net451 only.
It seems that the core version is built by targeting netstandard1.6, which should eliminate at least the runtime versioning problem. I'll add a test to make sure it builds at least fine against netstandard1.6 in CI. I suppose running the tests using the core/netstandard version and/or against pwsh are future improvements to it.
As a test I tried building using netstandard1.6 before running the tests in PR #856 but that did not go well. Maybe some of the test scripts have to be adapted for that as well but I don't really have the time/motivation for doing that tbh.

Copy link
Contributor

Choose a reason for hiding this comment

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

ok -thanks-

Choose a reason for hiding this comment

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

The only reason we decoupled the SDK and Runtime versions in PowerShell Core repo is that the new CLI versions violated PowerShell Core build process several times. I hope it doesn't matter here.

}
}