From 0ad9116243f273752f40c64e9a750f76a6c96efd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20W=C3=B3jcik?= Date: Tue, 20 Apr 2021 00:05:49 +0200 Subject: [PATCH 1/9] xbps-src: add make_check=ci-skip --- Manual.md | 14 +++++++++----- common/travis/prepare.sh | 1 + common/xbps-src/libexec/xbps-src-docheck.sh | 6 ++++++ etc/defaults.conf | 6 ++++++ xbps-src | 2 +- 5 files changed, 23 insertions(+), 6 deletions(-) diff --git a/Manual.md b/Manual.md index 8c2afbaca71d..73cd9088f9bc 100644 --- a/Manual.md +++ b/Manual.md @@ -176,9 +176,8 @@ can be used to perform other operations before configuring the package. - `check` This optional phase checks the result of the `build` phase by running the testsuite provided by the package. If the default `do_check` function provided by the build style doesn't do anything, the template should set `make_check_target` and/or `make_check_args` appropriately or define its own `do_check` function. If tests take too long -or can't run in all environments, they should be run only if `XBPS_CHECK_PKGS` is `full`, which means they should either -be under a `[ "$XBPS_CHECK_PKGS" = full ]` conditional (especially useful with custom `do_check`) or `make_check=extended` -should be set in the template. +or can't run in all environments, `make_check` should be set to fitting value or +`do_check` should be customized to limit testsuite unless `XBPS_CHECK_PKGS` is `full`. - `install` This phase installs the `package files` into the package destdir `/destdir/-`, via `make install` or any other compatible method. @@ -606,10 +605,15 @@ patches to the package sources during `do_patch()`. Patches are stored in - `disable_parallel_build` If set the package won't be built in parallel and `XBPS_MAKEJOBS` has no effect. -- `make_check` Sets the cases in which the `check` phase is run. Can be `yes` (the default) to run if -`XBPS_CHECK_PKGS` is set, `extended` to run if `XBPS_CHECK_PKGS` is `full` and `no` to never run. +- `make_check` Sets the cases in which the `check` phase is run. This option should usually be accompanied by a comment explaining why it was set, especially when set to `no`. +Allowed values: + - `yes` (the default) to run if `XBPS_CHECK_PKGS` is set. + - `extended` to run if `XBPS_CHECK_PKGS` is `full`. + - `ci-skip` to run locally if `XBPS_CHECK_PKGS` is set, but not as part of pull request checks. + - `no` to never run. + - `keep_libtool_archives` If enabled the `GNU Libtool` archives won't be removed. By default those files are always removed automatically. diff --git a/common/travis/prepare.sh b/common/travis/prepare.sh index 1e17be97545b..550fbd7598d0 100755 --- a/common/travis/prepare.sh +++ b/common/travis/prepare.sh @@ -5,6 +5,7 @@ [ "$XLINT" ] && exit 0 /bin/echo -e '\x1b[32mUpdating etc/conf...\x1b[0m' +echo XBPS_BUILD_ENVIRONMENT=void-packages-ci >> etc/conf echo XBPS_ALLOW_RESTRICTED=yes >> etc/conf /bin/echo -e '\x1b[32mEnabling ethereal chroot-style...\x1b[0m' diff --git a/common/xbps-src/libexec/xbps-src-docheck.sh b/common/xbps-src/libexec/xbps-src-docheck.sh index 1cb9f6ab13aa..1e82c1a3739f 100755 --- a/common/xbps-src/libexec/xbps-src-docheck.sh +++ b/common/xbps-src/libexec/xbps-src-docheck.sh @@ -43,6 +43,12 @@ if [ "$make_check" = extended -a "$XBPS_CHECK_PKGS" != full ]; then exit 0 fi +if [ "$make_check" = ci-skip ] && [ "$XBPS_BUILD_ENVIRONMENT" = void-packages-ci ]; then + msg_warn \ + "${pkgname}-${version}_${revision}: skipping here because of make_check=ci-skip. Tests should be run locally.\n" + exit 0 +fi + for f in $XBPS_COMMONDIR/environment/check/*.sh; do source_file "$f" done diff --git a/etc/defaults.conf b/etc/defaults.conf index 133449a150d6..6147954a18af 100644 --- a/etc/defaults.conf +++ b/etc/defaults.conf @@ -136,6 +136,12 @@ XBPS_SUCMD="sudo /bin/sh -c" # #XBPS_USE_BUILD_MTIME=yes +# [OPTIONAL] +# Enable continuous integration specific mode of operation. Currently this +# disables do_check for some packages. +# +#XBPS_BUILD_ENVIRONMENT=void-packages-ci + # [OPTIONAL] # When using the 'ethereal' chroot-style this switch must be activated, it is # meant as safeguard against users casually destroying their systems diff --git a/xbps-src b/xbps-src index 9d88873ab2c5..c3cd7e5db10b 100755 --- a/xbps-src +++ b/xbps-src @@ -635,7 +635,7 @@ export XBPS_SHUTILSDIR XBPS_CROSSPFDIR XBPS_TRIGGERSDIR \ XBPS_DESTDIR XBPS_MACHINE XBPS_TEMP_MASTERDIR XBPS_BINPKG_EXISTS \ XBPS_LIBEXECDIR XBPS_DISTDIR XBPS_DISTFILES_MIRROR XBPS_ALLOW_RESTRICTED \ XBPS_USE_GIT_COMMIT_DATE XBPS_PKG_COMPTYPE XBPS_REPO_COMPTYPE \ - XBPS_BUILDHELPERDIR XBPS_USE_BUILD_MTIME + XBPS_BUILDHELPERDIR XBPS_USE_BUILD_MTIME XBPS_BUILD_ENVIRONMENT for i in REPOSITORY DESTDIR BUILDDIR SRCDISTDIR; do eval val="\$XBPS_$i" From 3ebaa2b9252ca13eafcffb9724ee82c0fad90ed9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20W=C3=B3jcik?= Date: Tue, 20 Apr 2021 00:05:50 +0200 Subject: [PATCH 2/9] elogind: enable tests locally --- srcpkgs/elogind/template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/srcpkgs/elogind/template b/srcpkgs/elogind/template index d4bfe499bc55..a481be29d920 100644 --- a/srcpkgs/elogind/template +++ b/srcpkgs/elogind/template @@ -20,7 +20,7 @@ distfiles="https://github.com/${pkgname}/${pkgname}/archive/v${version}.tar.gz" checksum=dd2fcf22a89a078cad22e633d2f14a4cc9f4a9c8bae25c0e39fc4aec3e273bc9 conf_files="/etc/elogind/*.conf" # tests fail differently due to containerization and kernel features -make_check=extended +make_check=ci-skip if [ "$XBPS_TARGET_LIBC" = "musl" ]; then configure_args+=" -Dutmp=false" From 5a885cb7bbabc8711969154e5b955de6dd98db23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20W=C3=B3jcik?= Date: Tue, 20 Apr 2021 00:05:50 +0200 Subject: [PATCH 3/9] fish-shell: enable tests locally --- srcpkgs/fish-shell/template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/srcpkgs/fish-shell/template b/srcpkgs/fish-shell/template index 35ce6f0967ea..c7d3076af03a 100644 --- a/srcpkgs/fish-shell/template +++ b/srcpkgs/fish-shell/template @@ -16,7 +16,7 @@ distfiles="https://github.com/fish-shell/fish-shell/releases/download/${version} checksum=5944da1a8893d11b0828a4fd9136ee174549daffb3d0adfdd8917856fe6b4009 register_shell="/bin/fish /usr/bin/fish" # tests don't work as root -make_check=extended +make_check=ci-skip if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then makedepends+=" libatomic-devel" From 97251b525bba0eb7fff20b94ccc46ec0d050b1df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20W=C3=B3jcik?= Date: Tue, 20 Apr 2021 00:05:50 +0200 Subject: [PATCH 4/9] flac: enable tests locally --- srcpkgs/flac/template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/srcpkgs/flac/template b/srcpkgs/flac/template index bc126d52029c..8166b9f00655 100644 --- a/srcpkgs/flac/template +++ b/srcpkgs/flac/template @@ -15,7 +15,7 @@ distfiles="https://downloads.xiph.org/releases/flac/flac-${version}.tar.xz" checksum=213e82bd716c9de6db2f98bcadbc4c24c7e2efe8c75939a1a84e28539c4e1748 patch_args="-Np1" # the tests fail when run as root and as such break in the CI containers -make_check=extended +make_check=ci-skip # TODO: make into options case "$XBPS_TARGET_MACHINE" in From abd496f9d62cad4406a74081788676fbab40165e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20W=C3=B3jcik?= Date: Tue, 20 Apr 2021 00:05:50 +0200 Subject: [PATCH 5/9] igt-gpu-tools: enable tests locally --- srcpkgs/igt-gpu-tools/template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/srcpkgs/igt-gpu-tools/template b/srcpkgs/igt-gpu-tools/template index 2588c2ddff5c..3b222ecd18d8 100644 --- a/srcpkgs/igt-gpu-tools/template +++ b/srcpkgs/igt-gpu-tools/template @@ -16,7 +16,7 @@ homepage="https://gitlab.freedesktop.org/drm/igt-gpu-tools" distfiles="${XORG_SITE}/app/${pkgname}-${version}.tar.xz" checksum=40454d8f0484ea2477862007398a08eef78a6c252c4defce1c934548593fdd11 # tests don't behave in containers -make_check=extended +make_check=ci-skip lib32disabled=yes archs="i686* x86_64*" From 671d823738bb6bb4dcabdc4209552498a563002c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20W=C3=B3jcik?= Date: Tue, 20 Apr 2021 00:05:49 +0200 Subject: [PATCH 6/9] inetutils: enable tests locally --- srcpkgs/inetutils/template | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/srcpkgs/inetutils/template b/srcpkgs/inetutils/template index 7918a4641a87..ced4ac1166cd 100644 --- a/srcpkgs/inetutils/template +++ b/srcpkgs/inetutils/template @@ -20,8 +20,8 @@ subpackages="inetutils-dnsdomainname inetutils-ftp inetutils-hostname CFLAGS="-fcommon" -# tests can't run in CI -make_check=extended +# hostname test can't run in CI +make_check=ci-skip case "$XBPS_TARGET_MACHINE" in *-musl) From 1458d0ea6b1840b6f02d74e852995b5c21310a05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20W=C3=B3jcik?= Date: Tue, 20 Apr 2021 00:05:50 +0200 Subject: [PATCH 7/9] libgusb: enable tests locally --- srcpkgs/libgusb/template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/srcpkgs/libgusb/template b/srcpkgs/libgusb/template index e26b6ccf96d3..a7cc76a8c8b1 100644 --- a/srcpkgs/libgusb/template +++ b/srcpkgs/libgusb/template @@ -17,7 +17,7 @@ changelog="https://raw.githubusercontent.com/hughsie/libgusb/master/NEWS" distfiles="http://people.freedesktop.org/~hughsient/releases/${pkgname}-${version}.tar.xz" checksum=13277948a2ee06861234938089aea21bce6ad862f14c81a2efa85340ed701efd # requires access to USB devices, not available on CI -make_check=extended +make_check=ci-skip build_options="gir vala" build_options_default="gir vala" From dd9e1f71f173c4410e497426afd209ffc0a08b8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20W=C3=B3jcik?= Date: Tue, 20 Apr 2021 00:05:50 +0200 Subject: [PATCH 8/9] openvpn: enable tests locally --- srcpkgs/openvpn/template | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/srcpkgs/openvpn/template b/srcpkgs/openvpn/template index 31a9679a33f1..d521cf4c4061 100644 --- a/srcpkgs/openvpn/template +++ b/srcpkgs/openvpn/template @@ -21,8 +21,7 @@ desc_option_mbedtls="Build with mbedtls support" desc_option_pkcs11="Enable support for PKCS#11" vopt_conflict mbedtls pkcs11 -# tests can't run in CI -make_check=extended +make_check=ci-skip post_install() { vmkdir usr/share/examples/${pkgname} From 61bc9882f4e1b252e5b40b7589cc68b9c1ed39d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20W=C3=B3jcik?= Date: Tue, 20 Apr 2021 00:05:50 +0200 Subject: [PATCH 9/9] postgresql: enable tests locally --- srcpkgs/postgresql/template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/srcpkgs/postgresql/template b/srcpkgs/postgresql/template index 25f7e62bd8da..fcbf3e2a67c4 100644 --- a/srcpkgs/postgresql/template +++ b/srcpkgs/postgresql/template @@ -21,7 +21,7 @@ changelog="https://www.postgresql.org/docs/current/release-${version//./-}.html" distfiles="https://ftp.postgresql.org/pub/source/v${version}/${pkgname}-${version}.tar.bz2" checksum=930feaef28885c97ec40c26ab6221903751eeb625de92b22602706d7d47d1634 # initdb fails on github actions, works locally with xbps-uunshare -make_check=extended +make_check=ci-skip conf_files=" /etc/default/${pkgname}