ci/run.sh: Avoid deprecated Makefiles (#15832)

* ci/run.sh: Avoid deprecated Makefiles

* ci/run.sh: Streamline OS_NAME from `darwin` to `osx` on macOS

As DMD uses `osx` as OS in most other places, including the
`generated/osx/release/64` output dir, which is currently wrong
in run.sh's `build_path` and leads to CI failures on macOS.

* GHA: Disable `-debug` for DMD unittests with old host compilers

* GHA: Work around linker errors with -g on macOS 13

See https://issues.dlang.org/show_bug.cgi?id=23517.

compiler/src/posix.mak sets it to 10.9, compiler/test/Makefile to 11.
This commit is contained in:
Martin Kinkelin 2023-11-22 10:41:16 +01:00 committed by GitHub
parent f6802dd63f
commit ed22f5c28f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 15 deletions

View file

@ -6,7 +6,7 @@
set -uexo pipefail
# OS_NAME: linux|darwin|freebsd
# OS_NAME: linux|osx|freebsd
if [ -z ${OS_NAME+x} ] ; then echo "Variable 'OS_NAME' needs to be set."; exit 1; fi
# MODEL: 32|64
if [ -z ${MODEL+x} ] ; then echo "Variable 'MODEL' needs to be set."; exit 1; fi
@ -27,7 +27,7 @@ if [ "$OS_NAME" == "linux" ]; then
fi
apt-get -q update
apt-get install -yq $packages
elif [ "$OS_NAME" == "darwin" ]; then
elif [ "$OS_NAME" == "osx" ]; then
# required for dlang install.sh
brew install gnupg libarchive xz llvm
elif [ "$OS_NAME" == "freebsd" ]; then

View file

@ -7,7 +7,7 @@ set -uexo pipefail
# N: number of parallel build jobs
if [ -z ${N+x} ] ; then echo "Variable 'N' needs to be set."; exit 1; fi
# OS_NAME: linux|darwin|freebsd
# OS_NAME: linux|osx|freebsd
if [ -z ${OS_NAME+x} ] ; then echo "Variable 'OS_NAME' needs to be set."; exit 1; fi
# FULL_BUILD: true|false (true on Linux: use full permutations for DMD tests)
if [ -z ${FULL_BUILD+x} ] ; then echo "Variable 'FULL_BUILD' needs to be set."; exit 1; fi
@ -34,7 +34,7 @@ if [ "$OS_NAME" == "linux" ]; then
else
NM=nm
if [ "$OS_NAME" == "darwin" ]; then
if [ "$OS_NAME" == "osx" ]; then
export PATH="/usr/local/opt/llvm/bin:$PATH"
fi
fi
@ -59,8 +59,9 @@ clone() {
# build dmd (incl. building and running the unittests), druntime, phobos
build() {
source ~/dlang/*/activate # activate host compiler, incl. setting `DMD`
make -j$N -C compiler/src -f posix.mak MODEL=$MODEL HOST_DMD=$DMD DFLAGS="$CI_DFLAGS" BUILD=debug ENABLE_WARNINGS=1 unittest
make -j$N -C compiler/src -f posix.mak MODEL=$MODEL HOST_DMD=$DMD DFLAGS="$CI_DFLAGS" ENABLE_RELEASE=1 ENABLE_WARNINGS=1 all
$DMD compiler/src/build.d -ofgenerated/build
generated/build -j$N MODEL=$MODEL HOST_DMD=$DMD DFLAGS="$CI_DFLAGS" BUILD=debug unittest
generated/build -j$N MODEL=$MODEL HOST_DMD=$DMD DFLAGS="$CI_DFLAGS" ENABLE_RELEASE=1 dmd
make -j$N -C druntime -f posix.mak MODEL=$MODEL
make -j$N -C ../phobos -f posix.mak MODEL=$MODEL
deactivate # deactivate host compiler
@ -75,8 +76,8 @@ rebuild() {
mkdir -p _${build_path}
cp $build_path/dmd _${build_path}/host_dmd
cp $build_path/dmd.conf _${build_path}
make -j$N -C compiler/src -f posix.mak MODEL=$MODEL HOST_DMD=../../_${build_path}/host_dmd clean
make -j$N -C compiler/src -f posix.mak MODEL=$MODEL HOST_DMD=../../_${build_path}/host_dmd DFLAGS="$CI_DFLAGS" ENABLE_RELEASE=${ENABLE_RELEASE:-1} ENABLE_WARNINGS=1 all
rm -rf $build_path
generated/build -j$N MODEL=$MODEL HOST_DMD=_${build_path}/host_dmd DFLAGS="$CI_DFLAGS" ENABLE_RELEASE=${ENABLE_RELEASE:-1} dmd
# compare binaries to test reproducible build
if [ $compare -eq 1 ]; then
@ -100,12 +101,15 @@ test() {
# test dmd
test_dmd() {
# test fewer compiler argument permutations for PRs to reduce CI load
if [ "$FULL_BUILD" == "true" ] && [ "$OS_NAME" == "linux" ]; then
make -j1 -C compiler/test MODEL=$MODEL N=$N # all ARGS by default
# default to testing fewer compiler argument permutations to reduce CI load
if [ "$FULL_BUILD" == "true" ] && [ "$OS_NAME" == "linux" ]; then
local args=() # use all default ARGS
else
make -j1 -C compiler/test MODEL=$MODEL N=$N ARGS="-O -inline -release"
local args=(ARGS="-O -inline -release")
fi
$build_path/dmd -g -i -Icompiler/test -release compiler/test/run.d -ofgenerated/run
generated/run -j$N --environment MODEL=$MODEL HOST_DMD=$build_path/dmd "${args[@]}"
}
# build and run druntime unit tests