mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 21:21:48 +03:00
azure: add OMF build with LATEST dmd, do not download some files if already existing, simplify space handling
This commit is contained in:
parent
43c4ce36cc
commit
9aee71b6a9
3 changed files with 76 additions and 39 deletions
|
@ -8,6 +8,7 @@ clone() {
|
||||||
local url="$1"
|
local url="$1"
|
||||||
local path="$2"
|
local path="$2"
|
||||||
local branch="$3"
|
local branch="$3"
|
||||||
|
if [ ! -d $path ]; then
|
||||||
for i in {0..4}; do
|
for i in {0..4}; do
|
||||||
if git clone --depth 1 --branch "$branch" "$url" "$path" "${@:4}" --quiet; then
|
if git clone --depth 1 --branch "$branch" "$url" "$path" "${@:4}" --quiet; then
|
||||||
break
|
break
|
||||||
|
@ -18,6 +19,7 @@ clone() {
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
download() {
|
download() {
|
||||||
|
@ -43,8 +45,10 @@ install_grep() {
|
||||||
local tools_dir="${DMD_DIR}/tools"
|
local tools_dir="${DMD_DIR}/tools"
|
||||||
mkdir -p "$tools_dir"
|
mkdir -p "$tools_dir"
|
||||||
cd "$tools_dir"
|
cd "$tools_dir"
|
||||||
|
if [ ! -f grep.exe ]; then
|
||||||
download "http://downloads.dlang.org/other/grep-3.1.zip" "grep-3.1.zip"
|
download "http://downloads.dlang.org/other/grep-3.1.zip" "grep-3.1.zip"
|
||||||
unzip "grep-3.1.zip" # contains grep.exe
|
unzip "grep-3.1.zip" # contains grep.exe
|
||||||
|
fi
|
||||||
export PATH="${tools_dir}:$PATH"
|
export PATH="${tools_dir}:$PATH"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,14 +9,24 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
||||||
GNU_MAKE="$(which make)"
|
GNU_MAKE="$(which make)"
|
||||||
|
|
||||||
install_host_dmd() {
|
install_host_dmd() {
|
||||||
|
if [ ! -f dmd2/README.TXT ]; then
|
||||||
download "http://downloads.dlang.org/releases/2.x/${HOST_DMD_VERSION}/dmd.${HOST_DMD_VERSION}.windows.7z" dmd2.7z
|
download "http://downloads.dlang.org/releases/2.x/${HOST_DMD_VERSION}/dmd.${HOST_DMD_VERSION}.windows.7z" dmd2.7z
|
||||||
7z x dmd2.7z > /dev/null
|
7z x dmd2.7z > /dev/null
|
||||||
|
fi
|
||||||
export PATH="$PWD/dmd2/windows/bin/:$PATH"
|
export PATH="$PWD/dmd2/windows/bin/:$PATH"
|
||||||
export HOST_DC="$PWD/dmd2/windows/bin/dmd.exe"
|
export HOST_DC="$PWD/dmd2/windows/bin/dmd.exe"
|
||||||
export DM_MAKE="$PWD/dmd2/windows/bin/make.exe"
|
export DM_MAKE="$PWD/dmd2/windows/bin/make.exe"
|
||||||
dmd --version
|
dmd --version
|
||||||
}
|
}
|
||||||
|
|
||||||
|
install_host_dmc() {
|
||||||
|
if [ ! -f dm/README.TXT ]; then
|
||||||
|
download "http://downloads.dlang.org/other/dm857c.zip" dmc.zip
|
||||||
|
7z x dmc.zip > /dev/null
|
||||||
|
fi
|
||||||
|
dm/bin/dmc | head -n 1 || true
|
||||||
|
}
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# Setup required tools
|
# Setup required tools
|
||||||
################################################################################
|
################################################################################
|
||||||
|
@ -25,11 +35,29 @@ install_host_dmd() {
|
||||||
# REASON: the preinstalled version is buggy (see also: https://github.com/dlang/dmd/pull/9398#issuecomment-468773638)
|
# REASON: the preinstalled version is buggy (see also: https://github.com/dlang/dmd/pull/9398#issuecomment-468773638)
|
||||||
install_grep
|
install_grep
|
||||||
|
|
||||||
|
if [ "$HOST_DMD_VERSION" == "LATEST" ]; then
|
||||||
|
download "http://downloads.dlang.org/releases/LATEST" LATEST
|
||||||
|
HOST_DMD_VERSION="$(cat LATEST)"
|
||||||
|
fi
|
||||||
echo "D_VERSION: $HOST_DMD_VERSION"
|
echo "D_VERSION: $HOST_DMD_VERSION"
|
||||||
echo "VSINSTALLDIR: $VSINSTALLDIR"
|
echo "VSINSTALLDIR: $VSINSTALLDIR"
|
||||||
echo "GNU_MAKE: $("${GNU_MAKE}" --version)"
|
echo "GNU_MAKE: $("${GNU_MAKE}" --version)"
|
||||||
echo "GREP_VERSION: $(grep --version)"
|
echo "GREP_VERSION: $(grep --version)"
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Prepare C compiler
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
if [ "$MODEL" == "32" ] ; then
|
||||||
|
install_host_dmc
|
||||||
|
export CC="$PWD/dm/bin/dmc.exe"
|
||||||
|
export AR="$PWD/dm/bin/lib.exe"
|
||||||
|
else
|
||||||
|
export CC="$(where cl.exe)"
|
||||||
|
export AR="$(where lib.exe)" # must be done before installing dmd
|
||||||
|
export MSVC_AR="$AR" # for msvc-lib
|
||||||
|
fi
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# Install the host compiler
|
# Install the host compiler
|
||||||
################################################################################
|
################################################################################
|
||||||
|
@ -51,15 +79,18 @@ clone_repos
|
||||||
# Prepare build flags
|
# Prepare build flags
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
export CC="${MSVC_CC}"
|
|
||||||
export AR="${MSVC_AR}"
|
|
||||||
|
|
||||||
if [ "$MODEL" == "64" ] ; then
|
if [ "$MODEL" == "64" ] ; then
|
||||||
export MODEL_FLAG="-m64"
|
export MODEL_FLAG="-m64"
|
||||||
MAKE_FILE="win64.mak"
|
MAKE_FILE="win64.mak"
|
||||||
|
LIBNAME=phobos64.lib
|
||||||
|
elif [ "$MODEL" == "32mscoff" ] ; then
|
||||||
|
export MODEL_FLAG="-m32mscoff"
|
||||||
|
MAKE_FILE="win64.mak"
|
||||||
|
LIBNAME=phobos32mscoff.lib
|
||||||
else
|
else
|
||||||
export MODEL_FLAG="-m32"
|
export MODEL_FLAG="-m32"
|
||||||
MAKE_FILE="win32.mak"
|
MAKE_FILE="win32.mak"
|
||||||
|
LIBNAME=phobos.lib
|
||||||
fi
|
fi
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
|
@ -71,22 +102,15 @@ DMD_BIN_PATH="$DMD_DIR/generated/windows/release/${MODEL}/dmd"
|
||||||
cd "${DMD_DIR}/src"
|
cd "${DMD_DIR}/src"
|
||||||
"${DM_MAKE}" -f "${MAKE_FILE}" reldmd DMD="$DMD_BIN_PATH"
|
"${DM_MAKE}" -f "${MAKE_FILE}" reldmd DMD="$DMD_BIN_PATH"
|
||||||
|
|
||||||
################################################################################
|
|
||||||
# WORKAROUND: Make the paths to CC and AR whitespace free
|
|
||||||
# REASON: Druntime & Phobos Makefiles as the variables don't use quotation
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
ln -s "$(dirname "$CC")" "${DMD_DIR}/../ccdir"
|
|
||||||
export CC="$DMD_DIR/../ccdir/cl.exe"
|
|
||||||
export AR="$DMD_DIR/../ccdir/lib.exe"
|
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# WORKAROUND: Build zlib separately with DigitalMars make
|
# WORKAROUND: Build zlib separately with DigitalMars make
|
||||||
# REASON: whitespace path variables in DigitalMars make from indirect invocation from Phobos
|
# REASON: whitespace path variables in DigitalMars make from indirect invocation from Phobos
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
|
if [ "$MODEL" != "32" ] ; then
|
||||||
cd "${DMD_DIR}/../phobos/etc/c/zlib"
|
cd "${DMD_DIR}/../phobos/etc/c/zlib"
|
||||||
${DM_MAKE} -f win64.mak "MODEL=${MODEL}" "zlib${MODEL}.lib" CC="${CC}" LIB="${AR}" VCDIR="${VCINSTALLDIR}"
|
${DM_MAKE} -f win64.mak MODEL=${MODEL} "zlib${MODEL}.lib" "CC=$CC" "LIB=$AR" VCDIR=.
|
||||||
|
fi
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# Build Druntime and Phobos
|
# Build Druntime and Phobos
|
||||||
|
@ -94,7 +118,7 @@ ${DM_MAKE} -f win64.mak "MODEL=${MODEL}" "zlib${MODEL}.lib" CC="${CC}" LIB="${AR
|
||||||
|
|
||||||
for proj in druntime phobos; do
|
for proj in druntime phobos; do
|
||||||
cd "${DMD_DIR}/../${proj}"
|
cd "${DMD_DIR}/../${proj}"
|
||||||
"${DM_MAKE}" -f "${MAKE_FILE}" DMD="$DMD_BIN_PATH" CC="$CC" AR="$MSVC_AR" VCDIR="${VCINSTALLDIR}" CFLAGS="/C7"
|
"${DM_MAKE}" -f "${MAKE_FILE}" MODEL=$MODEL DMD="$DMD_BIN_PATH" "CC=$CC" "AR=$AR" VCDIR=.
|
||||||
done
|
done
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
|
@ -104,7 +128,7 @@ cd "${DMD_DIR}/test"
|
||||||
|
|
||||||
# WORKAROUND: Copy the built Phobos library in the path
|
# WORKAROUND: Copy the built Phobos library in the path
|
||||||
# REASON: LIB argument doesn't seem to work
|
# REASON: LIB argument doesn't seem to work
|
||||||
cp "${DMD_DIR}/../phobos/phobos64.lib" .
|
cp "${DMD_DIR}/../phobos/$LIBNAME" .
|
||||||
|
|
||||||
DMD_TESTSUITE_MAKE_ARGS="-j$N" "${GNU_MAKE}" -j1 start_all_tests ARGS="-O -inline -g" MODEL="$MODEL" MODEL_FLAG="$MODEL_FLAG"
|
DMD_TESTSUITE_MAKE_ARGS="-j$N" "${GNU_MAKE}" -j1 start_all_tests ARGS="-O -inline -g" MODEL="$MODEL" MODEL_FLAG="$MODEL_FLAG"
|
||||||
|
|
||||||
|
@ -114,5 +138,5 @@ DMD_TESTSUITE_MAKE_ARGS="-j$N" "${GNU_MAKE}" -j1 start_all_tests ARGS="-O -inlin
|
||||||
|
|
||||||
mkdir -p "${DMD_DIR}/artifacts"
|
mkdir -p "${DMD_DIR}/artifacts"
|
||||||
cd "${DMD_DIR}/artifacts"
|
cd "${DMD_DIR}/artifacts"
|
||||||
cp "${DMD_DIR}/../phobos/phobos64.lib" .
|
cp "${DMD_DIR}/../phobos/$LIBNAME" .
|
||||||
cp "${DMD_BIN_PATH}" .
|
cp "${DMD_BIN_PATH}" .
|
||||||
|
|
|
@ -1,7 +1,4 @@
|
||||||
# Learn more: https://aka.ms/yaml
|
# Learn more: https://aka.ms/yaml
|
||||||
variables:
|
|
||||||
HOST_DMD_VERSION: 2.084.1
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
- job: Windows
|
- job: Windows
|
||||||
timeoutInMinutes: 120
|
timeoutInMinutes: 120
|
||||||
|
@ -9,6 +6,7 @@ jobs:
|
||||||
vmImage: 'vs2017-win2016'
|
vmImage: 'vs2017-win2016'
|
||||||
variables:
|
variables:
|
||||||
VSINSTALLDIR: C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\
|
VSINSTALLDIR: C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\
|
||||||
|
HOST_DMD_VERSION: 2.084.1
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
x64:
|
x64:
|
||||||
|
@ -16,11 +14,22 @@ jobs:
|
||||||
MODEL: 64
|
MODEL: 64
|
||||||
ARCH: x64
|
ARCH: x64
|
||||||
D_COMPILER: dmd
|
D_COMPILER: dmd
|
||||||
#x86:
|
steps:
|
||||||
#OS: Win_32
|
- template: .azure-pipelines/windows.yml
|
||||||
#MODEL: 32
|
- job: Windows_OMF
|
||||||
#ARCH: x86
|
timeoutInMinutes: 120
|
||||||
#D_COMPILER: dmd
|
pool:
|
||||||
|
vmImage: 'vs2017-win2016'
|
||||||
|
variables:
|
||||||
|
VSINSTALLDIR: C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\
|
||||||
|
HOST_DMD_VERSION: LATEST
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
x64:
|
||||||
|
OS: Win_32
|
||||||
|
MODEL: 32
|
||||||
|
ARCH: x86
|
||||||
|
D_COMPILER: dmd
|
||||||
steps:
|
steps:
|
||||||
- template: .azure-pipelines/windows.yml
|
- template: .azure-pipelines/windows.yml
|
||||||
- job: Windows_VisualD
|
- job: Windows_VisualD
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue