Skip to content

Commit

Permalink
More thirdparty CI tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fuhsnn committed Nov 28, 2024
1 parent 242dae7 commit f44aad8
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 5 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/linux_thirdparty.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,17 @@ jobs:
- thirdparty: test_doom
- thirdparty: test_git
- thirdparty: test_libpng
- thirdparty: test_oniguruma_jq
- thirdparty: test_openssh
- thirdparty: test_openssl
- thirdparty: test_php
- thirdparty: test_postgres
- thirdparty: test_python
- thirdparty: test_qbe_hare
- thirdparty: test_sqlite
- thirdparty: test_tinycc
- thirdparty: test_toybox
- thirdparty: test_vim
- thirdparty: test_zlib
- thirdparty: test_zstd
- thirdparty: build_gcc
Expand Down
6 changes: 3 additions & 3 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -833,6 +833,9 @@ static void run_linker(StringArray *inputs, char *output) {
strarray_push(&arr, format("%s/crtbegin.o", gcc_libpath));
}

for (int i = 0; i < ld_extra_args.len; i++)
strarray_push(&arr, ld_extra_args.data[i]);

strarray_push(&arr, format("-L%s", gcc_libpath));
strarray_push(&arr, "-L/usr/lib/x86_64-linux-gnu");
strarray_push(&arr, "-L/usr/lib64");
Expand All @@ -848,9 +851,6 @@ static void run_linker(StringArray *inputs, char *output) {
strarray_push(&arr, "/lib64/ld-linux-x86-64.so.2");
}

for (int i = 0; i < ld_extra_args.len; i++)
strarray_push(&arr, ld_extra_args.data[i]);

for (int i = 0; i < inputs->len; i++)
strarray_push(&arr, inputs->data[i]);

Expand Down
5 changes: 4 additions & 1 deletion scripts/debian_asan.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ RUN apt-get -y autoremove gcc-12 && apt-get clean
ENV ASAN_OPTIONS=detect_leaks=0
ENV CC=/work/slimcc/slimcc_asan

RUN bash scripts/linux_thirdparty.bash install_libtool

RUN useradd -m non-root -s /bin/bash && \
su non-root -c "git config --global advice.detachedHead false" && \
mv scripts/linux*.bash /home/non-root
su non-root -c "git config --global init.defaultBranch init" && \
mv scripts/linux_thirdparty.bash /home/non-root

WORKDIR /home/non-root
75 changes: 74 additions & 1 deletion scripts/linux_thirdparty.bash
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,28 @@ github_clone() {
cd "$2"
}

git_fetch() {
mkdir -p "$3" && cd "$3"
git init
git remote add origin "$1"
git fetch --depth 1 origin "$2"
git checkout FETCH_HEAD
}

url_tar() {
mkdir -p "$2"
curl -fL "$1" | tar xz -C "$2" --strip-components=1
cd "$2"
}

install_libtool() {
url_tar https://ftp.gnu.org/gnu/libtool/libtool-2.5.4.tar.gz __libtool
fix_configure ./configure
fix_configure libltdl/configure
./configure
make -j2 install
cd ../ && rm -rf __libtool
}

# tests

Expand Down Expand Up @@ -61,10 +77,41 @@ test_libpng() {
make test
}

test_oniguruma_jq() {
git_fetch https://github.com/jqlang/jq 96e8d893c10ed2f7656ccb8cfa39a9a291663a7e jq
cd modules/

git_fetch https://github.com/kkos/oniguruma e0a8f04615ecc5bbae0bec8b007ecb4816966ae5 oniguruma
libtoolize
autoreconf -fi
fix_configure ./configure
CFLAGS=-fenable-universal-char ./configure
make check

cd ../../
libtoolize
autoreconf -fi
fix_configure ./configure
./configure
make check
}

test_openssh() {
github_tar openssh openssh-portable V_9_8_P1
./configure
make tests
make
make file-tests
# make t-exec ## "regress/agent-subprocess.sh" fail in CI
make interop-tests
make extra-tests
make unit
}

test_openssl() {
github_tar openssl openssl openssl-3.4.0
replace_line "#if !defined(__DJGPP__)" "#if 0" test/rsa_complex.c
./Configure
make test
}

test_php() {
Expand Down Expand Up @@ -102,13 +149,39 @@ test_python() {
./python -m test --exclude "${skip_tests[@]}"
}

test_qbe_hare() {
git_fetch git://c9x.me/qbe.git 90050202f57b22243f5d3dd434a81df2f89de9ed qbe
make CC="$CC" check
url_tar https://git.sr.ht/~sircmpwn/harec/archive/0.24.2.tar.gz harec
mv configs/linux.mk config.mk
make CC="$CC" QBE=../qbe check
}

test_sqlite() {
github_tar sqlite sqlite version-3.47.1
fix_configure ./configure
CFLAGS=-D_GNU_SOURCE ./configure
make tcltest
}

test_tinycc() {
git_fetch https://repo.or.cz/tinycc.git 085e029f08c9b0b57632703df565efdbe2cd0c7f tinycc
./configure && make && cd tests/tests2/ && make
}

test_toybox() {
git_fetch https://github.com/landley/toybox fb3ca98e2faaa11512061cdd3fc946ddf0c2696b toybox
make CC="$CC" HOSTCC="$CC" defconfig
make CC="$CC" HOSTCC="$CC"
make CC="$CC" HOSTCC="$CC" tests
}

test_vim() {
github_tar vim vim v9.1.0891
./configure
make && make testtiny
}

test_zlib() {
github_tar madler zlib v1.3.1
./configure
Expand Down

0 comments on commit f44aad8

Please sign in to comment.