diff --git a/.travis.yml b/.travis.yml index 7ea0706..c063f54 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,6 +16,11 @@ env: before_install: + # Fast finish the PR. + - | + (curl https://raw.githubusercontent.com/conda-forge/conda-forge-build-setup-feedstock/master/recipe/ff_ci_pr_build.py | \ + python - -v --ci "travis" "${TRAVIS_REPO_SLUG}" "${TRAVIS_BUILD_NUMBER}" "${TRAVIS_PULL_REQUEST}") || exit 1 + # Remove homebrew. - | echo "" diff --git a/ci_support/fast_finish_ci_pr_build.sh b/ci_support/fast_finish_ci_pr_build.sh new file mode 100755 index 0000000..463c27f --- /dev/null +++ b/ci_support/fast_finish_ci_pr_build.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +curl https://raw.githubusercontent.com/conda-forge/conda-forge-build-setup-feedstock/master/recipe/ff_ci_pr_build.py | \ + python - -v --ci "circle" "${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}" "${CIRCLE_BUILD_NUM}" "${CIRCLE_PR_NUMBER}" diff --git a/ci_support/run_docker_build.sh b/ci_support/run_docker_build.sh index 535683d..391d120 100755 --- a/ci_support/run_docker_build.sh +++ b/ci_support/run_docker_build.sh @@ -24,14 +24,30 @@ show_channel_urls: true CONDARC ) +# In order for the conda-build process in the container to write to the mounted +# volumes, we need to run with the same id as the host machine, which is +# normally the owner of the mounted volumes, or at least has write permission +HOST_USER_ID=$(id -u) +# Check if docker-machine is being used (normally on OSX) and get the uid from +# the VM +if hash docker-machine 2> /dev/null && docker-machine active > /dev/null; then + HOST_USER_ID=$(docker-machine ssh $(docker-machine active) id -u) +fi + +rm -f "$FEEDSTOCK_ROOT/build_artefacts/conda-forge-build-done" + cat << EOF | docker run -i \ -v "${RECIPE_ROOT}":/recipe_root \ -v "${FEEDSTOCK_ROOT}":/feedstock_root \ + -e HOST_USER_ID="${HOST_USER_ID}" \ -a stdin -a stdout -a stderr \ condaforge/linux-anvil \ - bash || exit $? + bash || exit 1 +set -e +set +x export BINSTAR_TOKEN=${BINSTAR_TOKEN} +set -x export PYTHONUNBUFFERED=1 echo "$config" > ~/.condarc @@ -47,4 +63,11 @@ source run_conda_forge_build_setup set +x conda build /recipe_root --quiet || exit 1 upload_or_check_non_existence /recipe_root conda-forge --channel=main || exit 1 +touch /feedstock_root/build_artefacts/conda-forge-build-done EOF + +# double-check that the build got to the end +# see https://github.com/conda-forge/conda-smithy/pull/337 +# for a possible fix +set -x +test -f "$FEEDSTOCK_ROOT/build_artefacts/conda-forge-build-done" || exit 1 diff --git a/circle.yml b/circle.yml index 0c5dcdf..421809c 100644 --- a/circle.yml +++ b/circle.yml @@ -1,5 +1,6 @@ checkout: post: + - ./ci_support/fast_finish_ci_pr_build.sh - ./ci_support/checkout_merge_commit.sh machine: diff --git a/recipe/build.sh b/recipe/build.sh index 7231c02..228250e 100644 --- a/recipe/build.sh +++ b/recipe/build.sh @@ -51,7 +51,9 @@ cmake $src_dir \ make -j $CPU_COUNT >> $BUILD_OUTPUT 2>&1 export ECCODES_TEST_VERBOSE_OUTPUT=1 eval ${LIBRARY_SEARCH_VAR}=$PREFIX/lib +if [[ $(uname) == Linux ]]; then ctest -j $CPU_COUNT >> $BUILD_OUTPUT 2>&1 +fi make install >> $BUILD_OUTPUT 2>&1 # The build finished without returning an error so dump a tail of the output. diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 196741c..a2482c7 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -10,7 +10,7 @@ source: sha256: 1a4112196497b8421480e2a0a1164071221e467853486577c4f07627a702f4c3 build: - number: 0 + number: 1 skip: true # [win] detect_binary_files_with_prefix: true