From unknown Sat Aug 16 10:47:17 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#54915 <54915@debbugs.gnu.org> To: bug#54915 <54915@debbugs.gnu.org> Subject: Status: [PATCH] Guile rejects empty vendor in GNU triplets, as used by NetBSD Reply-To: bug#54915 <54915@debbugs.gnu.org> Date: Sat, 16 Aug 2025 17:47:17 +0000 retitle 54915 [PATCH] Guile rejects empty vendor in GNU triplets, as used b= y NetBSD reassign 54915 guile submitter 54915 Taylor R Campbell severity 54915 normal tag 54915 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Apr 13 11:30:57 2022 Received: (at submit) by debbugs.gnu.org; 13 Apr 2022 15:30:57 +0000 Received: from localhost ([127.0.0.1]:53663 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1neexM-0006UI-Ne for submit@debbugs.gnu.org; Wed, 13 Apr 2022 11:30:57 -0400 Received: from lists.gnu.org ([209.51.188.17]:45728) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nebAY-0000mD-A5 for submit@debbugs.gnu.org; Wed, 13 Apr 2022 07:28:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43988) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nebAY-0001su-42 for bug-guile@gnu.org; Wed, 13 Apr 2022 07:28:18 -0400 Received: from jupiter.mumble.net ([74.50.56.165]:46644) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nebAV-0001an-2F for bug-guile@gnu.org; Wed, 13 Apr 2022 07:28:17 -0400 Received: by jupiter.mumble.net (Postfix, from userid 1014) id 6016B60859; Wed, 13 Apr 2022 11:26:44 +0000 (UTC) From: Taylor R Campbell To: bug-guile@gnu.org Subject: [PATCH] Guile rejects empty vendor in GNU triplets, as used by NetBSD Date: Wed, 13 Apr 2022 11:26:44 +0000 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=_Jk88w0qeZbZBxabcXkD5GbHSqAbVNpLw" Content-Transfer-Encoding: 7bit Message-Id: <20220413112644.6016B60859@jupiter.mumble.net> Received-SPF: pass client-ip=74.50.56.165; envelope-from=campbell@mumble.net; helo=jupiter.mumble.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, T_TVD_MIME_NO_HEADERS=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.6 (-) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Wed, 13 Apr 2022 11:30:54 -0400 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: -2.6 (--) This is a multi-part message in MIME format. --=_Jk88w0qeZbZBxabcXkD5GbHSqAbVNpLw NetBSD uses an empty vendor string in a GNU target triplet, like `x86_64--netbsd' or `armv7--netbsdelf-eabihf'; it's been like this since the mid-'90s. (Before that, NetBSD omitted the vendor altogether, so if x86_64 existed then it might have been `x86_64-netbsd'.) This runs afoul of a rule in guile's validate-target in module/system/base/target.scm that requires all components to be nonempty, so pkgsrc's guile build has been carrying around a workaround -- just for guile, not for any other packages I know of -- for ages. Without the workaround in pkgsrc: > BOOTSTRAP(stage0) GUILEC ice-9/eval.go > Backtrace: > 7 (apply-smob/1 # # ?) > 6 (apply-smob/1 #) > 5 (apply-smob/0 #) > 4 (primitive-eval ((@ (ice-9 control) %) (begin (# #) ?))) > 3 (apply-smob/1 #) > 2 (apply-smob/1 #) > 1 (scm-error misc-error #f "~A ~S" ("invalid target" "?") #) > 0 (apply-smob/1 # # #f ?) > > ERROR: In procedure apply-smob/1: > invalid target "x86_64--netbsd" The attached patch relaxes validate-target so it accepts an empty vendor string (but still requires all other components to be nonempty as before). With the patch and without the workaround in pkgsrc, guile builds happily. --=_Jk88w0qeZbZBxabcXkD5GbHSqAbVNpLw Content-Type: text/plain; charset="ISO-8859-1"; name="emptyvendor" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="emptyvendor.patch" >From 12440a85559c3de5e6bced9c9377f3d5d7f5948e Mon Sep 17 00:00:00 2001 From: Taylor R Campbell Date: Wed, 13 Apr 2022 09:51:08 +0000 Subject: [PATCH] Allow empty vendor string in GNU target triplets. NetBSD and pkgsrc have been using an empty vendor string since the mid-'90s, such as x86_64--netbsd. pkgsrc has been carrying around a workaround just the guile build for a long time. (Before that, NetBSD omitted the vendor altogether, so if x86_64 existed then it might have been `x86_64-netbsd', but that caused more problems.) This change makes Guile accept an empty vendor string so workarounds are no longer necessary. * module/system/base/target.scm (validate-target): Allow empty vendor string in GNU target triplets. --- module/system/base/target.scm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/module/system/base/target.scm b/module/system/base/target.scm index 74af64b9d..87ab5b0c4 100644 --- a/module/system/base/target.scm +++ b/module/system/base/target.scm @@ -53,7 +53,14 @@ (if (or (not (string? target)) (let ((parts (string-split target #\-))) (or (< (length parts) 3) - (or-map string-null? parts)))) + (let ((cpu (list-ref parts 0)) + (os (list-ref parts 2))) + (or (string-null? cpu) + ;; vendor (parts[1]) may be empty + (string-null? os) + ;; optional components (ABI) should be nonempty if + ;; specified + (or-map string-null? (list-tail parts 3))))))) (error "invalid target" target))) =20 (define (with-target target thunk) --=_Jk88w0qeZbZBxabcXkD5GbHSqAbVNpLw-- From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 16 03:43:22 2022 Received: (at 54915-done) by debbugs.gnu.org; 16 Jun 2022 07:43:22 +0000 Received: from localhost ([127.0.0.1]:40602 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o1k9y-0001cg-4h for submit@debbugs.gnu.org; Thu, 16 Jun 2022 03:43:22 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45516) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o1k9w-0001cT-Ui for 54915-done@debbugs.gnu.org; Thu, 16 Jun 2022 03:43:21 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:54806) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o1k9r-00083u-Ex; Thu, 16 Jun 2022 03:43:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=1khC+bj4+YQNFA1N4Ms+znz4YysuyfTthpXFHluzH34=; b=Rvk8uBsxdlfi+ZOCXcnZ lzDMSzWQYFUxzZn3+xlXWgQwBVYZAM1CFAeWorWS3PwRKC+L2ObtCvkeZ4jk2DddDbwZDrev4AuNL BQqtPCxnULkB1z56Uft6pFYSbOA3eYfhGFZZud3w2fJ3Vw9NzN0nIZZGRaLpazESRyYGaTjjBPe1Y bV2QEmroCyYpcpklzs9q8BQG9h7zBVqmw1XmYsf85P3v16opFyq5Wq8D/1ZrUv8IkLaQdXJmGW5jM GkANnDBKD2uiJz67NH1wxD3fOTqfOerVtsZy+T5RcQLFPNBpjgNeAwfHp1Jrv2kEU3LoRI1iC4iys M53UYfbV8TEXQQ==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=36020 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o1k9r-0005mB-2G; Thu, 16 Jun 2022 03:43:15 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Taylor R Campbell Subject: Re: bug#54915: [PATCH] Guile rejects empty vendor in GNU triplets, as used by NetBSD References: <20220413112644.6016B60859@jupiter.mumble.net> Date: Thu, 16 Jun 2022 09:43:12 +0200 In-Reply-To: <20220413112644.6016B60859@jupiter.mumble.net> (Taylor R. Campbell's message of "Wed, 13 Apr 2022 11:26:44 +0000") Message-ID: <878rpxoxyn.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 54915-done Cc: 54915-done@debbugs.gnu.org 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 (---) Hi, Taylor R Campbell skribis: >>>From 12440a85559c3de5e6bced9c9377f3d5d7f5948e Mon Sep 17 00:00:00 2001 > From: Taylor R Campbell > Date: Wed, 13 Apr 2022 09:51:08 +0000 > Subject: [PATCH] Allow empty vendor string in GNU target triplets. > > NetBSD and pkgsrc have been using an empty vendor string since the > mid-'90s, such as x86_64--netbsd. pkgsrc has been carrying around a > workaround just the guile build for a long time. (Before that, > NetBSD omitted the vendor altogether, so if x86_64 existed then it > might have been `x86_64-netbsd', but that caused more problems.) > This change makes Guile accept an empty vendor string so workarounds > are no longer necessary. > > * module/system/base/target.scm (validate-target): Allow empty vendor > string in GNU target triplets. I added tests in cross-compilation.test and committed. Thanks! Ludo=E2=80=99. From unknown Sat Aug 16 10:47:17 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 14 Jul 2022 11:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator