1 В избранное 0 Ответвления 0

OSCHINA-MIRROR/mirrors-LDC

Клонировать/Скачать
.cirrus.yml 10 КБ
Копировать Редактировать Web IDE Исходные данные Просмотреть построчно История
Martin Kinkelin Отправлено 03.05.2025 21:55 14050a6
# For PRs: check out the current *merge* ref, i.e., merge with target branch
clone_steps_template: &CLONE_STEPS_TEMPLATE
merge_with_target_branch_script: |
if [ -n "${CIRRUS_PR:-}" ]; then
git fetch origin "+refs/pull/$CIRRUS_PR/merge:"
git checkout -f FETCH_HEAD
fi
# Installs lit, clones the git submodules, builds LDC and the test
# runners and runs the tests.
# Requires env variables CI_ARCH, CI_OS, EXTRA_CMAKE_FLAGS and PARALLELISM.
common_steps_template: &COMMON_STEPS_TEMPLATE
install_lit_script: |
# Install lit
rm -f /usr/lib/python3.13/EXTERNALLY-MANAGED # required for Ubuntu 25.04
python3 -m pip install --user lit
python3 -c "import lit.main; lit.main.main();" --version . | head -n 1
clone_submodules_script: |
cd $CIRRUS_WORKING_DIR
git submodule update --init --depth $CIRRUS_CLONE_DEPTH
build_script: |
# Build LDC & LDC D unittests & defaultlib unittest runners
cmake --version
ninja --version
cd $CIRRUS_WORKING_DIR/..
installDir=$PWD/install
mkdir build
cd build
IFS=$'\n' extraFlags=( $(xargs -n1 <<<"$EXTRA_CMAKE_FLAGS") )
cmake -G Ninja $CIRRUS_WORKING_DIR \
-DCMAKE_BUILD_TYPE=Release \
-DD_COMPILER=$PWD/../host-ldc/bin/ldmd2 \
-DCMAKE_INSTALL_PREFIX=$installDir \
-DINCLUDE_INSTALL_DIR=$installDir/import \
-DLDC_LINK_MANUALLY=OFF \
"${extraFlags[@]}"
ninja -j$PARALLELISM obj/ldc2.o all ldc2-unittest all-test-runners
bin/ldc2 -version
always:
run_compiler_unittests_script: |
cd $CIRRUS_WORKING_DIR/../build
ctest --output-on-failure -R ldc2-unittest
run_lit_testsuite_script: |
cd $CIRRUS_WORKING_DIR/../build/tests
python3 runlit.py -v -j $PARALLELISM .
run_dmd_testsuite_script: |
cd $CIRRUS_WORKING_DIR/../build
DMD_TESTSUITE_MAKE_ARGS=-j$PARALLELISM ctest -V -R dmd-testsuite
run_defaultlib_tests_script: |
# Run defaultlib unittests & druntime integration tests
cd $CIRRUS_WORKING_DIR/../build
excludes="dmd-testsuite|lit-tests|ldc2-unittest"
if [[ "$CI_OS" == "freebsd" ]]; then
# FIXME: https://github.com/dlang/phobos/issues/10730
excludes+='|^std.experimental.allocator.building_blocks.allocator_list'
fi
ctest -j$PARALLELISM --output-on-failure -E "$excludes" --timeout 120
# Performs the extra packaging steps for jobs producing a prebuilt package.
# Requires env variables CI_ARCH, CI_OS, GITHUB_TOKEN and PARALLELISM (and CC for FreeBSD).
packaging_steps_template: &PACKAGING_STEPS_TEMPLATE
# Install LDC & make portable
install_script: |
cd $CIRRUS_WORKING_DIR/..
cd build
ninja install > /dev/null
cd ..
perl -pi -e s?$PWD/install/?%%ldcbinarypath%%/../?g install/etc/ldc2.conf
if [[ "$CI_OS" == "freebsd" ]]; then
perl -pi -e "s?,druntime-ldc\",?,druntime-ldc\", \"-gcc=$CC\",?" install/etc/ldc2.conf
fi
cp $CIRRUS_WORKING_DIR/{LICENSE,packaging/README} install
cat install/etc/ldc2.conf
# Now rename the installation dir to test portability
mv install installed
# Run hello-world integration test with shared libs
run_shared_libs_integration_test_script: |
cd $CIRRUS_WORKING_DIR/..
echo 'void main() { import std.stdio; writefln("Hello world, %d bits", size_t.sizeof * 8); }' > hello.d
installed/bin/ldc2 hello.d -of=hello -link-defaultlib-shared
./hello
# Run hello-world integration test with LTO
run_lto_integration_test_script: |
cd $CIRRUS_WORKING_DIR/..
installed/bin/ldc2 hello.d -of=hello_thin -flto=thin -defaultlib=phobos2-ldc-lto,druntime-ldc-lto
./hello_thin
installed/bin/ldc2 hello.d -of=hello_full -flto=full -defaultlib=phobos2-ldc-lto,druntime-ldc-lto
./hello_full
# Run dynamic-compile integration test
run_dynamic_compile_integration_test_script: |
cd $CIRRUS_WORKING_DIR/..
installed/bin/ldc2 -enable-dynamic-compile -run $CIRRUS_WORKING_DIR/tests/dynamiccompile/array.d
# Run ImportC integration test
run_importC_integration_test_script: |
cd $CIRRUS_WORKING_DIR/..
installed/bin/ldc2 -run $CIRRUS_WORKING_DIR/tests/dmd/runnable/test22597.c
# Build & copy dub
build_dub_script: |
cd $CIRRUS_WORKING_DIR/..
export DMD=$PWD/installed/bin/ldmd2
git clone --recursive https://github.com/dlang/dub.git
cd dub
git checkout "$(cat $CIRRUS_WORKING_DIR/packaging/dub_version)"
$DMD -run build.d -O -w -linkonce-templates
cp bin/dub ../installed/bin
../installed/bin/dub --version
# Build & copy dlang tools
build_dlang_tools_script: |
cd $CIRRUS_WORKING_DIR/..
DMD=$PWD/installed/bin/ldmd2
git clone --recursive https://github.com/dlang/tools.git dlang-tools
cd dlang-tools
git checkout "$(cat $CIRRUS_WORKING_DIR/packaging/dlang-tools_version)"
mkdir bin
$DMD -w -de -dip1000 rdmd.d -of=bin/rdmd
$DMD -w -de -dip1000 ddemangle.d -of=bin/ddemangle
$DMD -w -de -dip1000 DustMite/dustmite.d DustMite/splitter.d DustMite/polyhash.d -of=bin/dustmite
cp bin/{rdmd,ddemangle,dustmite} ../installed/bin
# Build & copy reggae
build_reggae_script: |
cd $CIRRUS_WORKING_DIR/..
git clone --recursive https://github.com/atilaneves/reggae.git
cd reggae
git checkout "$(cat $CIRRUS_WORKING_DIR/packaging/reggae_version)"
# needs rdmd in PATH
PATH="$PWD/../installed/bin:$PATH" DFLAGS="-O -linkonce-templates" ../dub/bin/dub build -v --build-mode=allAtOnce --combined --compiler="$PWD/../installed/bin/ldc2"
cp bin/reggae ../installed/bin
../installed/bin/reggae --version -b ninja
# Pack artifact
pack_artifact_script: |
cd $CIRRUS_WORKING_DIR/..
mkdir artifacts
if [[ "${CIRRUS_TAG:-}" == v* ]]; then
artifactID=${CIRRUS_TAG:1}
else
artifactID=${CIRRUS_CHANGE_IN_REPO:0:8}
fi
artifactName=ldc2-$artifactID-$CI_OS-$CI_ARCH
mv installed $artifactName
chmod -R go=rX $artifactName
tar=tar
if [[ "$CI_OS" == "freebsd" ]]; then
tar=gtar
fi
$tar -cf - --owner=0 --group=0 $artifactName | 7z a artifacts/$artifactName.tar.xz -si -txz -mx9 -mmt$PARALLELISM
ls -lh artifacts/ldc2-*.tar.xz
# Upload to GitHub release (only for commits on the master branch and tags)
upload_to_github_script: |
cd $CIRRUS_WORKING_DIR
if [[ "${CIRRUS_TAG:-}" == v* ]]; then
tools/upload-to-github.sh $CIRRUS_TAG ../artifacts/ldc2-*.tar.xz
elif [[ "${CIRRUS_TAG:-}" = "" && "$CIRRUS_PR" = "" && "$CIRRUS_BRANCH" = "master" ]]; then
tools/upload-to-github.sh CI ../artifacts/ldc2-*.tar.xz
fi
# Installs Ubuntu 20.04+ prerequisites.
# Requires env variables CI_ARCH, EXTRA_APT_PACKAGES and EXTRA_CMAKE_FLAGS.
install_ubuntu_prerequisites_template: &INSTALL_UBUNTU_PREREQUISITES_TEMPLATE
install_prerequisites_script: |
cd $CIRRUS_WORKING_DIR/..
nproc
export DEBIAN_FRONTEND=noninteractive
if [[ "$EXTRA_CMAKE_FLAGS" = *-DMULTILIB?ON* ]]; then
dpkg --add-architecture i386
gcc_pkg="g++-multilib"
libcurl_pkg="libcurl4 libcurl4:i386"
else
gcc_pkg="g++"
libcurl_pkg="libcurl4"
fi
apt-get -q update
apt-get -yq install \
git-core cmake ninja-build $gcc_pkg \
zlib1g-dev $libcurl_pkg curl gdb python3 python3-pip tzdata unzip zip \
$EXTRA_APT_PACKAGES
python3 --version
# Install custom Ninja on x86_64
if [[ "$CI_ARCH" == "x86_64" ]]; then
curl -fL --retry 3 --max-time 60 -O https://github.com/symmetryinvestments/ninja/releases/download/v1.11.1-sym1/ninja-linux.zip
mkdir ninja
unzip ninja-linux.zip -d ninja
rm ninja-linux.zip
ln -sf $PWD/ninja/ninja /usr/bin/ninja
fi
environment:
CIRRUS_CLONE_DEPTH: 50
GITHUB_TOKEN: ENCRYPTED[0955bd48c8d4e5391446fc0149d0719ad0b63df27ec9e6c180a5730a5b10dc7f28f09d1383423db158d21380ee2b022a]
task:
name: Ubuntu rolling x64 shared-libs-only gdmd
container:
image: ubuntu:rolling
cpu: 8
memory: 16G
timeout_in: 15m
environment:
CI_ARCH: x86_64
CI_OS: linux
EXTRA_APT_PACKAGES: "gdmd llvm-dev libclang-common-20-dev lld libcurl4-openssl-dev"
# need `-DCMAKE_EXE_LINKER_FLAGS=-lcurl` to work around libcurl dependency for ldc-profdata (distro LLVM apparently built with non-default LLVM_ENABLE_CURL=ON)
EXTRA_CMAKE_FLAGS: >-
-DBUILD_SHARED_LIBS=ON
-DBUILD_LTO_LIBS=ON
-DD_COMPILER=gdmd
-DLDC_LINK_MANUALLY=ON
-DCMAKE_EXE_LINKER_FLAGS=-lcurl
PARALLELISM: 8
# for gdmd:
LANG: C.UTF-8
<< : *INSTALL_UBUNTU_PREREQUISITES_TEMPLATE
<< : *CLONE_STEPS_TEMPLATE
# to get the LTO lit-tests working:
make_lld_the_default_linker_script: |
ln -sf ld.lld /usr/bin/ld
ld --version
disable_tests_script: |
cd $CIRRUS_WORKING_DIR
# FIXME: lsan_interceptors.cpp:82 "((!lsan_init_is_running)) != (0)"
rm tests/sanitizers/lsan_memleak.d
# apparently just fails due to extra linker error output
rm tests/dmd/fail_compilation/needspkgmod.d
<< : *COMMON_STEPS_TEMPLATE
task:
name: FreeBSD 13.4 x64
freebsd_instance:
image_family: freebsd-13-4
cpu: 4
memory: 8G
timeout_in: 60m
environment:
CI_ARCH: x86_64
CI_OS: freebsd
EXTRA_CMAKE_FLAGS: >-
-DBUILD_LTO_LIBS=ON
-DD_COMPILER_FLAGS="-O -flto=full -defaultlib=phobos2-ldc-lto,druntime-ldc-lto"
-DEXTRA_CXXFLAGS=-flto=full
PARALLELISM: 4
CC: clang19
CXX: clang++19
install_prerequisites_script: |
cd $CIRRUS_WORKING_DIR/..
sysctl -n hw.ncpu
pkg install -y git cmake ninja gmake llvm19 bash gtar 7-zip ldc
python3 --version
python3 -m ensurepip
# set up default llvm-config
ls -l /usr/local/bin/llvm-config*
ln -sf llvm-config19 /usr/local/bin/llvm-config
<< : *CLONE_STEPS_TEMPLATE
clone_submodules_early_script: |
cd $CIRRUS_WORKING_DIR
git submodule update --init --depth $CIRRUS_CLONE_DEPTH
# Build a first LDC as host compiler for the actual build
build_bootstrap_ldc_script: |
cd $CIRRUS_WORKING_DIR/..
mkdir host-ldc
cd host-ldc
cmake -G Ninja $CIRRUS_WORKING_DIR \
-DCMAKE_BUILD_TYPE=Release \
-DD_COMPILER=ldmd2 \
-DBUILD_SHARED_LIBS=OFF \
-DLDC_DYNAMIC_COMPILE=OFF \
-DBUILD_LTO_LIBS=ON
ninja -j$PARALLELISM
bin/ldc2 -version
<< : *COMMON_STEPS_TEMPLATE
<< : *PACKAGING_STEPS_TEMPLATE

Опубликовать ( 0 )

Вы можете оставить комментарий после Вход в систему

1
https://api.gitlife.ru/oschina-mirror/mirrors-LDC.git
git@api.gitlife.ru:oschina-mirror/mirrors-LDC.git
oschina-mirror
mirrors-LDC
mirrors-LDC
master