Skip to content
This repository has been archived by the owner on May 25, 2022. It is now read-only.

Use local phpmanager dependencies installer during development #154

Closed
yiendos opened this issue Aug 16, 2019 · 4 comments · Fixed by #155
Closed

Use local phpmanager dependencies installer during development #154

yiendos opened this issue Aug 16, 2019 · 4 comments · Fixed by #155
Assignees
Labels
Milestone

Comments

@yiendos
Copy link
Member

yiendos commented Aug 16, 2019

Attempting to use the box php commands results in a failure:

box php:list
Older versions of PHP require extra dependencies.
Please wait while we set up all build dependencies. This can take a couple of minutes .. 

Downloading install script .. finished 
Install dependencies from Ubuntu repositories .. finished 
E: Unable to locate package g++-4.4
E: Couldn't find any package by glob 'g++-4.4'
E: Couldn't find any package by regex 'g++-4.4'
E: Package 'gcc-4.4' has no installation candidate
E: Package 'libpng12-dev' has no installation candidate
ERROR: apt-get failed!
See /tmp/install-phpmanager-dependencies.log for more details.

For the relevant part of the code that attempts to install the dependencies:
https://github.com/joomlatools/joomlatools-vagrant/blob/master/shell/install-phpmanager-dependencies.sh#L120

However, it would seem as though build-essential already contains g++ as part of it's package:
https://packages.ubuntu.com/bionic/build-essential

And further it would seem we install this here:
https://github.com/joomlatools/joomlatools-vagrant/blob/master/puppet/environments/box/modules/profiles/manifests/base.pp#L12

We should be covered. However further tweaks might still be required for the phpmanager script to work correctly.

@yiendos yiendos added the bug label Aug 16, 2019
@yiendos yiendos added this to the 1.6 milestone Aug 16, 2019
@yiendos yiendos self-assigned this Aug 16, 2019
yiendos added a commit that referenced this issue Aug 16, 2019
@yiendos
Copy link
Member Author

yiendos commented Aug 16, 2019

Okie took me a bit to work out why the changes here:
5fafb3a#diff-65d6e3fcb3cdce960c89bf435441db7bL120

Wasn't being picked up by a vagrant provision. Then I worked out that the phpmanager file installed via puppet:
https://github.com/joomlatools/joomlatools-vagrant/blob/master/puppet/environments/box/modules/profiles/manifests/box/phpmanager.pp#L13

Doesn't actually invoke the shell/install-phpmanager-dependencies.sh, rather it makes a wget call to a similar script:
https://github.com/joomlatools/joomlatools-vagrant/blob/master/puppet/environments/box/modules/profiles/files/box/phpmanager/scripts/phpmanager#L681

I suggest that we move this script to the following location puppet:///modules/profiles/box/phpmanager/scripts if we wanted to install the dependancies on the first run of box php:xxx

If however the idea of the shell folder is to provision the vagrant box on vagrant up then I'd suggest that we amend the default Vagrantfile:
https://github.com/joomlatools/joomlatools-vagrant/blob/master/Vagrantfile#L72

to ensure these dependancies are run around the same time.

One arguement for moving these files to be installed on first run, is that it can take rather a long time to build all the phpmanager dependancies.

@stevenrombauts
Copy link
Member

@yiendos Installing these increases the size (and time needed) of the build considerably. Most users do not need this so that's why we only install it when the phpmanager script is run for the first time.

@yiendos
Copy link
Member Author

yiendos commented Aug 22, 2019

@stevenrombauts okie great thanks for the feedback, we are agreed that the install of dependencies should occur when the user first invokes a box php: command. But we are still relying on an external script to provision:
https://github.com/joomlatools/joomlatools-vagrant/blob/master/puppet/environments/box/modules/profiles/files/box/phpmanager/scripts/phpmanager#L681

I think for ease of developing the phpmanager in the future we should ensure that this script is installed alongside the phpmanager script. That way any changes you make to the install dependencies means they are easily tested locally.

Moving this file from the /shell to puppet/environments/box/modules/profiles/files/box/phpmanager/scripts/phpmanager should sort this?

@stevenrombauts
Copy link
Member

@yiendos Good point, would make things easier. As we discussed on Slack, I've added a check to the script to use the local copy in development and still use the online version otherwise.

stevenrombauts pushed a commit that referenced this issue Oct 11, 2019
#154: drop g++ and gcc from phpmanager install
@stevenrombauts stevenrombauts changed the title phpmanager bust on latest master Use local phpmanager dependencies installer during development Nov 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants