diff --git a/.ci/run.py b/.ci/run.py index ee572f49..9c62eaac 100644 --- a/.ci/run.py +++ b/.ci/run.py @@ -9,9 +9,11 @@ import sys import tempfile import uuid +import re from collections import OrderedDict from contextlib import contextmanager from packaging import version +from subprocess import PIPE import colorama from conans.client.tools.scm import Git @@ -29,7 +31,7 @@ def is_appveyor(): def appveyor_image(): return os.getenv("APPVEYOR_BUILD_WORKER_IMAGE","") - + @contextmanager def chdir(dir_path): @@ -93,7 +95,7 @@ def get_build_list(): build = [it for it in files if "build.py" in it] if not build: build = [it for it in files if os.path.basename(it) == script] - + if build: builds.append(os.path.join(root, build[0])) dirs[:] = [] @@ -182,21 +184,26 @@ def run_scripts(scripts): with chdir(os.path.dirname(script)): print_build(script) build_script = [sys.executable, abspath] if abspath.endswith(".py") else abspath - + # Need to initialize the cache with default files if they are not already there try: subprocess.call(['conan', 'install', 'foobar/foobar@conan/stable'], env=env, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) except: pass - + with ensure_python_environment_preserved(): with ensure_cache_preserved(): - result = subprocess.call(build_script, env=env) - - results[script] = result - if result != 0 and FAIL_FAST: - break + process = subprocess.run(build_script, env=env, stdout=PIPE, stderr=PIPE) + + results[script] = process.returncode + if process.returncode != 0: + if re.search(r'Current Conan version \(.*\) does not satisfy the defined one' + , process.stderr.decode()): + results[script] = "skip" + elif FAIL_FAST: + break + return results @@ -213,12 +220,14 @@ def print_results(results): def get_result_message(result): if result == 0: return colorama.Fore.GREEN + "SUCCESS" + colorama.Style.RESET_ALL + elif result == "skip": + return colorama.Fore.YELLOW + "SKIP" + colorama.Style.RESET_ALL return colorama.Fore.RED + "FAILURE" + colorama.Style.RESET_ALL def validate_results(results): for value in results.values(): - if value != 0: + if value != 0 and value != "skip": sys.exit(value) diff --git a/.ci/travis/before_install.sh b/.ci/travis/before_install.sh index bcd0651d..e4764e0f 100755 --- a/.ci/travis/before_install.sh +++ b/.ci/travis/before_install.sh @@ -4,10 +4,10 @@ set -e set -x if [ "$TRAVIS_OS_NAME" == "osx" ]; then - brew update - brew install openssl readline + brew update || brew update brew outdated pyenv || brew upgrade pyenv brew install pyenv-virtualenv + brew install openssl readline if which pyenv > /dev/null; then eval "$(pyenv init -)"; fi if which pyenv > /dev/null; then eval "$(pyenv init -)"; fi @@ -47,4 +47,4 @@ if [ "$TRAVIS_OS_NAME" == "osx" ]; then pyenv activate conan python --version -fi \ No newline at end of file +fi diff --git a/.ci/travis/requirements.txt b/.ci/travis/requirements.txt new file mode 100644 index 00000000..ae094b1b --- /dev/null +++ b/.ci/travis/requirements.txt @@ -0,0 +1,4 @@ +tox +tox-venv +tox-travis +requests diff --git a/.travis.yml b/.travis.yml index eb34cc9c..c1eb6fac 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,11 +1,20 @@ -sudo: false -language: python -dist: trusty - jobs: fast_finish: true include: + # Macos is slow, only if everything has passed + - stage: Macos - All Conan versions + name: Conan develop - Python 3.8 + language: generic + os: osx + osx_image: xcode12 + env: PYVER=py38 TOXENV=py38-conandev + - name: Conan Current - Python 3.8 + language: generic + os: osx + osx_image: xcode12 + env: PYVER=py38 TOXENV=py38-conancurrent + - stage: Linux - Conan develop name: Python 3.5 python: 3.5 @@ -47,41 +56,11 @@ jobs: env: TOXENV=py38-conanprevprev dist: xenial - # Macos is slow, only if everything has passed - - stage: Macos - All Conan versions - name: Conan develop - Python 3.8 - language: generic - os: osx - osx_image: xcode10 - env: PYVER=py38 TOXENV=py38-conandev - - name: Conan Current - Python 3.5 - language: generic - os: osx - osx_image: xcode10 - env: PYVER=py35 TOXENV=py35-conancurrent - - name: Conan Current - Python 3.8 - language: generic - os: osx - osx_image: xcode10 - env: PYVER=py38 TOXENV=py38-conancurrent -before_install: - - ./.ci/travis/before_install.sh - install: - - | - if [[ "$(uname -s)" == 'Darwin' ]]; then - if which pyenv > /dev/null; then eval "$(pyenv init -)"; fi - pyenv activate conan; - fi - pip install --upgrade pip - - pip install tox tox-venv tox-travis requests + - pip install -r .ci/travis/requirements.txt script: - - | - if [[ "$(uname -s)" == 'Darwin' ]]; then - if which pyenv > /dev/null; then eval "$(pyenv init -)"; fi - pyenv activate conan - fi - python .ci/last_conan_version.py - - tox + - travis_wait 30 tox -v diff --git a/features/integrate_build_system/build.py b/features/integrate_build_system/build.py old mode 100644 new mode 100755 diff --git a/libraries/dear-imgui/basic/build.sh b/libraries/dear-imgui/basic/build.sh index a09a066e..56d26a90 100755 --- a/libraries/dear-imgui/basic/build.sh +++ b/libraries/dear-imgui/basic/build.sh @@ -8,6 +8,6 @@ mkdir build pushd build export CONAN_SYSREQUIRES_MODE=enabled -conan install .. +conan install .. --build=missing cmake .. -DCMAKE_BUILD_TYPE=Release cmake --build . diff --git a/libraries/folly/basic/build.sh b/libraries/folly/basic/build.sh index beb282c0..1bd5aa9f 100755 --- a/libraries/folly/basic/build.sh +++ b/libraries/folly/basic/build.sh @@ -7,7 +7,7 @@ rm -rf build mkdir build pushd build -conan install .. +conan install .. --build=missing cmake .. -DCMAKE_BUILD_TYPE=Release cmake --build . diff --git a/libraries/protobuf/serialization/build.sh b/libraries/protobuf/serialization/build.sh index c4b20ab5..06507f04 100755 --- a/libraries/protobuf/serialization/build.sh +++ b/libraries/protobuf/serialization/build.sh @@ -7,7 +7,7 @@ rm -rf build mkdir build pushd build -conan install .. +conan install .. --build=missing cmake .. -DCMAKE_BUILD_TYPE=Release cmake --build .