]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
test_common: fix xap_helper build reuse
authorEric Wong <e@80x24.org>
Fri, 6 Jun 2025 10:24:27 +0000 (10:24 +0000)
committerEric Wong <e@80x24.org>
Sat, 7 Jun 2025 19:21:19 +0000 (19:21 +0000)
The change in commit c45a5498 to avoid copying introduced a
major test performance regression since the extra XFLAGS and
xap_modversion files (required to detect changes for rebuilding)
weren't copied.  Instead, just symlink the entire
architecture-specific directory instead of individual files.

I didn't notice the slowdown earlier since I only tested on a
busy system where my worktree is on an overloaded HDD.

Fixes: c45a5498 (test_common: symlink xap_helper instead of excessive copying, 2025-06-01)
lib/PublicInbox/TestCommon.pm

index fe81b30599f419d179e87ee0b13f1cfb6ca7002f..ab988de407a34a4392476b27c71124a43f8e63e1 100644 (file)
@@ -783,9 +783,9 @@ SKIP: {
                my $home = "$tmpdir/lei-daemon";
                mkdir($home, 0700);
                local $ENV{HOME} = $home;
-               if ($xh_cmd && $xh_cmd->[0] =~ m!\A.+/+([^/]+)\z!) {
-                       # avoid repeated rebuilds by symlinking
-                       my ($src, $bn) = ($xh_cmd->[0], $1);
+               if ($xh_cmd && $xh_cmd->[0] =~ m!\A(.+/+([^/]+))/+[^/]+\z!) {
+                       # avoid repeated rebuilds by symlinking entire dir
+                       my ($src, $bn) = ($1, $2);
                        my $dst = "$home/.cache/public-inbox/jaot";
                        File::Path::make_path($dst);
                        symlink $src, "$dst/$bn";