Re: [PHP-DEV] Build instructions for Ubuntu 18.04 (and other systems)

This is only part of a thread. view whole thread
  107120
September 15, 2019 20:42 d.takken@xs4all.nl (Dik Takken)
On 15-09-19 20:49, Nikita Popov wrote:
> > Anyone interested in doing this? >
Hi Nikita, May I suggest to provide instructions to build using Docker? This has a number of advantages: * Same instructions will work on Linux, MacOS and Windows * No need to install build dependencies on your host * Spin up a MySQL container by running 'docker run mysql:version' I took this route a while ago when I needed to setup a dev environment and it works nicely. I could do a write-up of this route if desired. Part of the instructions could be cast into a Docker image that can be published on Github and Docker Hub. This image could even have the command to run the tests baked into the image itself. Then, anyone can just run docker run php-tests:7.4 to build the sources and run the tests. For development you can mount your local git clone in the container. Regards, Dik Takken
  107121
September 15, 2019 20:53 carusogabriel34@gmail.com (Gabriel Caruso)
Hello Dik

On Sun, Sep 15, 2019, 22:42 Dik Takken takken@xs4all.nl> wrote:

> On 15-09-19 20:49, Nikita Popov wrote: > > > > Anyone interested in doing this? > > > > Hi Nikita, > > May I suggest to provide instructions to build using Docker? This has a > number of advantages: > > * Same instructions will work on Linux, MacOS and Windows > * No need to install build dependencies on your host > * Spin up a MySQL container by running 'docker run mysql:version' > > I took this route a while ago when I needed to setup a dev environment > and it works nicely. I could do a write-up of this route if desired. > > Part of the instructions could be cast into a Docker image that can be > published on Github and Docker Hub. This image could even have the > command to run the tests baked into the image itself. Then, anyone can > just run > > docker run php-tests:7.4 > > to build the sources and run the tests. For development you can mount > your local git clone in the container. > > Regards, > Dik Takken > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php
The main problem with Docker and php-src is that we need to touch the OS in order to make sure the new features and bugfixes will be compatible. Docker create a layer on top of that, right? Best regards,
> >
  107123
September 15, 2019 21:21 d.takken@xs4all.nl (Dik Takken)
On 15-09-19 22:53, Gabriel Caruso wrote:
> > > The main problem with Docker and php-src is that we need to touch the OS in > order to make sure the new features and bugfixes will be compatible. > > Docker create a layer on top of that, right? >
Correct. Honestly I was not considering the use case of testing interactions with OS-specific features as one might do using a CI/CD setup. Providing instructions that will work for every supported target environment is not an easy thing to do. I was thinking about the use case of local development where the developer needs to build the sources on whatever OS he / she happens to be using. Then, Docker makes much more sense as it provides a single consistent environment that will work the same way for anyone.
  107124
September 15, 2019 21:43 marandall@php.net (Mark Randall)
On 15/09/2019 21:53, Gabriel Caruso wrote:
> The main problem with Docker and php-src is that we need to touch the OS in > order to make sure the new features and bugfixes will be compatible.
What in particular needs to be adjusted at OS level to make testing work? If there's a list we can probably find a way around it, at least when running containerised. Are you referring to installing shared libraries on the host? -- Mark Randall
  107122
September 15, 2019 21:12 smalyshev@gmail.com (Stanislav Malyshev)
Hi!

> May I suggest to provide instructions to build using Docker? This has a > number of advantages: > > * Same instructions will work on Linux, MacOS and Windows > * No need to install build dependencies on your host > * Spin up a MySQL container by running 'docker run mysql:version'
This is certainly a good idea to have Docker build instructions as an option, but would not be good as the only or primary option. There are lots of situations where installing the whole docket setup on a host is either hard or an overkill for just building PHP. But as an option it's good.
> I took this route a while ago when I needed to setup a dev environment > and it works nicely. I could do a write-up of this route if desired.
I think having good docker-based build instructions would certainly be appreciated.
> Part of the instructions could be cast into a Docker image that can be > published on Github and Docker Hub. This image could even have the > command to run the tests baked into the image itself. Then, anyone can > just run > > docker run php-tests:7.4 > > to build the sources and run the tests. For development you can mount > your local git clone in the container.
Sounds like a nice idea. -- Stas Malyshev smalyshev@gmail.com