Travis CI build issues

I’ve encountered the following issues with by travis builds:

- Unable to install all requirements: av==6.1.2
- Unable to install all requirements: homeassistant-pyozw==0.1.4, pydispatcher==2.0.5

(Travis CI)

I have resolved the issues, but I’m sure there must be a better way, so I’m sharing this hoping someone will show a better way!

The second issue (homeassistant-pyozw==0.1.4, pydispatcher==2.0.5) is because missing stuff for zwave. Adding this to the travis script resolved it for me “sudo apt-get install -y libudev-dev” (and the documentation has a PR for this).

The first however was a bit tougher. I needed to install ffmpeg, but unfortunately the ubuntu boxes travis uses are really old which means there isn’t really a good trusted source (that I could fine). This script here installs it from the official install by doing a build but this takes like 17 minutes to run!!

- sudo apt install autoconf automake build-essential cmake libass-dev libfreetype6-dev libjpeg-dev libtheora-dev libtool libvorbis-dev libx264-dev pkg-config wget yasm zlib1g-dev
- wget http://ffmpeg.org/releases/ffmpeg-3.2.tar.bz2
- tar -xjf ffmpeg-3.2.tar.bz2
- cd ffmpeg-3.2
- ./configure --disable-static --enable-shared --disable-doc
- make
- sudo make install

I have found a package source with the compilation already setup and if I use this it installs:

- sudo add-apt-repository ppa:jonathonf/ffmpeg-3 -y
- sudo apt-get update
- sudo apt-get install ffmpeg
- ffmpeg -version

but this doesn’t actually work. ffmpeg does get installed, and gives this output with --version:

ffmpeg version 3.4.4-1~14.04.york0 Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04.4)
configuration: --prefix=/usr --extra-version=‘1~14.04.york0’ --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libmodplug --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
libavutil 55. 78.100 / 55. 78.100
libavcodec 57.107.100 / 57.107.100
libavformat 57. 83.100 / 57. 83.100
libavdevice 57. 10.100 / 57. 10.100
libavfilter 6.107.100 / 6.107.100
libavresample 3. 7. 0 / 3. 7. 0
libswscale 4. 8.100 / 4. 8.100
libswresample 2. 9.100 / 2. 9.100
libpostproc 54. 7.100 / 54. 7.100

but for some reason I still get the following errors:

ERROR:homeassistant.util.package:Unable to install package av==6.1.2: Failed building wheel for av
Command "/home/travis/virtualenv/python3.5.6/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-g26ql9nr/av/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-wvpoc6lt/install-record.txt --single-version-externally-managed --compile --install-headers /home/travis/virtualenv/python3.5.6/include/site/python3.5/av" failed with error code 1 in /tmp/pip-install-g26ql9nr/av/
ERROR:homeassistant.requirements:Not initializing stream because could not install requirement av==6.1.2

So, my question is does anyone have a good solution to resolve this stream issue I’m still facing!

2 Likes

I’m getting the av error as well on Travis. Because I have my each section of my configuration.yaml separated into individual files (ala @frenck) I simply added rm -f ./packages/stream.yaml in the before_install section!

This only works for me because the stream.yaml file only has one line in it: stream:. This makes it easy for me to quickly find each config section and disable components by renaming or deleting a file.

Here is my current .travis file.

language: python
python: "3.6.4"
before_install:
  - mv ./travis_secrets.yaml ./secrets.yaml
  - rm -f ./packages/stream.yaml
install:
  - pip3 install homeassistant
script:
  - hass -c ./ --script check_config --info all
2 Likes

Thanks for this I’ve been dealing with the zwave issues for the last month and couldn’t figure it out. Your solution fixed it right up so my builds succeed again.

1 Like

Another option is to use sed in your before_install stanza to comment out the stream: components:

before_install:
  - mv travis_secrets.yaml secrets.yaml
  ### Remove stream component
  - sed -i 's/^stream:/#stream:/g' configuration.yaml
1 Like

if you use:
dist: bionic
and
- sudo apt-get install -y libavformat-dev libavcodec-dev libavdevice-dev libavutil-dev libswscale-dev libswresample-dev libavfilter-dev
av should build. You don’t need to install FFmpeg as it is included in the ubuntu build of this dist. You should now be able to leave your stream configs to be checked by travis

1 Like

Thank you for the suggestion in using

dist:bionic

This resolved my stream: problem on Travis CI along with using those install requirements.

1 Like