Martin Kletzander
2021-Jul-13 21:26 UTC
[Libguestfs] [libnbd PATCH 0/6] Paint the pipeline complete green, finally
I hated the fact that it was not finished and it was (is) keeping me awake even though I do not really have tome to do this, but it is finally finished. We can even enable CI notifications to go public if that's something we'd like to do. Anyway, with this I hope I can finally get libnbd CI out of my mind and hopefully move to CI for other projects ASAP. Night night ;) Martin Kletzander (6): info: Require nbdkit >= 1.14 for info-can.sh One more VSOCK include fix macOS: Simple cloexec/nonblock fix macOS: Do not use --version_script Update CI files CI: Add testing on Alpine configure.ac | 10 +++ lib/internal.h | 3 + generator/states-connect-socket-activation.c | 2 +- generator/states-connect.c | 11 ++-- lib/uri.c | 2 + lib/utils.c | 68 ++++++++++++++++++++ lib/Makefile.am | 2 +- .gitlab-ci.yml | 23 +++++++ ci/cirrus/freebsd-12.vars | 4 +- ci/cirrus/freebsd-13.vars | 4 +- ci/cirrus/freebsd-current.vars | 4 +- ci/cirrus/macos-11.vars | 4 +- ci/containers/alpine-314.Dockerfile | 57 ++++++++++++++++ ci/containers/alpine-edge.Dockerfile | 57 ++++++++++++++++ ci/containers/centos-8.Dockerfile | 2 +- ci/containers/centos-stream-8.Dockerfile | 2 +- ci/containers/debian-10.Dockerfile | 2 +- ci/containers/debian-sid.Dockerfile | 2 +- ci/containers/fedora-33.Dockerfile | 2 +- ci/containers/fedora-34.Dockerfile | 2 +- ci/containers/fedora-rawhide.Dockerfile | 2 +- ci/containers/opensuse-leap-152.Dockerfile | 2 +- ci/containers/opensuse-tumbleweed.Dockerfile | 2 +- ci/containers/ubuntu-1804.Dockerfile | 2 +- ci/containers/ubuntu-2004.Dockerfile | 2 +- fuzzing/libnbd-fuzz-wrapper.c | 30 ++++++++- fuzzing/libnbd-libfuzzer-test.c | 30 ++++++++- info/info-can.sh | 4 ++ 28 files changed, 309 insertions(+), 28 deletions(-) create mode 100644 ci/containers/alpine-314.Dockerfile create mode 100644 ci/containers/alpine-edge.Dockerfile -- 2.32.0
Martin Kletzander
2021-Jul-13 21:26 UTC
[Libguestfs] [libnbd PATCH 1/6] info: Require nbdkit >= 1.14 for info-can.sh
The can_cache flag was introduced in 1.13.4, so the tests might fail on an older one. To make the check easier, only run this test with nbdkit >= 1.14 Signed-off-by: Martin Kletzander <mkletzan at redhat.com> --- info/info-can.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/info/info-can.sh b/info/info-can.sh index 4154e38e85ba..afa6043e24bc 100755 --- a/info/info-can.sh +++ b/info/info-can.sh @@ -24,6 +24,10 @@ set -x requires nbdkit --version requires nbdkit sh --version +# This test requires nbdkit >= 1.13.3 due to can_cache, check for at least 1.14. +minor=$( nbdkit --dump-config | grep ^version_minor | cut -d= -f2 ) +requires test $minor -ge 14 + # --is read-only and --can write are tested in info-is-read-only.sh # --can connect is tested in info-can-connect.sh -- 2.32.0
Martin Kletzander
2021-Jul-13 21:26 UTC
[Libguestfs] [libnbd PATCH 2/6] One more VSOCK include fix
This file was forgotten in commit e8ed016c34e1. Signed-off-by: Martin Kletzander <mkletzan at redhat.com> --- lib/uri.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/uri.c b/lib/uri.c index bcecbad5005a..56f47376ed98 100644 --- a/lib/uri.c +++ b/lib/uri.c @@ -32,6 +32,8 @@ #ifdef HAVE_LINUX_VM_SOCKETS_H #include <linux/vm_sockets.h> +#elif HAVE_SYS_VSOCK_H +#include <sys/vsock.h> #endif #include "internal.h" -- 2.32.0
Martin Kletzander
2021-Jul-13 21:26 UTC
[Libguestfs] [libnbd PATCH 3/6] macOS: Simple cloexec/nonblock fix
This is the most trivial way to fix the issue with macOS not having SOCK_CLOEXEC and SOCK_NONBLOCK. There is not much better way, so this is the only way to make it work on such platform(s). Signed-off-by: Martin Kletzander <mkletzan at redhat.com> --- lib/internal.h | 3 + generator/states-connect-socket-activation.c | 2 +- generator/states-connect.c | 11 ++-- lib/utils.c | 68 ++++++++++++++++++++ fuzzing/libnbd-fuzz-wrapper.c | 30 ++++++++- fuzzing/libnbd-libfuzzer-test.c | 30 ++++++++- 6 files changed, 136 insertions(+), 8 deletions(-) diff --git a/lib/internal.h b/lib/internal.h index 01f9d8ab5fea..8a4c189abe65 100644 --- a/lib/internal.h +++ b/lib/internal.h @@ -467,4 +467,7 @@ extern char *nbd_internal_printable_buffer (const void *buf, size_t count); extern char *nbd_internal_printable_string (const char *str); extern char *nbd_internal_printable_string_list (char **list); +extern int nbd_internal_socket(int domain, int type, int protocol, bool nonblock); +extern int nbd_internal_socketpair(int domain, int type, int protocol, int *fds); + #endif /* LIBNBD_INTERNAL_H */ diff --git a/generator/states-connect-socket-activation.c b/generator/states-connect-socket-activation.c index e601c9bb56be..8a2add312bc4 100644 --- a/generator/states-connect-socket-activation.c +++ b/generator/states-connect-socket-activation.c @@ -131,7 +131,7 @@ STATE_MACHINE { return 0; } - s = socket (AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC, 0); + s = nbd_internal_socket (AF_UNIX, SOCK_STREAM, 0, false); if (s == -1) { SET_NEXT_STATE (%.DEAD); set_error (errno, "socket"); diff --git a/generator/states-connect.c b/generator/states-connect.c index fcac86f36a34..8de12183d627 100644 --- a/generator/states-connect.c +++ b/generator/states-connect.c @@ -52,7 +52,7 @@ STATE_MACHINE { assert (!h->sock); family = h->connaddr.ss_family; - fd = socket (family, SOCK_STREAM|SOCK_NONBLOCK|SOCK_CLOEXEC, 0); + fd = nbd_internal_socket (family, SOCK_STREAM, 0, true); if (fd == -1) { SET_NEXT_STATE (%.DEAD); set_error (errno, "socket"); @@ -162,9 +162,10 @@ STATE_MACHINE { return -1; } - fd = socket (h->rp->ai_family, - h->rp->ai_socktype|SOCK_NONBLOCK|SOCK_CLOEXEC, - h->rp->ai_protocol); + fd = nbd_internal_socket (h->rp->ai_family, + h->rp->ai_socktype, + h->rp->ai_protocol, + true); if (fd == -1) { SET_NEXT_STATE (%NEXT_ADDRESS); return 0; @@ -227,7 +228,7 @@ STATE_MACHINE { assert (!h->sock); assert (h->argv.ptr); assert (h->argv.ptr[0]); - if (socketpair (AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC, 0, sv) == -1) { + if (nbd_internal_socketpair (AF_UNIX, SOCK_STREAM, 0, sv) == -1) { SET_NEXT_STATE (%.DEAD); set_error (errno, "socketpair"); return 0; diff --git a/lib/utils.c b/lib/utils.c index 260fd6a25796..972cbc5208a7 100644 --- a/lib/utils.c +++ b/lib/utils.c @@ -24,6 +24,7 @@ #include <unistd.h> #include <ctype.h> #include <errno.h> +#include <fcntl.h> #include "minmax.h" @@ -258,3 +259,70 @@ nbd_internal_printable_string_list (char **list) return s; } + +int nbd_internal_socket(int domain, + int type, + int protocol, + bool nonblock) +{ + int fd; + +#ifdef __APPLE__ + int flags; +#else + type |= SOCK_CLOEXEC; + if (nonblock) + type |= SOCK_NONBLOCK; +#endif + + fd = socket (domain, type, protocol); + +#ifdef __APPLE__ + if (fd == -1) + return -1; + + if (fcntl (fd, F_SETFD, FD_CLOEXEC) == -1) { + close(fd); + return -1; + } + + if (nonblock) { + flags = fcntl (fd, F_GETFL, 0); + if (flags == -1 || + fcntl (fd, F_SETFL, flags|O_NONBLOCK) == -1) { + close(fd); + return -1; + } + } +#endif + + return fd; +} + +int +nbd_internal_socketpair (int domain, int type, int protocol, int *fds) +{ + int ret; + +#ifdef __APPLE__ + size_t i; +#else + type |= SOCK_CLOEXEC; +#endif + + ret = socketpair (domain, type, protocol, fds); + +#ifdef __APPLE__ + if (ret == 0) { + for (i = 0; i < 2; i++) { + if (fcntl (fds[i], F_SETFD, FD_CLOEXEC) == -1) { + close(fds[0]); + close(fds[1]); + return -1; + } + } + } +#endif + + return ret; +} diff --git a/fuzzing/libnbd-fuzz-wrapper.c b/fuzzing/libnbd-fuzz-wrapper.c index 99a6d803258f..3d127e673e9e 100644 --- a/fuzzing/libnbd-fuzz-wrapper.c +++ b/fuzzing/libnbd-fuzz-wrapper.c @@ -41,6 +41,34 @@ static void client (int s); static void server (int fd, int s); +static int +get_socketpair (int domain, int type, int protocol, int *fds) +{ + int ret; + +#ifdef __APPLE__ + size_t i; +#else + type |= SOCK_CLOEXEC; +#endif + + ret = socketpair (domain, type, protocol, fds); + +#ifdef __APPLE__ + if (ret == 0) { + for (i = 0; i < 2; i++) { + if (fcntl (fds[i], F_SETFD, FD_CLOEXEC) == -1) { + close(fds[0]); + close(fds[1]); + return -1; + } + } + } +#endif + + return ret; +} + int main (int argc, char *argv[]) { @@ -61,7 +89,7 @@ main (int argc, char *argv[]) } /* Create a connected socket. */ - if (socketpair (AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC, 0, sv) == -1) { + if (get_socketpair (AF_UNIX, SOCK_STREAM, 0, sv) == -1) { perror ("socketpair"); exit (EXIT_FAILURE); } diff --git a/fuzzing/libnbd-libfuzzer-test.c b/fuzzing/libnbd-libfuzzer-test.c index 5ee29b877bdb..0bf988ee8398 100644 --- a/fuzzing/libnbd-libfuzzer-test.c +++ b/fuzzing/libnbd-libfuzzer-test.c @@ -41,6 +41,34 @@ static void client (int sock); static void server (const uint8_t *data, size_t size, int sock); +static int +get_socketpair (int domain, int type, int protocol, int *fds) +{ + int ret; + +#ifdef __APPLE__ + size_t i; +#else + type |= SOCK_CLOEXEC; +#endif + + ret = socketpair (domain, type, protocol, fds); + +#ifdef __APPLE__ + if (ret == 0) { + for (i = 0; i < 2; i++) { + if (fcntl (fds[i], F_SETFD, FD_CLOEXEC) == -1) { + close(fds[0]); + close(fds[1]); + return -1; + } + } + } +#endif + + return ret; +} + /* This is the entry point called by libFuzzer. */ int LLVMFuzzerTestOneInput (const uint8_t *data, size_t size) @@ -49,7 +77,7 @@ LLVMFuzzerTestOneInput (const uint8_t *data, size_t size) int sv[2], r, status; /* Create a connected socket. */ - if (socketpair (AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC, 0, sv) == -1) { + if (nbd_internal_socketpair (AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC, 0, sv) == -1) { perror ("socketpair"); exit (EXIT_FAILURE); } -- 2.32.0
Martin Kletzander
2021-Jul-13 21:26 UTC
[Libguestfs] [libnbd PATCH 4/6] macOS: Do not use --version_script
The linker does not support this option. Signed-off-by: Martin Kletzander <mkletzan at redhat.com> --- configure.ac | 10 ++++++++++ lib/Makefile.am | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 9f6ba03a4773..18a66ee9114f 100644 --- a/configure.ac +++ b/configure.ac @@ -513,6 +513,16 @@ AS_IF([test "x$enable_golang" != "xno"],[ ],[GOLANG=no]) AM_CONDITIONAL([HAVE_GOLANG],[test "x$GOLANG" != "xno"]) +case $host_os in + darwin*) + VERSION_SCRIPT+ ;; + *) + VERSION_SCRIPT="-Wl,--version-script=${srcdir}/libnbd.syms" + ;; +esac +AC_SUBST([VERSION_SCRIPT]) + dnl Produce output files. AC_CONFIG_HEADERS([config.h]) diff --git a/lib/Makefile.am b/lib/Makefile.am index 968e41aa177b..ece50770326e 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -78,7 +78,7 @@ libnbd_la_LIBADD = \ $(NULL) libnbd_la_LDFLAGS = \ $(PTHREAD_LIBS) \ - -Wl,--version-script=$(srcdir)/libnbd.syms \ + $(VERSION_SCRIPT) \ -version-info 0:0:0 \ $(NULL) -- 2.32.0
- removes valgrind from macOS but makes the package installation not fail because of its installation which cannot be done on macOS. - fixes python update from 3.7 to 3.8 on FreeBSDs and the followup renaming of packages. Signed-off-by: Martin Kletzander <mkletzan at redhat.com> --- ci/cirrus/freebsd-12.vars | 4 ++-- ci/cirrus/freebsd-13.vars | 4 ++-- ci/cirrus/freebsd-current.vars | 4 ++-- ci/cirrus/macos-11.vars | 4 ++-- ci/containers/centos-8.Dockerfile | 2 +- ci/containers/centos-stream-8.Dockerfile | 2 +- ci/containers/debian-10.Dockerfile | 2 +- ci/containers/debian-sid.Dockerfile | 2 +- ci/containers/fedora-33.Dockerfile | 2 +- ci/containers/fedora-34.Dockerfile | 2 +- ci/containers/fedora-rawhide.Dockerfile | 2 +- ci/containers/opensuse-leap-152.Dockerfile | 2 +- ci/containers/opensuse-tumbleweed.Dockerfile | 2 +- ci/containers/ubuntu-1804.Dockerfile | 2 +- ci/containers/ubuntu-2004.Dockerfile | 2 +- 15 files changed, 19 insertions(+), 19 deletions(-) diff --git a/ci/cirrus/freebsd-12.vars b/ci/cirrus/freebsd-12.vars index 28f7cc2bea45..7d07d0d7a751 100644 --- a/ci/cirrus/freebsd-12.vars +++ b/ci/cirrus/freebsd-12.vars @@ -2,7 +2,7 @@ # # $ lcitool variables freebsd-12 libnbd # -# https://gitlab.com/libvirt/libvirt-ci/-/commit/4a5cf5007ce3bb5e330b9f3361c5931b072ebe28 +# https://gitlab.com/libvirt/libvirt-ci/-/commit/1b32d74a089da43a0f79eba012ad04c30b57ecc6 PACKAGING_COMMAND='pkg' CCACHE='/usr/local/bin/ccache' @@ -10,4 +10,4 @@ MAKE='/usr/local/bin/gmake' NINJA='/usr/local/bin/ninja' PYTHON='/usr/local/bin/python3' PIP3='/usr/local/bin/pip-3.7' -PKGS='autoconf automake bash-completion ca_root_nss ccache diffutils fusefs-libs3 git glib gmake gnutls go gsed jq libev libtool libxml2 nbd-server nbdkit ocaml ocaml-findlib p5-Pod-Simple perl5 pkgconf py37-flake8 python3 qemu valgrind' +PKGS='autoconf automake bash-completion ca_root_nss ccache diffutils fusefs-libs3 git glib gmake gnutls go gsed jq libev libtool libxml2 nbd-server nbdkit ocaml ocaml-findlib p5-Pod-Simple perl5 pkgconf py38-flake8 python3 qemu valgrind' diff --git a/ci/cirrus/freebsd-13.vars b/ci/cirrus/freebsd-13.vars index e577fa5197b8..538dbeae06f8 100644 --- a/ci/cirrus/freebsd-13.vars +++ b/ci/cirrus/freebsd-13.vars @@ -2,7 +2,7 @@ # # $ lcitool variables freebsd-13 libnbd # -# https://gitlab.com/libvirt/libvirt-ci/-/commit/4a5cf5007ce3bb5e330b9f3361c5931b072ebe28 +# https://gitlab.com/libvirt/libvirt-ci/-/commit/1b32d74a089da43a0f79eba012ad04c30b57ecc6 PACKAGING_COMMAND='pkg' CCACHE='/usr/local/bin/ccache' @@ -10,4 +10,4 @@ MAKE='/usr/local/bin/gmake' NINJA='/usr/local/bin/ninja' PYTHON='/usr/local/bin/python3' PIP3='/usr/local/bin/pip-3.7' -PKGS='autoconf automake bash-completion ca_root_nss ccache diffutils fusefs-libs3 git glib gmake gnutls go gsed jq libev libtool libxml2 nbd-server nbdkit ocaml ocaml-findlib p5-Pod-Simple perl5 pkgconf py37-flake8 python3 qemu valgrind' +PKGS='autoconf automake bash-completion ca_root_nss ccache diffutils fusefs-libs3 git glib gmake gnutls go gsed jq libev libtool libxml2 nbd-server nbdkit ocaml ocaml-findlib p5-Pod-Simple perl5 pkgconf py38-flake8 python3 qemu valgrind' diff --git a/ci/cirrus/freebsd-current.vars b/ci/cirrus/freebsd-current.vars index 01aceca0aaa3..b0b0c23b6b24 100644 --- a/ci/cirrus/freebsd-current.vars +++ b/ci/cirrus/freebsd-current.vars @@ -2,7 +2,7 @@ # # $ lcitool variables freebsd-current libnbd # -# https://gitlab.com/libvirt/libvirt-ci/-/commit/4a5cf5007ce3bb5e330b9f3361c5931b072ebe28 +# https://gitlab.com/libvirt/libvirt-ci/-/commit/1b32d74a089da43a0f79eba012ad04c30b57ecc6 PACKAGING_COMMAND='pkg' CCACHE='/usr/local/bin/ccache' @@ -10,4 +10,4 @@ MAKE='/usr/local/bin/gmake' NINJA='/usr/local/bin/ninja' PYTHON='/usr/local/bin/python3' PIP3='/usr/local/bin/pip-3.7' -PKGS='autoconf automake bash-completion ca_root_nss ccache diffutils fusefs-libs3 git glib gmake gnutls go gsed jq libev libtool libxml2 nbd-server nbdkit ocaml ocaml-findlib p5-Pod-Simple perl5 pkgconf py37-flake8 python3 qemu valgrind' +PKGS='autoconf automake bash-completion ca_root_nss ccache diffutils fusefs-libs3 git glib gmake gnutls go gsed jq libev libtool libxml2 nbd-server nbdkit ocaml ocaml-findlib p5-Pod-Simple perl5 pkgconf py38-flake8 python3 qemu valgrind' diff --git a/ci/cirrus/macos-11.vars b/ci/cirrus/macos-11.vars index 0824e81d78ba..53ea348c0130 100644 --- a/ci/cirrus/macos-11.vars +++ b/ci/cirrus/macos-11.vars @@ -2,7 +2,7 @@ # # $ lcitool variables macos-11 libnbd # -# https://gitlab.com/libvirt/libvirt-ci/-/commit/4a5cf5007ce3bb5e330b9f3361c5931b072ebe28 +# https://gitlab.com/libvirt/libvirt-ci/-/commit/1b32d74a089da43a0f79eba012ad04c30b57ecc6 PACKAGING_COMMAND='brew' CCACHE='/usr/local/bin/ccache' @@ -10,4 +10,4 @@ MAKE='/usr/local/bin/gmake' NINJA='/usr/local/bin/ninja' PYTHON='/usr/local/bin/python3' PIP3='/usr/local/bin/pip3' -PKGS='autoconf automake bash-completion ccache diffutils flake8 git glib gnu-sed gnutls golang jq libev libtool libxml2 make ocaml ocaml-findlib perl pkg-config python3 qemu valgrind' +PKGS='autoconf automake bash-completion ccache diffutils flake8 git glib gnu-sed gnutls golang jq libev libtool libxml2 make ocaml ocaml-findlib perl pkg-config python3 qemu' diff --git a/ci/containers/centos-8.Dockerfile b/ci/containers/centos-8.Dockerfile index 03c917f51d6c..bb4457294fb3 100644 --- a/ci/containers/centos-8.Dockerfile +++ b/ci/containers/centos-8.Dockerfile @@ -2,7 +2,7 @@ # # $ lcitool dockerfile centos-8 libnbd # -# https://gitlab.com/libvirt/libvirt-ci/-/commit/4a5cf5007ce3bb5e330b9f3361c5931b072ebe28 +# https://gitlab.com/libvirt/libvirt-ci/-/commit/1b32d74a089da43a0f79eba012ad04c30b57ecc6 FROM docker.io/library/centos:8 diff --git a/ci/containers/centos-stream-8.Dockerfile b/ci/containers/centos-stream-8.Dockerfile index 2b124a35f633..051aba4ec1ee 100644 --- a/ci/containers/centos-stream-8.Dockerfile +++ b/ci/containers/centos-stream-8.Dockerfile @@ -2,7 +2,7 @@ # # $ lcitool dockerfile centos-stream-8 libnbd # -# https://gitlab.com/libvirt/libvirt-ci/-/commit/4a5cf5007ce3bb5e330b9f3361c5931b072ebe28 +# https://gitlab.com/libvirt/libvirt-ci/-/commit/1b32d74a089da43a0f79eba012ad04c30b57ecc6 FROM quay.io/centos/centos:stream8 diff --git a/ci/containers/debian-10.Dockerfile b/ci/containers/debian-10.Dockerfile index bb6abf99fb04..992b2c86911e 100644 --- a/ci/containers/debian-10.Dockerfile +++ b/ci/containers/debian-10.Dockerfile @@ -2,7 +2,7 @@ # # $ lcitool dockerfile debian-10 libnbd # -# https://gitlab.com/libvirt/libvirt-ci/-/commit/4a5cf5007ce3bb5e330b9f3361c5931b072ebe28 +# https://gitlab.com/libvirt/libvirt-ci/-/commit/1b32d74a089da43a0f79eba012ad04c30b57ecc6 FROM docker.io/library/debian:10-slim diff --git a/ci/containers/debian-sid.Dockerfile b/ci/containers/debian-sid.Dockerfile index 81f76a19f47c..38819625d436 100644 --- a/ci/containers/debian-sid.Dockerfile +++ b/ci/containers/debian-sid.Dockerfile @@ -2,7 +2,7 @@ # # $ lcitool dockerfile debian-sid libnbd # -# https://gitlab.com/libvirt/libvirt-ci/-/commit/4a5cf5007ce3bb5e330b9f3361c5931b072ebe28 +# https://gitlab.com/libvirt/libvirt-ci/-/commit/1b32d74a089da43a0f79eba012ad04c30b57ecc6 FROM docker.io/library/debian:sid-slim diff --git a/ci/containers/fedora-33.Dockerfile b/ci/containers/fedora-33.Dockerfile index 207f4a070301..177df083453d 100644 --- a/ci/containers/fedora-33.Dockerfile +++ b/ci/containers/fedora-33.Dockerfile @@ -2,7 +2,7 @@ # # $ lcitool dockerfile fedora-33 libnbd # -# https://gitlab.com/libvirt/libvirt-ci/-/commit/4a5cf5007ce3bb5e330b9f3361c5931b072ebe28 +# https://gitlab.com/libvirt/libvirt-ci/-/commit/1b32d74a089da43a0f79eba012ad04c30b57ecc6 FROM registry.fedoraproject.org/fedora:33 diff --git a/ci/containers/fedora-34.Dockerfile b/ci/containers/fedora-34.Dockerfile index 47569ff00f5e..b3aac697a1a0 100644 --- a/ci/containers/fedora-34.Dockerfile +++ b/ci/containers/fedora-34.Dockerfile @@ -2,7 +2,7 @@ # # $ lcitool dockerfile fedora-34 libnbd # -# https://gitlab.com/libvirt/libvirt-ci/-/commit/4a5cf5007ce3bb5e330b9f3361c5931b072ebe28 +# https://gitlab.com/libvirt/libvirt-ci/-/commit/1b32d74a089da43a0f79eba012ad04c30b57ecc6 FROM registry.fedoraproject.org/fedora:34 diff --git a/ci/containers/fedora-rawhide.Dockerfile b/ci/containers/fedora-rawhide.Dockerfile index 8fbaa20d3822..5922c6863af2 100644 --- a/ci/containers/fedora-rawhide.Dockerfile +++ b/ci/containers/fedora-rawhide.Dockerfile @@ -2,7 +2,7 @@ # # $ lcitool dockerfile fedora-rawhide libnbd # -# https://gitlab.com/libvirt/libvirt-ci/-/commit/4a5cf5007ce3bb5e330b9f3361c5931b072ebe28 +# https://gitlab.com/libvirt/libvirt-ci/-/commit/1b32d74a089da43a0f79eba012ad04c30b57ecc6 FROM registry.fedoraproject.org/fedora:rawhide diff --git a/ci/containers/opensuse-leap-152.Dockerfile b/ci/containers/opensuse-leap-152.Dockerfile index 42bdc314b387..dda15b7e627f 100644 --- a/ci/containers/opensuse-leap-152.Dockerfile +++ b/ci/containers/opensuse-leap-152.Dockerfile @@ -2,7 +2,7 @@ # # $ lcitool dockerfile opensuse-leap-152 libnbd # -# https://gitlab.com/libvirt/libvirt-ci/-/commit/4a5cf5007ce3bb5e330b9f3361c5931b072ebe28 +# https://gitlab.com/libvirt/libvirt-ci/-/commit/1b32d74a089da43a0f79eba012ad04c30b57ecc6 FROM registry.opensuse.org/opensuse/leap:15.2 diff --git a/ci/containers/opensuse-tumbleweed.Dockerfile b/ci/containers/opensuse-tumbleweed.Dockerfile index 3e226d3abc53..22af9e533376 100644 --- a/ci/containers/opensuse-tumbleweed.Dockerfile +++ b/ci/containers/opensuse-tumbleweed.Dockerfile @@ -2,7 +2,7 @@ # # $ lcitool dockerfile opensuse-tumbleweed libnbd # -# https://gitlab.com/libvirt/libvirt-ci/-/commit/4a5cf5007ce3bb5e330b9f3361c5931b072ebe28 +# https://gitlab.com/libvirt/libvirt-ci/-/commit/1b32d74a089da43a0f79eba012ad04c30b57ecc6 FROM registry.opensuse.org/opensuse/tumbleweed:latest diff --git a/ci/containers/ubuntu-1804.Dockerfile b/ci/containers/ubuntu-1804.Dockerfile index 3598b01ddcaf..42c4ae400d43 100644 --- a/ci/containers/ubuntu-1804.Dockerfile +++ b/ci/containers/ubuntu-1804.Dockerfile @@ -2,7 +2,7 @@ # # $ lcitool dockerfile ubuntu-1804 libnbd # -# https://gitlab.com/libvirt/libvirt-ci/-/commit/4a5cf5007ce3bb5e330b9f3361c5931b072ebe28 +# https://gitlab.com/libvirt/libvirt-ci/-/commit/1b32d74a089da43a0f79eba012ad04c30b57ecc6 FROM docker.io/library/ubuntu:18.04 diff --git a/ci/containers/ubuntu-2004.Dockerfile b/ci/containers/ubuntu-2004.Dockerfile index 93edb848df86..e40427c3125e 100644 --- a/ci/containers/ubuntu-2004.Dockerfile +++ b/ci/containers/ubuntu-2004.Dockerfile @@ -2,7 +2,7 @@ # # $ lcitool dockerfile ubuntu-2004 libnbd # -# https://gitlab.com/libvirt/libvirt-ci/-/commit/4a5cf5007ce3bb5e330b9f3361c5931b072ebe28 +# https://gitlab.com/libvirt/libvirt-ci/-/commit/1b32d74a089da43a0f79eba012ad04c30b57ecc6 FROM docker.io/library/ubuntu:20.04 -- 2.32.0
Martin Kletzander
2021-Jul-13 21:26 UTC
[Libguestfs] [libnbd PATCH 6/6] CI: Add testing on Alpine
It is the favourite small container distribution and it just works. Signed-off-by: Martin Kletzander <mkletzan at redhat.com> --- .gitlab-ci.yml | 23 +++++++++++ ci/containers/alpine-314.Dockerfile | 57 ++++++++++++++++++++++++++++ ci/containers/alpine-edge.Dockerfile | 57 ++++++++++++++++++++++++++++ 3 files changed, 137 insertions(+) create mode 100644 ci/containers/alpine-314.Dockerfile create mode 100644 ci/containers/alpine-edge.Dockerfile diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 43fba2e84cfa..935711e8fea3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -95,6 +95,15 @@ stages: - if: "$CIRRUS_GITHUB_REPO && $CIRRUS_API_TOKEN" # Native container build jobs +x64-alpine-314-container: + extends: .container_job + variables: + NAME: alpine-314 + +x64-alpine-edge-container: + extends: .container_job + variables: + NAME: alpine-edge x64-centos-8-container: extends: .container_job @@ -174,6 +183,20 @@ x64-centos-8: variables: NAME: centos-8 +x64-alpine-314: + extends: .native_build_job + needs: + - x64-alpine-314-container + variables: + NAME: alpine-314 + +x64-alpine-edge: + extends: .native_build_job + needs: + - x64-alpine-edge-container + variables: + NAME: alpine-edge + x64-centos-8-clang: extends: .native_build_job needs: diff --git a/ci/containers/alpine-314.Dockerfile b/ci/containers/alpine-314.Dockerfile new file mode 100644 index 000000000000..c9ae76e7120b --- /dev/null +++ b/ci/containers/alpine-314.Dockerfile @@ -0,0 +1,57 @@ +# THIS FILE WAS AUTO-GENERATED +# +# $ lcitool dockerfile alpine-314 libnbd +# +# https://gitlab.com/libvirt/libvirt-ci/-/commit/1b32d74a089da43a0f79eba012ad04c30b57ecc6 + +FROM docker.io/library/alpine:3.14 + +RUN apk update && \ + apk upgrade && \ + apk add \ + autoconf \ + automake \ + bash-completion \ + ca-certificates \ + ccache \ + clang \ + diffutils \ + fuse3 \ + fuse3-dev \ + g++ \ + gcc \ + git \ + glib-dev \ + gnutls-dev \ + gnutls-utils \ + go \ + hexdump \ + iproute2 \ + jq \ + libev-dev \ + libtool \ + libxml2-dev \ + make \ + nbd \ + nbd-client \ + ocaml \ + ocaml-findlib-dev \ + ocaml-ocamldoc \ + perl \ + pkgconf \ + py3-flake8 \ + python3-dev \ + qemu \ + qemu-img \ + sed \ + valgrind && \ + mkdir -p /usr/libexec/ccache-wrappers && \ + ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/c++ && \ + ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/cc && \ + ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/clang && \ + ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/g++ && \ + ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/gcc + +ENV LANG "en_US.UTF-8" +ENV MAKE "/usr/bin/make" +ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers" diff --git a/ci/containers/alpine-edge.Dockerfile b/ci/containers/alpine-edge.Dockerfile new file mode 100644 index 000000000000..4512e44252b5 --- /dev/null +++ b/ci/containers/alpine-edge.Dockerfile @@ -0,0 +1,57 @@ +# THIS FILE WAS AUTO-GENERATED +# +# $ lcitool dockerfile alpine-edge libnbd +# +# https://gitlab.com/libvirt/libvirt-ci/-/commit/1b32d74a089da43a0f79eba012ad04c30b57ecc6 + +FROM docker.io/library/alpine:edge + +RUN apk update && \ + apk upgrade && \ + apk add \ + autoconf \ + automake \ + bash-completion \ + ca-certificates \ + ccache \ + clang \ + diffutils \ + fuse3 \ + fuse3-dev \ + g++ \ + gcc \ + git \ + glib-dev \ + gnutls-dev \ + gnutls-utils \ + go \ + hexdump \ + iproute2 \ + jq \ + libev-dev \ + libtool \ + libxml2-dev \ + make \ + nbd \ + nbd-client \ + ocaml \ + ocaml-findlib-dev \ + ocaml-ocamldoc \ + perl \ + pkgconf \ + py3-flake8 \ + python3-dev \ + qemu \ + qemu-img \ + sed \ + valgrind && \ + mkdir -p /usr/libexec/ccache-wrappers && \ + ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/c++ && \ + ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/cc && \ + ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/clang && \ + ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/g++ && \ + ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/gcc + +ENV LANG "en_US.UTF-8" +ENV MAKE "/usr/bin/make" +ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers" -- 2.32.0
Martin Kletzander
2021-Jul-14 07:36 UTC
[Libguestfs] [libnbd PATCH 0/6] Paint the pipeline complete green, finally
On Tue, Jul 13, 2021 at 11:26:02PM +0200, Martin Kletzander wrote:>I hated the fact that it was not finished and it was (is) keeping me awake even >though I do not really have tome to do this, but it is finally finished. We can >even enable CI notifications to go public if that's something we'd like to do. > >Anyway, with this I hope I can finally get libnbd CI out of my mind and >hopefully move to CI for other projects ASAP. > >Night night ;) >You can see the pipeline passed for this series here: https://gitlab.com/nertpinx/libnbd/-/pipelines/336483317> >Martin Kletzander (6): > info: Require nbdkit >= 1.14 for info-can.sh > One more VSOCK include fix > macOS: Simple cloexec/nonblock fix > macOS: Do not use --version_script > Update CI files > CI: Add testing on Alpine > > configure.ac | 10 +++ > lib/internal.h | 3 + > generator/states-connect-socket-activation.c | 2 +- > generator/states-connect.c | 11 ++-- > lib/uri.c | 2 + > lib/utils.c | 68 ++++++++++++++++++++ > lib/Makefile.am | 2 +- > .gitlab-ci.yml | 23 +++++++ > ci/cirrus/freebsd-12.vars | 4 +- > ci/cirrus/freebsd-13.vars | 4 +- > ci/cirrus/freebsd-current.vars | 4 +- > ci/cirrus/macos-11.vars | 4 +- > ci/containers/alpine-314.Dockerfile | 57 ++++++++++++++++ > ci/containers/alpine-edge.Dockerfile | 57 ++++++++++++++++ > ci/containers/centos-8.Dockerfile | 2 +- > ci/containers/centos-stream-8.Dockerfile | 2 +- > ci/containers/debian-10.Dockerfile | 2 +- > ci/containers/debian-sid.Dockerfile | 2 +- > ci/containers/fedora-33.Dockerfile | 2 +- > ci/containers/fedora-34.Dockerfile | 2 +- > ci/containers/fedora-rawhide.Dockerfile | 2 +- > ci/containers/opensuse-leap-152.Dockerfile | 2 +- > ci/containers/opensuse-tumbleweed.Dockerfile | 2 +- > ci/containers/ubuntu-1804.Dockerfile | 2 +- > ci/containers/ubuntu-2004.Dockerfile | 2 +- > fuzzing/libnbd-fuzz-wrapper.c | 30 ++++++++- > fuzzing/libnbd-libfuzzer-test.c | 30 ++++++++- > info/info-can.sh | 4 ++ > 28 files changed, 309 insertions(+), 28 deletions(-) > create mode 100644 ci/containers/alpine-314.Dockerfile > create mode 100644 ci/containers/alpine-edge.Dockerfile > >-- >2.32.0 >-------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: not available URL: <http://listman.redhat.com/archives/libguestfs/attachments/20210714/0edb75db/attachment.sig>