Skip to content

Commit ad578ff

Browse files
kinkeUplinkCoder
authored andcommitted
Azure CI OMF job: Link testsuite tools with correct phobos.lib
Previously, the tools were compiled by the DMD host compiler, but linked with freshly compiled druntime/Phobos, leading to inevitable issues popping up in dlang/druntime#3141 and dlang/druntime#3142.
1 parent 5944f99 commit ad578ff

1 file changed

Lines changed: 14 additions & 5 deletions

File tree

.azure-pipelines/windows.sh

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,20 @@ cd "${DMD_DIR}/../druntime"
114114
################################################################################
115115
cd "${DMD_DIR}/test"
116116

117-
# WORKAROUND: Copy the built Phobos library in the path
118-
# REASON: LIB argument doesn't seem to work
119-
cp "${DMD_DIR}/../phobos/$LIBNAME" .
120-
121-
"${GNU_MAKE}" -j1 start_all_tests ARGS="-O -inline -g" MODEL="$MODEL" MODEL_FLAG="$MODEL_FLAG" N="$N"
117+
if [ "$MODEL" == "32" ] ; then
118+
# Prebuild some tools (run & d_do_test, built by Makefile) with host compiler.
119+
"${GNU_MAKE}" -j1 test_results/run.exe MODEL="$MODEL" MODEL_FLAG="$MODEL_FLAG" N="$N"
120+
# WORKAROUND: Make Optlink use freshly built Phobos, not the host compiler's.
121+
# Optlink apparently prefers LIB in sc.ini over the LIB env variable (and `-conf=` for
122+
# DMD apparently doesn't prevent that).
123+
#rm "$LIB/../bin/sc.ini"
124+
cp "${DMD_DIR}/../phobos/$LIBNAME" .
125+
# This also requires to build the remaining tools (sanitize_json & unit_test_runner,
126+
# built by run.d, not the Makefile...) with the tested compiler, not the host compiler.
127+
"${GNU_MAKE}" -j1 start_all_tests ARGS="-O -inline -g" MODEL="$MODEL" MODEL_FLAG="$MODEL_FLAG" N="$N" HOST_DMD="$DMD_BIN_PATH"
128+
else
129+
"${GNU_MAKE}" -j1 start_all_tests ARGS="-O -inline -g" MODEL="$MODEL" MODEL_FLAG="$MODEL_FLAG" N="$N"
130+
fi
122131

123132
################################################################################
124133
# Prepare artifacts

0 commit comments

Comments
 (0)