guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: lint: Adjust patch file length check.


From: guix-commits
Subject: branch master updated: lint: Adjust patch file length check.
Date: Sat, 18 Dec 2021 03:21:17 -0500

This is an automated email from the git hooks/post-receive script.

vagrantc pushed a commit to branch master
in repository guix.

The following commit(s) were added to refs/heads/master by this push:
     new 5f547a5  lint: Adjust patch file length check.
5f547a5 is described below

commit 5f547a5c425cc99553ea713703e09a8db9f3c38b
Author: Vagrant Cascadian <vagrant@debian.org>
AuthorDate: Fri Nov 26 12:13:45 2021 -0800

    lint: Adjust patch file length check.
    
    With the switch to "ustar" format in commit
    bdf5c16ac052af2ca9d5c3acc4acbc08fd9fdbea, the maximum file length has
    increased.
    
    * guix/lint.scm (check-patch-file-names): Adjust margin used to check for
      patch file lengths. Increase allowable patch file length appropriate to 
new
      tar format. Extend warning to explain that long files may break 'make 
dist'.
    * tests/lint.scm: Update tests accordingly.
---
 guix/lint.scm  | 10 +++++++---
 tests/lint.scm |  8 ++++----
 2 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/guix/lint.scm b/guix/lint.scm
index 403f343..379bd0e 100644
--- a/guix/lint.scm
+++ b/guix/lint.scm
@@ -990,8 +990,12 @@ patch could not be found."
 
      ;; Check whether we're reaching tar's maximum file name length.
      (let ((prefix (string-length (%distro-directory)))
-           (margin (string-length "guix-2.0.0rc3-10000-1234567890/"))
-           (max    99))
+           ;; Margin approximating the largest path that "make dist" might
+           ;; create, with a release candidate version, 123456 commits, and
+           ;; git commit hash abcde0.
+           (margin (string-length "guix-92.0.0rc3-123456-abcde0/"))
+           ;; Tested maximum patch file length for ustar format.
+           (max    151))
        (filter-map (match-lambda
                      ((? string? patch)
                       (if (> (+ margin (if (string-prefix? (%distro-directory)
@@ -1001,7 +1005,7 @@ patch could not be found."
                              max)
                           (make-warning
                            package
-                           (G_ "~a: file name is too long")
+                           (G_ "~a: file name is too long, which may break 
'make dist'")
                            (list (basename patch))
                            #:field 'patch-file-names)
                           #f))
diff --git a/tests/lint.scm b/tests/lint.scm
index e9663e6..76c2a70 100644
--- a/tests/lint.scm
+++ b/tests/lint.scm
@@ -520,17 +520,17 @@
                                  (file-name "x.patch")))))))))
     (check-patch-file-names pkg)))
 
-(test-equal "patches: file name too long"
+(test-equal "patches: file name too long, which may break 'make dist'"
   (string-append "x-"
-                 (make-string 100 #\a)
-                 ".patch: file name is too long")
+                 (make-string 152 #\a)
+                 ".patch: file name is too long, which may break 'make dist'")
   (single-lint-warning-message
    (let ((pkg (dummy-package
                "x"
                (source
                 (dummy-origin
                  (patches (list (string-append "x-"
-                                               (make-string 100 #\a)
+                                               (make-string 152 #\a)
                                                ".patch"))))))))
      (check-patch-file-names pkg))))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]