Skip to content

Conversation

JonathanWolfe
Copy link
Contributor

Summary

Fixes #6439

The chocolately install has always been full of log spam due to an incorrectly written /l*v flag, but those logs are also unneeded since the output has no useful info so I just removed them (this can be reversed to just fix the flag if y'all really want it back).

This also removes the bad nodejs-lts nuget dependency added in #5925. It now has no dependency, and instead logs out to inform the user to install node if it's missing.

Test plan

  • choco uninstall yarn
  • Replace the {VERSION} and {CHECKSUM} placeholders manually or do a full build (I manually replaced)
  • .\chocolateyinstall.ps1

@pascalberger
Copy link
Contributor

@Daniel15 Any chance you can have a look at this? This PR would allow to use the yarn Chocolatey package again with Node version different than LTS and solve the issue with the log output which confuses users.

@Daniel15
Copy link
Member

Daniel15 commented Dec 13, 2018

Oops, sorry I missed this! This seems mostly good to me.

The file is intentionally called chocolateyinstall.ps1.in because it contains placeholders. The idea is that if it has the .in extension, it has the placeholders, and it's renamed to remove the .in when the placeholders are removed. Could you please rename it back?

The chocolately install has always been full of log spam due to an incorrectly written /l*v flag

If I remember correctly, this flag was copied as-is from a Chocolatey template for MSI-based installers.

This also removes the bad nodejs-lts nuget dependency added in #5925. It now has no dependency, and instead logs out to inform the user to install node if it's missing.

The package intentionally had a Node.js dependency so that it could work out-of-the-box without the user having to know about Node.js. I guess outputting a message is fine. I wish Chocolatey had a way of specifying that both nodejs and nodejs-lts satisfy the requirement.

if (-Not (Get-Command "node" -errorAction SilentlyContinue)) {
Write-Host "Yarn requires NodeJS to be installed. To install, use either of the commands below:"
Write-Host "choco install nodejs"
Write-Host "choco install nodejs-lts"
Copy link
Contributor

Choose a reason for hiding this comment

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

I would suggest to add this information also to the nuspec file as a note (like e.g. done here)

Copy link
Member

@Daniel15 Daniel15 left a comment

Choose a reason for hiding this comment

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

As per my previous comments

@Daniel15 Daniel15 self-assigned this Dec 13, 2018
packageName = 'yarn'
softwareName = 'Yarn*'
fileType = 'msi'
silentArgs = "/qn /norestart /l*v `"$env:TEMP\chocolatey\$($packageName)\$($packageName).MsiInstall.log`""
Copy link
Contributor

Choose a reason for hiding this comment

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

While this solves the issue of the log output, it also disables logging at all. Upstream issue for this is chocolatey/choco#1016

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So our options are either a giant blob of Error looking xml or nothing. I prefer nothing but we can add back the error blob.

@JonathanWolfe
Copy link
Contributor Author

@Daniel15

The file is intentionally called chocolateyinstall.ps1.in ... Could you please rename it back?

Renamed back. I think I just changed it because I was checking syntax highlighting and the PSAnalyzer and forgot to undo.

The package intentionally had a Node.js dependency so that it could work out-of-the-box without the user having to know about Node.js. I guess outputting a message is fine. I wish Chocolatey had a way of specifying that both nodejs and nodejs-lts satisfy the requirement.

Yeah, nuget doesn't have the concept of either only and. I don't think there will be many people trying to use Yarn without node installed anyways so the issue won't/shouldn't come up much.

Copy link
Member

@Daniel15 Daniel15 left a comment

Choose a reason for hiding this comment

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

Thank you!

@Daniel15 Daniel15 merged commit d7811e4 into yarnpkg:master Dec 21, 2018
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.

Bad chocolatey package dependency

3 participants