From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 15 12:30:48 2021 Received: (at 50264) by debbugs.gnu.org; 15 Sep 2021 16:30:49 +0000 Received: from localhost ([127.0.0.1]:53084 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mQXo8-0003DD-J1 for submit@debbugs.gnu.org; Wed, 15 Sep 2021 12:30:48 -0400 Received: from eggs.gnu.org ([209.51.188.92]:42398) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mQXo6-0003Co-0b for 50264@debbugs.gnu.org; Wed, 15 Sep 2021 12:30:46 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:42498) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mQXo0-0004U4-9A; Wed, 15 Sep 2021 12:30:40 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=35674 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mQXny-0005Yv-VN; Wed, 15 Sep 2021 12:30:39 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Lars-Dominik Braun Subject: Re: bug#50264: ca-certificate-bundle fails to build In-Reply-To: <87sfy63tlh.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Wed, 15 Sep 2021 14:34:50 +0200") References: <87bl58z4pa.fsf@gnu.org> <871r5wct8c.fsf@gnu.org> <87a6kf5mpo.fsf@gnu.org> <87sfy63tlh.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) Date: Wed, 15 Sep 2021 18:30:37 +0200 Message-ID: <8735q54x8y.fsf@gnu.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 50264 Cc: 50264@debbugs.gnu.org, Leo Famulari X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable And for posterity, here=E2=80=99s the script I used to reproduce the proble= m: it=E2=80=99d pick 10 packages at random and call =E2=80=98ca-certificate-bu= ndle=E2=80=99 on them. Since this bug depends on what=E2=80=99s in the store, I=E2=80=99d run it o= n my laptop, which only contains a fraction of the 18K packages in Guix, so it would reproduce the bug after a couple of iterations. That, together with the inevitable =E2=80=98pk=E2=80=99 calls plus a bit of= chance, voil=C3=A0! Ludo=E2=80=99. --=-=-= Content-Type: text/plain Content-Disposition: inline; filename=ca-certificate-bundle.scm Content-Description: the reproducer ;; https://issues.guix.gnu.org/50264 (use-modules (gnu) (guix) (guix profiles) (guix monads) (ice-9 match) (srfi srfi-1)) (define (all-packages) "Return the list of all the packages, public or private, omitting only superseded packages." (fold-packages (lambda (package lst) (match (package-replacement package) (#f (cons package lst)) (replacement (append (list replacement package) lst)))) '() #:select? (negate package-superseded))) (define (random-seed) (logxor (getpid) (car (gettimeofday)))) (define shuffle ;from offload.scm (let ((state (seed->random-state (random-seed)))) (lambda (lst) "Return LST shuffled (using the Fisher-Yates algorithm.)" (define vec (list->vector lst)) (let loop ((result '()) (i (vector-length vec))) (if (zero? i) result (let* ((j (random i state)) (val (vector-ref vec j))) (vector-set! vec j (vector-ref vec (- i 1))) (loop (cons val result) (- i 1)))))))) (define (test packages) (pk 'testing-packages (map package-full-name packages)) (let ((manifest (packages->manifest packages))) (with-store store (let ((drv (run-with-store store (ca-certificate-bundle manifest)))) (pk 'drv drv) (unless (find (lambda (input) (let ((drv (derivation-input-derivation input))) (string-prefix? "glibc-utf8-locales" (derivation-name drv)))) (derivation-inputs drv)) (pk 'drv drv (derivation-inputs drv)) (display-backtrace (make-stack #t) (current-error-port)) (error "bah!" drv)) (newline) (newline))))) (let loop ((packages (shuffle (all-packages)))) (test (take packages 10)) (loop (drop packages 10))) --=-=-=--