unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: Lars-Dominik Braun <lars@6xq.net>
Cc: 50264@debbugs.gnu.org
Subject: bug#50264: ca-certificate-bundle fails to build
Date: Wed, 15 Sep 2021 18:30:04 +0200	[thread overview]
Message-ID: <874kal4x9v.fsf@gnu.org> (raw)
In-Reply-To: <87sfy63tlh.fsf@gnu.org> ("Ludovic Courtès"'s message of "Wed, 15 Sep 2021 14:34:50 +0200")

[-- Attachment #1: Type: text/plain, Size: 452 bytes --]

And for posterity, here’s the script I used to reproduce the problem:
it’d pick 10 packages at random and call ‘ca-certificate-bundle’ on them.

Since this bug depends on what’s in the store, I’d run it on 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 ‘pk’ calls plus a bit of chance, voilà!

Ludo’.


[-- Attachment #2: the reproducer --]
[-- Type: text/plain, Size: 2043 bytes --]

;; 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)))

  parent reply	other threads:[~2021-09-15 16:41 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-30  8:12 bug#50264: ca-certificate-bundle fails to build Lars-Dominik Braun
2021-09-04 16:27 ` Ludovic Courtès
2021-09-06 11:22   ` Lars-Dominik Braun
2021-09-10 16:04     ` Ludovic Courtès
2021-09-10 16:17       ` Jack Hill
2021-09-11  7:08       ` Lars-Dominik Braun
2021-09-14 13:08         ` Ludovic Courtès
2021-09-14 16:04           ` Leo Famulari
2021-09-15  6:40             ` Lars-Dominik Braun
2021-09-15 12:34               ` Ludovic Courtès
2021-09-15 16:25                 ` Ludovic Courtès
2021-09-15 16:30                 ` Ludovic Courtès [this message]
2021-09-15 16:30                 ` Ludovic Courtès
2021-09-06 23:18 ` Kyle Andrews
2021-09-06 23:29   ` bdju via Bug reports for GNU Guix
2021-09-10 11:24 ` Vladilen Kozin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874kal4x9v.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=50264@debbugs.gnu.org \
    --cc=lars@6xq.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).