{"action":"created","issue":{"url":"https://api.github.com/repos/ramsey/uuid/issues/89","labels_url":"https://api.github.com/repos/ramsey/uuid/issues/89/labels{/name}","comments_url":"https://api.github.com/repos/ramsey/uuid/issues/89/comments","events_url":"https://api.github.com/repos/ramsey/uuid/issues/89/events","html_url":"https://github.com/ramsey/uuid/pull/89","id":110369960,"number":89,"title":"Modify Travis CI builds to run tests on multiple CPU architectures","user":{"login":"ramsey","id":42941,"avatar_url":"https://avatars.githubusercontent.com/u/42941?v=3","gravatar_id":"","url":"https://api.github.com/users/ramsey","html_url":"https://github.com/ramsey","followers_url":"https://api.github.com/users/ramsey/followers","following_url":"https://api.github.com/users/ramsey/following{/other_user}","gists_url":"https://api.github.com/users/ramsey/gists{/gist_id}","starred_url":"https://api.github.com/users/ramsey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ramsey/subscriptions","organizations_url":"https://api.github.com/users/ramsey/orgs","repos_url":"https://api.github.com/users/ramsey/repos","events_url":"https://api.github.com/users/ramsey/events{/privacy}","received_events_url":"https://api.github.com/users/ramsey/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-10-08T04:11:55Z","updated_at":"2015-10-16T17:19:23Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ramsey/uuid/pulls/89","html_url":"https://github.com/ramsey/uuid/pull/89","diff_url":"https://github.com/ramsey/uuid/pull/89.diff","patch_url":"https://github.com/ramsey/uuid/pull/89.patch"},"body":"The ramsey/uuid library has requirements to run on 32-bit and 64-bit systems, as well as little-endian and big-endian systems. Travis CI only provides hardware for testing 64-bit, little-endian CPU architectures, but they recently announced support for Docker[^1].\r\n\r\nAfter some research, I found it is possible to use [QEMU][] with [chroot][] jails on Travis CI to emulate other CPU architectures and run tests through these chroot jails[^2]. Unfortunately, it takes an awful long time to set up a chroot jail, build PHP within it, and run the tests. It wasn't reasonable to expect to do this on every single push to the ramsey/uuid repository. This is where Docker comes in.\r\n\r\nI was able to create chroot jails for each architecture and version of PHP combination I need to test and then turn these into Docker images, which Travis is able to download and run fairly quickly. The instances on which Travis CI is running their Docker services do not currently support phpenv or php-build, so I needed to masquerade as a Python project and specify all PHP versions and CPU architectures in environment variables in my `.travis.yml` configuration. I run `composer install` and report to Coveralls outside of the Docker images, but all tests are run within the Docker images.\r\n\r\nThe Docker image I created for PHP 7.0.0RC4 on MIPS architecture produces segfaults when attempting to build PHP with Phar. PHP builds okay without Phar, but then it produces segfaults when running any PHP script on the image, so I'm leaving out 7.0.0RC4 on MIPS for now.\r\n\r\nThe Docker images for use with ramsey/uuid tests are available here: <https://hub.docker.com/r/benramsey/ramsey-uuid/>.\r\n\r\n[^1]: \"Using Docker on Travis CI,\" <http://blog.travis-ci.com/2015-08-19-using-docker-on-travis-ci/>\r\n[^2]: \"Running Travis CI tests on ARM architecture,\" <https://www.tomaz.me/2013/12/02/running-travis-ci-tests-on-arm.html>\r\n\r\n[qemu]: http://wiki.qemu.org/Main_Page\r\n[chroot]: https://en.wikipedia.org/wiki/Chroot"},"comment":{"url":"https://api.github.com/repos/ramsey/uuid/issues/comments/148776845","html_url":"https://github.com/ramsey/uuid/pull/89#issuecomment-148776845","issue_url":"https://api.github.com/repos/ramsey/uuid/issues/89","id":148776845,"user":{"login":"ramsey","id":42941,"avatar_url":"https://avatars.githubusercontent.com/u/42941?v=3","gravatar_id":"","url":"https://api.github.com/users/ramsey","html_url":"https://github.com/ramsey","followers_url":"https://api.github.com/users/ramsey/followers","following_url":"https://api.github.com/users/ramsey/following{/other_user}","gists_url":"https://api.github.com/users/ramsey/gists{/gist_id}","starred_url":"https://api.github.com/users/ramsey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ramsey/subscriptions","organizations_url":"https://api.github.com/users/ramsey/orgs","repos_url":"https://api.github.com/users/ramsey/repos","events_url":"https://api.github.com/users/ramsey/events{/privacy}","received_events_url":"https://api.github.com/users/ramsey/received_events","type":"User","site_admin":false},"created_at":"2015-10-16T17:19:23Z","updated_at":"2015-10-16T17:19:23Z","body":"Going to go ahead and merge this in."}}