From patchwork Sun Nov 10 18:23:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Buck X-Patchwork-Id: 70211 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 5CAC727BBEA; Mon, 11 Nov 2024 00:22:31 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham 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 1B7A727BBE2 for ; Mon, 11 Nov 2024 00:22:31 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tAIBz-0006Qu-Fp; Sun, 10 Nov 2024 19:22:07 -0500 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 1tAIBw-0006QN-M0 for guix-patches@gnu.org; Sun, 10 Nov 2024 19:22:04 -0500 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 1tAIBv-000301-VR; Sun, 10 Nov 2024 19:22:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=ZRkNCLClyWtVYK6HxjQoL9CpCL8SQgwD7BOBRUqZEIc=; b=vZhkqLzttO7vIX30JXlSF4J0C8P/S/RN4tUhnVie9yfZFzLEBIfM3BWFr7joPq8W8dptNgSqKot47Q74YGWqD3TurXR3d4rE63XPcyeHCE0uA8nG/V1F8XPpyIxjxBo6Tgj66n/gzuJlow+YQfY96gGToejaE4B9k2Uz2bKpfJc5vwqWn0dhDo2+cfgQcQGPegRpD1uVxeKj8eYT7Uijf7SmtzuBhcWEVrQQDMw6yGtMnJz8NAPm9uIdcmjNUSw3DA7xIb4od07gSwGL8GF7oJ2oWs3Va+c2OukbAcZTvmdcKlbQ8L/1j7ewm5dmW1e6/0yIkZ1usWILyVy5RJmOjg==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tAIBt-00062o-Op; Sun, 10 Nov 2024 19:22:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74296] [PATCH 1/1] guix: records: Fix abi check in cross compile context Resent-From: Christoph Buck Original-Sender: "Debbugs-submit" Resent-CC: guix@cbaines.net, dev@jpoiret.xyz, ludo@gnu.org, othacehe@gnu.org, zimon.toutoune@gmail.com, me@tobias.gr, guix-patches@gnu.org Resent-Date: Mon, 11 Nov 2024 00:22:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74296 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 74296@debbugs.gnu.org Cc: Christoph Buck , Christopher Baines , Josselin Poiret , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Simon Tournier , Tobias Geerinckx-Rice X-Debbugs-Original-Xcc: Christopher Baines , Josselin Poiret , Ludovic =?utf-8?q?Court=C3=A8s?= , Mathieu Othacehe , Simon Tournier , Tobias Geerinckx-Rice Received: via spool by 74296-submit@debbugs.gnu.org id=B74296.173128447823171 (code B ref 74296); Mon, 11 Nov 2024 00:22:01 +0000 Received: (at 74296) by debbugs.gnu.org; 11 Nov 2024 00:21:18 +0000 Received: from localhost ([127.0.0.1]:57105 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tAIBA-00061c-Ku for submit@debbugs.gnu.org; Sun, 10 Nov 2024 19:21:18 -0500 Received: from mail-108-mta139.mxroute.com ([136.175.108.139]:37047) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tACaf-0006j8-9f for 74296@debbugs.gnu.org; Sun, 10 Nov 2024 13:23:14 -0500 Received: from filter006.mxroute.com ([136.175.111.3] filter006.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta139.mxroute.com (ZoneMTA) with ESMTPSA id 1931750bde60003e01.001 for <74296@debbugs.gnu.org> (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384); Sun, 10 Nov 2024 18:23:07 +0000 X-Zone-Loop: 4d0e7d944e28d7e4aa8b3ddbe5d3fb7fa6dd67c971fc X-Originating-IP: [136.175.111.3] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=icepic.de; s=x; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=ZRkNCLClyWtVYK6HxjQoL9CpCL8SQgwD7BOBRUqZEIc=; b=Bn7QJHH9ibwijRkP9rC0/BQ9rV 1Wwc3oncyze2lrMeqQBHiSibAYGrAlwewaUO0rx3A+/DMpIQM8sZUO+CnGOf0m3yHIvJUrHWYhgkv qf2I2QXstUF+RFjark1wn4D+9/9E3XEYcEGn+1HEFVFBnURxYd39h+LO06V0namoB6CTEU3dcCJoN 2US0q5EvKqfVchLBBqx8RxzZbPTHOYTm1updTwhdq+rOmpEL7yysnnHCTCFLOU0OupXckALsVlwGd v9FUiy16A3Pmu3zHndrwo1F4MzVaisz7ayiQNb8pag5FoKCHoFtn3cArDIUSOAiL7HKkC+rl5+WXu v/PkJNcA==; From: Christoph Buck Date: Sun, 10 Nov 2024 19:23:01 +0100 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Authenticated-Id: dev@icepic.de X-Mailman-Approved-At: Sun, 10 Nov 2024 19:21:15 -0500 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/records.scm: Use 32bit hash value for abi check to prevent `record-abi-mismatch-error` in a cross-compile context Change-Id: I889747b1a2837bee8bf9b4de5729fdcf1b165380 --- guix/records.scm | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/guix/records.scm b/guix/records.scm index dca1e3c2e7..2084499e36 100644 --- a/guix/records.scm +++ b/guix/records.scm @@ -415,11 +415,13 @@ (define-syntax define-record-type* ;; list of symbols. (syntax-case field-specs () (((field get properties ...) ...) - (string-hash (object->string - (syntax->datum #'((field properties ...) ...))) - (cond-expand - (guile-3 (target-most-positive-fixnum)) - (else most-positive-fixnum)))))) + (let ((hash-value + (string-hash + (object->string (syntax->datum #'((field properties ...) ...)))))) + (cond + ((< most-positive-fixnum (ash 1 32)) hash-value) + ((< most-positive-fixnum (ash 1 64)) (ash hash-value -32)) + (else (error "unexpected!" most-positive-fixnum))))))) (syntax-case s () ((_ type syntactic-ctor ctor pred