From: Lucas De Marchi Date: Mon, 9 Sep 2024 13:33:35 +0000 (-0500) Subject: meson: Stop rebuilding modules over and over X-Git-Tag: v34~380 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=5b082f6e0afca10481c7cce3585dfc39ef6beb17;p=thirdparty%2Fkmod.git meson: Stop rebuilding modules over and over Instead of removing the sources every time and rebuilding, just use rsync to preserve the timestamps and allow Make to do its job of rebuilding if it changed. There's a bug in meson that keeps building the testsuite even outside of `ninja test`, but if the build result is cached, we can greatly minimize the impact for developers. Closes: https://github.com/kmod-project/kmod/issues/119 Signed-off-by: Lucas De Marchi Reviewed-by: Emil Velikov Link: https://github.com/kmod-project/kmod/pull/121 --- diff --git a/.github/actions/setup-alpine/action.yml b/.github/actions/setup-alpine/action.yml index b7bf35a3..34052887 100644 --- a/.github/actions/setup-alpine/action.yml +++ b/.github/actions/setup-alpine/action.yml @@ -18,6 +18,7 @@ runs: linux-edge-dev \ meson \ openssl-dev \ + rsync \ scdoc \ tar \ xz-dev \ diff --git a/.github/actions/setup-archlinux/action.yml b/.github/actions/setup-archlinux/action.yml index 27f14f83..38883bbf 100644 --- a/.github/actions/setup-archlinux/action.yml +++ b/.github/actions/setup-archlinux/action.yml @@ -20,6 +20,7 @@ runs: multilib-devel \ linux-headers \ meson \ + rsync \ scdoc \ git \ gtk-doc diff --git a/.github/actions/setup-debian/action.yml b/.github/actions/setup-debian/action.yml index b2b4d814..32c8cd58 100644 --- a/.github/actions/setup-debian/action.yml +++ b/.github/actions/setup-debian/action.yml @@ -20,6 +20,7 @@ runs: libzstd-dev \ linux-headers-generic \ meson \ + rsync \ scdoc \ zlib1g-dev \ zstd diff --git a/.github/actions/setup-fedora/action.yml b/.github/actions/setup-fedora/action.yml index e7c58462..a667e43f 100644 --- a/.github/actions/setup-fedora/action.yml +++ b/.github/actions/setup-fedora/action.yml @@ -21,6 +21,7 @@ runs: git \ gtk-doc \ libtool \ + rsync \ scdoc # CI builds with KDIR pointing to /usr/lib/modules/*/build # so just a foo/build pointing to the right place, assuming diff --git a/.github/actions/setup-ubuntu/action.yml b/.github/actions/setup-ubuntu/action.yml index 8bb2eb76..ab6087ad 100644 --- a/.github/actions/setup-ubuntu/action.yml +++ b/.github/actions/setup-ubuntu/action.yml @@ -20,6 +20,7 @@ runs: libzstd-dev \ linux-headers-generic \ meson \ + rsync \ scdoc \ zlib1g-dev \ zstd diff --git a/README.md b/README.md index bb801870..e98aa5df 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,8 @@ Compilation and installation In order to compile the source code you need the following software packages: - GCC/CLANG compiler - GNU C library / musl / uClibc + - rsync + Optional dependencies: - ZLIB library diff --git a/scripts/setup-modules.sh b/scripts/setup-modules.sh index 4996b649..f3c8a7c3 100755 --- a/scripts/setup-modules.sh +++ b/scripts/setup-modules.sh @@ -10,9 +10,7 @@ export MODULE_DIRECTORY=$4 # TODO: meson allows only out of tree builds if test "$SRCDIR" != "$BUILDDIR"; then - rm -rf "$MODULE_PLAYGROUND" - mkdir -p "$(dirname "$MODULE_PLAYGROUND")" - cp -r "$SRCDIR/$MODULE_PLAYGROUND" "$MODULE_PLAYGROUND" + rsync --recursive --times "$SRCDIR/$MODULE_PLAYGROUND/" "$MODULE_PLAYGROUND/" fi export MAKEFLAGS=${MAKEFLAGS-"-j$(nproc)"}