guix_mirror_bot pushed a commit to branch master
in repository guix.
commit 2ac2a4877d76e6ca4f4300e042050f7857fb2130
Author: Maxim Cournoyer <[email protected]>
AuthorDate: Tue Oct 21 19:55:54 2025 +0900
build/gnu: Do not attempt to strip Guile byte-compiled files.
This fails and produces noise and spurious debug files.
* guix/build/gnu-build-system.scm (strip) <guile-bytecode?>: New predicate.
Use it to filter out .go files from the files to be stripped.
Change-Id: I3063083a7d04d903d85d28d9526fdec079914fce
---
guix/build/gnu-build-system.scm | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/guix/build/gnu-build-system.scm b/guix/build/gnu-build-system.scm
index 63bbeae605..f7fd7c0818 100644
--- a/guix/build/gnu-build-system.scm
+++ b/guix/build/gnu-build-system.scm
@@ -518,6 +518,12 @@ makefiles."
(debug-file file))
file))
+ (define (guile-bytecode? file)
+ (and (string-suffix? ".go" file)
+ (elf-section-by-name
+ (parse-elf (call-with-input-file file get-bytevector-all))
+ ".guile.procprops")))
+
(define (strip-dir dir)
(format #t "stripping binaries in ~s with ~s and flags ~s~%"
dir strip-command strip-flags)
@@ -526,7 +532,11 @@ makefiles."
debug-output objcopy-command))
(for-each (lambda (file)
- (when (or (elf-file? file) (ar-file? file))
+ (when (and (or (elf-file? file) (ar-file? file))
+ ;; XXX: 'strip' (and 'objdump') choke on the Guile
+ ;; byte-compiled objects, with errors like "Unable
+ ;; to recognise the format of the input file".
+ (not (guile-bytecode? file)))
;; If an error occurs while processing a file, issue a
;; warning and continue to the next file.
(guard (c ((invoke-error? c)