From ac15fea94ca4d1cfafebbbe07ac88a3f426ff923 Mon Sep 17 00:00:00 2001 From: Rob Davies Date: Tue, 22 Oct 2024 14:50:34 +0100 Subject: [PATCH] Use --enable-libgsl --enable-perl-filters when testing Add packages needed for these options and enable them on configure builds. The perl IO::Pty package is also added for Debian and Ubuntu so the usage tests work. Also adjust how flags are set in the CI builds to ensure they are applied consistently. --- .cirrus.yml | 48 ++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 38 insertions(+), 10 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 4e9927e6..023eb4f6 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -42,16 +42,34 @@ compile_template: &COMPILE if test "$USE_CONFIG" = "yes"; then (cd $HTSDIR && autoreconf -i) autoreconf -i - ./configure --enable-werror || (cat config.log; /bin/false) + ./configure --enable-werror $CONFIG_OPTS \ + ${CC:+CC="$CC"} \ + ${CFLAGS:+CFLAGS="$CFLAGS"} \ + ${CPPFLAGS:+CPPFLAGS="$CPPFLAGS"} \ + ${LDFLAGS:+LDFLAGS="$LDFLAGS"} \ + || (cat config.log; /bin/false) make -j3 else - make -j3 plugindir=$CIRRUS_WORKING_DIR/plugins -e + make -j3 plugindir="$CIRRUS_WORKING_DIR/plugins" \ + ${HTSDIR:+HTSDIR="$HTSDIR"} \ + ${CC:+CC="$CC"} \ + ${CFLAGS:+CFLAGS="$CFLAGS"} \ + ${CPPFLAGS:+CPPFLAGS="$CPPFLAGS"} \ + ${LDFLAGS:+LDFLAGS="$LDFLAGS"} fi test_template: &TEST test_script: | - make -e test - + if test "$USE_CONFIG" = "yes"; then + make test + else + make test \ + ${HTSDIR:+HTSDIR="$HTSDIR"} \ + ${CC:+CC="$CC"} \ + ${CFLAGS:+CFLAGS="$CFLAGS"} \ + ${CPPFLAGS:+CPPFLAGS="$CPPFLAGS"} \ + ${LDFLAGS:+LDFLAGS="$LDFLAGS"} + fi #-------------------------------------------------- # Task: linux builds. @@ -68,15 +86,23 @@ gcc_task: LC_ALL: C CIRRUS_CLONE_DEPTH: 1 HTSDIR: ./htslib - CFLAGS: -fsanitize=address - LDFLAGS: -fsanitize=address matrix: - environment: USE_CONFIG: no + CFLAGS: -g -Og -Wall -Werror -fsanitize=address + LDFLAGS: -fsanitize=address - environment: USE_CONFIG: yes - CFLAGS: -std=gnu99 -O0 + CONFIG_OPTS: --enable-libgsl --enable-perl-filters + CFLAGS: -std=gnu99 -g -Og -Wall -fsanitize=address + LDFLAGS: -fsanitize=address + + install_script: | + apt-get update + apt-get install -y --no-install-suggests --no-install-recommends \ + libdeflate-dev libperl-dev libgsl0-dev libio-pty-perl + << : *COMPILE << : *TEST @@ -92,7 +118,6 @@ ubuntu_task: environment: CC: clang - CFLAGS: -g -O2 -Werror -Wall -Wformat -Wformat=2 LC_ALL: C CIRRUS_CLONE_DEPTH: 1 HTSDIR: ./htslib @@ -100,10 +125,12 @@ ubuntu_task: matrix: - environment: USE_CONFIG: no + CFLAGS: -g -O2 -Werror -Wall -Wformat -Wformat=2 - container: memory: 2G environment: USE_CONFIG: yes + CONFIG_OPTS: --enable-libgsl --enable-perl-filters CFLAGS: -g -Wall -O3 LDFLAGS: -Wl,-rpath,`pwd`/inst/lib @@ -114,7 +141,7 @@ ubuntu_task: apt-get install -y --no-install-suggests --no-install-recommends \ ca-certificates clang git autoconf automake \ make zlib1g-dev libbz2-dev liblzma-dev libcurl4-gnutls-dev \ - libssl-dev libdeflate-dev + libssl-dev libdeflate-dev libperl-dev libgsl0-dev libio-pty-perl << : *COMPILE << : *TEST @@ -133,13 +160,14 @@ rockylinux_task: CIRRUS_CLONE_DEPTH: 1 HTSDIR: ./htslib USE_CONFIG: yes + CONFIG_OPTS: --enable-libgsl --enable-perl-filters # NB: we could consider building a docker image with these # preinstalled and specifying that instead, to speed up testing. install_script: | yum install -y autoconf automake make gcc perl-Data-Dumper perl-FindBin \ zlib-devel bzip2 bzip2-devel xz-devel curl-devel openssl-devel \ - git diffutils + git diffutils gsl-devel perl-ExtUtils-Embed << : *COMPILE << : *TEST