HDF5 fails on Travis CI with Trusty; works with Precise

It looks like the HDF5 package is having trouble on Trusty Tahr on Travis CI, but it works with Precise Pangolin.

I just started a package that depends on the HDF5.jl. I pushed my branch, enabled Travis CI, and it failed at the build step:

INFO: Building HDF5
/usr/bin/sudo: 1: /usr/bin/sudo: [[: not found
================================[ ERROR: HDF5 ]=================================
LoadError: failed process: Process(`sudo apt-get install hdf5-tools`, ProcessExited(1)) [1]
while loading /home/travis/.julia/v0.6/HDF5/deps/build.jl, in expression starting on line 44

I took a look at some other packages that used the HDF5 package, and all of the ones that had clean builds were last built on Precise, so I added:

dist: precise

To my .travis.yml file, and this worked fine.

I notice that Travis CI only just started rolling out Trusty as a default yesterday.

Does anyone know why this is failing? Any further info?

Do you have a setting for sudo, either false or required ? What that looks like to me is that /usr/bin/sudo in the VM your job got routed to was probably replaced by Travis with a bash script, but it’s trying to be executed by /bin/sh which is dash on Ubuntu so doesn’t recognize the bashism [[ which must be somewhere in an if statement in the (hypothetical) bash script. Sounds like a bug that should be reported on Travis CI’s issue tracker.

As a workaround in order to avoid having BinDeps need to call sudo apt-get install hdf5-tools, you can try using the apt packages plugin

addons:
  apt:
    packages:
    - hdf5-tools

Thanks @tkelman! When I use sudo: required in my .travis.yml file, it works, without having to specify the distribution (and it defaults to trusty).

Per your advice, I wrote this up in Travis issue here:

I think I might not be the only Julia user facing this issue though, so perhaps this will be a useful thread for other users’ searches.

[https://github.com/travis-ci/travis-ci/issues/8129]

Yes, I have had the same problems with HDF5 on Travis. Thanks for writing this.