Use a different variant to compile all testsuite tools with the host compiler

This commit is contained in:
Martin Kinkelin 2020-06-26 15:01:40 +02:00
parent 104f8cfb94
commit e372f407f8
2 changed files with 14 additions and 15 deletions

View file

@ -61,15 +61,12 @@ clone_repos
################################################################################ ################################################################################
if [ "$MODEL" == "64" ] ; then if [ "$MODEL" == "64" ] ; then
export MODEL_FLAG="-m64"
MAKE_FILE="win64.mak" MAKE_FILE="win64.mak"
LIBNAME=phobos64.lib LIBNAME=phobos64.lib
elif [ "$MODEL" == "32mscoff" ] ; then elif [ "$MODEL" == "32mscoff" ] ; then
export MODEL_FLAG="-m32mscoff"
MAKE_FILE="win64.mak" MAKE_FILE="win64.mak"
LIBNAME=phobos32mscoff.lib LIBNAME=phobos32mscoff.lib
else else
export MODEL_FLAG="-m32"
export LIB="$PWD/dmd2/windows/lib" export LIB="$PWD/dmd2/windows/lib"
MAKE_FILE="win32.mak" MAKE_FILE="win32.mak"
LIBNAME=phobos.lib LIBNAME=phobos.lib
@ -115,20 +112,22 @@ cd "${DMD_DIR}/../druntime"
cd "${DMD_DIR}/test" cd "${DMD_DIR}/test"
if [ "$MODEL" == "32" ] ; then if [ "$MODEL" == "32" ] ; then
# Prebuild some tools (run & d_do_test, built by Makefile) with host compiler.
"${GNU_MAKE}" -j1 test_results/run.exe MODEL="$MODEL" MODEL_FLAG="$MODEL_FLAG" N="$N"
# WORKAROUND: Make Optlink use freshly built Phobos, not the host compiler's. # WORKAROUND: Make Optlink use freshly built Phobos, not the host compiler's.
# Optlink apparently prefers LIB in sc.ini over the LIB env variable (and `-conf=` for # Optlink apparently prefers LIB in sc.ini over the LIB env variable (and
# DMD apparently doesn't prevent that). # `-conf=` for DMD apparently doesn't prevent that).
#rm "$LIB/../bin/sc.ini" # There's apparently no sane way to specify a libdir for Optlink in the DMD
cp "${DMD_DIR}/../phobos/$LIBNAME" . # cmdline, so remove the sc.ini file and set the DFLAGS and LIB env variables
# This also requires to build the remaining tools (sanitize_json & unit_test_runner, # manually for the host compiler. These 2 variables are adapted for the
# built by run.d, not the Makefile...) with the tested compiler, not the host compiler. # actual tests with the tested compiler (by run.d).
"${GNU_MAKE}" -j1 start_all_tests ARGS="-O -inline -g" MODEL="$MODEL" MODEL_FLAG="$MODEL_FLAG" N="$N" HOST_DMD="$DMD_BIN_PATH" HOST_DMD_DIR="$(cygpath -w "$DMD_DIR/tools/dmd2")"
else rm "$HOST_DMD_DIR/windows/bin/sc.ini"
"${GNU_MAKE}" -j1 start_all_tests ARGS="-O -inline -g" MODEL="$MODEL" MODEL_FLAG="$MODEL_FLAG" N="$N" export DFLAGS="-I$HOST_DMD_DIR/src/phobos -I$HOST_DMD_DIR/src/druntime/import"
export LIB="$HOST_DMD_DIR/windows/lib"
fi fi
"$HOST_DC" -m$MODEL -g -i run.d
./run --environment --jobs=$N all ARGS="-O -inline -g" MODEL="$MODEL"
################################################################################ ################################################################################
# Prepare artifacts # Prepare artifacts
################################################################################ ################################################################################

View file

@ -488,7 +488,7 @@ string[string] getEnvironment()
auto druntimePath = environment.get("DRUNTIME_PATH", testPath(`..\..\druntime`)); auto druntimePath = environment.get("DRUNTIME_PATH", testPath(`..\..\druntime`));
auto phobosPath = environment.get("PHOBOS_PATH", testPath(`..\..\phobos`)); auto phobosPath = environment.get("PHOBOS_PATH", testPath(`..\..\phobos`));
env["DFLAGS"] = `-I%s\import -I%s`.format(druntimePath, phobosPath); env["DFLAGS"] = `-I%s\import -I%s`.format(druntimePath, phobosPath);
env["LIB"] = phobosPath; env["LIB"] = phobosPath ~ ";" ~ environment.get("LIB");
} }
else else
{ {