guix-commits
[Top][All Lists]
Advanced

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

branch master updated: Filter out narinfos with excessive size


From: Christopher Baines
Subject: branch master updated: Filter out narinfos with excessive size
Date: Sun, 07 Feb 2021 04:05:08 -0500

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

cbaines pushed a commit to branch master
in repository data-service.

The following commit(s) were added to refs/heads/master by this push:
     new 15d7756  Filter out narinfos with excessive size
15d7756 is described below

commit 15d7756ef8990b8c49ce3b5298a444d4969b95a1
Author: Christopher Baines <mail@cbaines.net>
AuthorDate: Sun Feb 7 09:01:53 2021 +0000

    Filter out narinfos with excessive size
    
    This is currently an issue with ci.guix.gnu.org
    https://issues.guix.gnu.org/46212 for substitutes for outputs who's size
    exceed 32 bits of information.
---
 guix-data-service/substitutes.scm | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/guix-data-service/substitutes.scm 
b/guix-data-service/substitutes.scm
index b6c29f2..7cc3c1d 100644
--- a/guix-data-service/substitutes.scm
+++ b/guix-data-service/substitutes.scm
@@ -16,8 +16,10 @@
 ;;; <http://www.gnu.org/licenses/>.
 
 (define-module (guix-data-service substitutes)
+  #:use-module (srfi srfi-1)
   #:use-module (ice-9 match)
   #:use-module (guix scripts substitute)
+  #:use-module (guix narinfo)
   #:use-module (guix-data-service database)
   #:use-module (guix-data-service model build-server)
   #:use-module (guix-data-service model nar)
@@ -54,6 +56,11 @@
                      key args)))))))
          build-servers)))))
 
+(define %narinfo-max-size
+  (- (expt 2 (- (* 8 8) ;; 8 bytes
+                1))
+     1))
+
 (define* (fetch-narinfo-files conn build-server-id build-server-url
                               revision-commits
                               #:key specific-outputs)
@@ -80,4 +87,15 @@
          (record-narinfo-details-and-return-ids
           conn
           build-server-id
-          narinfos))))))
+          (filter-map
+           (lambda (narinfo)
+             (if (> (narinfo-size narinfo)
+                    %narinfo-max-size)
+                 (begin
+                   (simple-format (current-error-port)
+                                  "narinfo ~A has excessive size ~A\n"
+                                  (narinfo-path narinfo)
+                                  (narinfo-size narinfo))
+                   #f)
+                 narinfo))
+           narinfos)))))))



reply via email to

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