From a3d3649c5ef555bfc73786258030a6986e779cc9 Mon Sep 17 00:00:00 2001
From: Will Szumski <will@stackhpc.com>
Date: Tue, 15 Oct 2019 13:35:15 +0100
Subject: [PATCH] Install libffi headers

This is to resolve the following issue in CI:

    c/_cffi_backend.c:15:17: fatal error: ffi.h: No such file or directory
     #include <ffi.h>
                     ^
    compilation terminated.
    error: command 'gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /home/zuul/kayobe-venv/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-PV3WhJ/cffi/setup.py'"'"'; __file__='"'"'/tmp/pip-install-PV3WhJ/cffi/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-ZvlZVY/install-record.txt --single-version-externally-managed --compile --install-headers /home/zuul/kayobe-venv/include/site/python2.7/cffi Check the logs for full command output.

Change-Id: I1bd724be7dc77058870f37cb1c9404472fa466ca
see: https://zuul.opendev.org/t/openstack/build/c20a316a699b4073abf75960634ebfcd
---
 dev/functions               | 4 ++--
 doc/source/installation.rst | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/dev/functions b/dev/functions
index 347a5563..e0a24b01 100644
--- a/dev/functions
+++ b/dev/functions
@@ -85,9 +85,9 @@ function config_init {
 function install_dependencies {
     echo "Installing package dependencies for kayobe"
     if [[ -e /etc/centos-release ]]; then
-        sudo yum -y install gcc git vim python-virtualenv
+        sudo yum -y install gcc git vim python-virtualenv libffi-devel
     else
-        sudo apt install -y python-dev python-virtualenv gcc git
+        sudo apt install -y python-dev python-virtualenv gcc git libffi-dev
     fi
 }
 
diff --git a/doc/source/installation.rst b/doc/source/installation.rst
index a2ae11bd..83d6ced1 100644
--- a/doc/source/installation.rst
+++ b/doc/source/installation.rst
@@ -26,11 +26,11 @@ some of kayobe's python dependencies.
 
 On CentOS::
 
-    $ yum install -y python-devel python-virtualenv gcc
+    $ yum install -y python-devel python-virtualenv gcc libffi-devel
 
 On Ubuntu::
 
-    $ apt install -y python-dev python-virtualenv gcc
+    $ apt install -y python-dev python-virtualenv gcc libffi-dev
 
 If installing Kayobe from source, then Git is required for cloning and working
 with the source code repository.
-- 
GitLab