Fix build script paths to work with new merged repository structure

Co-Authored-By: Geod24 <pro.mathias.lang@gmail.com>
Co-Authored-By: Martin Kinkelin <noone@nowhere.com>
Co-Authored-By: Vladimir Panteleev <git@cy.md>
This commit is contained in:
Iain Buclaw 2022-07-03 17:28:13 +02:00
parent 69ab16a7e8
commit 09d04945bd
56 changed files with 499 additions and 209 deletions

View file

@ -89,7 +89,7 @@ clone_repos() {
local REPO_BRANCH="$SYSTEM_PULLREQUEST_TARGETBRANCH" local REPO_BRANCH="$SYSTEM_PULLREQUEST_TARGETBRANCH"
fi fi
for proj in druntime phobos; do for proj in phobos; do
if [ "$REPO_BRANCH" != master ] && [ "$REPO_BRANCH" != stable ] && if [ "$REPO_BRANCH" != master ] && [ "$REPO_BRANCH" != stable ] &&
! git ls-remote --exit-code --heads "https://github.com/dlang/$proj.git" "$REPO_BRANCH" > /dev/null; then ! git ls-remote --exit-code --heads "https://github.com/dlang/$proj.git" "$REPO_BRANCH" > /dev/null; then
# use master as fallback for other repos to test feature branches # use master as fallback for other repos to test feature branches

View file

@ -37,22 +37,22 @@ REM configure LDC path
if "%D_COMPILER%" == "ldc" reg add "HKLM\SOFTWARE\LDC" /v InstallationFolder /t REG_SZ /d "%LDC_DIR%" /reg:32 /f if "%D_COMPILER%" == "ldc" reg add "HKLM\SOFTWARE\LDC" /v InstallationFolder /t REG_SZ /d "%LDC_DIR%" /reg:32 /f
echo [STEP]: Building DMD via VS projects echo [STEP]: Building DMD via VS projects
cd src cd compiler\src
if "%D_COMPILER%" == "ldc" set LDC_ARGS=%LDC_ARGS% /p:DCompiler=LDC if "%D_COMPILER%" == "ldc" set LDC_ARGS=%LDC_ARGS% /p:DCompiler=LDC
msbuild /target:dmd /p:Configuration=%CONFIGURATION% /p:Platform=%PLATFORM% %LDC_ARGS% vcbuild\dmd.sln || exit /B 1 msbuild /target:dmd /p:Configuration=%CONFIGURATION% /p:Platform=%PLATFORM% %LDC_ARGS% vcbuild\dmd.sln || exit /B 1
%DMD% --version %DMD% --version
echo [STEP]: Building druntime echo [STEP]: Building druntime
cd "%DMD_DIR%\..\druntime" cd "%DMD_DIR%\druntime"
"%DM_MAKE%" -f win64.mak MODEL=%MODEL% "DMD=%DMD%" "VCDIR=%VCINSTALLDIR%." "CC=%MSVC_CC%" "MAKE=%DM_MAKE%" "HOST_DMD=%HOST_DMD%" target || exit /B 2 "%DM_MAKE%" -f win64.mak MODEL=%MODEL% "DMD=%DMD%" "VCDIR=%VCINSTALLDIR%." "CC=%MSVC_CC%" "MAKE=%DM_MAKE%" "HOST_DMD=%HOST_DMD%" target || exit /B 2
echo [STEP]: Building phobos echo [STEP]: Building phobos
cd "%DMD_DIR%\..\phobos" cd "%DMD_DIR%\..\phobos"
"%DM_MAKE%" -f win64.mak MODEL=%MODEL% "DMD=%DMD%" "VCDIR=%VCINSTALLDIR%." "CC=%MSVC_CC%" "AR=%MSVC_AR%" "MAKE=%DM_MAKE%" || exit /B 3 "%DM_MAKE%" -f win64.mak MODEL=%MODEL% "DMD=%DMD%" "VCDIR=%VCINSTALLDIR%." "CC=%MSVC_CC%" "AR=%MSVC_AR%" "MAKE=%DM_MAKE%" "DRUNTIME=%DMD_DIR%\druntime" || exit /B 3
echo [STEP]: Building run.d testrunner and its tools echo [STEP]: Building run.d testrunner and its tools
REM needs to be done before tampering with LIB and DFLAGS env variables (affecting the ldmd2 host compiler too) REM needs to be done before tampering with LIB and DFLAGS env variables (affecting the ldmd2 host compiler too)
cd "%DMD_DIR%\test" cd "%DMD_DIR%\compiler\test"
"%HOST_DMD%" -m%MODEL% -g -i run.d || exit /B 4 "%HOST_DMD%" -m%MODEL% -g -i run.d || exit /B 4
run.exe tools "BUILD=%CONFIGURATION%" "DMD_MODEL=%PLATFORM%" || exit /B 4 run.exe tools "BUILD=%CONFIGURATION%" "DMD_MODEL=%PLATFORM%" || exit /B 4
@ -77,17 +77,17 @@ if not "%C_RUNTIME%" == "mingw" goto not_mingw
rem skip runnable_cxx tests (incompatible MSVC runtime versions - 2017 (cl.exe) vs. 2013) rem skip runnable_cxx tests (incompatible MSVC runtime versions - 2017 (cl.exe) vs. 2013)
set DMD_TESTS=runnable compilable fail_compilation dshell unit_tests set DMD_TESTS=runnable compilable fail_compilation dshell unit_tests
rem FIXME: debug info incomplete when linking through lld-link rem FIXME: debug info incomplete when linking through lld-link
del test\runnable\testpdb.d del compiler\test\runnable\testpdb.d
set DRUNTIME_TESTS=test_mingw set DRUNTIME_TESTS=test_mingw
:not_mingw :not_mingw
echo [STEP]: Building and running druntime tests echo [STEP]: Building and running druntime tests
cd "%DMD_DIR%\..\druntime" cd "%DMD_DIR%\druntime"
"%DM_MAKE%" -f win64.mak MODEL=%MODEL% "DMD=%DMD%" "VCDIR=%VCINSTALLDIR%." "CC=%MSVC_CC%" "MAKE=%DM_MAKE%" unittest %DRUNTIME_TESTS% || exit /B 5 "%DM_MAKE%" -f win64.mak MODEL=%MODEL% "DMD=%DMD%" "VCDIR=%VCINSTALLDIR%." "CC=%MSVC_CC%" "MAKE=%DM_MAKE%" unittest %DRUNTIME_TESTS% || exit /B 5
echo [STEP]: Running DMD testsuite echo [STEP]: Running DMD testsuite
cd "%DMD_DIR%\test" cd "%DMD_DIR%\compiler\test"
set CC=%MSVC_CC% set CC=%MSVC_CC%
run.exe --environment --jobs=%N% %DMD_TESTS% "ARGS=-O -inline -g" "BUILD=%CONFIGURATION%" "DMD_MODEL=%PLATFORM%" || exit /B 6 run.exe --environment --jobs=%N% %DMD_TESTS% "ARGS=-O -inline -g" "BUILD=%CONFIGURATION%" "DMD_MODEL=%PLATFORM%" || exit /B 6
@ -99,4 +99,4 @@ if "%D_COMPILER%_%MODEL%" == "ldc_64" copy %LDC_DIR%\lib64\libcurl.dll .
if "%D_COMPILER%_%MODEL%" == "ldc_32mscoff" copy %LDC_DIR%\lib32\libcurl.dll . if "%D_COMPILER%_%MODEL%" == "ldc_32mscoff" copy %LDC_DIR%\lib32\libcurl.dll .
if "%D_COMPILER%_%MODEL%" == "dmd_64" copy %DMD_DIR%\dmd2\windows\bin64\libcurl.dll . if "%D_COMPILER%_%MODEL%" == "dmd_64" copy %DMD_DIR%\dmd2\windows\bin64\libcurl.dll .
if "%D_COMPILER%_%MODEL%" == "dmd_32mscoff" copy %DMD_DIR%\dmd2\windows\bin\libcurl.dll . if "%D_COMPILER%_%MODEL%" == "dmd_32mscoff" copy %DMD_DIR%\dmd2\windows\bin\libcurl.dll .
"%DM_MAKE%" -f win64.mak MODEL=%MODEL% "DMD=%DMD%" "VCDIR=%VCINSTALLDIR%." "CC=%MSVC_CC%" "MAKE=%DM_MAKE%" unittest || exit /B 7 "%DM_MAKE%" -f win64.mak MODEL=%MODEL% "DMD=%DMD%" "VCDIR=%VCINSTALLDIR%." "CC=%MSVC_CC%" "MAKE=%DM_MAKE%" "DRUNTIME=%DMD_DIR%\druntime" unittest || exit /B 7

View file

@ -80,9 +80,9 @@ else
DMD_BIN_PATH="$DMD_DIR/generated/windows/release/$MODEL/dmd" DMD_BIN_PATH="$DMD_DIR/generated/windows/release/$MODEL/dmd"
fi fi
cd "$DMD_DIR/src" cd "$DMD_DIR/compiler/src"
"$DM_MAKE" -f "$MAKE_FILE" MAKE="$DM_MAKE" BUILD=debug unittest "$DM_MAKE" -f "$MAKE_FILE" MAKE="$DM_MAKE" BUILD=debug unittest
DFLAGS="-L-LARGEADDRESSAWARE" "$DM_MAKE" -f "$MAKE_FILE" MAKE="$DM_MAKE" reldmd-asserts DFLAGS="-L-LARGEADDRESSAWARE" "$DM_MAKE" -f "$MAKE_FILE" MAKE="$DM_MAKE" GEN="$DMD_DIR\generated" reldmd-asserts
################################################################################ ################################################################################
# Build Druntime and Phobos # Build Druntime and Phobos
@ -90,20 +90,19 @@ DFLAGS="-L-LARGEADDRESSAWARE" "$DM_MAKE" -f "$MAKE_FILE" MAKE="$DM_MAKE" reldmd-
LIBS_MAKE_ARGS=(-f "$MAKE_FILE" MODEL=$MODEL DMD="$DMD_BIN_PATH" VCDIR=. CC="$CC" AR="$AR" MAKE="$DM_MAKE") LIBS_MAKE_ARGS=(-f "$MAKE_FILE" MODEL=$MODEL DMD="$DMD_BIN_PATH" VCDIR=. CC="$CC" AR="$AR" MAKE="$DM_MAKE")
for proj in druntime phobos; do cd "$DMD_DIR/druntime"
cd "$DMD_DIR/../$proj" "$DM_MAKE" "${LIBS_MAKE_ARGS[@]}"
"$DM_MAKE" "${LIBS_MAKE_ARGS[@]}"
done cd "$DMD_DIR/../phobos"
"$DM_MAKE" "${LIBS_MAKE_ARGS[@]}" DRUNTIME="$DMD_DIR\druntime"
################################################################################ ################################################################################
# Run DMD testsuite # Run DMD testsuite
################################################################################ ################################################################################
cd "$DMD_DIR/test" cd "$DMD_DIR/compiler/test"
# build run.d testrunner and its tools while host compiler is untampered # build run.d testrunner and its tools while host compiler is untampered
cd ../test
if [ "$MODEL" == "32omf" ] ; then if [ "$MODEL" == "32omf" ] ; then
TOOL_MODEL=32; TOOL_MODEL=32;
else else
@ -118,8 +117,8 @@ if [ "${DMD_TEST_COVERAGE:-0}" = "1" ] ; then
# Recompile debug dmd + unittests # Recompile debug dmd + unittests
rm -rf "$DMD_DIR/generated/windows" rm -rf "$DMD_DIR/generated/windows"
DFLAGS="-L-LARGEADDRESSAWARE" ../generated/build.exe --jobs=$N ENABLE_DEBUG=1 ENABLE_COVERAGE=1 dmd DFLAGS="-L-LARGEADDRESSAWARE" ../../generated/build.exe --jobs=$N ENABLE_DEBUG=1 ENABLE_COVERAGE=1 dmd
DFLAGS="-L-LARGEADDRESSAWARE" ../generated/build.exe --jobs=$N ENABLE_DEBUG=1 ENABLE_COVERAGE=1 unittest DFLAGS="-L-LARGEADDRESSAWARE" ../../generated/build.exe --jobs=$N ENABLE_DEBUG=1 ENABLE_COVERAGE=1 unittest
fi fi
if [ "$MODEL" == "32omf" ] ; then if [ "$MODEL" == "32omf" ] ; then
@ -152,7 +151,7 @@ fi
# Build and run druntime tests # Build and run druntime tests
################################################################################ ################################################################################
cd "$DMD_DIR/../druntime" cd "$DMD_DIR/druntime"
"$DM_MAKE" "${LIBS_MAKE_ARGS[@]}" unittest test_all "$DM_MAKE" "${LIBS_MAKE_ARGS[@]}" unittest test_all
################################################################################ ################################################################################
@ -168,7 +167,7 @@ else
else else
cp "$DMD_DIR/tools/dmd2/windows/bin/libcurl.dll" . cp "$DMD_DIR/tools/dmd2/windows/bin/libcurl.dll" .
fi fi
"$DM_MAKE" "${LIBS_MAKE_ARGS[@]}" unittest "$DM_MAKE" "${LIBS_MAKE_ARGS[@]}" DRUNTIME="$DMD_DIR\druntime" unittest
fi fi
################################################################################ ################################################################################

View file

@ -95,7 +95,7 @@ setup_repos() {
git checkout -f FETCH_HEAD git checkout -f FETCH_HEAD
fi fi
for proj in druntime phobos; do for proj in phobos; do
if [ $base_branch != master ] && [ $base_branch != stable ] && if [ $base_branch != master ] && [ $base_branch != stable ] &&
! git ls-remote --exit-code --heads https://github.com/dlang/$proj.git $base_branch > /dev/null; then ! git ls-remote --exit-code --heads https://github.com/dlang/$proj.git $base_branch > /dev/null; then
# use master as fallback for other repos to test feature branches # use master as fallback for other repos to test feature branches
@ -114,10 +114,10 @@ coverage()
local build_path=generated/linux/$BUILD/$MODEL local build_path=generated/linux/$BUILD/$MODEL
local builder=generated/build local builder=generated/build
dmd -g -od=generated -of=$builder src/build dmd -g -od=generated -of=$builder compiler/src/build
# build dmd, druntime, and phobos # build dmd, druntime, and phobos
$builder MODEL=$MODEL HOST_DMD=$DMD BUILD=$BUILD all $builder MODEL=$MODEL HOST_DMD=$DMD BUILD=$BUILD all
make -j$N -C ../druntime -f posix.mak MODEL=$MODEL BUILD=$BUILD make -j$N -C druntime -f posix.mak MODEL=$MODEL BUILD=$BUILD
make -j$N -C ../phobos -f posix.mak MODEL=$MODEL BUILD=$BUILD make -j$N -C ../phobos -f posix.mak MODEL=$MODEL BUILD=$BUILD
# save the built dmd as host compiler this time # save the built dmd as host compiler this time
@ -134,14 +134,14 @@ coverage()
# FIXME # FIXME
# Temporarily the failing long file name test has been removed # Temporarily the failing long file name test has been removed
rm -rf test/compilable/issue17167.sh rm -rf compiler/test/compilable/issue17167.sh
# rebuild dmd with coverage enabled # rebuild dmd with coverage enabled
$builder MODEL=$MODEL BUILD=$BUILD HOST_DMD=$PWD/_${build_path}/host_dmd ENABLE_COVERAGE=1 $builder MODEL=$MODEL BUILD=$BUILD HOST_DMD=$PWD/_${build_path}/host_dmd ENABLE_COVERAGE=1
cp $build_path/dmd _${build_path}/host_dmd_cov cp $build_path/dmd _${build_path}/host_dmd_cov
$builder MODEL=$MODEL BUILD=$BUILD HOST_DMD=$PWD/_${build_path}/host_dmd ENABLE_COVERAGE=1 unittest $builder MODEL=$MODEL BUILD=$BUILD HOST_DMD=$PWD/_${build_path}/host_dmd ENABLE_COVERAGE=1 unittest
_${build_path}/host_dmd -Itest -i -run ./test/run.d -j$N MODEL=$MODEL BUILD=$BUILD ARGS="-O -inline -release" DMD_TEST_COVERAGE=1 HOST_DMD=$PWD/_${build_path}/host_dmd _${build_path}/host_dmd -Icompiler/test -i -run ./compiler/test/run.d -j$N MODEL=$MODEL BUILD=$BUILD ARGS="-O -inline -release" DMD_TEST_COVERAGE=1 HOST_DMD=$PWD/_${build_path}/host_dmd
} }
# Checks that all files have been committed and no temporary, untracked files exist. # Checks that all files have been committed and no temporary, untracked files exist.
@ -149,13 +149,13 @@ coverage()
check_clean_git() check_clean_git()
{ {
# Restore temporarily removed files # Restore temporarily removed files
git checkout test/compilable/issue17167.sh git checkout compiler/test/compilable/issue17167.sh
# Remove temporary directory + install script # Remove temporary directory + install script
rm -rf _generated rm -rf _generated
rm -f install.sh rm -f install.sh
# auto-removal of these files doesn't work on CirleCi # auto-removal of these files doesn't work on CirleCi
rm -f test/compilable/vcg-ast.d.cg rm -f compiler/test/compilable/vcg-ast.d.cg
rm -f test/compilable/vcg-ast-arraylength.d.cg rm -f compiler/test/compilable/vcg-ast-arraylength.d.cg
# Ensure that there are no untracked changes # Ensure that there are no untracked changes
make -f posix.mak check-clean-git make -f posix.mak check-clean-git
} }
@ -164,7 +164,7 @@ check_clean_git()
check_run_individual() check_run_individual()
{ {
local build_path=generated/linux/$BUILD/$MODEL local build_path=generated/linux/$BUILD/$MODEL
"${build_path}/dmd" -I./test -i -run ./test/run.d "BUILD=$BUILD" "MODEL=$MODEL" test/runnable/template2962.d ./test/compilable/test14275.d "${build_path}/dmd" -Icompiler/test -i -run ./compiler/test/run.d "BUILD=$BUILD" "MODEL=$MODEL" compiler/test/runnable/template2962.d ./compiler/test/compilable/test14275.d
} }
# Checks the D build.d script # Checks the D build.d script
@ -173,12 +173,12 @@ check_d_builder()
echo "Testing D build" echo "Testing D build"
# load environment for bootstrap compiler # load environment for bootstrap compiler
source "$(CURL_USER_AGENT=\"$CURL_USER_AGENT\" bash ~/dlang/install.sh dmd-$HOST_DMD_VER --activate)" source "$(CURL_USER_AGENT=\"$CURL_USER_AGENT\" bash ~/dlang/install.sh dmd-$HOST_DMD_VER --activate)"
./src/build.d clean ./compiler/src/build.d clean
rm -rf generated # just to be sure rm -rf generated # just to be sure
# TODO: add support for 32-bit builds # TODO: add support for 32-bit builds
./src/build.d MODEL=64 ./compiler/src/build.d MODEL=64
./generated/linux/release/64/dmd --version | grep -v "dirty" ./generated/linux/release/64/dmd --version | grep -v "dirty"
./src/build.d clean ./compiler/src/build.d clean
deactivate deactivate
} }
@ -188,10 +188,10 @@ test_cxx()
# load environment for bootstrap compiler # load environment for bootstrap compiler
source "$(CURL_USER_AGENT=\"$CURL_USER_AGENT\" bash ~/dlang/install.sh dmd-$HOST_DMD_VER --activate)" source "$(CURL_USER_AGENT=\"$CURL_USER_AGENT\" bash ~/dlang/install.sh dmd-$HOST_DMD_VER --activate)"
echo "Test CXX frontend.h header generation" echo "Test CXX frontend.h header generation"
./src/build.d ./compiler/src/build.d
make -j$N -C ../druntime -f posix.mak MODEL=$MODEL BUILD=$BUILD make -j$N -C druntime -f posix.mak MODEL=$MODEL BUILD=$BUILD
make -j$N -C ../phobos -f posix.mak MODEL=$MODEL BUILD=$BUILD make -j$N -C ../phobos -f posix.mak MODEL=$MODEL BUILD=$BUILD
./src/build.d cxx-headers-test ./compiler/src/build.d cxx-headers-test
deactivate deactivate
} }

View file

@ -1,3 +1,4 @@
# Test
common_steps_template: &COMMON_STEPS_TEMPLATE common_steps_template: &COMMON_STEPS_TEMPLATE
install_prerequisites_script: ./ci/cirrusci.sh install_prerequisites_script: ./ci/cirrusci.sh
install_host_compiler_script: ./ci/run.sh install_host_compiler install_host_compiler_script: ./ci/run.sh install_host_compiler

4
.gitattributes vendored
View file

@ -1,3 +1,3 @@
# The following text files requires strict end of line rules # The following text files requires strict end of line rules
test/compilable/extra-files/makedeps-import.txt text eol=lf compiler/test/compilable/extra-files/makedeps-import.txt text eol=lf
test/fail_compilation/extra-files/makedeps-import.txt text eol=lf compiler/test/fail_compilation/extra-files/makedeps-import.txt text eol=lf

View file

@ -119,9 +119,21 @@ jobs:
- { os: windows-2019, target: g++-6 } - { os: windows-2019, target: g++-6 }
- { os: windows-2019, target: g++-5 } - { os: windows-2019, target: g++-5 }
# TODO: Implement support for clang and MSVC on Windows # TODO: Implement support for clang and MSVC2017 on Windows
# Currently those are still being run by the auto-tester # Currently those are still being run by the auto-tester
- os: windows-2019 # We can hardly test below 2017 in the CI because there's
# no way to install it via command line
# (TODO: Test with 2015 as the blog post is slightly ambiguous)
# https://devblogs.microsoft.com/cppblog/introducing-the-visual-studio-build-tools/
- { os: windows-2019, target: msvc-2017 }
- { os: windows-2019, target: msvc-2015 }
- { os: windows-2019, target: msvc-2013 }
- { os: windows-2019, target: clang-13.0.0 }
- { os: windows-2019, target: clang-12.0.0 }
- { os: windows-2019, target: clang-11.0.0 }
- { os: windows-2019, target: clang-10.0.0 }
- { os: windows-2019, target: clang-9.0.0 }
- { os: windows-2019, target: clang-8.0.0 }
# This sets the configuration for each jobs # This sets the configuration for each jobs
# There's a bit of duplication involved (e.g. breaking down g++-9.3 into 2 strings), # There's a bit of duplication involved (e.g. breaking down g++-9.3 into 2 strings),
@ -191,13 +203,6 @@ jobs:
with: with:
path: dmd path: dmd
persist-credentials: false persist-credentials: false
- name: Checkout druntime
uses: actions/checkout@v2
with:
path: druntime
repository: dlang/druntime
ref: ${{ steps.base_branch.outputs.branch }}
persist-credentials: false
- name: Checkout Phobos - name: Checkout Phobos
uses: actions/checkout@v2 uses: actions/checkout@v2
with: with:
@ -304,48 +309,115 @@ jobs:
exit 1 exit 1
fi fi
# Restore or install dmc (and DM make)
- name: '[Windows] Restore dmc from cache'
id: cache-dmc
if: runner.os == 'Windows'
uses: actions/cache@v1
with:
path: ${{ github.workspace }}\tools\
key: ${{ matrix.os }}-dmc857
- name: '[Windows] Install dmc'
if: runner.os == 'Windows' && steps.cache-dmc.outputs.cache-hit != 'true'
shell: powershell
run: |
$url = "http://ftp.digitalmars.com/Digital_Mars_C++/Patch/dm857c.zip"
$sha256hash = "F51CDFEB45EAF4FFBF7ABF0FE9B3D548B202B4528401005C2C3192B00BC32367"
Write-Host ('Downloading {0} ...' -f $url)
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$ProgressPreference = 'SilentlyContinue'
New-Item -ItemType directory -Path ${{ github.workspace }}\tools\
Invoke-WebRequest -Uri $url -OutFile '${{ github.workspace }}\tools\dmc.zip'
if ((Get-FileHash '${{ github.workspace }}\tools\dmc.zip' -Algorithm "SHA256").Hash -ne $sha256hash) {
exit 1
}
Expand-Archive '${{ github.workspace }}\tools\dmc.zip' -DestinationPath ${{ github.workspace }}\tools\
- name: '[Windows] Add VC toolset to PATH'
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1
- name: '[Windows] Set environment variables'
if: runner.os == 'Windows'
shell: bash
run: |
echo "VISUAL_STUDIO_LIB_NOT_DM=$(which lib.exe)" >> $GITHUB_ENV
echo "HOST_DMD=${{ env.DC }}" >> $GITHUB_ENV
echo "${{ github.workspace }}/tools/dm/bin/" >> $GITHUB_PATH
######################################## ########################################
# Building DMD, druntime, Phobos # # Building DMD, druntime, Phobos #
######################################## ########################################
- name: '[Posix] Build compiler & standard library' - name: '[Posix] Build compiler & standard library'
if: runner.os != 'Windows'
# By default, VMs have 2 processors available, hence the `-j2`: # By default, VMs have 2 processors available, hence the `-j2`:
# https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners#supported-runners-and-hardware-resources # https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners#supported-runners-and-hardware-resources
run: | run: |
# All hosts are 64 bits but let's be explicit # All hosts are 64 bits but let's be explicit
./dmd/src/build.d -j2 MODEL=64 ./dmd/compiler/src/build.d -j2 MODEL=64
make -C druntime -f posix.mak -j2 MODEL=64 make -C dmd/druntime -f posix.mak -j2 MODEL=64
make -C phobos -f posix.mak -j2 MODEL=64 make -C phobos -f posix.mak -j2 MODEL=64
# Both version can live side by side (they end up in a different directory) # Both version can live side by side (they end up in a different directory)
# However, since clang does not provide a multilib package, only test 32 bits with g++ # However, since clang does not provide a multilib package, only test 32 bits with g++
if [ ${{ matrix.compiler }} == "g++" ]; then if [ ${{ matrix.compiler }} == "g++" ]; then
./dmd/src/build.d install -j2 MODEL=32 ./dmd/compiler/src/build.d install -j2 MODEL=32
make -C druntime -f posix.mak install -j2 MODEL=32 make -C dmd/druntime -f posix.mak install -j2 MODEL=32
make -C phobos -f posix.mak install -j2 MODEL=32 make -C phobos -f posix.mak install -j2 MODEL=32
fi fi
- name: '[Windows] Build compiler & standard library'
if: runner.os == 'Windows'
shell: bash
run: |
dmd -run dmd/compiler/src/build.d -j2 MODEL=64
if [ $? -ne 0 ]; then return 1; fi
# Note: Only CC for druntime and AR for Phobos are required ATM,
# but providing all three to avoid surprise for future contributors
# Those should really be in the path, though.
cd dmd/druntime
make -f win64.mak
if [ $? -ne 0 ]; then return 1; fi
cd ../../phobos/
make -f win64.mak CC=cl.exe LD=link "AR=$VISUAL_STUDIO_LIB_NOT_DM"
if [ $? -ne 0 ]; then return 1; fi
cd ../
######################################## ########################################
# Running the test suite # # Running the test suite #
######################################## ########################################
- name: Run C++ test suite - name: '[Posix] Run C++ test suite'
if: runner.os != 'Windows'
env: env:
# Reset LD_LIBRARY_PATH when running the tests, so they use the newly built libphobos2.so. # Reset LD_LIBRARY_PATH when running the tests, so they use the newly built libphobos2.so.
LD_LIBRARY_PATH: '' LD_LIBRARY_PATH: ''
run: | run: |
./dmd/test/run.d --environment runnable_cxx dshell/dll_cxx.d MODEL=64 ./dmd/compiler/test/run.d --environment runnable_cxx dshell/dll_cxx.d MODEL=64
if [ ${{ matrix.compiler }} == "g++" ]; then if [ ${{ matrix.compiler }} == "g++" ]; then
./dmd/test/run.d clean ./dmd/compiler/test/run.d clean
./dmd/test/run.d --environment runnable_cxx dshell/dll_cxx.d MODEL=32 ./dmd/compiler/test/run.d --environment runnable_cxx dshell/dll_cxx.d MODEL=32
fi fi
- name: '[Windows] Run C++ test suite'
if: runner.os == 'Windows'
shell: bash
run: |
cd dmd/druntime
make -f win64.mak test_stdcpp CC=cl.exe LD=link "AR=$VISUAL_STUDIO_LIB_NOT_DM"
if [ $? -ne 0 ]; then return 1; fi
######################################## ########################################
# Run C++ frontend unittests # # Run C++ frontend unittests #
######################################## ########################################
- name: Run C++ frontend unittests - name: Run C++ frontend unittests
if: matrix.compiler == 'g++'
run: | run: |
./dmd/src/build.d cxx-unittest MODEL=64 ./dmd/compiler/src/build.d cxx-unittest MODEL=64
if [ ${{ matrix.compiler }} == "g++" ]; then
./dmd/src/build.d cxx-unittest MODEL=32 - name: Run C++ frontend unittests (32-bit)
fi if: matrix.compiler == 'g++'
run: |
./dmd/compiler/src/build.d cxx-unittest MODEL=32
######################################## ########################################
# Store generated artifacts # # Store generated artifacts #

20
.gitignore vendored
View file

@ -1,9 +1,9 @@
*.[oa] *.[oa]
*.deps *.deps
.B* .B*
test/test_results /compiler/test/test_results
test/trace.def /compiler/test/trace.def
test/trace.log /compiler/test/trace.log
generated/ generated/
*.obj *.obj
*.map *.map
@ -17,9 +17,9 @@ dub.selections.json
# Visual Studio files # Visual Studio files
*.exe *.exe
*.pdb *.pdb
src/vcbuild/Win32 /compiler/src/vcbuild/Win32
src/vcbuild/x64 /compiler/src/vcbuild/x64
src/vcbuild/.vs /compiler/src/vcbuild/.vs
*.ncb *.ncb
*.suo *.suo
*.sdf *.sdf
@ -35,13 +35,13 @@ xcuserdata/
dmd.xcodeproj/ dmd.xcodeproj/
# Output files # Output files
src/*.bak /compiler/src/*.bak
src/*.lib /compiler/src/*.lib
src/*.lst /compiler/src/*.lst
tags tags
# OSX # OSX
src/optabgen.dSYM/ /compiler/src/optabgen.dSYM/
# GCov # GCov
*.gcno *.gcno

View file

@ -59,9 +59,9 @@ clone() {
# build dmd (incl. building and running the unittests), druntime, phobos # build dmd (incl. building and running the unittests), druntime, phobos
build() { build() {
source ~/dlang/*/activate # activate host compiler, incl. setting `DMD` source ~/dlang/*/activate # activate host compiler, incl. setting `DMD`
make -j$N -C 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" BUILD=debug ENABLE_WARNINGS=1 unittest
make -j$N -C src -f posix.mak MODEL=$MODEL HOST_DMD=$DMD DFLAGS="$CI_DFLAGS" ENABLE_RELEASE=1 ENABLE_WARNINGS=1 all make -j$N -C compiler/src -f posix.mak MODEL=$MODEL HOST_DMD=$DMD DFLAGS="$CI_DFLAGS" ENABLE_RELEASE=1 ENABLE_WARNINGS=1 all
make -j$N -C ../druntime -f posix.mak MODEL=$MODEL make -j$N -C druntime -f posix.mak MODEL=$MODEL
make -j$N -C ../phobos -f posix.mak MODEL=$MODEL make -j$N -C ../phobos -f posix.mak MODEL=$MODEL
deactivate # deactivate host compiler deactivate # deactivate host compiler
} }
@ -75,8 +75,8 @@ rebuild() {
mkdir -p _${build_path} mkdir -p _${build_path}
cp $build_path/dmd _${build_path}/host_dmd cp $build_path/dmd _${build_path}/host_dmd
cp $build_path/dmd.conf _${build_path} cp $build_path/dmd.conf _${build_path}
make -j$N -C 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 clean
make -j$N -C src -f posix.mak MODEL=$MODEL HOST_DMD=../_${build_path}/host_dmd DFLAGS="$CI_DFLAGS" ENABLE_RELEASE=${ENABLE_RELEASE:-1} ENABLE_WARNINGS=1 all 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
# compare binaries to test reproducible build # compare binaries to test reproducible build
if [ $compare -eq 1 ]; then if [ $compare -eq 1 ]; then
@ -102,15 +102,15 @@ test() {
test_dmd() { test_dmd() {
# test fewer compiler argument permutations for PRs to reduce CI load # test fewer compiler argument permutations for PRs to reduce CI load
if [ "$FULL_BUILD" == "true" ] && [ "$OS_NAME" == "linux" ]; then if [ "$FULL_BUILD" == "true" ] && [ "$OS_NAME" == "linux" ]; then
make -j1 -C test MODEL=$MODEL N=$N # all ARGS by default make -j1 -C compiler/test MODEL=$MODEL N=$N # all ARGS by default
else else
make -j1 -C test MODEL=$MODEL N=$N ARGS="-O -inline -release" make -j1 -C compiler/test MODEL=$MODEL N=$N ARGS="-O -inline -release"
fi fi
} }
# build and run druntime unit tests # 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 # build and run Phobos unit tests
@ -145,10 +145,10 @@ test_dub_package() {
deactivate deactivate
} }
# clone druntime/phobos repos if not already available # clone phobos repos if not already available
setup_repos() { setup_repos() {
local branch="$1" local branch="$1"
for proj in druntime phobos; do for proj in phobos; do
if [ ! -d ../$proj ]; then if [ ! -d ../$proj ]; then
if [ $branch != master ] && [ $branch != stable ] && if [ $branch != master ] && [ $branch != stable ] &&
! git ls-remote --exit-code --heads https://github.com/dlang/$proj.git $branch > /dev/null; then ! git ls-remote --exit-code --heads https://github.com/dlang/$proj.git $branch > /dev/null; then

View file

@ -21,8 +21,9 @@ import std.parallelism : TaskPool, totalCPUs;
const thisBuildScript = __FILE_FULL_PATH__.buildNormalizedPath; const thisBuildScript = __FILE_FULL_PATH__.buildNormalizedPath;
const srcDir = thisBuildScript.dirName; const srcDir = thisBuildScript.dirName;
const dmdRepo = srcDir.dirName; const compilerDir = srcDir.dirName;
const testDir = dmdRepo.buildPath("test"); const dmdRepo = compilerDir.dirName;
const testDir = compilerDir.buildPath("test");
shared bool verbose; // output verbose logging shared bool verbose; // output verbose logging
shared bool force; // always build everything (ignores timestamp checking) shared bool force; // always build everything (ignores timestamp checking)
@ -292,7 +293,7 @@ alias lexer = makeRuleWithArgs!((MethodInitializer!BuildRule builder, BuildRule
extraFlags, extraFlags,
// source files need to have relative paths in order for the code coverage // source files need to have relative paths in order for the code coverage
// .lst files to be named properly for CodeCov to find them // .lst files to be named properly for CodeCov to find them
rule.sources.map!(e => e.relativePath(dmdRepo)) rule.sources.map!(e => e.relativePath(compilerDir))
).array ).array
) )
); );
@ -307,7 +308,7 @@ alias dmdConf = makeRule!((builder, rule) {
{ {
enum confFile = "sc.ini"; enum confFile = "sc.ini";
enum conf = `[Environment] enum conf = `[Environment]
DFLAGS="-I%@P%\..\..\..\..\..\druntime\import" "-I%@P%\..\..\..\..\..\phobos" DFLAGS="-I%@P%\..\..\..\..\druntime\import" "-I%@P%\..\..\..\..\..\phobos"
LIB="%@P%\..\..\..\..\..\phobos" LIB="%@P%\..\..\..\..\..\phobos"
[Environment32] [Environment32]
@ -324,10 +325,10 @@ DFLAGS=%DFLAGS% -L/OPT:NOICF
{ {
enum confFile = "dmd.conf"; enum confFile = "dmd.conf";
enum conf = `[Environment32] enum conf = `[Environment32]
DFLAGS=-I%@P%/../../../../../druntime/import -I%@P%/../../../../../phobos -L-L%@P%/../../../../../phobos/generated/{OS}/{BUILD}/32{exportDynamic} -fPIC DFLAGS=-I%@P%/../../../../druntime/import -I%@P%/../../../../../phobos -L-L%@P%/../../../../../phobos/generated/{OS}/{BUILD}/32{exportDynamic} -fPIC
[Environment64] [Environment64]
DFLAGS=-I%@P%/../../../../../druntime/import -I%@P%/../../../../../phobos -L-L%@P%/../../../../../phobos/generated/{OS}/{BUILD}/64{exportDynamic} -fPIC DFLAGS=-I%@P%/../../../../druntime/import -I%@P%/../../../../../phobos -L-L%@P%/../../../../../phobos/generated/{OS}/{BUILD}/64{exportDynamic} -fPIC
`; `;
} }
@ -362,7 +363,7 @@ alias common = makeRuleWithArgs!((MethodInitializer!BuildRule builder, BuildRule
// source files need to have relative paths in order for the code coverage // source files need to have relative paths in order for the code coverage
// .lst files to be named properly for CodeCov to find them // .lst files to be named properly for CodeCov to find them
rule.sources.map!(e => e.relativePath(dmdRepo)) rule.sources.map!(e => e.relativePath(compilerDir))
).array) ).array)
); );
@ -398,7 +399,7 @@ alias backend = makeRuleWithArgs!((MethodInitializer!BuildRule builder, BuildRul
// source files need to have relative paths in order for the code coverage // source files need to have relative paths in order for the code coverage
// .lst files to be named properly for CodeCov to find them // .lst files to be named properly for CodeCov to find them
rule.sources.map!(e => e.relativePath(dmdRepo)) rule.sources.map!(e => e.relativePath(compilerDir))
).array) ).array)
); );
@ -490,7 +491,7 @@ alias dmdExe = makeRuleWithArgs!((MethodInitializer!BuildRule builder, BuildRule
].chain(extraFlags, platformArgs, flags["DFLAGS"], ].chain(extraFlags, platformArgs, flags["DFLAGS"],
// source files need to have relative paths in order for the code coverage // source files need to have relative paths in order for the code coverage
// .lst files to be named properly for CodeCov to find them // .lst files to be named properly for CodeCov to find them
rule.sources.map!(e => e.relativePath(dmdRepo)) rule.sources.map!(e => e.relativePath(compilerDir))
).array); ).array);
}); });
@ -587,9 +588,9 @@ alias dmdPGO = makeRule!((builder, rule) {
// Run phobos unittests // Run phobos unittests
//TODO makefiles //TODO makefiles
//generated/linux/release/64/unittest/test_runner builds the unittests without running them. //generated/linux/release/64/unittest/test_runner builds the unittests without running them.
const scope cmd = ["make", "-C", "../phobos", "-j" ~ jobs.to!string, "-fposix.mak", "generated/linux/release/64/unittest/test_runner", "DMD_DIR="~dmdRepo]; const scope cmd = ["make", "-C", "../phobos", "-j" ~ jobs.to!string, "-fposix.mak", "generated/linux/release/64/unittest/test_runner", "DMD_DIR="~compilerDir];
log("%-(%s %)", cmd); log("%-(%s %)", cmd);
if (spawnProcess(cmd, null, Config.init, dmdRepo).wait()) if (spawnProcess(cmd, null, Config.init, compilerDir).wait())
stderr.writeln("Phobos Tests failed! This will not end the PGO build because some data may have been gathered"); stderr.writeln("Phobos Tests failed! This will not end the PGO build because some data may have been gathered");
})); }));
alias finalDataMerge = methodInit!(BuildRule, (rundBuilder, rundRule) => rundBuilder alias finalDataMerge = methodInit!(BuildRule, (rundBuilder, rundRule) => rundBuilder
@ -807,7 +808,7 @@ alias toolsRepo = makeRule!((builder, rule) => builder
auto toolsDir = env["TOOLS_DIR"]; auto toolsDir = env["TOOLS_DIR"];
version(Win32) version(Win32)
// Win32-git seems to confuse C:\... as a relative path // Win32-git seems to confuse C:\... as a relative path
toolsDir = toolsDir.relativePath(dmdRepo); toolsDir = toolsDir.relativePath(compilerDir);
run([env["GIT"], "clone", "--depth=1", env["GIT_HOME"] ~ "/tools", toolsDir]); run([env["GIT"], "clone", "--depth=1", env["GIT_HOME"] ~ "/tools", toolsDir]);
}) })
); );
@ -893,7 +894,7 @@ alias man = makeRule!((builder, rule) {
alias genMan = methodInit!(BuildRule, (genManBuilder, genManRule) => genManBuilder alias genMan = methodInit!(BuildRule, (genManBuilder, genManRule) => genManBuilder
.target(env["G"].buildPath("gen_man")) .target(env["G"].buildPath("gen_man"))
.sources([ .sources([
dmdRepo.buildPath("docs", "gen_man.d"), compilerDir.buildPath("docs", "gen_man.d"),
env["D"].buildPath("cli.d")]) env["D"].buildPath("cli.d")])
.command([ .command([
env["HOST_DMD_RUN"], env["HOST_DMD_RUN"],
@ -920,7 +921,7 @@ alias man = makeRule!((builder, rule) {
"man1/dumpobj.1 man1/obj2asm.1 man5/dmd.conf.5".split "man1/dumpobj.1 man1/obj2asm.1 man5/dmd.conf.5".split
.map!(e => methodInit!(BuildRule, (manFileBuilder, manFileRule) => manFileBuilder .map!(e => methodInit!(BuildRule, (manFileBuilder, manFileRule) => manFileBuilder
.target(genManDir.buildPath(e)) .target(genManDir.buildPath(e))
.sources([dmdRepo.buildPath("docs", "man", e)]) .sources([compilerDir.buildPath("docs", "man", e)])
.deps([directoryRule(manFileRule.target.dirName)]) .deps([directoryRule(manFileRule.target.dirName)])
.commandFunction(() => copyAndTouch(manFileRule.sources[0], manFileRule.target)) .commandFunction(() => copyAndTouch(manFileRule.sources[0], manFileRule.target))
.msg("copy '%s' to '%s'".format(manFileRule.sources[0], manFileRule.target)) .msg("copy '%s' to '%s'".format(manFileRule.sources[0], manFileRule.target))
@ -1069,17 +1070,17 @@ alias install = makeRule!((builder, rule) {
installRelativeFiles(env["INSTALL"].buildPath(env["OS"], bin), dmdExeFile.dirName, dmdExeFile.only, octal!755); installRelativeFiles(env["INSTALL"].buildPath(env["OS"], bin), dmdExeFile.dirName, dmdExeFile.only, octal!755);
version (Windows) version (Windows)
installRelativeFiles(env["INSTALL"], dmdRepo, sourceFiles); installRelativeFiles(env["INSTALL"], compilerDir, sourceFiles);
const scPath = buildPath(env["OS"], bin, conf); const scPath = buildPath(env["OS"], bin, conf);
const iniPath = buildPath(dmdRepo, "ini"); const iniPath = buildPath(compilerDir, "ini");
// The sources distributed alongside an official release only include the // The sources distributed alongside an official release only include the
// configuration of the current OS at the root directory instead of the // configuration of the current OS at the root directory instead of the
// whole `ini` folder in the project root. // whole `ini` folder in the project root.
const confPath = iniPath.exists() const confPath = iniPath.exists()
? buildPath(iniPath, scPath) ? buildPath(iniPath, scPath)
: buildPath(dmdRepo, "..", scPath); : buildPath(dmdRepo, scPath);
copyAndTouch(confPath, buildPath(env["INSTALL"], scPath)); copyAndTouch(confPath, buildPath(env["INSTALL"], scPath));
@ -1258,9 +1259,9 @@ void parseEnvironment()
else else
enum installPref = ".."; enum installPref = "..";
env.setDefault("INSTALL", environment.get("INSTALL_DIR", dmdRepo.buildPath(installPref, "install"))); env.setDefault("INSTALL", environment.get("INSTALL_DIR", compilerDir.buildPath(installPref, "install")));
env.setDefault("DOCSRC", dmdRepo.buildPath("dlang.org")); env.setDefault("DOCSRC", compilerDir.buildPath("dlang.org"));
env.setDefault("DOCDIR", srcDir); env.setDefault("DOCDIR", srcDir);
env.setDefault("DOC_OUTPUT_DIR", env["DOCDIR"]); env.setDefault("DOC_OUTPUT_DIR", env["DOCDIR"]);
@ -1272,7 +1273,7 @@ void parseEnvironment()
auto generated = env["GENERATED"] = dmdRepo.buildPath("generated"); auto generated = env["GENERATED"] = dmdRepo.buildPath("generated");
auto g = env["G"] = generated.buildPath(os, build, model); auto g = env["G"] = generated.buildPath(os, build, model);
mkdirRecurse(g); mkdirRecurse(g);
env.setDefault("TOOLS_DIR", dmdRepo.dirName.buildPath("tools")); env.setDefault("TOOLS_DIR", compilerDir.dirName.buildPath("tools"));
auto hostDmdDef = env.getDefault("HOST_DMD", null); auto hostDmdDef = env.getDefault("HOST_DMD", null);
if (hostDmdDef.length == 0) if (hostDmdDef.length == 0)
@ -2243,7 +2244,7 @@ class BuildException : Exception
The directory where all run commands are executed from. All relative file paths The directory where all run commands are executed from. All relative file paths
in a `run` command must be relative to `runDir`. in a `run` command must be relative to `runDir`.
*/ */
alias runDir = dmdRepo; alias runDir = compilerDir;
/** /**
Run a command which may not succeed and optionally log the invocation. Run a command which may not succeed and optionally log the invocation.

View file

@ -68,7 +68,7 @@ endif
INSTALL_DIR=../../install INSTALL_DIR=../../install
D = dmd D = dmd
GENERATED = ../generated GENERATED = ../../generated
G = $(GENERATED)/$(OS)/$(BUILD)/$(MODEL) G = $(GENERATED)/$(OS)/$(BUILD)/$(MODEL)
$(shell mkdir -p $G) $(shell mkdir -p $G)

View file

@ -112,32 +112,32 @@
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental> <LinkIncremental>true</LinkIncremental>
<OutDir>..\..\generated\Windows\$(Configuration)\$(PlatformName)\</OutDir> <OutDir>..\..\..\generated\Windows\$(Configuration)\$(PlatformName)\</OutDir>
<IntDir>$(OutDir)\dmd\</IntDir> <IntDir>$(OutDir)\dmd\</IntDir>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental> <LinkIncremental>true</LinkIncremental>
<OutDir>..\..\generated\Windows\$(Configuration)\$(PlatformName)\</OutDir> <OutDir>..\..\..\generated\Windows\$(Configuration)\$(PlatformName)\</OutDir>
<IntDir>$(OutDir)\dmd\</IntDir> <IntDir>$(OutDir)\dmd\</IntDir>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental> <LinkIncremental>false</LinkIncremental>
<OutDir>..\..\generated\Windows\$(Configuration)\$(PlatformName)\</OutDir> <OutDir>..\..\..\generated\Windows\$(Configuration)\$(PlatformName)\</OutDir>
<IntDir>$(OutDir)\dmd\</IntDir> <IntDir>$(OutDir)\dmd\</IntDir>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RelWithAsserts|Win32'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RelWithAsserts|Win32'">
<LinkIncremental>false</LinkIncremental> <LinkIncremental>false</LinkIncremental>
<OutDir>..\..\generated\Windows\$(Configuration)\$(PlatformName)\</OutDir> <OutDir>..\..\..\generated\Windows\$(Configuration)\$(PlatformName)\</OutDir>
<IntDir>$(OutDir)\dmd\</IntDir> <IntDir>$(OutDir)\dmd\</IntDir>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental> <LinkIncremental>false</LinkIncremental>
<OutDir>..\..\generated\Windows\$(Configuration)\$(PlatformName)\</OutDir> <OutDir>..\..\..\generated\Windows\$(Configuration)\$(PlatformName)\</OutDir>
<IntDir>$(OutDir)\dmd\</IntDir> <IntDir>$(OutDir)\dmd\</IntDir>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RelWithAsserts|x64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RelWithAsserts|x64'">
<LinkIncremental>false</LinkIncremental> <LinkIncremental>false</LinkIncremental>
<OutDir>..\..\generated\Windows\$(Configuration)\$(PlatformName)\</OutDir> <OutDir>..\..\..\generated\Windows\$(Configuration)\$(PlatformName)\</OutDir>
<IntDir>$(OutDir)\dmd\</IntDir> <IntDir>$(OutDir)\dmd\</IntDir>
</PropertyGroup> </PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
@ -316,9 +316,9 @@
<ClInclude Include="../dmd/**/*.h" /> <ClInclude Include="../dmd/**/*.h" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<CustomBuild Include="..\..\VERSION"> <CustomBuild Include="..\..\..\VERSION">
<Message>Creating VERSION: $(_rdmdExe) ..\..\config.d $(OutDir) ..\..\VERSION</Message> <Message>Creating VERSION: $(_rdmdExe) ..\..\..\config.d $(OutDir) ..\..\..\VERSION</Message>
<Command>$(_rdmdExe) ..\..\config.d $(OutDir) ..\..\VERSION</Command> <Command>$(_rdmdExe) ..\..\..\config.d $(OutDir) ..\..\..\VERSION</Command>
<Outputs>$(OutDir)VERSION;%(Outputs)</Outputs> <Outputs>$(OutDir)VERSION;%(Outputs)</Outputs>
</CustomBuild> </CustomBuild>
</ItemGroup> </ItemGroup>

View file

@ -49,7 +49,7 @@ OS=windows
D=dmd D=dmd
# Generated files directory # Generated files directory
GEN = ..\generated GEN = ..\..\generated
G = $(GEN)\$(OS)\$(BUILD)\$(MODEL) G = $(GEN)\$(OS)\$(BUILD)\$(MODEL)
##### Tools ##### Tools

View file

@ -17,7 +17,7 @@ OS=windows
$(HOST_DC) -g -of$@ $< $(HOST_DC) -g -of$@ $<
D=dmd D=dmd
GEN = ..\generated GEN = ..\..\generated
G = $(GEN)\$(OS)\$(BUILD)\$(MODEL) G = $(GEN)\$(OS)\$(BUILD)\$(MODEL)
DEPENDENCIES=vcbuild\msvc-lib.exe $G DEPENDENCIES=vcbuild\msvc-lib.exe $G

View file

@ -48,31 +48,31 @@ ifeq ($(findstring win,$(OS)),win)
PIC?=0 PIC?=0
DRUNTIME_PATH=..\..\druntime DRUNTIME_PATH=..\..\druntime
PHOBOS_PATH=..\..\phobos PHOBOS_PATH=..\..\..\phobos
export DFLAGS=-I$(DRUNTIME_PATH)\import -I$(PHOBOS_PATH) export DFLAGS=-I$(DRUNTIME_PATH)\import -I$(PHOBOS_PATH)
export LIB=$(PHOBOS_PATH) export LIB=$(PHOBOS_PATH)
# auto-tester might run the testsuite with a different $(MODEL) than DMD # auto-tester might run the testsuite with a different $(MODEL) than DMD
# has been compiled with. Hence we manually check which binary exists. # has been compiled with. Hence we manually check which binary exists.
# For windows the $(OS) during build is: `windows` # For windows the $(OS) during build is: `windows`
ifeq (,$(wildcard ../generated/windows/$(BUILD)/64/dmd$(EXE))) ifeq (,$(wildcard ../../generated/windows/$(BUILD)/64/dmd$(EXE)))
DMD_MODEL=32 DMD_MODEL=32
else else
DMD_MODEL=64 DMD_MODEL=64
endif endif
export DMD=../generated/windows/$(BUILD)/$(DMD_MODEL)/dmd$(EXE) export DMD=../../generated/windows/$(BUILD)/$(DMD_MODEL)/dmd$(EXE)
else else
export EXE= export EXE=
# auto-tester might run the testsuite with a different $(MODEL) than DMD # auto-tester might run the testsuite with a different $(MODEL) than DMD
# has been compiled with. Hence we manually check which binary exists. # has been compiled with. Hence we manually check which binary exists.
ifeq (,$(wildcard ../generated/$(OS)/$(BUILD)/64/dmd)) ifeq (,$(wildcard ../../generated/$(OS)/$(BUILD)/64/dmd))
DMD_MODEL=32 DMD_MODEL=32
else else
DMD_MODEL=64 DMD_MODEL=64
endif endif
export DMD=../generated/$(OS)/$(BUILD)/$(DMD_MODEL)/dmd export DMD=../../generated/$(OS)/$(BUILD)/$(DMD_MODEL)/dmd
# default to PIC, use PIC=1/0 to en-/disable PIC. # default to PIC, use PIC=1/0 to en-/disable PIC.
# Note that shared libraries and C files are always compiled with PIC. # Note that shared libraries and C files are always compiled with PIC.
@ -86,7 +86,7 @@ else
endif endif
DRUNTIME_PATH=../../druntime DRUNTIME_PATH=../../druntime
PHOBOS_PATH=../../phobos PHOBOS_PATH=../../../phobos
# link against shared libraries (defaults to true on supported platforms, can be overridden w/ make SHARED=0) # link against shared libraries (defaults to true on supported platforms, can be overridden w/ make SHARED=0)
SHARED=$(if $(findstring $(OS),linux freebsd),1,) SHARED=$(if $(findstring $(OS),linux freebsd),1,)
DFLAGS=-I$(DRUNTIME_PATH)/import -I$(PHOBOS_PATH) -L-L$(PHOBOS_PATH)/generated/$(OS)/$(BUILD)/$(MODEL) DFLAGS=-I$(DRUNTIME_PATH)/import -I$(PHOBOS_PATH) -L-L$(PHOBOS_PATH)/generated/$(OS)/$(BUILD)/$(MODEL)

View file

@ -9,7 +9,7 @@
"importPaths": [ "importPaths": [
"compilable", "compilable",
"../../druntime/import", "../../druntime/import",
"../../phobos" "../../../phobos"
], ],
"libName": "VALUE_REMOVED_FOR_TEST", "libName": "VALUE_REMOVED_FOR_TEST",
"libraryFiles": [ "libraryFiles": [

View file

@ -10,7 +10,7 @@ int main()
run("$DMD -m$MODEL -of$OUTPUT_BASE/a$EXE -defaultlib=libphobos2.so $EXTRA_FILES/test_shared.d"); run("$DMD -m$MODEL -of$OUTPUT_BASE/a$EXE -defaultlib=libphobos2.so $EXTRA_FILES/test_shared.d");
run("$OUTPUT_BASE/a$EXE", stdout, stderr, [ run("$OUTPUT_BASE/a$EXE", stdout, stderr, [
"LD_LIBRARY_PATH" : "../../phobos/generated/"~OS~'/'~BUILD~'/'~MODEL "LD_LIBRARY_PATH" : "../../../phobos/generated/"~OS~'/'~BUILD~'/'~MODEL
]); ]);
return 0; return 0;

View file

@ -61,10 +61,10 @@ private struct CallbackHelper {
int main() int main()
{ {
auto dmdParentDir = dirName(dirName(dirName(__FILE_FULL_PATH__))); auto dmdParentDir = dirName(dirName(dirName(dirName(__FILE_FULL_PATH__))));
global.path = new Strings(); global.path = new Strings();
global.path.push((dmdParentDir ~ "/phobos").ptr); global.path.push((dmdParentDir ~ "/phobos").ptr);
global.path.push((dmdParentDir ~ "/druntime/import").ptr); global.path.push((dmdParentDir ~ "/dmd/druntime/import").ptr);
/* comment for error output in parsing & semantic */ /* comment for error output in parsing & semantic */
diagnosticHandler = (const ref Loc location, diagnosticHandler = (const ref Loc location,

View file

@ -529,7 +529,7 @@ string[string] getEnvironment()
env["DSEP"] = `\\`; env["DSEP"] = `\\`;
env["SEP"] = `\`; env["SEP"] = `\`;
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 ~ ";" ~ environment.get("LIB"); env["LIB"] = phobosPath ~ ";" ~ environment.get("LIB");
} }
@ -540,7 +540,7 @@ string[string] getEnvironment()
env["DSEP"] = "/"; env["DSEP"] = "/";
env["SEP"] = "/"; env["SEP"] = "/";
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`));
// default to PIC, use PIC=1/0 to en-/disable PIC. // default to PIC, use PIC=1/0 to en-/disable PIC.
// Note that shared libraries and C files are always compiled with PIC. // Note that shared libraries and C files are always compiled with PIC.

View file

@ -30,12 +30,13 @@ else version (SunOS)
else else
static assert(0, "Unrecognized or unsupported OS."); static assert(0, "Unrecognized or unsupported OS.");
enum projectRootDir = __FILE_FULL_PATH__.dirName.buildNormalizedPath("..", ".."); enum projectRootDir = __FILE_FULL_PATH__.dirName.buildNormalizedPath("..", "..", "..");
enum generatedDir = projectRootDir.buildPath("generated"); enum generatedDir = projectRootDir.buildPath("generated");
enum dmdFilename = "dmd".setExtension(exeExtension); enum dmdFilename = "dmd".setExtension(exeExtension);
alias testPath = path => projectRootDir.buildPath("test", path); enum compilerRootDir = __FILE_FULL_PATH__.dirName.buildNormalizedPath("..", "..");
alias testPath = path => compilerRootDir.buildPath("test", path);
string build() string build()
{ {

View file

@ -239,7 +239,7 @@ void writeRunnerFile(Range)(Range moduleNames, string path, string filter)
.joiner(",\n") .joiner(",\n")
.to!string; .to!string;
const content = format!codeTemplate(imports, modules, format!`"%s"`(filter), projectRootDir); const content = format!codeTemplate(imports, modules, format!`"%s"`(filter), compilerRootDir);
write(path, content); write(path, content);
} }
@ -269,7 +269,7 @@ string[] buildCmdArgs(string runnerPath, string outputPath, const string[] testF
"-of" ~ outputPath, "-of" ~ outputPath,
"-m" ~ model "-m" ~ model
], ],
testFiles.map!(f => relativePath(f, projectRootDir)), testFiles.map!(f => relativePath(f, compilerRootDir)),
[ runnerPath ] [ runnerPath ]
).array; ).array;
@ -339,7 +339,7 @@ int main(string[] args)
const flags = buildCmdArgs(runnerPath, outputPath, testFiles); const flags = buildCmdArgs(runnerPath, outputPath, testFiles);
write(cmdfilePath, flags.join("\n")); write(cmdfilePath, flags.join("\n"));
const dmd = execute([ dmdPath, "@" ~ cmdfilePath ], null, Config.none, size_t.max, projectRootDir); const dmd = execute([ dmdPath, "@" ~ cmdfilePath ], null, Config.none, size_t.max, compilerRootDir);
if (dmd.status) if (dmd.status)
{ {
enum msg = "Failed to compile the `unit` test executable! (exit code %d) enum msg = "Failed to compile the `unit` test executable! (exit code %d)

View file

@ -22,7 +22,7 @@ string[] defaultImportPaths()
enum dlangDir = __FILE_FULL_PATH__.dirName.buildNormalizedPath("..", "..", ".."); enum dlangDir = __FILE_FULL_PATH__.dirName.buildNormalizedPath("..", "..", "..");
enum druntimeDir = dlangDir.buildPath("druntime", "import"); enum druntimeDir = dlangDir.buildPath("druntime", "import");
enum phobosDir = dlangDir.buildPath("phobos"); enum phobosDir = dlangDir.buildPath("..", "phobos");
return [ return [
environment.get("DRUNTIME_PATH", druntimeDir), environment.get("DRUNTIME_PATH", druntimeDir),

View file

@ -590,4 +590,4 @@ ParameterList createTemplateParameterList(ArgMatch[] vargs)
pl.addMember(pd); pl.addMember(pd);
} }
return pl; return pl;
} }

View file

@ -5,9 +5,9 @@
QUIET:= QUIET:=
DMD_DIR=../dmd DMD_DIR=../compiler
DUB=dub DUB=dub
TOOLS_DIR=../tools TOOLS_DIR=../../tools
include $(DMD_DIR)/src/osmodel.mak include $(DMD_DIR)/src/osmodel.mak
@ -25,8 +25,8 @@ ifneq ($(BUILD),release)
endif endif
endif endif
DMD=$(DMD_DIR)/generated/$(OS)/$(BUILD)/$(MODEL)/dmd DMD=$(DMD_DIR)/../generated/$(OS)/$(BUILD)/$(MODEL)/dmd
INSTALL_DIR=../install INSTALL_DIR=../../install
# directory where the html files for the documentation are placed # directory where the html files for the documentation are placed
DOC_OUTPUT_DIR=doc DOC_OUTPUT_DIR=doc
@ -88,7 +88,7 @@ endif
UTFLAGS:=-version=CoreUnittest -unittest -checkaction=context UTFLAGS:=-version=CoreUnittest -unittest -checkaction=context
# Set PHOBOS_DFLAGS (for linking against Phobos) # Set PHOBOS_DFLAGS (for linking against Phobos)
PHOBOS_PATH=../phobos PHOBOS_PATH=../../phobos
SHARED=$(if $(findstring $(OS),linux freebsd),1,) SHARED=$(if $(findstring $(OS),linux freebsd),1,)
ROOT_DIR := $(shell pwd) ROOT_DIR := $(shell pwd)
PHOBOS_DFLAGS=-conf= $(MODEL_FLAG) -I$(ROOT_DIR)/import -I$(PHOBOS_PATH) -L-L$(PHOBOS_PATH)/generated/$(OS)/$(BUILD)/$(MODEL) $(PIC) PHOBOS_DFLAGS=-conf= $(MODEL_FLAG) -I$(ROOT_DIR)/import -I$(PHOBOS_PATH) -L-L$(PHOBOS_PATH)/generated/$(OS)/$(BUILD)/$(MODEL) $(PIC)
@ -96,7 +96,7 @@ ifeq (1,$(SHARED))
PHOBOS_DFLAGS+=-defaultlib=libphobos2.so -L-rpath=$(PHOBOS_PATH)/generated/$(OS)/$(BUILD)/$(MODEL) PHOBOS_DFLAGS+=-defaultlib=libphobos2.so -L-rpath=$(PHOBOS_PATH)/generated/$(OS)/$(BUILD)/$(MODEL)
endif endif
ROOT_OF_THEM_ALL = generated ROOT_OF_THEM_ALL = ../generated
ROOT = $(ROOT_OF_THEM_ALL)/$(OS)/$(BUILD)/$(MODEL) ROOT = $(ROOT_OF_THEM_ALL)/$(OS)/$(BUILD)/$(MODEL)
OBJDIR=obj/$(OS)/$(BUILD)/$(MODEL) OBJDIR=obj/$(OS)/$(BUILD)/$(MODEL)
DRUNTIME_BASE=druntime-$(OS)$(MODEL) DRUNTIME_BASE=druntime-$(OS)$(MODEL)

View file

@ -943,5 +943,3 @@ unittest
assert(rol(C7_9, 1) == rol1(C7_9)); assert(rol(C7_9, 1) == rol1(C7_9));
assert(ror(C7_9, 1) == ror1(C7_9)); assert(ror(C7_9, 1) == ror1(C7_9));
} }

View file

@ -468,4 +468,3 @@ const(section)* getsectbynamefromheaderwithswap_64(
const scope char* section, const scope char* section,
int fSwap int fSwap
); );

View file

@ -19,4 +19,3 @@ static if (__BSD_VISIBLE)
{ {
pure void* memmem(return scope const void* haystack, size_t haystacklen, scope const void* needle, size_t needlelen); pure void* memmem(return scope const void* haystack, size_t haystacklen, scope const void* needle, size_t needlelen);
} }

View file

@ -65,4 +65,3 @@ extern (D) pure @safe @nogc nothrow {
} }
} }

View file

@ -66,4 +66,3 @@ ssize_t flistxattr (int __fd, char *list, size_t size);
int removexattr (const scope char *path, const scope char *name); int removexattr (const scope char *path, const scope char *name);
int lremovexattr (const scope char *path, const scope char *name); int lremovexattr (const scope char *path, const scope char *name);
int fremovexattr (int fd, const scope char *name); int fremovexattr (int fd, const scope char *name);

View file

@ -208,4 +208,3 @@ enum: int
TIPC_DEST_DROPPABLE = 129, TIPC_DEST_DROPPABLE = 129,
TIPC_CONN_TIMEOUT = 130, TIPC_CONN_TIMEOUT = 130,
} }

View file

@ -608,4 +608,3 @@ pure unittest
assert(!FD_ISSET(i, &fd)); assert(!FD_ISSET(i, &fd));
} }
} }

View file

@ -1628,4 +1628,3 @@ version (Solaris)
int addrtosymstr(uintptr_t, char*, int); int addrtosymstr(uintptr_t, char*, int);
int printstack(int); int printstack(int);
} }

View file

@ -113,4 +113,3 @@ struct pcadmin_t
id_t pc_cid; id_t pc_cid;
caddr_t pc_cladmin; caddr_t pc_cladmin;
} }

View file

@ -50,4 +50,3 @@ void setprocset(ref procset_t psp, idop_t op, idtype_t ltype, id_t lid, idtype_t
psp.p_ridtype = rtype; psp.p_ridtype = rtype;
psp.p_rid = rid; psp.p_rid = rid;
} }

View file

@ -10,4 +10,3 @@ module core.sys.windows.cguid;
version (Windows): version (Windows):
import core.sys.windows.basetyps; import core.sys.windows.basetyps;

View file

@ -444,4 +444,3 @@ alias NTSTATUS function(ULONG, PULONG,
PSECPKG_FUNCTION_TABLE *, PULONG) SpLsaModeInitializeFn; PSECPKG_FUNCTION_TABLE *, PULONG) SpLsaModeInitializeFn;
alias NTSTATUS function(ULONG, PULONG, alias NTSTATUS function(ULONG, PULONG,
PSECPKG_USER_FUNCTION_TABLE *, PULONG) SpUserModeInitializeFn; PSECPKG_USER_FUNCTION_TABLE *, PULONG) SpUserModeInitializeFn;

View file

@ -10,4 +10,3 @@ module core.sys.windows.olectlid;
version (Windows): version (Windows):
import core.sys.windows.basetyps; import core.sys.windows.basetyps;

View file

@ -16,4 +16,3 @@ import core.sys.windows.basetyps, core.sys.windows.w32api;
// I think this is just a helper macro for other win32 headers? // I think this is just a helper macro for other win32 headers?
//MACRO #define DEFINE_SHLGUID(n,l,w1,w2) DEFINE_GUID(n,l,w1,w2,0xC0,0,0,0,0,0,0,0x46) //MACRO #define DEFINE_SHLGUID(n,l,w1,w2) DEFINE_GUID(n,l,w1,w2,0xC0,0,0,0,0,0,0,0x46)

View file

@ -380,4 +380,3 @@ version (Unicode) {
alias QUERY_SECURITY_PACKAGE_INFO_FN_A QUERY_SECURITY_PACKAGE_INFO_FN; alias QUERY_SECURITY_PACKAGE_INFO_FN_A QUERY_SECURITY_PACKAGE_INFO_FN;
alias INIT_SECURITY_INTERFACE_A INIT_SECURITY_INTERFACE; alias INIT_SECURITY_INTERFACE_A INIT_SECURITY_INTERFACE;
} }

View file

@ -25,4 +25,3 @@ __attribute__((destructor)) static void finalizer ()
{ {
rt_term(); rt_term();
} }

View file

@ -12,4 +12,4 @@ void main()
stats = GC.profileStats(); stats = GC.profileStats();
assert(stats.numCollections == 0); assert(stats.numCollections == 0);
} }

View file

@ -10,4 +10,3 @@ custom_gc:
$(DMD) -m$(MODEL) -conf= -Isrc -defaultlib=$(DRUNTIMELIB) test\init_fini\src\custom_gc.d $(DMD) -m$(MODEL) -conf= -Isrc -defaultlib=$(DRUNTIMELIB) test\init_fini\src\custom_gc.d
custom_gc.exe custom_gc.exe
del custom_gc.exe custom_gc.obj del custom_gc.exe custom_gc.obj

View file

@ -7,4 +7,3 @@ DRUNTIMELIB=druntime64.lib
test: test:
$(DMD) -m$(MODEL) -conf= -Isrc -defaultlib=$(DRUNTIMELIB) test\uuid\test.d uuid.lib $(DMD) -m$(MODEL) -conf= -Isrc -defaultlib=$(DRUNTIMELIB) test\uuid\test.d uuid.lib
del test.exe test.obj del test.exe test.obj

View file

@ -4,10 +4,10 @@
# Ignored, only the default value is supported # Ignored, only the default value is supported
#MODEL=32omf #MODEL=32omf
DMD_DIR=..\dmd DMD_DIR=..\compiler
BUILD=release BUILD=release
OS=windows OS=windows
DMD=$(DMD_DIR)\generated\$(OS)\$(BUILD)\32\dmd DMD=$(DMD_DIR)\..\generated\$(OS)\$(BUILD)\32\dmd
# Used for running MASM assembler on .asm files # Used for running MASM assembler on .asm files
CC=dmc CC=dmc

View file

@ -9,13 +9,13 @@ MODEL=64
# Otherwise set it explicitly, e.g., to `C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\Hostx86\x86\cl.exe`. # Otherwise set it explicitly, e.g., to `C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\Hostx86\x86\cl.exe`.
CC=cl CC=cl
DMD_DIR=..\dmd DMD_DIR=..\compiler
BUILD=release BUILD=release
OS=windows OS=windows
# The D compiler used to build things # The D compiler used to build things
DMD=$(DMD_DIR)\generated\$(OS)\$(BUILD)\$(MODEL)\dmd DMD=$(DMD_DIR)\..\generated\$(OS)\$(BUILD)\$(MODEL)\dmd
DOCDIR=doc DOCDIR=doc
IMPDIR=import IMPDIR=import

52
dub.sdl
View file

@ -10,25 +10,27 @@ dependency ":frontend" version="*"
subPackage { subPackage {
name "root" name "root"
targetType "library" targetType "library"
sourcePaths "src/dmd/common" "src/dmd/root" importPaths "compiler/src"
sourcePaths "compiler/src/dmd/common" "compiler/src/dmd/root"
} }
subPackage { subPackage {
name "lexer" name "lexer"
targetType "library" targetType "library"
importPaths "compiler/src"
sourcePaths sourcePaths
sourceFiles \ sourceFiles \
"src/dmd/console.d" \ "compiler/src/dmd/console.d" \
"src/dmd/entity.d" \ "compiler/src/dmd/entity.d" \
"src/dmd/errors.d" \ "compiler/src/dmd/errors.d" \
"src/dmd/file_manager.d" \ "compiler/src/dmd/file_manager.d" \
"src/dmd/globals.d" \ "compiler/src/dmd/globals.d" \
"src/dmd/id.d" \ "compiler/src/dmd/id.d" \
"src/dmd/identifier.d" \ "compiler/src/dmd/identifier.d" \
"src/dmd/lexer.d" \ "compiler/src/dmd/lexer.d" \
"src/dmd/tokens.d" \ "compiler/src/dmd/tokens.d" \
"src/dmd/utils.d" "compiler/src/dmd/utils.d"
versions \ versions \
"CallbackAPI" \ "CallbackAPI" \
@ -47,7 +49,7 @@ subPackage {
preGenerateCommands `"%DUB_EXE%" --arch=%DUB_ARCH% --compiler="%DC%" --single "%DUB_PACKAGE_DIR%config.d" -- "%DUB_PACKAGE_DIR%generated/dub" "%DUB_PACKAGE_DIR%VERSION"` platform="windows" preGenerateCommands `"%DUB_EXE%" --arch=%DUB_ARCH% --compiler="%DC%" --single "%DUB_PACKAGE_DIR%config.d" -- "%DUB_PACKAGE_DIR%generated/dub" "%DUB_PACKAGE_DIR%VERSION"` platform="windows"
stringImportPaths \ stringImportPaths \
"src/dmd/res" \ "compiler/src/dmd/res" \
"generated/dub" "generated/dub"
dependency "dmd:root" version="*" dependency "dmd:root" version="*"
@ -56,14 +58,15 @@ subPackage {
subPackage { subPackage {
name "parser" name "parser"
targetType "library" targetType "library"
importPaths "compiler/src"
sourcePaths sourcePaths
sourceFiles \ sourceFiles \
"src/dmd/astbase.d" \ "compiler/src/dmd/astbase.d" \
"src/dmd/parse.d" \ "compiler/src/dmd/parse.d" \
"src/dmd/transitivevisitor.d" \ "compiler/src/dmd/transitivevisitor.d" \
"src/dmd/permissivevisitor.d" \ "compiler/src/dmd/permissivevisitor.d" \
"src/dmd/strictvisitor.d" "compiler/src/dmd/strictvisitor.d"
versions "CallbackAPI" versions "CallbackAPI"
@ -73,8 +76,9 @@ subPackage {
subPackage { subPackage {
name "frontend" name "frontend"
targetType "library" targetType "library"
sourcePaths "src/dmd" importPaths "compiler/src"
stringImportPaths "src/dmd/res" sourcePaths "compiler/src/dmd"
stringImportPaths "compiler/src/dmd/res"
versions \ versions \
"NoBackend" \ "NoBackend" \
@ -83,10 +87,10 @@ subPackage {
"MARS" \ "MARS" \
"CallbackAPI" "CallbackAPI"
excludedSourceFiles "src/dmd/backend/*" excludedSourceFiles "compiler/src/dmd/backend/*"
excludedSourceFiles "src/dmd/root/*" excludedSourceFiles "compiler/src/dmd/root/*"
excludedSourceFiles "src/dmd/common/*" excludedSourceFiles "compiler/src/dmd/common/*"
excludedSourceFiles "src/dmd/{\ excludedSourceFiles "compiler/src/dmd/{\
astbase,\ astbase,\
console,\ console,\
entity,\ entity,\
@ -104,7 +108,7 @@ subPackage {
utf,\ utf,\
utils\ utils\
}.d" }.d"
excludedSourceFiles "src/dmd/{\ excludedSourceFiles "compiler/src/dmd/{\
dmsc,\ dmsc,\
e2ir,\ e2ir,\
eh,\ eh,\

View file

@ -1,18 +1,20 @@
INSTALL_DIR=$(PWD)/../install INSTALL_DIR=$(PWD)/../install
ECTAGS_LANGS = Make,C,C++,D,Sh ECTAGS_LANGS = Make,C,C++,D,Sh
ECTAGS_FILES = src/dmd/*.[chd] src/dmd/backend/*.[chd] src/dmd/root/*.[chd] ECTAGS_FILES = compiler/dmd/*.[chd] compiler/dmd/backend/*.[chd] compiler/dmd/root/*.[chd]
.PHONY: all clean test install auto-tester-build auto-tester-test toolchain-info .PHONY: all clean test install auto-tester-build auto-tester-test toolchain-info
all: all:
$(QUIET)$(MAKE) -C src -f posix.mak all $(QUIET)$(MAKE) -C compiler/src -f posix.mak all
$(QUIET)$(MAKE) -C druntime -f posix.mak target
ifneq (,$(findstring Darwin_64_32, $(PWD))) ifneq (,$(findstring Darwin_64_32, $(PWD)))
auto-tester-build: auto-tester-build:
echo "Darwin_64_32_disabled" echo "Darwin_64_32_disabled"
else else
auto-tester-build: auto-tester-build:
$(QUIET)$(MAKE) -C src -f posix.mak auto-tester-build ENABLE_RELEASE=1 ENABLE_ASSERTS=1 $(QUIET)$(MAKE) -C compiler/src -f posix.mak auto-tester-build ENABLE_RELEASE=1 ENABLE_ASSERTS=1
$(QUIET)$(MAKE) -C druntime -f posix.mak auto-tester-build ENABLE_RELEASE=1 ENABLE_ASSERTS=1
endif endif
ifneq (,$(findstring Darwin_64_32, $(PWD))) ifneq (,$(findstring Darwin_64_32, $(PWD)))
@ -24,28 +26,29 @@ auto-tester-test: test
else # POSIX else # POSIX
# Like test, but without runnable_cxx # Like test, but without runnable_cxx
auto-tester-test: auto-tester-test:
$(QUIET)$(MAKE) -C src -f posix.mak auto-tester-test $(QUIET)$(MAKE) -C compiler/src -f posix.mak auto-tester-test
$(QUIET)$(MAKE) -C test -f Makefile auto-tester-test $(QUIET)$(MAKE) -C compiler/test -f Makefile auto-tester-test
$(QUIET)$(MAKE) -C druntime -f posix.mak auto-tester-test
endif endif
endif endif
buildkite-test: test buildkite-test: test
toolchain-info: toolchain-info:
$(QUIET)$(MAKE) -C src -f posix.mak toolchain-info $(QUIET)$(MAKE) -C compiler/src -f posix.mak toolchain-info
clean: clean:
$(QUIET)$(MAKE) -C src -f posix.mak clean $(QUIET)$(MAKE) -C compiler/src -f posix.mak clean
$(QUIET)$(MAKE) -C test -f Makefile clean $(QUIET)$(MAKE) -C compiler/test -f Makefile clean
$(RM) tags $(RM) tags
test: test:
$(QUIET)$(MAKE) -C src -f posix.mak unittest $(QUIET)$(MAKE) -C compiler/src -f posix.mak unittest
$(QUIET)$(MAKE) -C src -f posix.mak dmd $(QUIET)$(MAKE) -C compiler/src -f posix.mak dmd
$(QUIET)$(MAKE) -C test -f Makefile $(QUIET)$(MAKE) -C compiler/test -f Makefile
html: html:
$(QUIET)$(MAKE) -C src -f posix.mak html $(QUIET)$(MAKE) -C compiler/src -f posix.mak html
# Creates Exuberant Ctags tags file # Creates Exuberant Ctags tags file
tags: posix.mak $(ECTAGS_FILES) tags: posix.mak $(ECTAGS_FILES)
@ -57,10 +60,10 @@ install:
echo "Darwin_64_32_disabled" echo "Darwin_64_32_disabled"
else else
install: all install: all
$(MAKE) INSTALL_DIR=$(INSTALL_DIR) -C src -f posix.mak install $(MAKE) INSTALL_DIR=$(INSTALL_DIR) -C compiler/src -f posix.mak install
cp -r samples $(INSTALL_DIR) cp -r compiler/samples $(INSTALL_DIR)
mkdir -p $(INSTALL_DIR)/man mkdir -p $(INSTALL_DIR)/man
cp -r docs/man/* $(INSTALL_DIR)/man/ cp -r compiler/docs/man/* $(INSTALL_DIR)/man/
endif endif
# Checks that all files have been committed and no temporary, untracked files exist. # Checks that all files have been committed and no temporary, untracked files exist.
@ -74,7 +77,7 @@ check-clean-git:
fi fi
style: style:
$(QUIET)$(MAKE) -C src -f posix.mak style $(QUIET)$(MAKE) -C compiler/src -f posix.mak style
.DELETE_ON_ERROR: # GNU Make directive (delete output files on error) .DELETE_ON_ERROR: # GNU Make directive (delete output files on error)

3
src/README.md Normal file
View file

@ -0,0 +1,3 @@
# Backwards-compatibility stub directory
This directory holds backwards compatibility files for scripts written before Druntime was merged into this directory.

1
src/dmd/backend/dvec.d Normal file
View file

@ -0,0 +1 @@
// Dummy file for backwards compatibility with old ae.sys.d-based D build tools.

1
src/dmd/mars.d Normal file
View file

@ -0,0 +1 @@
// Dummy file for backwards compatibility with old ae.sys.d-based D build tools.

1
src/osmodel.mak Normal file
View file

@ -0,0 +1 @@
include $(dir $(lastword $(MAKEFILE_LIST)))../compiler/src/osmodel.mak

38
src/posix.mak Normal file
View file

@ -0,0 +1,38 @@
# Proxy Makefile for backwards compatibility after move to /compiler/src
all:
$(QUIET)$(MAKE) -C ../compiler/src -f posix.mak $@
auto-tester-build:
$(QUIET)$(MAKE) -C ../compiler/src -f posix.mak $@
auto-tester-test:
$(QUIET)$(MAKE) -C ../compiler/src -f posix.mak $@
buildkite-test:
$(QUIET)$(MAKE) -C ../compiler/src -f posix.mak $@
toolchain-info:
$(QUIET)$(MAKE) -C ../compiler/src -f posix.mak $@
clean:
$(QUIET)$(MAKE) -C ../compiler/src -f posix.mak $@
test:
$(QUIET)$(MAKE) -C ../compiler/src -f posix.mak $@
html:
$(QUIET)$(MAKE) -C ../compiler/src -f posix.mak $@
tags:
$(QUIET)$(MAKE) -C ../compiler/src -f posix.mak $@
install:
$(QUIET)$(MAKE) -C ../compiler/src -f posix.mak $@
check-clean-git:
$(QUIET)$(MAKE) -C ../compiler/src -f posix.mak $@
style:
$(QUIET)$(MAKE) -C ../compiler/src -f posix.mak $@

89
src/win32.mak Normal file
View file

@ -0,0 +1,89 @@
# Proxy Makefile for backwards compatibility after move to /compiler/src
############################### Configuration ################################
OS=windows
BUILD=release
MODEL=32
HOST_DC=dmd
MAKE=make
GEN=..\..\generated
G=$(GEN)\$(OS)\$(BUILD)\$(MODEL)
MAKE_WIN32=$(MAKE) -f win32.mak \
"OS=$(OS)" \
"BUILD=$(BUILD)" \
"MODEL=$(MODEL)" \
"HOST_DMD=$(HOST_DMD)" \
"HOST_DC=$(HOST_DC)" \
"MAKE=$(MAKE)" \
"VERBOSE=$(VERBOSE)" \
"ENABLE_RELEASE=$(ENABLE_RELEASE)" \
"ENABLE_DEBUG=$(ENABLE_DEBUG)" \
"ENABLE_ASSERTS=$(ENABLE_ASSERTS)" \
"ENABLE_LTO=$(ENABLE_LTO)" \
"ENABLE_UNITTEST=$(ENABLE_UNITTEST)" \
"ENABLE_PROFILE=$(ENABLE_PROFILE)" \
"ENABLE_COVERAGE=$(ENABLE_COVERAGE)" \
"DFLAGS=$(DFLAGS)" \
"GEN=$(GEN)" \
"G=$G"
################################## Targets ###################################
defaulttarget :
cd ..\compiler\src
$(MAKE_WIN32) $@
cd ..\..\src
release :
cd ..\compiler\src
$(MAKE_WIN32) $@
cd ..\..\src
trace :
cd ..\compiler\src
$(MAKE_WIN32) $@
cd ..\..\src
clean :
cd ..\compiler\src
$(MAKE_WIN32) $@
cd ..\..\src
install :
cd ..\compiler\src
$(MAKE_WIN32) $@
cd ..\..\src
install-clean :
cd ..\compiler\src
$(MAKE_WIN32) $@
cd ..\..\src
zip :
cd ..\compiler\src
$(MAKE_WIN32) $@
cd ..\..\src
dmd :
cd ..\compiler\src
$(MAKE_WIN32) $@
cd ..\..\src
debdmd :
cd ..\compiler\src
$(MAKE_WIN32) $@
cd ..\..\src
reldmd :
cd ..\compiler\src
$(MAKE_WIN32) $@
cd ..\..\src
reldmd-asserts :
cd ..\compiler\src
$(MAKE_WIN32) $@
cd ..\..\src
unittest :
cd ..\compiler\src
$(MAKE_WIN32) $@
cd ..\..\src
detab :
cd ..\compiler\src
$(MAKE_WIN32) $@
cd ..\..\src
tolf :
cd ..\compiler\src
$(MAKE_WIN32) $@
cd ..\..\src

89
src/win64.mak Normal file
View file

@ -0,0 +1,89 @@
# Proxy Makefile for backwards compatibility after move to /compiler/src
############################### Configuration ################################
OS=windows
BUILD=release
MODEL=64
HOST_DC=dmd
MAKE=make
GEN=..\..\generated
G=$(GEN)\$(OS)\$(BUILD)\$(MODEL)
MAKE_WIN32=$(MAKE) -f win64.mak \
"OS=$(OS)" \
"BUILD=$(BUILD)" \
"MODEL=$(MODEL)" \
"HOST_DMD=$(HOST_DMD)" \
"HOST_DC=$(HOST_DC)" \
"MAKE=$(MAKE)" \
"VERBOSE=$(VERBOSE)" \
"ENABLE_RELEASE=$(ENABLE_RELEASE)" \
"ENABLE_DEBUG=$(ENABLE_DEBUG)" \
"ENABLE_ASSERTS=$(ENABLE_ASSERTS)" \
"ENABLE_LTO=$(ENABLE_LTO)" \
"ENABLE_UNITTEST=$(ENABLE_UNITTEST)" \
"ENABLE_PROFILE=$(ENABLE_PROFILE)" \
"ENABLE_COVERAGE=$(ENABLE_COVERAGE)" \
"DFLAGS=$(DFLAGS)" \
"GEN=$(GEN)" \
"G=$G"
################################## Targets ###################################
defaulttarget :
cd ..\compiler\src
$(MAKE_WIN32) $@
cd ..\..\src
release :
cd ..\compiler\src
$(MAKE_WIN32) $@
cd ..\..\src
trace :
cd ..\compiler\src
$(MAKE_WIN32) $@
cd ..\..\src
clean :
cd ..\compiler\src
$(MAKE_WIN32) $@
cd ..\..\src
install :
cd ..\compiler\src
$(MAKE_WIN32) $@
cd ..\..\src
install-clean :
cd ..\compiler\src
$(MAKE_WIN32) $@
cd ..\..\src
zip :
cd ..\compiler\src
$(MAKE_WIN32) $@
cd ..\..\src
dmd :
cd ..\compiler\src
$(MAKE_WIN32) $@
cd ..\..\src
debdmd :
cd ..\compiler\src
$(MAKE_WIN32) $@
cd ..\..\src
reldmd :
cd ..\compiler\src
$(MAKE_WIN32) $@
cd ..\..\src
reldmd-asserts :
cd ..\compiler\src
$(MAKE_WIN32) $@
cd ..\..\src
unittest :
cd ..\compiler\src
$(MAKE_WIN32) $@
cd ..\..\src
detab :
cd ..\compiler\src
$(MAKE_WIN32) $@
cd ..\..\src
tolf :
cd ..\compiler\src
$(MAKE_WIN32) $@
cd ..\..\src

View file

@ -1,20 +1,26 @@
MAKE=make MAKE=make
defaulttarget: defaulttarget:
cd src cd compiler\src
$(MAKE) -f win32.mak $(MAKE) -f win32.mak
cd .. cd ..\..
auto-tester-build: auto-tester-build:
cd src cd compiler\src
$(MAKE) -f win32.mak auto-tester-build
cd ..\..
cd druntime
$(MAKE) -f win32.mak auto-tester-build $(MAKE) -f win32.mak auto-tester-build
cd .. cd ..
auto-tester-test: auto-tester-test:
cd test cd compiler\test
$(MAKE) $(MAKE)
cd ..\..
cd druntime
$(MAKE) -f win32.mak auto-tester-test
cd .. cd ..
cd samples cd compiler\samples
gmake -f win32.mak DMD=..\src\dmd.exe MODEL=$(MODEL) "LIB=..\..\phobos;$(LIB)" \ gmake -f win32.mak DMD=..\src\dmd.exe MODEL=$(MODEL) "LIB=..\..\phobos;$(LIB)" \
"DFLAGS=-I..\..\druntime\import -I..\..\phobos -m$(MODEL)" "DFLAGS=-I..\..\druntime\import -I..\..\phobos -m$(MODEL)"
cd .. cd ..\..

View file

@ -5,5 +5,5 @@
MAKE=make MAKE=make
all: all:
cd src cd compiler\src
$(MAKE) -f win64.mak $(MAKE) -f win64.mak