[PATCH] Add initial Travis CI support
by Dmitry V. Levin
This runs "make distcheck" using gcc-9, gcc-8, gcc-7, and clang
on x86_64, x86, x32, aarch64, s390x, and ppc64le architectures.
* .travis.yml: New file.
* ci/install-dependencies.sh: Likewise.
* ci/run-build-and-tests.sh: Likewise.
Resolves: https://github.com/linux-pam/linux-pam/issues/28
---
I've also pushed it to ldv/travis-ci branch.
.travis.yml | 115 +++++++++++++++++++++++++++++++++++++
ci/install-dependencies.sh | 83 ++++++++++++++++++++++++++
ci/run-build-and-tests.sh | 88 ++++++++++++++++++++++++++++
3 files changed, 286 insertions(+)
create mode 100644 .travis.yml
create mode 100755 ci/install-dependencies.sh
create mode 100755 ci/run-build-and-tests.sh
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 00000000..ae627ed4
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,115 @@
+language: c
+
+dist: bionic
+
+before_install: ci/install-dependencies.sh
+
+script: ci/run-build-and-tests.sh
+
+sudo: required
+
+git:
+ depth: 2147483647
+
+env:
+ global:
+ - VERBOSE=1
+
+matrix:
+ include:
+ - compiler: gcc
+ arch: amd64
+ env:
+ - TARGET=x86_64
+ - compiler: gcc-9
+ arch: amd64
+ env:
+ - TARGET=x86_64
+ - compiler: gcc-8
+ arch: amd64
+ env:
+ - TARGET=x86_64
+ - compiler: clang
+ arch: amd64
+ env:
+ - TARGET=x86_64
+ - compiler: gcc
+ arch: amd64
+ env:
+ - TARGET=x86
+ - compiler: gcc-9
+ arch: amd64
+ env:
+ - TARGET=x86
+ - compiler: gcc-8
+ arch: amd64
+ env:
+ - TARGET=x86
+ - compiler: clang
+ arch: amd64
+ env:
+ - TARGET=x86
+ - compiler: gcc
+ arch: amd64
+ env:
+ - TARGET=x32
+ - compiler: gcc-9
+ arch: amd64
+ env:
+ - TARGET=x32
+ - compiler: gcc-8
+ arch: amd64
+ env:
+ - TARGET=x32
+ - compiler: clang
+ arch: amd64
+ env:
+ - TARGET=x32
+ - compiler: gcc
+ arch: arm64
+ env:
+ - TARGET=aarch64
+ - compiler: gcc-9
+ arch: arm64
+ env:
+ - TARGET=aarch64
+ - compiler: gcc-8
+ arch: arm64
+ env:
+ - TARGET=aarch64
+ - compiler: clang
+ arch: arm64
+ env:
+ - TARGET=aarch64
+ - compiler: gcc
+ arch: s390x
+ env:
+ - TARGET=s390x
+ - compiler: gcc-9
+ arch: s390x
+ env:
+ - TARGET=s390x
+ - compiler: gcc-8
+ arch: s390x
+ env:
+ - TARGET=s390x
+ - compiler: clang
+ arch: s390x
+ env:
+ - TARGET=s390x
+ - compiler: gcc
+ arch: ppc64le
+ env:
+ - TARGET=ppc64le
+ - compiler: gcc-9
+ arch: ppc64le
+ env:
+ - TARGET=ppc64le
+ - compiler: gcc-8
+ arch: ppc64le
+ env:
+ - TARGET=ppc64le
+ - compiler: clang
+ arch: ppc64le
+ env:
+ - TARGET=ppc64le
diff --git a/ci/install-dependencies.sh b/ci/install-dependencies.sh
new file mode 100755
index 00000000..aaeaf389
--- /dev/null
+++ b/ci/install-dependencies.sh
@@ -0,0 +1,83 @@
+#!/bin/sh -ex
+#
+# Copyright (c) 2018-2019 The strace developers.
+# All rights reserved.
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+j=-j`nproc` || j=
+type sudo >/dev/null 2>&1 && sudo=sudo || sudo=
+packages="
+autoconf
+automake
+autopoint
+bison
+bzip2
+docbook-xml
+docbook-xsl
+flex
+gettext
+libaudit-dev
+libcrack2-dev
+libdb-dev
+libfl-dev
+libselinux1-dev
+libtool
+libxcrypt-dev
+libxml2-utils
+make
+pkg-config
+sed
+w3m
+xsltproc
+xz-utils
+$CC"
+
+retry_if_failed()
+{
+ for i in `seq 0 99`; do
+ "$@" && i= && break || sleep 1
+ done
+ [ -z "$i" ]
+}
+
+updated=
+apt_get_install()
+{
+ [ -n "$updated" ] || {
+ retry_if_failed $sudo apt-get -qq update
+ updated=1
+ }
+ retry_if_failed $sudo \
+ apt-get -qq --no-install-suggests --no-install-recommends \
+ install -y "$@"
+}
+
+case "$CC" in
+ gcc-*)
+ retry_if_failed \
+ $sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
+ ;;
+esac
+
+case "$TARGET" in
+ x32|x86)
+ packages="$packages gcc-multilib"
+ case "$CC" in
+ gcc-*) packages="$packages $CC-multilib" ;;
+ esac
+ ;;
+esac
+
+apt_get_install $packages
+
+case "${CHECK-}" in
+ coverage)
+ apt_get_install lcov python-pip python-setuptools
+ retry_if_failed \
+ pip install --user codecov
+ ;;
+ valgrind)
+ apt_get_install valgrind
+ ;;
+esac
diff --git a/ci/run-build-and-tests.sh b/ci/run-build-and-tests.sh
new file mode 100755
index 00000000..db55bdd0
--- /dev/null
+++ b/ci/run-build-and-tests.sh
@@ -0,0 +1,88 @@
+#!/bin/sh -ex
+#
+# Copyright (c) 2018-2019 The strace developers.
+# All rights reserved.
+#
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+DISTCHECK_CONFIGURE_FLAGS='--disable-dependency-tracking'
+export DISTCHECK_CONFIGURE_FLAGS
+
+case "${TARGET-}" in
+ x32)
+ CC="$CC -mx32"
+ ;;
+ x86)
+ CC="$CC -m32"
+ DISTCHECK_CONFIGURE_FLAGS="$DISTCHECK_CONFIGURE_FLAGS --build=i686-pc-linux-gnu --target=i686-pc-linux-gnu"
+ ;;
+esac
+
+CPPFLAGS=
+
+case "${CHECK-}" in
+ coverage)
+ DISTCHECK_CONFIGURE_FLAGS="$DISTCHECK_CONFIGURE_FLAGS --enable-code-coverage"
+ CFLAGS='-g -O0'
+ CFLAGS_FOR_BUILD="$CFLAGS"
+ export CFLAGS CFLAGS_FOR_BUILD
+ ;;
+ valgrind)
+ DISTCHECK_CONFIGURE_FLAGS="$DISTCHECK_CONFIGURE_FLAGS --enable-valgrind"
+ ;;
+esac
+
+echo 'BEGIN OF BUILD ENVIRONMENT INFORMATION'
+uname -a |head -1
+libc="$(ldd /bin/sh |sed -n 's|^[^/]*\(/[^ ]*/libc\.so[^ ]*\).*|\1|p' |head -1)"
+$libc |head -1
+$CC --version |head -1
+make --version |head -1
+autoconf --version |head -1
+automake --version |head -1
+libtoolize --version |head -1
+kver="$(printf '%s\n%s\n' '#include <linux/version.h>' 'LINUX_VERSION_CODE' | $CC $CPPFLAGS -E -P -)"
+printf 'kernel-headers %s.%s.%s\n' $(($kver/65536)) $(($kver/256%256)) $(($kver%256))
+echo 'END OF BUILD ENVIRONMENT INFORMATION'
+
+export CC_FOR_BUILD="$CC"
+
+./autogen.sh
+./configure $DISTCHECK_CONFIGURE_FLAGS \
+ || {
+ rc=$?
+ cat config.log
+ echo "$CC -dumpspecs follows"
+ $CC -dumpspecs
+ exit $rc
+}
+
+j=-j`nproc` || j=
+
+case "${CHECK-}" in
+ coverage)
+ make -k $j all VERBOSE=${VERBOSE-}
+ make -k $j check VERBOSE=${VERBOSE-}
+ codecov --gcov-args=-abcp ||:
+ echo 'BEGIN OF TEST SUITE INFORMATION'
+ tail -n 99999 -- tests*/test-suite.log
+ echo 'END OF TEST SUITE INFORMATION'
+ ;;
+ valgrind)
+ make -k $j all VERBOSE=${VERBOSE-}
+ rc=$?
+ for n in ${VALGRIND_TOOLS:-memcheck helgrind drd}; do
+ make -k $j -C "${VALGRIND_TESTDIR:-.}" \
+ check-valgrind-$n VERBOSE=${VERBOSE-} ||
+ rc=$?
+ done
+ echo 'BEGIN OF TEST SUITE INFORMATION'
+ tail -n 99999 -- tests*/test-suite*.log ||
+ rc=$?
+ echo 'END OF TEST SUITE INFORMATION'
+ [ "$rc" -eq 0 ]
+ ;;
+ *)
+ make -k $j distcheck VERBOSE=${VERBOSE-}
+ ;;
+esac
--
ldv
4 years
pam_start_confdir implementation to address issue #143
by Tomas Mraz
The attached patch adds a new pam_start_confdir() API call to address
the issue #143. It allows setting a directory from which the service
PAM configuration is to be loaded. Please review.
--
Tomáš Mráz
No matter how far down the wrong road you've gone, turn back.
Turkish proverb
[You'll know whether the road is wrong if you carefully listen to your
conscience.]
4 years, 1 month
Regression in pam_unix caused by using pam_modutil_sanitize_fd
by Tomas Mraz
The pam_modutil_sanitize_fd() when called to provide a dummy pipes for
stdout and stderr closes the read end of the newly created dummy pipe.
This is wrong as any writes to such pipe will trigger SIGPIPE. The
original code did a trick to avoid that by dup2-ing the read end of the
pipe as stdin. However it does not necessarily have to be stdin, we
just need to ensure the read end of the pipe is not closed.
The attached patch implements the fix. OK to commit?
--
Tomáš Mráz
No matter how far down the wrong road you've gone, turn back.
Turkish proverb
[You'll know whether the road is wrong if you carefully listen to your
conscience.]
4 years, 1 month
Re: [linux-pam/linux-pam] a33d19: pam_group, pam_time: Fix logical error with multip...
by Dmitry V. Levin
Hi,
On Mon, Feb 24, 2020 at 10:00:14AM -0800, Tomáš Mráz wrote:
> Branch: refs/heads/master
> Home: https://github.com/linux-pam/linux-pam
> Commit: a33d198dd60d34422c706fd85d00b64d43402690
> https://github.com/linux-pam/linux-pam/commit/a33d198dd60d34422c706fd85d0...
> Author: Tomas Mraz <tmraz(a)fedoraproject.org>
> Date: 2020-02-24 (Mon, 24 Feb 2020)
>
> Changed paths:
> M modules/pam_group/group.conf.5.xml
> M modules/pam_group/pam_group.c
> M modules/pam_time/pam_time.c
> M modules/pam_time/time.conf.5.xml
>
> Log Message:
> -----------
> pam_group, pam_time: Fix logical error with multiple ! operators
>
> * modules/pam_group/group.conf.5.xml: Document what logic list means.
> * modules/pam_time/time.conf.5.xml: Likewise.
> * modules/pam_group/pam_group.c (logic_field): Clear the not operator for the
> further operations.
> * modules/pam_time/pam_time.c (logic_field): Likewise.
Looks like "make distcheck" started to fail after this change.
--
ldv
4 years, 2 months
Multiple pam_env cleanups
by Tomas Mraz
The pam_env code is fairly ugly, this improves it only a little bit.
Please review.
--
Tomáš Mráz
No matter how far down the wrong road you've gone, turn back.
Turkish proverb
[You'll know whether the road is wrong if you carefully listen to your
conscience.]
4 years, 2 months