All linux builds will be in Docker containers, on AWS.
Distribution subdirectories should be consistently named: DISTRO-NUMERIC_VERSION[-VERSION_NAME] - for example, debian-9-stretch, or ubuntu-16.04-xenial. There are two required files:
make-package: executable script that creates a package from/var/out/hhvm-nightly-$VERSION.tar.gz, and put the output in/var/outDOCKER_BASE: plain text file containing the name of a public docker image that should be used for the build - for example,debian:stretch. It needs to be possible to pass this todocker run, for example,docker run -it debian:stretch /bin/bash -lshould work.
Docker containers will have the following directories bind-mounted:
/var/out: read-write; build artifacts (e.g. packages) go here./opt/hhvm-packaging: read-only; this directory./opt/hhvm-distro-packaging: read-only; the subdirectory for your distribution. This should contain amake-packagescript or symlink
For example, when building for Debian Jessie, the debian-8-jessie/
subdirectory is mounted to /opt/hhvm-distro-packaging.
The package building process will execute
/opt/hhvm-distro-packaging/make-package in the container, and will
expect that to create packages in /var/out. make-package should install
all required build dependencies. Use the native package manager's support
for build-depends or similar where possible.
You probably want make-package to be a symlink to /opt/hhvm-packaging/bin/make-debianish-package; this expects:
- a
DISTRIBUTIONfile containing the string name for the distribution - e.g. 'jessie', 'trusty' - a
PKGVERfile containing the package version - e.g.1~jessie - a
debian/subdirectory, containingcontrol,rules, etc.
If you are able to use an existing distribution's debian/ directory directly, please make it a symlink to
/opt/hhvm-packaging/OTHER_DISTRO_HERE/debian.
Packages will be build with debbuild
- Install Docker
- run
bin/make-interactive-container; you now have a shell in the container - within the container, install git (e.g.
apt-get update -y; apt-get install -y git) - run
/opt/hhvm-packaging/bin/make-source-tarball - run
/opt/hhvm-distro-packaging/make-package
You can specify a distribution at step 2 - for example, `bin/interactive-container debian-9-stretch'
- Install Docker
- If you are on MacOS,
brew install gnu-tar, andexport TAR=gtar bin/make-source-tarball(just once)- run
bin/make-package-in-throwaway-container DISTRO_ID(for each distribution)
DISTRO_ID is the name of one of the distribution-specific subdirectories, e.g. debian-9-stretch.
As we want to execute docker commands, we run directly on EC2, not ECS. AWS supports running commands on EC2 instance startup - EC2 calls this 'user data' - a file or script-as-text in 'user data' will be executed.
The scripts we use are in the aws/ subdirectory, and expect to be ran on
Ubuntu 16.04 hosts.
- tag the release on the
hhvm-stagingrepo bin/make-all-packages-on-aws VERSION
This will follow the automation flow defined in the hhvm-builds AWS
step function (a.k.a. 'state machine'); this currently looks like this:
If you need to rebuild just for one distribution:
- edit
DISTRO/PKGVERif needed and push to github bin/make-package-on-aws VERSION DISTRO
