Skip to content

Commit 8ece1fa

Browse files
committed
Use a special D docker image for CircleCi
1 parent 636c4a6 commit 8ece1fa

2 files changed

Lines changed: 59 additions & 35 deletions

File tree

.circleci/config.yml

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,33 @@
11
version: 2
22
jobs:
3-
build:
3+
no_pic:
44
working_directory: ~/dmd
55
docker:
66
- image: circleci/node:4.8.2
77
parallelism: 2
8-
branches:
9-
ignore:
10-
- dmd-1.x
118
steps:
129
- checkout
1310
- run:
1411
command: ./.circleci/run.sh install-deps
15-
name: Install DMD
12+
name: Install dependencies
1613
- run:
17-
command: sudo apt-get update && sudo apt-get install gdb
18-
name: Install GDB
19-
- run:
20-
command: ./.circleci/run.sh setup-repos
21-
name: Clone DRuntime & Phobos
22-
- run:
23-
command: ./.circleci/run.sh coverage
24-
name: Run testsuite with -cov
14+
command: ./.circleci/run.sh all
15+
name: Run all
16+
pic:
17+
working_directory: ~/dmd
18+
docker:
19+
- image: dlang2/dmd-circleci:2.078.0
20+
steps:
21+
- checkout
2522
- run:
26-
command: ./.circleci/run.sh check-clean-git
27-
name: Check for temporary files generated by the test suite
23+
# this is needed to "fix" the Docker permission errors - see https://github.com/dlang/dmd/pull/7579
24+
command: sudo ls -l /dlang/dmd-2.078.0/linux && sudo ls -l /dlang/dmd-2.078.0/src
25+
name: Test Docker image
2826
- run:
29-
command: ./.circleci/run.sh codecov
30-
name: Upload coverage files to CodeCov
27+
command: ./.circleci/run.sh all
28+
workflows:
29+
version: 2
30+
all:
31+
jobs:
32+
- pic
33+
- no_pic

.circleci/run.sh

Lines changed: 39 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,23 @@ HOST_DMD_VER=2.072.2 # same as in dmd/src/posix.mak
66
CURL_USER_AGENT="CirleCI $(curl --version | head -n 1)"
77
N=4
88
CIRCLE_NODE_INDEX=${CIRCLE_NODE_INDEX:-0}
9+
CIRCLE_STAGE=${CIRCLE_STAGE:-pic}
910
CIRCLE_PROJECT_REPONAME=${CIRCLE_PROJECT_REPONAME:-dmd}
1011
BUILD="debug"
11-
12-
case $CIRCLE_NODE_INDEX in
13-
0) MODEL=64 ;;
14-
1) MODEL=32 ;;
12+
DMD=dmd
13+
PIC=1
14+
15+
case $CIRCLE_STAGE in
16+
pic)
17+
MODEL=64
18+
PIC=1
19+
;;
20+
no_pic)
21+
PIC=0
22+
case $CIRCLE_NODE_INDEX in
23+
0) MODEL=64 ;;
24+
1) MODEL=32 ;;
25+
esac
1526
esac
1627

1728
# clone druntime and phobos
@@ -49,9 +60,11 @@ download() {
4960
}
5061

5162
install_deps() {
63+
sudo apt-get update --quiet=2
5264
if [ $MODEL -eq 32 ]; then
53-
sudo apt-get update --quiet=2
54-
sudo apt-get install g++-multilib --assume-yes --quiet=2
65+
sudo apt-get install g++-multilib gdb --assume-yes --quiet=2
66+
else
67+
sudo apt-get install gdb --assume-yes --quiet=2
5568
fi
5669

5770
download "https://dlang.org/install.sh" "https://nightlies.dlang.org/install.sh" "install.sh"
@@ -93,12 +106,14 @@ setup_repos() {
93106
coverage()
94107
{
95108
# load environment for bootstrap compiler
96-
source "$(CURL_USER_AGENT=\"$CURL_USER_AGENT\" bash ~/dlang/install.sh dmd-$HOST_DMD_VER --activate)"
109+
if [ -f ~/dlang/install.sh ] ; then
110+
source "$(CURL_USER_AGENT=\"$CURL_USER_AGENT\" bash ~/dlang/install.sh dmd-$HOST_DMD_VER --activate)"
111+
fi
97112
98113
# build dmd, druntime, and phobos
99-
make -j$N -C src -f posix.mak MODEL=$MODEL HOST_DMD=$DMD BUILD=$BUILD ENABLE_WARNINGS=1 all
100-
make -j$N -C ../druntime -f posix.mak MODEL=$MODEL
101-
make -j$N -C ../phobos -f posix.mak MODEL=$MODEL
114+
make -j$N -C src -f posix.mak MODEL=$MODEL HOST_DMD=$DMD BUILD=$BUILD ENABLE_WARNINGS=1 PIC="$PIC" all
115+
make -j$N -C ../druntime -f posix.mak MODEL=$MODEL PIC="$PIC"
116+
make -j$N -C ../phobos -f posix.mak MODEL=$MODEL PIC="$PIC"
102117
103118
# FIXME
104119
# Temporarily the failing long file name test has been removed
@@ -113,12 +128,12 @@ coverage()
113128
mkdir -p _${build_path}
114129
cp $build_path/dmd _${build_path}/host_dmd
115130
cp $build_path/dmd.conf _${build_path}
116-
make -j$N -C src -f posix.mak MODEL=$MODEL HOST_DMD=../_${build_path}/host_dmd clean
117-
make -j$N -C src -f posix.mak MODEL=$MODEL HOST_DMD=../_${build_path}/host_dmd ENABLE_COVERAGE=1 ENABLE_WARNINGS=1
131+
make -j$N -C src -f posix.mak MODEL=$MODEL HOST_DMD=../_${build_path}/host_dmd PIC="$PIC" clean
132+
make -j$N -C src -f posix.mak MODEL=$MODEL HOST_DMD=../_${build_path}/host_dmd ENABLE_COVERAGE=1 ENABLE_WARNINGS=1 PIC="$PIC"
118133
119134
cp $build_path/dmd _${build_path}/host_dmd_cov
120-
make -j1 -C src -f posix.mak MODEL=$MODEL HOST_DMD=../_${build_path}/host_dmd_cov ENABLE_COVERAGE=1 unittest
121-
make -j1 -C test MODEL=$MODEL ARGS="-O -inline -release" DMD_TEST_COVERAGE=1
135+
make -j1 -C src -f posix.mak MODEL=$MODEL HOST_DMD=../_${build_path}/host_dmd_cov ENABLE_COVERAGE=1 PIC="$PIC" unittest
136+
make -j1 -C test MODEL=$MODEL ARGS="-O -inline -release" DMD_TEST_COVERAGE=1 PIC="$PIC"
122137
}
123138
124139
# Checks that all files have been committed and no temporary, untracked files exist.
@@ -145,8 +160,14 @@ codecov()
145160
146161
case $1 in
147162
install-deps) install_deps ;;
148-
setup-repos) setup_repos ;;
149-
coverage) coverage ;;
150-
check-clean-git) check_clean_git;;
151-
codecov) codecov ;;
163+
setup-repos) echo "removed" ;;
164+
coverage) echo "removed" ;;
165+
check-clean-git) echo "removed" ;;
166+
codecov) echo "removed" ;;
167+
all)
168+
setup_repos;
169+
coverage;
170+
check_clean_git;
171+
codecov;
172+
;;
152173
esac

0 commit comments

Comments
 (0)