Skip to content
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

(GH-394) chocolatey.dll no more #479

Merged
merged 20 commits into from Apr 25, 2022
Merged

Conversation

mwallner
Copy link
Member

@mwallner mwallner commented Oct 22, 2021

Description

  • rip out chocolatey.dll (use choco.exe from $env:ChocolateyInstall)
  • install chocolatey from nupkg if not present (local + remote)

Related Issue

Fixes #247
Fixes #369
Fixes #394
Fixes #423
Fixes #442
Fixes #455

Motivation and Context

To be able to use the neweset functionality within Chocolatey would require unbundling Chocolatey within Boxstarter and using the latest* version from Chocolatey.org.

With this PR, Boxstarter will always try to use the Chocolatey version from $env:ChocolateyInstall or install Chocolatey from a chocolatey.nupkg that comes with Boxstarter and should easily be updated whenever a new version of Chocolatey is released. (I intentionally do not use 'latest' here, because there might be unforseen issues with a newer version - hence it's safer to stick with a 'known-to-be-good' version until verified/tested. / as of today, Boxstarter would 'ship' with Chocolatey 0.11.3)

Currently Boxstarter uses it's own version for remote installs but the remote installs could install, or use the current version of the Chocolatey package on the local machine to install remotely.

How Has This Been Tested?

Mainly on my dev-pc, use psake Package in the "buildscripts" directory to build artifacts that can be installed via chocolatey or simply use boxstartershell.ps1 (note: you still need to psake Package before!) and use Install-BoxstarterPackage on a remote host.

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@mwallner mwallner requested review from flcdrg and pauby October 22, 2021 19:04
@mwallner mwallner self-assigned this Oct 22, 2021
@mwallner mwallner added this to the 3.0.0 milestone Oct 22, 2021
@mwallner mwallner changed the title GH-394: chocolatey.dll no more (GH-394) chocolatey.dll no more Oct 22, 2021
@JPRuskin JPRuskin added the hacktoberfest-accepted Pull Requests opened during hacktoberfest, and has been accepted by a team member label Oct 23, 2021
@mwallner
Copy link
Member Author

rebased to include #478 (upload build artifacts on appveyor build)

@mwallner
Copy link
Member Author

note: as of #478 you now can grab the build artifacty from appveyor (i.e. the last build ) and use/install/test them in a VM or local machine.

@mwallner
Copy link
Member Author

converted to draft -> investigating the issue @Baune8D reported in GH-394

@Baune8D
Copy link

Baune8D commented Nov 1, 2021

Adding feedback to this PR instead as requested by @pauby

Installation of remote package does not start with 2.13.16 artifacts

What You Are Seeing?

Boxstarter never initiates remote install and just hangs on Boxstarter starting Calling Chocolatey to install MagicScript. This may take several minutes to complete...

image

I can verify that remoting works, because i can see Boxstarter trigging scripts on the remote machine on setup and teardown.

What Is Expected?

Remote install is expected to start.

How Did You Get This To Happen? (Steps to Reproduce)

This issue only happens with the 2.13.16 artifacts from AppVeyor https://ci.appveyor.com/project/chocolatey/boxstarter/builds/41341291/artifacts

Using Boxstarter 2.13.0 the remote installations starts correctly.

Remote install is kicked off from the host with Install-BoxstarterPackage -ComputerName $hostname -PackageName $package -Credential $cred -StopOnPackageFailure against a Hyper-V VM (Generation 2, Configuration 10).

Host is using Chocolatey 0.11.3

Installation of chocolatey package triggers verbose information and ends in a loop using 2.13.16 artifacts

What You Are Seeing?

When installing chocolatey package through Boxstarter 2.13.16, it triggers alot of verbose information and ulimately ends in a loop with the message Checking for other running MSIEXEC installers...

What Is Expected?

Chocolatey package should install correctly and without verbose information.

How Did You Get This To Happen? (Steps to Reproduce)

Calling choco install 'git' --no-progress in a Boxstarter package.

This issue only happens with the 2.13.16 artifacts from AppVeyor https://ci.appveyor.com/project/chocolatey/boxstarter/builds/41341291/artifacts

Using Boxstarter 2.13.0 the installation runs correctly.

Output Log

Log from %LOCALAPPDATA%\Boxstarter\boxstarter.log
https://gist.github.com/Baune8D/f5618641b173d5c150dc33e94ba77526

@mwallner
Copy link
Member Author

Boxstarter never initiates remote install and just hangs on Boxstarter starting Calling Chocolatey to install MagicScript. This may take several minutes to complete...
...
Remote install is expected to start.

Hey @Baune8D , thanks again for your effort!
I managed to figure out what's going wrong here and will soon be able to provide a fix, stay tuned!

(note/memo: $env:temp changes when Boxstarter invokes choco.exe (+via scheduled task),- choco.exe appends /chocolateywhich leads to BoxstarterTask.ps1 / .stream files not being at the expected location,- nothing happens)

@mwallner mwallner marked this pull request as ready for review November 20, 2021 21:05
@mwallner
Copy link
Member Author

hey @Baune8D , @flcdrg - could I ask you to take the latest Travis CI binaries for a spin? - I really want to get this out asap but also try not to break any use case I haven't got on my radar.

@mwallner
Copy link
Member Author

I have yet to do some testing and update the docs, I'm not entirely sure if opening a new process for invoking chocolatey Start-Process choco.exe and loading Boxstarter context by "injecting a extension to sideload Boxstarter" will break any currently possible scenario.

so far I've tested:

  • basic Install-BoxstarterPackage (local + remote) - using packages from the community repo
  • basic Install-BoxstarterPackage (local + remote) - using custom packages (New-BoxstarterPackage + Invoke-BoxstarterBuild) that contain Boxstarter commands (Invoke-Reboot)
  • Chocolatey 0.11.3 will be installed by using this version of Boxstarter if no other version is present before (looking at $env:ChocolateyInstall)
  • Chocolatey Business extension is able to load without error - using C4B commands from Boxstarter packages should be possible

@flcdrg
Copy link
Member

flcdrg commented Nov 21, 2021

I'll try to give it a spin.

I think this should definitely be a major version release, so that would also be a hint that there's a chance of behaviour changing.

@Baune8D
Copy link

Baune8D commented Nov 22, 2021

@mwallner Excited to give this another run! 😄

I'm currently running into a minor issue. Boxstarter complains about not being able to find Install-BoxstarterExtension:

image

It seems that adding Install-BoxstarterExtension to BoxStarter.Bootstrapper.psm1 solves this issue.

@Baune8D
Copy link

Baune8D commented Nov 22, 2021

I am also still seeing alot of irrelevant verbose information in the terminal window when installing Chocolatey packages (As described in #479 (comment)) :
image
image
But i am not experiencing any loops anymore and installation seems to progress correctly.

@mwallner
Copy link
Member Author

@mwallner Excited to give this another run! smile

I'm currently running into a minor issue. Boxstarter complains about not being able to find Install-BoxstarterExtension:

image

It seems that adding Install-BoxstarterExtension to BoxStarter.Bootstrapper.psm1 solves this issue.

Good Catch!
I actually forgot to commit the change after I moved from Setup- to Install- in order to use approved verbs.
(explains why I haven't seen this in my demo env also x_x)

mwallner added a commit to mwallner/boxstarter that referenced this pull request Feb 16, 2022
@mwallner
Copy link
Member Author

rebased onto current master

@gep13 gep13 removed this from the 3.0.0 milestone Apr 8, 2022
@gep13 gep13 merged commit da88a41 into chocolatey:master Apr 25, 2022
@gep13
Copy link
Member

gep13 commented Apr 25, 2022

@mwallner thanks for all your work in pulling this together, it is VERY much appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest-accepted Pull Requests opened during hacktoberfest, and has been accepted by a team member
Projects
None yet
5 participants