From 1e1460af0d03a266d0d6cf2c1600d28630f5f0a9 Mon Sep 17 00:00:00 2001 From: CismonX Date: Thu, 27 Feb 2025 10:08:26 +0800 Subject: [PATCH] ci: add build.sr.ht configuration Automate the building and testing process of BookmarkFS using the builds.sr.ht service, to see whether it still works on: - Debian, Arch Linux * Typical GNU/Linux distros, either stable or cutting-edge. - Alpine Linux * Minimal non-GNU setup, notably BusyBox, TinyCC, musl and pdpmake. - FreeBSD * FreeBSD kernel and userland, including Clang and others. --- .builds/alpine.yml | 46 ++++++++++++++++++++++++++++++++++++++++++ .builds/archlinux.yml | 40 ++++++++++++++++++++++++++++++++++++ .builds/debian.yml | 43 +++++++++++++++++++++++++++++++++++++++ .builds/freebsd.yml | 47 +++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 176 insertions(+) create mode 100644 .builds/alpine.yml create mode 100644 .builds/archlinux.yml create mode 100644 .builds/debian.yml create mode 100644 .builds/freebsd.yml diff --git a/.builds/alpine.yml b/.builds/alpine.yml new file mode 100644 index 0000000..7a6cad8 --- /dev/null +++ b/.builds/alpine.yml @@ -0,0 +1,46 @@ +# +# Copyright (C) 2025 CismonX +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty, provided the copyright notice and +# this notice are preserved. This file is offered as-is, without any warranty. +# + +# Switch to alpine/latest once tcc leaves aports/testing +image: alpine/edge +packages: [ + # build + autoconf, automake, libtool, autoconf-archive, pkgconf, pdpmake, tcc, + texinfo, musl-dev, tcc-dev, tcc-libs-static, + # lib + fuse3-dev, libseccomp-dev, sqlite-dev, jansson-dev, nettle-dev, + readline-dev, tcl-dev, uriparser-dev, xxhash-dev, + # for fusermount3(1) + fuse3, +] +sources: + - https://git.sr.ht/~cismonx/bookmarkfs +environment: + BUILD_CFLAGS: -g -b -Wall -Wunsupported -Werror=unsupported + # While musl does support _GNU_SOURCE, + # here is a good place to see how well BookmarkFS works with a non-GNU libc. + BUILD_CPPFLAGS: -D_DEFAULT_SOURCE +tasks: + # Use srcdir as builddir, since pdpmake does not support VPATH. + - setup: | + cd bookmarkfs + autoreconf -i + ./configure \ + --enable-bookmarkfs-debug --enable-xxhash-inline \ + --enable-bookmarkfs-util --enable-bookmarkfs-mount \ + --enable-bookmarkfs-fsck --enable-bookmarkfs-mkfs \ + --enable-bookmarkctl --enable-fsck-handler-tcl \ + --enable-backend-firefox --enable-backend-chromium \ + CC=tcc CFLAGS="$BUILD_CFLAGS" CPPFLAGS="$BUILD_CPPFLAGS" + - build: | + cd bookmarkfs + pdpmake + pdpmake info + - test: | + cd bookmarkfs + pdpmake check diff --git a/.builds/archlinux.yml b/.builds/archlinux.yml new file mode 100644 index 0000000..b8bd48f --- /dev/null +++ b/.builds/archlinux.yml @@ -0,0 +1,40 @@ +# +# Copyright (C) 2025 CismonX +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty, provided the copyright notice and +# this notice are preserved. This file is offered as-is, without any warranty. +# + +image: archlinux +packages: [ + # build + autoconf, automake, libtool, autoconf-archive, pkgconf, make, gcc, texinfo, + # lib + fuse3, libseccomp, sqlite, jansson, nettle, readline, tcl, uriparser, xxhash, +] +sources: + - https://git.sr.ht/~cismonx/bookmarkfs +environment: + BUILD_CFLAGS: >- + -std=c99 -O0 -g -Wall -Wextra -Wpedantic -Wshadow + -fsanitize=address,undefined -fno-sanitize-recover + BUILD_CPPFLAGS: -D_GNU_SOURCE +tasks: + - setup: | + mkdir bookmarkfs/build && cd bookmarkfs/build + autoreconf -i .. + ../configure \ + --enable-bookmarkfs-debug --enable-xxhash-inline \ + --enable-bookmarkfs-util --enable-bookmarkfs-mount \ + --enable-bookmarkfs-fsck --enable-bookmarkfs-mkfs \ + --enable-bookmarkctl --enable-fsck-handler-tcl \ + --enable-backend-firefox --enable-backend-chromium \ + CFLAGS="$BUILD_CFLAGS" CPPFLAGS="$BUILD_CPPFLAGS" + - build: | + cd bookmarkfs/build + make + make info + - test: | + cd bookmarkfs/build + make check diff --git a/.builds/debian.yml b/.builds/debian.yml new file mode 100644 index 0000000..9416424 --- /dev/null +++ b/.builds/debian.yml @@ -0,0 +1,43 @@ +# +# Copyright (C) 2025 CismonX +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty, provided the copyright notice and +# this notice are preserved. This file is offered as-is, without any warranty. +# + +image: debian/stable +packages: [ + # build + autoconf, automake, libtool, autoconf-archive, pkgconf, make, gcc, texinfo, + # lib + libfuse3-dev, libseccomp-dev, libsqlite3-dev, libjansson-dev, nettle-dev, + libreadline-dev, tcl-dev, liburiparser-dev, libxxhash-dev, + # for fusermount3(1) + fuse3, +] +sources: + - https://git.sr.ht/~cismonx/bookmarkfs +environment: + BUILD_CFLAGS: >- + -std=c99 -O0 -g -Wall -Wextra -Wpedantic -Wshadow + -fsanitize=address,undefined -fno-sanitize-recover + BUILD_CPPFLAGS: -D_GNU_SOURCE +tasks: + - setup: | + mkdir bookmarkfs/build && cd bookmarkfs/build + autoreconf -i .. + ../configure \ + --enable-bookmarkfs-debug --enable-xxhash-inline \ + --enable-bookmarkfs-util --enable-bookmarkfs-mount \ + --enable-bookmarkfs-fsck --enable-bookmarkfs-mkfs \ + --enable-bookmarkctl --enable-fsck-handler-tcl \ + --enable-backend-firefox --enable-backend-chromium \ + CFLAGS="$BUILD_CFLAGS" CPPFLAGS="$BUILD_CPPFLAGS" + - build: | + cd bookmarkfs/build + make + make info + - test: | + cd bookmarkfs/build + make check diff --git a/.builds/freebsd.yml b/.builds/freebsd.yml new file mode 100644 index 0000000..9b0687c --- /dev/null +++ b/.builds/freebsd.yml @@ -0,0 +1,47 @@ +# +# Copyright (C) 2025 CismonX +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty, provided the copyright notice and +# this notice are preserved. This file is offered as-is, without any warranty. +# + +image: freebsd/latest +packages: [ + # build + autoconf, automake, libtool, autoconf-archive, pkgconf, texinfo, + # lib + fusefs-libs3, sqlite3, jansson, nettle, readline, tcl86, uriparser, xxhash, +] +sources: + - https://git.sr.ht/~cismonx/bookmarkfs +environment: + BUILD_CFLAGS: >- + -std=c99 -O0 -g -Wall -Wextra -Wpedantic -Wshadow + -fsanitize=address,undefined -fno-sanitize-recover + BUILD_CPPFLAGS: "" +tasks: + # Unlike Debian, FreeBSD Ports does not have a "dependency package" concept, + # and we have to manually create a symlink for Tcl's pkg-config file. + - init: | + cd /usr/local/libdata/pkgconfig + sudo ln -s tcl86.pc tcl.pc + - setup: | + mkdir bookmarkfs/build && cd bookmarkfs/build + autoreconf -i .. + ../configure \ + --enable-bookmarkfs-debug --enable-xxhash-inline \ + --enable-bookmarkfs-util --enable-bookmarkfs-mount \ + --enable-bookmarkfs-fsck --enable-bookmarkfs-mkfs \ + --enable-bookmarkctl --enable-fsck-handler-tcl \ + --enable-backend-firefox --enable-backend-chromium \ + CFLAGS="$BUILD_CFLAGS" CPPFLAGS="$BUILD_CPPFLAGS" + - build: | + cd bookmarkfs/build + make + make info + - test: | + sudo kldload fusefs + sudo sysctl vfs.usermount=1 + cd bookmarkfs/build + make check