我有一个依赖于 datastax php-driver 的项目: https ://github.com/datastax/php-driver
我已经成功地将这个驱动器用于 PHP 5.6 和 travis。我想切换到容器构建,因为 php-drive 的所有者已经成功地做到了(也让构建速度更快是一个奖励)。
我遇到了以下错误:
checking whether the C compiler works... no
configure: error: in `/home/travis/build/company-project/git-repo-project/php-driver/ext':
configure: error: C compiler cannot create executables
configure: error: C compiler cannot create executables
See `config.log' for more details
The command "./install.sh" failed and exited with 77 during .
.travis.yml 文件如下所示:
language: php
sudo: false
addons:
apt:
packages:
- libssl-dev
- g++
- make
- cmake
- clang
cache:
ccache: true
directories:
- ${HOME}/dependencies
php:
- 5.6
env:
global:
# Configure the .phpt tests to be Travis friendly
- REPORT_EXIT_STATUS=1
- TEST_PHP_ARGS="-q -s output.txt -g XFAIL,FAIL,BORK,WARN,LEAK,SKIP -x --show-diff"
- PATH=$HOME/.local/bin:$PATH
# Indicate the cached dependencies directory
- CACHED_DEPENDENCIES_DIRECTORY=${HOME}/dependencies
# Add libuv source build for container based TravisCI
- LIBUV_VERSION=1.8.0
- LIBUV_ROOT_DIR=${CACHED_DEPENDENCIES_DIRECTORY}/libuv/${LIBUV_VERSION}
- APP_ENV=travis
before_install:
# Configure, build, install (or used cached libuv)
- if [ ! -d "${LIBUV_ROOT_DIR}" ]; then
pushd /tmp;
wget -q http://dist.libuv.org/dist/v${LIBUV_VERSION}/libuv-v${LIBUV_VERSION}.tar.gz;
tar xzf libuv-v${LIBUV_VERSION}.tar.gz;
pushd /tmp/libuv-v${LIBUV_VERSION};
sh autogen.sh;
./configure --prefix=${LIBUV_ROOT_DIR};
make -j$(nproc) install;
popd;
popd;
else echo "Using Cached libuv v${LIBUV_VERSION}. Dependency does not need to be re-compiled";
fi
- git clone https://github.com/datastax/php-driver.git
- cd php-driver
- git submodule update --init
- cd ext
- ./install.sh
- cd "$TRAVIS_BUILD_DIR"
- echo "extension=cassandra.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`
# Install CCM
- pip install --user ccm
install:
- composer update -n
services:
- mysql
- cassandra
script:
- vendor/bin/codecept run
最初作为包,只需要 libssl-dev,但由于它缺少 C 编译器,我决定检查 datastax 构建指南并折腾一些额外的包:http ://datastax.github.io/cpp-driver/主题/建筑/
错误保持不变。我知道datastax的驱动程序通过travis构建的原因是因为make是用他们的c语言编译的,但是当我以前在sudo而不是容器中时,我能够成功地完成整个运行。任何帮助表示赞赏。