diff --git a/.cirrus.yml b/.cirrus.yml index 0b0ce41bea..09bc07bb79 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -2,8 +2,6 @@ common_steps_template: &COMMON_STEPS_TEMPLATE install_prerequisites_script: ./cirrusci.sh install_host_compiler_script: | set -uexo pipefail - # kludge for ci.sh - if [ "${DMD:0:4}" == "gdmd" ]; then export DMD="gdmd"; fi compiler="$DMD" if [ -n "${D_VERSION+x}" ]; then compiler="$DMD-$D_VERSION"; fi ./ci.sh install_d "$compiler" @@ -46,7 +44,6 @@ task: - TASK_NAME_SUFFIX: x64, LDC DMD: ldc - TASK_NAME_SUFFIX: x64, GDC - GDC_VERSION: 9 DMD: gdmd-9 << : *COMMON_STEPS_TEMPLATE diff --git a/ci.sh b/ci.sh index aee5c857e3..0c3b4dc9ba 100755 --- a/ci.sh +++ b/ci.sh @@ -172,23 +172,24 @@ download_install_sh() { } install_d() { - if [ "${DMD:-dmd}" == "gdc" ] || [ "${DMD:-dmd}" == "gdmd" ] ; then - export DMD=gdmd-${GDC_VERSION} - if [ ! -e ~/dlang/gdc-${GDC_VERSION}/activate ] ; then + local compiler="$1" + if [ "${compiler:0:5}" == "gdmd-" ] ; then + local gdc_version="${compiler:5}" + if [ ! -e ~/dlang/gdc-$gdc_version/activate ] ; then sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test sudo apt-get update - sudo apt-get install -y gdc-${GDC_VERSION} + sudo apt-get install -y gdc-$gdc_version # fetch the dmd-like wrapper - sudo wget https://raw.githubusercontent.com/D-Programming-GDC/GDMD/master/dmd-script -O /usr/bin/gdmd-${GDC_VERSION} - sudo chmod +x /usr/bin/gdmd-${GDC_VERSION} + sudo curl -fsSL -A "$CURL_USER_AGENT" --connect-timeout 5 --speed-time 30 --speed-limit 1024 --retry 5 --retry-delay 5 https://raw.githubusercontent.com/D-Programming-GDC/GDMD/master/dmd-script -o /usr/bin/gdmd-$gdc_version + sudo chmod +x /usr/bin/gdmd-$gdc_version # fake install script and create a fake 'activate' script - mkdir -p ~/dlang/gdc-${GDC_VERSION} - echo "deactivate(){ echo;}" > ~/dlang/gdc-${GDC_VERSION}/activate + mkdir -p ~/dlang/gdc-$gdc_version + echo "deactivate(){ echo;}" > ~/dlang/gdc-$gdc_version/activate fi else local install_sh="install.sh" download_install_sh "$install_sh" - CURL_USER_AGENT="$CURL_USER_AGENT" bash "$install_sh" "$1" + CURL_USER_AGENT="$CURL_USER_AGENT" bash "$install_sh" "$compiler" fi } diff --git a/cirrusci.sh b/cirrusci.sh index 5fabef2965..e67494676d 100755 --- a/cirrusci.sh +++ b/cirrusci.sh @@ -22,7 +22,7 @@ if [ "$OS_NAME" == "linux" ]; then fi if [ "${DMD:0:4}" == "gdmd" ]; then # ci.sh uses `sudo add-apt-repository ...` to add a PPA repo - packages="$packages sudo software-properties-common wget" + packages="$packages sudo software-properties-common" fi apt-get -q update apt-get install -yq $packages diff --git a/semaphoreci.sh b/semaphoreci.sh index 1de4b3d916..f3fc9a346a 100755 --- a/semaphoreci.sh +++ b/semaphoreci.sh @@ -30,17 +30,19 @@ else fi export BRANCH -################################################################################ -# Install D host compiler -################################################################################ - -./ci.sh install_d "$DMD" - ################################################################################ # Define commands ################################################################################ case $1 in - setup) ./ci.sh setup_repos ;; - testsuite) ./ci.sh testsuite ;; + setup) + ./ci.sh setup_repos + ;; + testsuite) + if [ "$DMD" == "gdc" ] || [ "$DMD" == "gdmd" ] ; then + export DMD=gdmd-$GDC_VERSION + fi + ./ci.sh install_d "$DMD" + ./ci.sh testsuite + ;; esac