]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
meson: Stop rebuilding modules over and over
authorLucas De Marchi <lucas.de.marchi@gmail.com>
Mon, 9 Sep 2024 13:33:35 +0000 (08:33 -0500)
committerLucas De Marchi <lucas.de.marchi@gmail.com>
Mon, 9 Sep 2024 16:05:54 +0000 (11:05 -0500)
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 <lucas.de.marchi@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/121
.github/actions/setup-alpine/action.yml
.github/actions/setup-archlinux/action.yml
.github/actions/setup-debian/action.yml
.github/actions/setup-fedora/action.yml
.github/actions/setup-ubuntu/action.yml
README.md
scripts/setup-modules.sh

index b7bf35a3cb16ffcc0713b27da14873007aedb8fc..340528871549591096df39c1db84ddb64cb717e3 100644 (file)
@@ -18,6 +18,7 @@ runs:
           linux-edge-dev \
           meson \
           openssl-dev \
+          rsync \
           scdoc \
           tar \
           xz-dev \
index 27f14f83af9ddb3b092a896cf5ba5a53e9ea6aad..38883bbf4a73f01b3e86769dc714c8f8c09afa48 100644 (file)
@@ -20,6 +20,7 @@ runs:
           multilib-devel \
           linux-headers \
           meson \
+          rsync \
           scdoc \
           git \
           gtk-doc
index b2b4d8147d8d82bba9548c12d6e87310815916af..32c8cd580f4ccd067a909b7bee1482beb45e07d7 100644 (file)
@@ -20,6 +20,7 @@ runs:
           libzstd-dev \
           linux-headers-generic \
           meson \
+          rsync \
           scdoc \
           zlib1g-dev \
           zstd
index e7c584626f99ea99e16ecf10fd7089c09820a432..a667e43f9ae024d1fe721450a49bd13dc4e4bb67 100644 (file)
@@ -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
index 8bb2eb76a682a285a7caa8f9598f8323f8cfed31..ab6087ad35e6abd0daf4418319fe31481119a14d 100644 (file)
@@ -20,6 +20,7 @@ runs:
           libzstd-dev \
           linux-headers-generic \
           meson \
+          rsync \
           scdoc \
           zlib1g-dev \
           zstd
index bb8018709f02c1b3611d155e6ba2006897f9aa24..e98aa5dfa1bdaf071d112eb1be18dd7e34914d7a 100644 (file)
--- 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
index 4996b649ac06dea258bbec9cfa4d970e4d2edc81..f3c8a7c3f5216dd3b72e1e691526d41f1a4e6c24 100755 (executable)
@@ -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)"}