From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id uG5WIy0hRmaJCAEAe85BDQ:P1 (envelope-from ) for ; Thu, 16 May 2024 17:07:25 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id uG5WIy0hRmaJCAEAe85BDQ (envelope-from ) for ; Thu, 16 May 2024 17:07:25 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1715872045; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=25isR5uTEpYfEqSogFB/iGlCaU1H07oyIDtZVNg9Lac=; b=LbXKjNt7C5E5c7379PIojb8VeGJ+MRNfZKxMkyTp7n8ojE9ciO6hf5dCtmHINwZY3QYYIU eG4IrZED9P0iO1A7/i8PCsjg4ZYLdGpNt2YPFfxUf6fVMdxOb7sa9AF8t4xAQv79VyIXJt VYbS2UD6K79Rw8heqAiztEvCOa167pAZU2XbgKnb8kWTATx4go1ICxdUQTRUPxizMxWfk8 GPgf2aosm0AQRVc5GfSbdWPfU/wIrc3ZOqdIel2/MJVgqxKVATB/ekib0vPlusw9DNhXZ/ YRavgQ16Id7BPq/LUo8UZ9P7EtiEqgmYwb1eNIIsSRqLp13OKuC4dJsiS9LREw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1715872045; a=rsa-sha256; cv=none; b=PQ5eE/g8NMUgNWeBsqsU0RZ3wX9raoBXNtoiCB/9VxId1BqC0GTq9Ddj4KjUsBrwik302F KMko0CXGOrbKMubYRXz+OFSQy0KA7GY83BrP6qZMznylEu6l+MRce+/iVjhzF83y0hKa0n lnfc9Gg6gx/bXeP3tSSWe4s78ANBCBzX9HZjjhAhKYo6mIOCL1Sm/nqdoQMnBpRicivWUj SjdwRM4KAzV+OIEW2MvbIC634jPYKKFqD7ocBlQC/9nFAyAU0vh0WJAI/wsI93ZyNg79Gc 0AILTqcrp6QjDnV0DAgvkJJThqgTqjjsVHhe9e/6tvcuohvkTnvbVCbDAr9Aeg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 4C9506657A for ; Thu, 16 May 2024 17:07:25 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s7chK-0002Bu-7W; Thu, 16 May 2024 11:07:10 -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 1s7chE-0002Av-9e for guix-patches@gnu.org; Thu, 16 May 2024 11:07:04 -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 1s7chB-0000Dw-2I for guix-patches@gnu.org; Thu, 16 May 2024 11:07:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s7chD-0007mE-AP for guix-patches@gnu.org; Thu, 16 May 2024 11:07:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70985] [PATCH 2/4] gnu: tls: Raise conditions from target->openssl-target. Resent-From: Christopher Baines Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 16 May 2024 15:07:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70985 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 70985@debbugs.gnu.org Received: via spool by 70985-submit@debbugs.gnu.org id=B70985.171587200629846 (code B ref 70985); Thu, 16 May 2024 15:07:03 +0000 Received: (at 70985) by debbugs.gnu.org; 16 May 2024 15:06:46 +0000 Received: from localhost ([127.0.0.1]:49223 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s7cgw-0007lF-8A for submit@debbugs.gnu.org; Thu, 16 May 2024 11:06:46 -0400 Received: from mira.cbaines.net ([212.71.252.8]:43538) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s7cgt-0007kv-UM for 70985@debbugs.gnu.org; Thu, 16 May 2024 11:06:44 -0400 Received: from localhost (unknown [45.67.83.153]) by mira.cbaines.net (Postfix) with ESMTPSA id CE87A27BBE9 for <70985@debbugs.gnu.org>; Thu, 16 May 2024 16:06:10 +0100 (BST) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id 7177d07f for <70985@debbugs.gnu.org>; Thu, 16 May 2024 15:06:08 +0000 (UTC) From: Christopher Baines Date: Thu, 16 May 2024 16:06:04 +0100 Message-ID: <1f3d2facacce8938a74c241e051dc43550327cee.1715871966.git.mail@cbaines.net> X-Mailer: git-send-email 2.41.0 In-Reply-To: <3828bc238a8cc400f9686fe6856c665c31e927dd.1715871966.git.mail@cbaines.net> References: <3828bc238a8cc400f9686fe6856c665c31e927dd.1715871966.git.mail@cbaines.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -1.87 X-Spam-Score: -1.87 X-Migadu-Queue-Id: 4C9506657A X-Migadu-Scanner: mx11.migadu.com X-TUID: MKtmmolYvHSl Rather than rasising generic errors. * gnu/packages/tls.scm (target->openssl-target): Raise conditions rather than generic errors. (openssl-1.1): Call target->openssl-target with the package. Change-Id: I13c63328cdf6bc177b20879805246ad94ff2665b --- gnu/packages/tls.scm | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/gnu/packages/tls.scm b/gnu/packages/tls.scm index 719da8e113..f04e171a9b 100644 --- a/gnu/packages/tls.scm +++ b/gnu/packages/tls.scm @@ -84,7 +84,9 @@ (define-module (gnu packages tls) #:use-module (gnu packages time) #:use-module (gnu packages version-control) #:use-module (gnu packages base) - #:use-module (srfi srfi-1)) + #:use-module (srfi srfi-1) + #:use-module (srfi srfi-34) + #:use-module (srfi srfi-35)) (define-public libtasn1 (package @@ -390,7 +392,7 @@ (define-public guile2.2-gnutls (modify-inputs (package-inputs guile-gnutls) (replace "guile" guile-2.2))))) -(define (target->openssl-target target) +(define (target->openssl-target pkg target) "Return the value to set CONFIGURE_TARGET_ARCH to when cross-compiling OpenSSL for TARGET." ;; Keep this code outside the build code, @@ -411,7 +413,10 @@ (define (target->openssl-target target) ((target-linux? target) "linux") (else - (error "unsupported openssl target kernel")))) + (raise (condition + (&package-unsupported-target-error + (package pkg) + (target target))))))) (arch (cond ((target-x86-32? target) @@ -438,7 +443,10 @@ (define (target->openssl-target target) ((target-64bit? target) "generic64") (else - (error "unsupported openssl target architecture"))))) + (raise (condition + (&package-unsupported-target-error + (package pkg) + (target target)))))))) (string-append kernel "-" arch)))) (define-public openssl-1.1 @@ -488,6 +496,7 @@ (define-public openssl-1.1 (setenv "CROSS_COMPILE" (string-append target "-")) (setenv "CONFIGURE_TARGET_ARCH" #$(target->openssl-target + this-package (%current-target-system)))))) #~()) #$@(if (target-hurd?) -- 2.41.0