]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
Swap rsync for cp --archive for module sources copying
authorEmil Velikov <emil.l.velikov@gmail.com>
Thu, 17 Oct 2024 20:30:08 +0000 (21:30 +0100)
committerLucas De Marchi <lucas.de.marchi@gmail.com>
Thu, 17 Oct 2024 21:57:43 +0000 (16:57 -0500)
As Tobias reported, rsync is a bit of heavyweight dependency. We
introduced it, as a replacement for the rm/cp -r previously used.

The rsync was inspired since, unlike make, meson will build all the test
binaries/artefacts even without calling "meson test".

We can go back to cp with --archive (--preserve=timestamps at least),
which will ensure we don't get stale files. To ensure the second run
doesn't copy the source folder as _subfolder_ of the dest we need to
wildcard the copy... Plus we need a proper destination folder in the
first place.

With this, we get a no-op second+ builds - be that with meson or make.
Since the explicit always-dirty state is by design, drop the meson TODO
and document the output variable.

Confirmed by comparing both the `make --debug` output and the execution
times.

Reported-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/192
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
.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
testsuite/meson.build

index 93934b1c3971bbfdb215b2546b9ab89c3e59e07e..33deff7a09f836b54a6035a314db55f7daceb886 100644 (file)
@@ -23,7 +23,6 @@ runs:
           linux-edge-dev \
           meson \
           openssl-dev \
-          rsync \
           scdoc \
           tar \
           xz-dev \
index 21c0e68b1cb200636d8426bb88e2fa4f0836f3fc..c2425d4be92794d0153356258a179ce1176fa24f 100644 (file)
@@ -24,5 +24,4 @@ runs:
           gtk-doc \
           linux-headers \
           meson \
-          rsync \
           scdoc
index d1b27674a8534c41fbecf89f31093dbbbe2203a9..f79ed109b14d056ed750ced54154dd09b1c16fea 100644 (file)
@@ -25,7 +25,6 @@ runs:
           libzstd-dev \
           linux-headers-generic \
           meson \
-          rsync \
           scdoc \
           zlib1g-dev \
           zstd
index 28a2a0d387f504f1d5f346179baba1a70b0f0c8e..586471876613bd55fc29c304536f4acda05944cc 100644 (file)
@@ -29,7 +29,6 @@ runs:
           make \
           meson \
           openssl-devel \
-          rsync \
           scdoc \
           xz-devel \
           zlib-devel
index 19366e091eb1152ea1e9beba02ebdd840b57ffac..b6514789ca3a4dd03e44d4da0760573e4ae39b53 100644 (file)
@@ -25,7 +25,6 @@ runs:
           libzstd-dev \
           linux-headers-generic \
           meson \
-          rsync \
           scdoc \
           zlib1g-dev \
           zstd
index e23cc0376ffbb115bd85a9291996ff3eb357468a..e42a5ed695d3bba1606fa98953a0a7c523c63b99 100644 (file)
--- a/README.md
+++ b/README.md
@@ -39,7 +39,6 @@ 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 89f34d9cbbabe6a4ad9ee16354cf7d909116e17a..62eee6f31f5b99bff7be78faca00d4a85b0e305c 100755 (executable)
@@ -8,7 +8,8 @@ MODULE_PLAYGROUND=$3
 
 # TODO: meson allows only out of tree builds
 if test "$SRCDIR" != "$BUILDDIR"; then
-    rsync --recursive --times "$SRCDIR/$MODULE_PLAYGROUND/" "$MODULE_PLAYGROUND/"
+    mkdir -p "$MODULE_PLAYGROUND"
+    cp --archive "$SRCDIR/$MODULE_PLAYGROUND/"* "$MODULE_PLAYGROUND/"
 fi
 
 export MAKEFLAGS=${MAKEFLAGS-"-j$(nproc)"}
index 394e4f36f77c37a019d6618e8e36e755d7d9d6af..c786196cf15fd3cf5c7d55aaecdb7115778a0e04 100644 (file)
@@ -10,9 +10,11 @@ build_module_playground = custom_target(
     meson.project_build_root(),
     'testsuite/module-playground', # do not prepend source/build root
   ],
+  # The command ensures we don't do extra work, so the missing output token file
+  # and the build_always_stale true are intentional.
   output : 'bb-rootfs',
   console : true,
-  build_always_stale : true, # TODO: only when the playground has changed
+  build_always_stale : true,
   build_by_default : false,
 )