使travis从sudo变为容器构建失败

时间:2016-03-17 00:29:11

标签: travis-ci datastax-php-driver

我有一个依赖于datastax php-driver的项目: https://github.com/datastax/php-driver

我已成功使用此驱动器用于PHP 5.6和travis。 我想切换到容器构建,因为php驱动器的所有者已经设法这样做了(也使得构建得更快是一种奖励)。

我遇到了以下错误:

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/topics/building/

错误保持不变。我知道datastax的驱动程序通过travis构建的原因是因为make是用他们的c语言编译的,但是当我以前在sudo而不是容器中时,我能够成功完成整个运行。任何帮助表示赞赏。

0 个答案:

没有答案