Make it easier to install the dotnet CLI tools#1139
Merged
JamesWTruher merged 28 commits intoPowerShell:developmentfrom Feb 19, 2019
Merged
Make it easier to install the dotnet CLI tools#1139JamesWTruher merged 28 commits intoPowerShell:developmentfrom
JamesWTruher merged 28 commits intoPowerShell:developmentfrom
Conversation
Also harden logic for running the installation script
Collaborator
|
Awesome, I wanted to do that for a while but was never too bothered to actually take the initiative. |
6 tasks
…e starting to build
… dotnet CLI update build script to handle WMF4 better (theoretically)
Use output of dotnet --version if there are problems with --list-sdks
set failure of finding dotnet as a warning, we will attempt to install it during bootstrap this handles the case of a blank slate where dotnet has never been installed
badeae0 to
fcf73b6
Compare
6d7ec14 to
f0dab58
Compare
f0dab58 to
e3752cc
Compare
Sometimes you can't even invoke dotnet if the version is too low
Throw away stderr of dotnet execution under some case and emit it in others. Change ToString of PortableVersion to enable better sorts
Sometimes we need the raw version so the installation script works, but sometimes we need to be able to compare it with other versions.
4686c98 to
866f35b
Compare
Also add additional verbose output to improve debuggability print response from upload
866f35b to
264652d
Compare
cf72691 to
cd1cbb9
Compare
…ppveyors test result recognition
We've had trouble with LANG being set to something that causes problems, so make sure we report what it is. Removed a bit of the verbosity which was added for debugging
Fix some errors in the module discovered by the tests
Change logic when downloading the dotnet install script Also enforce en_US.UTF-8 language to ensure that appveyor can see our test results
Contributor
Author
|
@bergmeister - I think this is ready now, let me know if you have additional comments |
bergmeister
approved these changes
Feb 19, 2019
Collaborator
There was a problem hiding this comment.
A lot of positive changes, even tests for it, I am overall happy with it. Points to consider or think about before merging (but not required to be addressed):
- If we call bootstrap automatically anyway as part of the
buildmodule, why do we need to expose theBootstrapswitch then? - Why can we not rely on the
dotnetbinary doing the logic for testing if the version is suitable? As far as I am aware they do logic and write to stderr in certain cases. It looks a bit like re-inventing the wheel to me but as long as it works, I am fine with it though. - Most of the logic seems to be quite generic, I am wondering if it would be worthwhile to later separate the
dotnetlogic of this out into a separate repo/module on the PSGallery?
Contributor
Author
|
@bergmeister thanks for the feedback and here are answers to questions:
|
bergmeister
pushed a commit
to bergmeister/PSScriptAnalyzer
that referenced
this pull request
Mar 5, 2019
* Add bootstrapping code to install dotnet * fix logic for downloading proper dotnet installer. * add a version checker for installed dotnet Also harden logic for running the installation script * Add bootstrapping code to install dotnet * Handle missing dotnet, and install it. * Add logic for checking the appropriate version of the Cli tools before starting to build * Update appveyor.psm1 to use build script bootstrapping for installing dotnet CLI update build script to handle WMF4 better (theoretically) * make the hunt for the dotnet executable more generic and try harder to find the exe * Fix typo when checking for usable versions of dotnet * use -version rather than ambiguous -v when installing dotnet * Improve error message when hunting for cli version Use output of dotnet --version if there are problems with --list-sdks * ignore errors when first attempting to find dotnet executable set failure of finding dotnet as a warning, we will attempt to install it during bootstrap this handles the case of a blank slate where dotnet has never been installed * Improve logic for handling a system where dotnet has never been installed * fine tune messages emitted during the hunt for dotnet * additional logic for finding dotnet executable * harden search for dotnet Sometimes you can't even invoke dotnet if the version is too low * Attempt to quieten build output. Throw away stderr of dotnet execution under some case and emit it in others. Change ToString of PortableVersion to enable better sorts * Fix tostring method for portable version * add -Raw flag to Get-GlobalJsonSdkVersion Sometimes we need the raw version so the installation script works, but sometimes we need to be able to compare it with other versions. * Attempt to harden the upload code Also add additional verbose output to improve debuggability print response from upload * upgrade pester version to 4.4.4 * Force the testsuite TestFixture to be named 'Pester' to get through appveyors test result recognition * Emit env:LANG to output before executing tests We've had trouble with LANG being set to something that causes problems, so make sure we report what it is. Removed a bit of the verbosity which was added for debugging * Create tests for build module Fix some errors in the module discovered by the tests * Add additional tests Change logic when downloading the dotnet install script Also enforce en_US.UTF-8 language to ensure that appveyor can see our test results
bergmeister
pushed a commit
to bergmeister/PSScriptAnalyzer
that referenced
this pull request
Mar 22, 2019
* Add bootstrapping code to install dotnet * fix logic for downloading proper dotnet installer. * add a version checker for installed dotnet Also harden logic for running the installation script * Add bootstrapping code to install dotnet * Handle missing dotnet, and install it. * Add logic for checking the appropriate version of the Cli tools before starting to build * Update appveyor.psm1 to use build script bootstrapping for installing dotnet CLI update build script to handle WMF4 better (theoretically) * make the hunt for the dotnet executable more generic and try harder to find the exe * Fix typo when checking for usable versions of dotnet * use -version rather than ambiguous -v when installing dotnet * Improve error message when hunting for cli version Use output of dotnet --version if there are problems with --list-sdks * ignore errors when first attempting to find dotnet executable set failure of finding dotnet as a warning, we will attempt to install it during bootstrap this handles the case of a blank slate where dotnet has never been installed * Improve logic for handling a system where dotnet has never been installed * fine tune messages emitted during the hunt for dotnet * additional logic for finding dotnet executable * harden search for dotnet Sometimes you can't even invoke dotnet if the version is too low * Attempt to quieten build output. Throw away stderr of dotnet execution under some case and emit it in others. Change ToString of PortableVersion to enable better sorts * Fix tostring method for portable version * add -Raw flag to Get-GlobalJsonSdkVersion Sometimes we need the raw version so the installation script works, but sometimes we need to be able to compare it with other versions. * Attempt to harden the upload code Also add additional verbose output to improve debuggability print response from upload * upgrade pester version to 4.4.4 * Force the testsuite TestFixture to be named 'Pester' to get through appveyors test result recognition * Emit env:LANG to output before executing tests We've had trouble with LANG being set to something that causes problems, so make sure we report what it is. Removed a bit of the verbosity which was added for debugging * Create tests for build module Fix some errors in the module discovered by the tests * Add additional tests Change logic when downloading the dotnet install script Also enforce en_US.UTF-8 language to ensure that appveyor can see our test results
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Summary
Sometimes the build of script analyzer fails because version specified in
global.jsonis not installed. This PR makes it easier to install the proper version of the CLI tools with the-bootstrapparameter tobuild.ps1will determine which version of the CLI is needed, validate whether the proper version is already present, and if not, will install it.
This does not validate whether the net452 targeting framework is installed, that must be done manually.
PR Checklist
.cs,.ps1and.psm1files have the correct copyright headerWIP:to the beginning of the title and remove the prefix when the PR is ready.