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

Travis doesn't support xmllint on new Trusty environment #247

Open
MattGeri opened this issue Jul 25, 2017 · 7 comments
Open

Travis doesn't support xmllint on new Trusty environment #247

MattGeri opened this issue Jul 25, 2017 · 7 comments

Comments

@MattGeri
Copy link
Contributor

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

@westonruter
Copy link
Contributor

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

wp-dev-lib/check-diff.sh

Lines 402 to 403 in bb1ae0b

# Install PHP tools.
if [ -s "$TEMP_DIRECTORY/paths-scope-php" ]; then

@westonruter
Copy link
Contributor

@MattGeri see also #249 where precise is now the default. Still, we should support trusty.

@ocean90
Copy link
Contributor

ocean90 commented Oct 3, 2017

I started with that in ocean90@e7d3849 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?

@westonruter
Copy link
Contributor

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.

@JDGrimes
Copy link
Contributor

JDGrimes commented Oct 4, 2017

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.

@ocean90
Copy link
Contributor

ocean90 commented Oct 4, 2017

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 travis-ci/travis-ci#5876.

@valendesigns
Copy link
Contributor

I did it like this:

install:
    - sudo apt-get install -y libxml2-utils

But the addons method seems a little more elegant.

dtbaker added a commit to envato/wp-envato-market that referenced this issue Feb 27, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants