diff --git a/.circleci/config.yml b/.circleci/config.yml index 8101c3fba5e8..5ef481e1ae8e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,30 +1,43 @@ version: 2 jobs: - build: + no_pic: working_directory: ~/dmd docker: - image: circleci/node:4.8.2 parallelism: 2 - branches: - ignore: - - dmd-1.x steps: - checkout - run: command: ./.circleci/run.sh install-deps - name: Install DMD - - run: - command: sudo apt-get update && sudo apt-get install gdb - name: Install GDB + name: Install dependencies - run: + # needs to be a separate step, s.t. `run.sh` gets updated too command: ./.circleci/run.sh setup-repos - name: Clone DRuntime & Phobos + name: Merge with upstream + clone DRuntime & Phobos - run: - command: ./.circleci/run.sh coverage - name: Run testsuite with -cov + command: ./.circleci/run.sh all + name: Run all + pic: + working_directory: ~/dmd + docker: + # See: https://github.com/wilzbach/dlang-docker/blob/master/circleci/dlang.docker + - image: dlang2/dmd-circleci:2.078.0 + steps: + - checkout + - run: + # this is needed to "fix" the Docker permission errors - see https://github.com/dlang/dmd/pull/7579 + command: sudo ls -l /dlang/dmd-2.078.0/linux && sudo ls -l /dlang/dmd-2.078.0/src + name: Test Docker image - run: - command: ./.circleci/run.sh check-clean-git - name: Check for temporary files generated by the test suite + # needs to be a separate step, s.t. `run.sh` gets updated too + command: ./.circleci/run.sh setup-repos + name: Merge with upstream + clone DRuntime & Phobos - run: - command: ./.circleci/run.sh codecov - name: Upload coverage files to CodeCov + command: ./.circleci/run.sh all + name: Run all +workflows: + version: 2 + all: + jobs: + - pic + - no_pic diff --git a/.circleci/run.sh b/.circleci/run.sh index 54942e50bc60..dd83e827a6a0 100755 --- a/.circleci/run.sh +++ b/.circleci/run.sh @@ -6,12 +6,23 @@ HOST_DMD_VER=2.072.2 # same as in dmd/src/posix.mak CURL_USER_AGENT="CirleCI $(curl --version | head -n 1)" N=4 CIRCLE_NODE_INDEX=${CIRCLE_NODE_INDEX:-0} +CIRCLE_STAGE=${CIRCLE_STAGE:-pic} CIRCLE_PROJECT_REPONAME=${CIRCLE_PROJECT_REPONAME:-dmd} BUILD="debug" - -case $CIRCLE_NODE_INDEX in - 0) MODEL=64 ;; - 1) MODEL=32 ;; +DMD=dmd +PIC=1 + +case $CIRCLE_STAGE in + pic) + MODEL=64 + PIC=1 + ;; + no_pic) + PIC=0 + case $CIRCLE_NODE_INDEX in + 0) MODEL=64 ;; + 1) MODEL=32 ;; + esac esac # clone druntime and phobos @@ -49,9 +60,11 @@ download() { } install_deps() { + sudo apt-get update --quiet=2 if [ $MODEL -eq 32 ]; then - sudo apt-get update --quiet=2 - sudo apt-get install g++-multilib --assume-yes --quiet=2 + sudo apt-get install g++-multilib gdb --assume-yes --quiet=2 + else + sudo apt-get install gdb --assume-yes --quiet=2 fi download "https://dlang.org/install.sh" "https://nightlies.dlang.org/install.sh" "install.sh" @@ -93,12 +106,14 @@ setup_repos() { coverage() { # load environment for bootstrap compiler - source "$(CURL_USER_AGENT=\"$CURL_USER_AGENT\" bash ~/dlang/install.sh dmd-$HOST_DMD_VER --activate)" + if [ -f ~/dlang/install.sh ] ; then + source "$(CURL_USER_AGENT=\"$CURL_USER_AGENT\" bash ~/dlang/install.sh dmd-$HOST_DMD_VER --activate)" + fi # build dmd, druntime, and phobos - make -j$N -C src -f posix.mak MODEL=$MODEL HOST_DMD=$DMD BUILD=$BUILD ENABLE_WARNINGS=1 all - make -j$N -C ../druntime -f posix.mak MODEL=$MODEL - make -j$N -C ../phobos -f posix.mak MODEL=$MODEL + make -j$N -C src -f posix.mak MODEL=$MODEL HOST_DMD=$DMD BUILD=$BUILD ENABLE_WARNINGS=1 PIC="$PIC" all + make -j$N -C ../druntime -f posix.mak MODEL=$MODEL PIC="$PIC" + make -j$N -C ../phobos -f posix.mak MODEL=$MODEL PIC="$PIC" # FIXME # Temporarily the failing long file name test has been removed @@ -113,12 +128,12 @@ coverage() mkdir -p _${build_path} cp $build_path/dmd _${build_path}/host_dmd cp $build_path/dmd.conf _${build_path} - make -j$N -C src -f posix.mak MODEL=$MODEL HOST_DMD=../_${build_path}/host_dmd clean - make -j$N -C src -f posix.mak MODEL=$MODEL HOST_DMD=../_${build_path}/host_dmd ENABLE_COVERAGE=1 ENABLE_WARNINGS=1 + make -j$N -C src -f posix.mak MODEL=$MODEL HOST_DMD=../_${build_path}/host_dmd PIC="$PIC" clean + make -j$N -C src -f posix.mak MODEL=$MODEL HOST_DMD=../_${build_path}/host_dmd ENABLE_COVERAGE=1 ENABLE_WARNINGS=1 PIC="$PIC" cp $build_path/dmd _${build_path}/host_dmd_cov - make -j1 -C src -f posix.mak MODEL=$MODEL HOST_DMD=../_${build_path}/host_dmd_cov ENABLE_COVERAGE=1 unittest - make -j1 -C test MODEL=$MODEL ARGS="-O -inline -release" DMD_TEST_COVERAGE=1 + make -j1 -C src -f posix.mak MODEL=$MODEL HOST_DMD=../_${build_path}/host_dmd_cov ENABLE_COVERAGE=1 PIC="$PIC" unittest + make -j1 -C test MODEL=$MODEL ARGS="-O -inline -release" DMD_TEST_COVERAGE=1 PIC="$PIC" } # Checks that all files have been committed and no temporary, untracked files exist. @@ -146,7 +161,15 @@ codecov() case $1 in install-deps) install_deps ;; setup-repos) setup_repos ;; - coverage) coverage ;; - check-clean-git) check_clean_git;; - codecov) codecov ;; + coverage) echo "removed" ;; + check-clean-git) echo "removed" ;; + codecov) + echo "removed - use 'all'" + # Fall-through is used to maintain compatibility with the existing PRs + ;& + all) + coverage; + check_clean_git; + codecov; + ;; esac diff --git a/test/Makefile b/test/Makefile index 5f1a157258a9..ddb705495cc7 100644 --- a/test/Makefile +++ b/test/Makefile @@ -178,6 +178,7 @@ else endif export DFLAGS endif +REQUIRED_ARGS+=$(PIC_FLAG) ifeq ($(OS),osx) ifeq ($(MODEL),64)