Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 28 additions & 15 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,43 @@
version: 2
jobs:
build:
no_pic:
working_directory: ~/dmd
docker:
- image: circleci/node:4.8.2
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could replace this with a D Docker image that doesn't require -fPIC, e.g. https://github.com/wilzbach/dlang-docker/blob/master/circleci/dlang.docker built for Ubuntu 14.04, but this should be more than fine for now (it's the existing status quo after all).

parallelism: 2
branches:
ignore:
- dmd-1.x
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This didn't work with the new workflow setting and AFAICT is only required for the respective branch anyways.

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
57 changes: 40 additions & 17 deletions .circleci/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand All @@ -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.
Expand Down Expand Up @@ -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
1 change: 1 addition & 0 deletions test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ else
endif
export DFLAGS
endif
REQUIRED_ARGS+=$(PIC_FLAG)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After the other PRs that's all that's needed to fix the test suite for -fPIC :)


ifeq ($(OS),osx)
ifeq ($(MODEL),64)
Expand Down