forked from ldc-developers/ldc
-
Notifications
You must be signed in to change notification settings - Fork 10
/
shippable.yml
165 lines (159 loc) · 6.19 KB
/
shippable.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
language: c
compiler:
- gcc
runtime:
nodePool: shippable_shared_aarch64
# git clone depth
depth: 50
env:
global:
- secure: RQ6gpJFPBDGVlnz+ZzSgeMpkcnvcA/7Lzyj/r06fMFR5iOz2cYaImCekNRw2PlhYQ+0FCQ119TLMKNOa7OUu6XxUp5LZtq7pSB6QLe3RB3YysFsosNPlY/wyyRsrW9ICEbDP/X8kPcfrDtOPGS/dGIwgeo0+R4Yl0OLDK9GrExEY45bWgvuLqoWDO89pi31kBk5LG5MAYhHZ0UTdboi5A2GRT0T8M0kr53jBRka8FGkbncXfHp9+/6IjTVJoUduRkdsk0A9RN1KRoao6rtrBNNvwIStc6zxJSOHszoaTp/K/ucGC4InZl/9GHPS/Y78SGKn7YJv3tGmcGzqAxrVaXQ==
matrix:
- LLVM_VERSION=9.0.0
HOST_LDC_VERSION=1.14.0
EXTRA_CMAKE_FLAGS="-DBUILD_LTO_LIBS=ON -DCMAKE_EXE_LINKER_FLAGS=-static-libstdc++ -DLDC_INSTALL_LTOPLUGIN=ON -DLDC_INSTALL_LLVM_RUNTIME_LIBS=ON -DLDC_INSTALL_LLVM_RUNTIME_LIBS_ARCH=aarch64"
build:
ci:
- export DEBIAN_FRONTEND=noninteractive
- apt-get -q update
- |
apt-get -yq install \
git-core cmake ninja-build \
libcurl3 libcurl4-openssl-dev \
curl gdb p7zip-full python-pip tzdata unzip zip
- update-alternatives --install /usr/bin/ld ld /usr/bin/ld.gold 99
- pip install --user lit
# Download & extract host LDC
- curl -L -o ldc2.tar.xz https://github.com/ldc-developers/ldc/releases/download/v$HOST_LDC_VERSION/ldc2-$HOST_LDC_VERSION-linux-aarch64.tar.xz
- mkdir host-ldc
- tar -xf ldc2.tar.xz --strip 1 -C host-ldc
- rm ldc2.tar.xz
# Download & extract LDC-flavoured LLVM
- |
assertsSuffix=""
if [ "$IS_GIT_TAG" = "false" ]; then
echo 'Using LLVM with enabled assertions'
assertsSuffix="-withAsserts"
fi
curl -L -o llvm.tar.xz https://github.com/ldc-developers/llvm/releases/download/ldc-v$LLVM_VERSION/llvm-$LLVM_VERSION-linux-aarch64$assertsSuffix.tar.xz
- mkdir llvm
- tar -xf llvm.tar.xz --strip 1 -C llvm
- rm llvm.tar.xz
# Build bootstrap LDC
- cmake --version
- ninja --version
- mkdir bootstrap-ldc
- cd bootstrap-ldc
- |
cmake -G Ninja .. \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_ROOT_DIR=$PWD/../llvm \
-DD_COMPILER=$PWD/../host-ldc/bin/ldmd2 \
-DBUILD_SHARED_LIBS=OFF \
-DCOMPILE_D_MODULES_SEPARATELY=ON \
-DCOMPILE_ALL_D_FILES_AT_ONCE=OFF
- ninja -j32
- bin/ldc2 --version
- cd ..
# Build LDC & LDC D unittests
- |
set -x
installDir=$PWD/install
mkdir build
cd build
cmake -G Ninja .. \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_ROOT_DIR=$PWD/../llvm \
-DD_COMPILER=$PWD/../bootstrap-ldc/bin/ldmd2 \
-DCMAKE_INSTALL_PREFIX=$installDir \
-DINCLUDE_INSTALL_DIR=$installDir/import \
-DCOMPILE_ALL_D_FILES_AT_ONCE=OFF \
$EXTRA_CMAKE_FLAGS
set +x
- ninja -j32 all ldc2-unittest
- bin/ldc2 --version
# Build defaultlib unittest runners
- ninja -j16 all-test-runners
# Run LDC D unittests
- ctest --output-on-failure -R "ldc2-unittest"
# Run LIT testsuite, ignore the errors
- PATH=$PWD/../llvm/bin:$PATH ctest -V -R "lit-tests" || true
# Run DMD testsuite (non-debug only for now), ignore the errors
- DMD_TESTSUITE_MAKE_ARGS='-j16 -k' ctest -V -R "dmd-testsuite" -E "-debug$" || true
# Run defaultlib unittests (non-debug only for now, excl. hanging core.thread)
# & druntime stand-alone tests, ignore the errors
- ctest -j16 --output-on-failure -E "dmd-testsuite|lit-tests|ldc2-unittest|-debug(-shared)?$|^core.thread($|-)" || true
# Install LDC & make portable
- ninja install > /dev/null
- cd ..
- perl -pi -e s?$PWD/install/?%%ldcbinarypath%%/../?g install/etc/ldc2.conf
- cat install/etc/ldc2.conf
- cp LICENSE install
- cp packaging/README install
# Now rename the installation dir to test portability
- mv install installed
# Run hello-world integration test with shared libs
- echo 'void main() { import std.stdio; writefln("Hello world, %d bits", size_t.sizeof * 8); }' > hello.d
- installed/bin/ldc2 hello.d -of=hello -link-defaultlib-shared
- ./hello
# Run hello-world integration test with LTO
# FIXME: these broke with LLVM 8 (failing assertions)
#- installed/bin/ldc2 hello.d -of=hello_thin -flto=thin -defaultlib=phobos2-ldc-lto,druntime-ldc-lto
#- ./hello_thin
#- installed/bin/ldc2 hello.d -of=hello_full -flto=full -defaultlib=phobos2-ldc-lto,druntime-ldc-lto
#- ./hello_full
# Run dynamic-compile integration test
- installed/bin/ldc2 -enable-dynamic-compile -run tests/dynamiccompile/array.d
# Build & copy dub
- export DMD=$PWD/installed/bin/ldmd2
- git clone --recursive https://github.com/dlang/dub.git
- cd dub
- git checkout "$(cat ../packaging/dub_version)"
- |
if [ "$IS_GIT_TAG" = "false" ]; then
# FIXME: dub is built with `-g -O`, which leads to issue #2361 with enabled
# assertions, at least on Linux. So strip `-g` for untagged builds.
perl -pi -e "s? -g -O ? -O ?g" build.sh
fi
- ./build.sh
- cp bin/dub ../installed/bin
- cd ..
- installed/bin/dub --version
# Build & copy dlang tools
- git clone --recursive https://github.com/dlang/tools.git dlang-tools
- cd dlang-tools
- |
make -f posix.mak -j16 install \
DMD=$PWD/../installed/bin/ldmd2 \
DMD_DIR=$PWD/../tests/d2 \
DFLAGS="-w -de" \
INSTALL_DIR=$PWD
- cp bin/{rdmd,ddemangle,dustmite} ../installed/bin
- cd ..
# Pack installation dir
- |
if [ "$IS_GIT_TAG" = "true" ]; then
artifactID=${GIT_TAG_NAME:1}
else
artifactID=${COMMIT:0:8}
fi
artifactName=ldc2-$artifactID-linux-aarch64
mv installed $artifactName
artifact=$artifactName.tar.xz
tar -cf - $artifactName | 7za a $artifact -si -txz -mx9
ls -l $artifact
# Upload to GitHub release (only for commits on the master branch and tags)
- |
if [ "$IS_GIT_TAG" = "true" ]; then
tools/upload-to-github.sh $GIT_TAG_NAME ldc2-*.tar.xz
elif [[ "$IS_PULL_REQUEST" = "false" && "$BRANCH" = "master" ]]; then
tools/upload-to-github.sh CI ldc2-*.tar.xz
fi
integrations:
notifications:
- integrationName: email
type: email
on_success: never
on_failure: never
on_cancel: never
on_pull_request: never