summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2026-08-17 11:22:03 +0200
committerLudovic Courtès <ludo@gnu.org>2026-08-20 18:25:42 +0200
commit1cd4083d29612fa0b5b6e32b15bd96a5f710f90d (patch)
tree79bc8fab891e48bcb55136befcf5d05dd4f678c8
parentd3946f76e12c94a2c4a406b7cfdc2dc5b224723d (diff)
pack: With ‘-R’, do not wrap directories.
Fixes a bug whereby ‘build-wrapper’ would end up being called on directories (typically libexec/ sub-directories) simply because they match ‘executable-file?’. * guix/scripts/pack.scm (wrapped-package)[build](executable?): New procedure. Use it instead of ‘executable-file?’. Reported-by: Tomas Volf <~@wolfsden.cz> Fixes: https://issues.guix.gnu.org/81571 Signed-off-by: Ludovic Courtès <ludo@gnu.org> Merges: #10609
-rw-r--r--guix/scripts/pack.scm9
1 files changed, 8 insertions, 1 deletions
diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm
index 1536e913bf6..dbaff4a89c0 100644
--- a/guix/scripts/pack.scm
+++ b/guix/scripts/pack.scm
@@ -1348,6 +1348,13 @@ libfakechroot.so and related ld.so machinery as a fallback."
1348 (elf-loader-compile-flags program))) 1348 (elf-loader-compile-flags program)))
1349 (delete-file "run.c"))) 1349 (delete-file "run.c")))
1350 1350
1351 (define (executable? file)
1352 ;; Return #t if FILE is a regular file and is executable.
1353 (let ((s (stat file #f)))
1354 (and s
1355 (eq? 'regular (stat:type s))
1356 (not (zero? (logand (stat:mode s) #o100))))))
1357
1351 (setvbuf (current-output-port) 'line) 1358 (setvbuf (current-output-port) 'line)
1352 1359
1353 ;; Link the top-level files of PACKAGE so that search paths are 1360 ;; Link the top-level files of PACKAGE so that search paths are
@@ -1360,7 +1367,7 @@ libfakechroot.so and related ld.so machinery as a fallback."
1360 (scandir input)) 1367 (scandir input))
1361 1368
1362 (receive (executables others) 1369 (receive (executables others)
1363 (partition executable-file? 1370 (partition executable?
1364 ;; Note: Trailing slash in case these are symlinks. 1371 ;; Note: Trailing slash in case these are symlinks.
1365 (append (find-files (string-append input "/bin/")) 1372 (append (find-files (string-append input "/bin/"))
1366 (find-files (string-append input "/sbin/")) 1373 (find-files (string-append input "/sbin/"))