This repository was archived by the owner on Jan 7, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy path.buildbot.sh
More file actions
46 lines (36 loc) · 1.34 KB
/
.buildbot.sh
File metadata and controls
46 lines (36 loc) · 1.34 KB
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
#!/bin/sh
#
# Build script for continuous integration.
set -e
case ${CI_TRACER_KIND} in
"sw" | "hw" ) true;;
*) echo "CI_TRACER_KIND must be set to either 'hw' or 'sw'"
exit 1;;
esac
export PATH=PATH=/opt/gdb-8.2/bin:${PATH}
COMMIT_HASH=$(git rev-parse --short HEAD)
TARBALL_TOPDIR=`pwd`/build/ykrustc-stage2-latest
TARBALL_NAME=ykrustc-${CI_TRACER_KIND}-stage2-${COMMIT_HASH}.tar.bz2
SYMLINK_NAME=ykrustc-${CI_TRACER_KIND}-stage2-latest.tar.bz2
SNAP_DIR=/opt/ykrustc-bin-snapshots
# Ensure the build fails if it uses excessive amounts of memory.
ulimit -d $((1024 * 1024 * 10)) # 10 GiB
# Note that the gdb must be Python enabled.
/usr/bin/time -v ./x.py test --config .buildbot.config.toml --stage 2
# Build extended tools and install into TARBALL_TOPDIR.
mkdir -p ${TARBALL_TOPDIR}
/usr/bin/time -v ./x.py install --config .buildbot.config.toml
# Check that the install looks feasible.
for i in rustc cargo rustdoc; do
test -e ${TARBALL_TOPDIR}/bin/${i}
done
# Archive the build and put it in /opt
git show -s HEAD > ${TARBALL_TOPDIR}/VERSION
cd build
tar jcf ${TARBALL_NAME} `basename ${TARBALL_TOPDIR}`
chmod 775 ${TARBALL_NAME}
mv ${TARBALL_NAME} ${SNAP_DIR}
ln -sf ${SNAP_DIR}/${TARBALL_NAME} ${SNAP_DIR}/${SYMLINK_NAME}
# Remove all but the 10 latest builds
cd ${SNAP_DIR}
sh -c "ls -tp | grep -v '/$' | tail -n +11 | xargs -I {} rm -- {}"