mirror of
https://github.com/dlang/dmd.git
synced 2025-04-25 20:50:41 +03:00
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:
parent
f6802dd63f
commit
ed22f5c28f
3 changed files with 23 additions and 15 deletions
10
.github/workflows/main.yml
vendored
10
.github/workflows/main.yml
vendored
|
@ -27,6 +27,7 @@ jobs:
|
|||
- job_name: Ubuntu 22.04 x64, DMD (bootstrap)
|
||||
os: ubuntu-22.04
|
||||
host_dmd: dmd-2.079.0
|
||||
disable_debug_for_dmd_unittests: true # no `-debug` - host frontend too old
|
||||
- job_name: Ubuntu 22.04 x86, DMD (latest)
|
||||
os: ubuntu-22.04
|
||||
model: 32
|
||||
|
@ -46,6 +47,7 @@ jobs:
|
|||
- job_name: Ubuntu 22.04 x64, GDC
|
||||
os: ubuntu-22.04
|
||||
host_dmd: gdmd-9
|
||||
disable_debug_for_dmd_unittests: true # no `-debug` - host frontend too old
|
||||
# macOS
|
||||
- job_name: macOS 13 x64, DMD (latest)
|
||||
os: macos-13
|
||||
|
@ -64,13 +66,15 @@ jobs:
|
|||
timeout-minutes: 40
|
||||
env:
|
||||
# for ci/run.sh:
|
||||
OS_NAME: ${{ startsWith(matrix.os, 'ubuntu') && 'linux' || (startsWith(matrix.os, 'macos') && 'darwin' || '') }}
|
||||
OS_NAME: ${{ startsWith(matrix.os, 'ubuntu') && 'linux' || (startsWith(matrix.os, 'macos') && 'osx' || '') }}
|
||||
MODEL: ${{ matrix.model || '64' }}
|
||||
HOST_DMD: ${{ matrix.host_dmd }}
|
||||
N: ${{ startsWith(matrix.os, 'macos') && '3' || '2' }}
|
||||
FULL_BUILD: true
|
||||
# for coverage:
|
||||
DMD_TEST_COVERAGE: ${{ matrix.coverage && '1' || '0' }}
|
||||
# work around https://issues.dlang.org/show_bug.cgi?id=23517
|
||||
MACOSX_DEPLOYMENT_TARGET: '11'
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
|
@ -99,10 +103,10 @@ jobs:
|
|||
|
||||
ci/run.sh setup_repos "$REPO_BRANCH"
|
||||
- name: Build
|
||||
run: ci/run.sh build
|
||||
run: ${{ matrix.disable_debug_for_dmd_unittests && 'ENABLE_DEBUG=0' || '' }} ci/run.sh build
|
||||
- name: Rebuild dmd (with enabled coverage)
|
||||
if: matrix.coverage
|
||||
run: ENABLE_RELEASE=0 ENABLE_DEBUG=1 ENABLE_COVERAGE=1 ${{ runner.os == 'macOS' && 'OS_NAME=osx' || '' }} ci/run.sh rebuild
|
||||
run: ENABLE_RELEASE=0 ENABLE_DEBUG=1 ENABLE_COVERAGE=1 ci/run.sh rebuild
|
||||
- name: Test dmd
|
||||
run: ci/run.sh test_dmd
|
||||
- name: Test druntime
|
||||
|
|
|
@ -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
|
||||
|
|
24
ci/run.sh
24
ci/run.sh
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue