Travis doesn't support xmllint on new Trusty environment
Travis now defaults to it's new Ubuntu Trusty environment (unless specified not to in the config file). However in this environment, xmllint or probably the libxml2-utils package is not installed.
So when the build tries to check the XML, an error is thrown:
xargs: xmllint: No such file or directory
Switching back to Ubuntu Precise is a short term fix for this. Add the following to .travis.yml
dist: - precise
Seems like then the best permanent fix would be to update the install_tools function to install xmllint if [ -s "$TEMP_DIRECTORY/paths-scope-xml" ], yeah?
See https://github.com/xwp/wp-dev-lib/blob/bb1ae0b61663d022ec1ed78aa623720de39c9049/check-diff.sh#L402-L403
@MattGeri see also #249 where precise is now the default. Still, we should support trusty.
I started with that in https://github.com/ocean90/wp-dev-lib/commit/e7d384919b66f19cfa8bc8ae94ce834cb98f900e until I realized that having sudo apt-get there isn't the best idea for local environments. Should this be part of travis.install.sh?
Yes, that makes sense to me. However, sudo is going to fail on Travis too when running on a containerized environment. So the xmllint installation should be done without sudo, assuming that is possible.
Travis can install it for you, by adding this to .travis.yml:
addons:
apt:
packages:
# Needed for `xmllint`.
- libxml2-utils
Then sudo isn't required.
Correct, I tried that yesterday and it's working, see https://travis-ci.org/GlotPress/GlotPress-WP/jobs/282788413#L428 and https://travis-ci.org/GlotPress/GlotPress-WP/jobs/282788413#L700.
The only disadvantage is that there's no apt caching, see https://github.com/travis-ci/travis-ci/issues/5876.
I did it like this:
install:
- sudo apt-get install -y libxml2-utils
But the addons method seems a little more elegant.