ci.sh: Rename install_d to install_host_compiler and add some more comments

This commit is contained in:
Martin Kinkelin 2020-10-15 14:16:34 +02:00
parent 88a9f59748
commit ac598b9b60
3 changed files with 8 additions and 5 deletions

View file

@ -1,6 +1,6 @@
common_steps_template: &COMMON_STEPS_TEMPLATE common_steps_template: &COMMON_STEPS_TEMPLATE
install_prerequisites_script: ./cirrusci.sh install_prerequisites_script: ./cirrusci.sh
install_host_compiler_script: ./ci.sh install_d install_host_compiler_script: ./ci.sh install_host_compiler
setup_repos_script: | setup_repos_script: |
set -uexo pipefail set -uexo pipefail
ln -s $CIRRUS_WORKING_DIR ../dmd ln -s $CIRRUS_WORKING_DIR ../dmd

9
ci.sh
View file

@ -98,10 +98,12 @@ test_dmd() {
fi fi
} }
# build and run druntime unit tests
test_druntime() { test_druntime() {
make -j$N -C ../druntime -f posix.mak MODEL=$MODEL unittest make -j$N -C ../druntime -f posix.mak MODEL=$MODEL unittest
} }
# build and run Phobos unit tests
test_phobos() { test_phobos() {
make -j$N -C ../phobos -f posix.mak MODEL=$MODEL unittest make -j$N -C ../phobos -f posix.mak MODEL=$MODEL unittest
} }
@ -179,14 +181,15 @@ download_install_sh() {
done done
} }
install_d() { # install D host compiler
install_host_compiler() {
if [ "${HOST_DC:0:5}" == "gdmd-" ] ; then if [ "${HOST_DC:0:5}" == "gdmd-" ] ; then
local gdc_version="${HOST_DC:5}" local gdc_version="${HOST_DC:5}"
if [ ! -e ~/dlang/gdc-$gdc_version/activate ] ; then if [ ! -e ~/dlang/gdc-$gdc_version/activate ] ; then
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
sudo apt-get update sudo apt-get update
sudo apt-get install -y gdc-$gdc_version sudo apt-get install -y gdc-$gdc_version
# fetch the dmd-like wrapper # fetch the gdmd wrapper for CLI compatibility with dmd
sudo curl -fsSL -A "$CURL_USER_AGENT" --connect-timeout 5 --speed-time 30 --speed-limit 1024 --retry 5 --retry-delay 5 https://raw.githubusercontent.com/D-Programming-GDC/GDMD/master/dmd-script -o /usr/bin/gdmd-$gdc_version sudo curl -fsSL -A "$CURL_USER_AGENT" --connect-timeout 5 --speed-time 30 --speed-limit 1024 --retry 5 --retry-delay 5 https://raw.githubusercontent.com/D-Programming-GDC/GDMD/master/dmd-script -o /usr/bin/gdmd-$gdc_version
sudo chmod +x /usr/bin/gdmd-$gdc_version sudo chmod +x /usr/bin/gdmd-$gdc_version
# fake install script and create a fake 'activate' script # fake install script and create a fake 'activate' script
@ -205,7 +208,7 @@ install_d() {
if [ "$#" -gt 0 ]; then if [ "$#" -gt 0 ]; then
case $1 in case $1 in
install_d) install_d ;; install_host_compiler) install_host_compiler ;;
setup_repos) setup_repos "$2" ;; # ci.sh setup_repos <git branch> setup_repos) setup_repos "$2" ;; # ci.sh setup_repos <git branch>
build) build ;; build) build ;;
rebuild) rebuild "${2:-}" ;; # ci.sh rebuild [1] (use `1` to compare binaries to test reproducible build) rebuild) rebuild "${2:-}" ;; # ci.sh rebuild [1] (use `1` to compare binaries to test reproducible build)

View file

@ -38,6 +38,6 @@ fi
################################################################################ ################################################################################
case $1 in case $1 in
setup) ./ci.sh install_d && ./ci.sh setup_repos "$BRANCH" ;; setup) ./ci.sh install_host_compiler && ./ci.sh setup_repos "$BRANCH" ;;
testsuite) ./ci.sh testsuite ;; testsuite) ./ci.sh testsuite ;;
esac esac