From patchwork Tue Apr 9 10:06:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Efraim Flashner X-Patchwork-Id: 62880 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 5544627BBE9; Tue, 9 Apr 2024 11:08:20 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 623E827BBE2 for ; Tue, 9 Apr 2024 11:08:19 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ru8OZ-0006AI-KG; Tue, 09 Apr 2024 06:08:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ru8OY-0006A6-1e for guix-patches@gnu.org; Tue, 09 Apr 2024 06:08:02 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ru8OX-0002uf-ET; Tue, 09 Apr 2024 06:08:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ru8Oc-0008LF-3k; Tue, 09 Apr 2024 06:08:06 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70303] [PATCH 2/2] graft: Perform grafts with guile-final. Resent-From: Efraim Flashner Original-Sender: "Debbugs-submit" Resent-CC: guix@cbaines.net, dev@jpoiret.xyz, ludo@gnu.org, othacehe@gnu.org, rekado@elephly.net, zimon.toutoune@gmail.com, me@tobias.gr, guix-patches@gnu.org Resent-Date: Tue, 09 Apr 2024 10:08:06 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70303 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 70303@debbugs.gnu.org Cc: Efraim Flashner , Christopher Baines , Josselin Poiret , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice X-Debbugs-Original-Xcc: Christopher Baines , Josselin Poiret , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice Received: via spool by 70303-submit@debbugs.gnu.org id=B70303.171265724931719 (code B ref 70303); Tue, 09 Apr 2024 10:08:06 +0000 Received: (at 70303) by debbugs.gnu.org; 9 Apr 2024 10:07:29 +0000 Received: from localhost ([127.0.0.1]:48334 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ru8O0-0008FX-GR for submit@debbugs.gnu.org; Tue, 09 Apr 2024 06:07:29 -0400 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]:61508) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ru8Nu-0008Dm-K5 for 70303@debbugs.gnu.org; Tue, 09 Apr 2024 06:07:23 -0400 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-343c2f5b50fso3591137f8f.2 for <70303@debbugs.gnu.org>; Tue, 09 Apr 2024 03:07:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712657229; x=1713262029; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=t+PeYFE4Q3SHAojuyM0mZQr+09nvn9cStfNPy0LcHZM=; b=YBCifrybZWxm9f7o8W7b2e4Cu6wgFn6b3YSSBXJu8VeiKRv8SZYHrMkvybFe0HiA7i oVhnBo3pw0RuFMDuRMq+KTTyVkuqD8cKA17sNIXomu0vPualVh6K0Pzb4eNquAmexpf7 Z6QrzczzTog8jlvVAlxU77NsaCxVPLUR6u0D0hf1o4ZjRVcBewUmQSYNXA/NOpMfvcCI vy1Qe6u1Zhi0rW67ps5vOa3PHwzXCrbR6065aE1QRP5CEcCZRpjMdD5lxE5sbV5sAnD3 ULpojOLMXe5Yu8su6Rqa8pqjG03mgKewdvxU2BVbrDkzLmYyv3fXIzYPB9mdKU0T64zj /3tQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712657229; x=1713262029; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=t+PeYFE4Q3SHAojuyM0mZQr+09nvn9cStfNPy0LcHZM=; b=Q5bvIDvWTU+bw46Fqqloe451CT+aZDLuPWPo74nXrLpc6JWObS3oS+S/TBBNT4prM8 hXbypqciEiMARH/tKNw4Bwr2+Rr9LS0lZm5RQnj8ZFSvvEoZjLss3qCOv3qG44qb/aia yNQJV8nu9SPQHI5Ay3zs9lg6fi9jWahWFrfqgOt+2kJkkjv1wJv01cuvBENDz9IzhXZi D6iZ4VC9y954Hg3EE7syW8Boe0xMPQ71DoG2BCwGetlERarGyxVv05ZugViHfvdJ2Fl7 PVWp6ahHqhB8+focuAyJN0ySJJwIRqpt3Xt36y+akAherZmEHchcmqPLHipOX8LNIdUy BF2g== X-Gm-Message-State: AOJu0YxX2ipVVZXS5wOTjSeFVsjfg4rBVAAFtPnBZobj6XBdX5/1PHqj 1IrbThVGmA4dUYWOE4VeRvoQ9LiwtPeOLnQmNMcAb2N1NXbbactnjl/+X/0QlHU= X-Google-Smtp-Source: AGHT+IEHtRSN0/sjZZf5zIfnMiKEzkkqYotAkj9+xuoS1qaNzf3uxAS/azgVJXodRaPQHJ4USERPRA== X-Received: by 2002:adf:e4c9:0:b0:341:9db8:6269 with SMTP id v9-20020adfe4c9000000b003419db86269mr8768871wrm.48.1712657228528; Tue, 09 Apr 2024 03:07:08 -0700 (PDT) Received: from localhost ([141.226.11.200]) by smtp.gmail.com with ESMTPSA id h2-20020adff182000000b00343e6bec771sm10715019wro.94.2024.04.09.03.07.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Apr 2024 03:07:08 -0700 (PDT) From: Efraim Flashner Date: Tue, 9 Apr 2024 13:06:56 +0300 Message-ID: X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * guix/build/graft.scm (rewrite-directory): Rewrite store directories in individual files sequentially. (exit-on-exception): Remove procedure. * guix/packages.scm (guile-for-grafts): Switch to guile-final. Change-Id: I50f7b23a3ceff8bb1495dc1f4bc772746147d924 --- guix/build/graft.scm | 24 ++++-------------------- guix/packages.scm | 6 ++---- 2 files changed, 6 insertions(+), 24 deletions(-) diff --git a/guix/build/graft.scm b/guix/build/graft.scm index c8c7e33ab2..7fc5ecba99 100644 --- a/guix/build/graft.scm +++ b/guix/build/graft.scm @@ -299,19 +299,6 @@ (define (rename-matching-files directory mapping) (string-append (dirname file) "/" target)))) matches))) -(define (exit-on-exception proc) - "Return a procedure that wraps PROC so that 'primitive-exit' is called when -an exception is caught." - (lambda (arg) - (catch #t - (lambda () - (proc arg)) - (lambda (key . args) - ;; Since ports are not thread-safe as of Guile 2.0, reopen stderr. - (let ((port (fdopen 2 "w0"))) - (print-exception port #f key args) - (primitive-exit 1)))))) - (define* (rewrite-directory directory output mapping #:optional (store (%store-directory))) "Copy DIRECTORY to OUTPUT, replacing strings according to MAPPING, a list of @@ -383,13 +370,10 @@ (define* (rewrite-directory directory output mapping (else (error "unsupported file type" stat))))) - ;; Use 'exit-on-exception' to force an exit upon I/O errors, given that - ;; 'n-par-for-each' silently swallows exceptions. - ;; See . - (n-par-for-each (parallel-job-count) - (exit-on-exception rewrite-leaf) - (find-files directory (const #t) - #:directories? #t)) + ;; n-par-for-each can lead to segfaults in the grafting code. + (for-each rewrite-leaf + (find-files directory (const #t) + #:directories? #t)) (rename-matching-files output mapping)) (define %graft-hooks diff --git a/guix/packages.scm b/guix/packages.scm index 930b1a3b0e..80642eb049 100644 --- a/guix/packages.scm +++ b/guix/packages.scm @@ -882,10 +882,8 @@ (define (default-guile) (define (guile-for-grafts) "Return the Guile package used to build grafting derivations." - ;; Guile 2.2 would not work due to when - ;; grafting packages. - (let ((distro (resolve-interface '(gnu packages guile)))) - (module-ref distro 'guile-2.0))) + (let ((distro (resolve-interface '(gnu packages commencement)))) + (module-ref distro 'guile-final))) (define* (default-guile-derivation #:optional (system (%current-system))) "Return the derivation for SYSTEM of the default Guile package used to run