From patchwork Sun Jun 12 00:45:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michal Atlas X-Patchwork-Id: 39887 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 A3F2E27BBEA; Sun, 12 Jun 2022 14:56:54 +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 5240627BBE9 for ; Sun, 12 Jun 2022 14:56:54 +0100 (BST) Received: from localhost ([::1]:51218 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o0O5F-0003sz-Fg for patchwork@mira.cbaines.net; Sun, 12 Jun 2022 09:56:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42094) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o0IR4-0000FN-8l for guix-patches@gnu.org; Sun, 12 Jun 2022 03:55:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:60714) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o0IR4-0005KU-0v for guix-patches@gnu.org; Sun, 12 Jun 2022 03:55:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o0IR4-0003W2-0k for guix-patches@gnu.org; Sun, 12 Jun 2022 03:55:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#55920] [PATCH] build-system: chicken: Added insert-missing-version phase Resent-From: Michal Atlas Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 12 Jun 2022 07:55:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 55920 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 55920@debbugs.gnu.org Cc: Michal Atlas X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.165502045113447 (code B ref -1); Sun, 12 Jun 2022 07:55:01 +0000 Received: (at submit) by debbugs.gnu.org; 12 Jun 2022 07:54:11 +0000 Received: from localhost ([127.0.0.1]:54611 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o0IQB-0003Ul-W7 for submit@debbugs.gnu.org; Sun, 12 Jun 2022 03:54:11 -0400 Received: from lists.gnu.org ([209.51.188.17]:40766) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o0BlA-0000d2-W9 for submit@debbugs.gnu.org; Sat, 11 Jun 2022 20:47:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60904) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o0BlA-00009K-Fz for guix-patches@gnu.org; Sat, 11 Jun 2022 20:47:20 -0400 Received: from mout01.posteo.de ([185.67.36.65]:54669) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o0Bl8-0007vR-DE for guix-patches@gnu.org; Sat, 11 Jun 2022 20:47:20 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 0022F240026 for ; Sun, 12 Jun 2022 02:47:14 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1654994835; bh=iZMZIe7mrPQNr9pljDgH4PoOr34UUO5J036wV0Z9cW8=; h=From:To:Cc:Subject:Date:From; b=j9sF/86Cz0ONfuCL7r8N16J0bd7bPny7kigR7TIJXuha/6P0PGjiZaA289COR9lbF FcVH105wO9ez2RLd3JbS6WGCRFTihujbik11p2If8NHhODs40veaNYT7HtTQRsVbCN c3dwRlRIGrKoLAlPiYIIrO1L3QNosEMw6qFhF12giDK9DH1WzDh+iGDPojK8oVt6hf OFr85nwrb/meju91y97JScQIj0JlVYmyFuPlIYk+yNT/P6UuH7A1pzfBFnxGrHot98 TTrGsjeQEiXTpPD/pWdHHSS7ACg9knkasrnYOb+yGBhZ3Y/dK5+z47YRfO/0Opj105 oQulyoBJj47BQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4LLGHk2klnz6tmT; Sun, 12 Jun 2022 02:47:14 +0200 (CEST) From: Michal Atlas Date: Sun, 12 Jun 2022 00:45:20 +0000 Message-Id: <20220612004520.6107-1-michal_atlas@posteo.net> MIME-Version: 1.0 Received-SPF: pass client-ip=185.67.36.65; envelope-from=michal_atlas@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sun, 12 Jun 2022 03:54:07 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Mailman-Approved-At: Sun, 12 Jun 2022 09:56:23 -0400 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" X-getmail-retrieved-from-mailbox: Patches Many .egg files don't contain version information, this causes `chicken-install` to label them {unknown}, which makes it fail compilations whenever a dependency is tagged with a minimum-version. I am unaware of a way to force this check to not-happen and the version information should be included anyway, so this patch should fix the problem. --- guix/build/chicken-build-system.scm | 12 ++++++++++++ 1 file changed, 12 insertions(+) base-commit: 1643402950b2d2384ec74fb69e059cc6a4c4ebed diff --git a/guix/build/chicken-build-system.scm b/guix/build/chicken-build-system.scm index 5db9906acf..341ab64a0f 100644 --- a/guix/build/chicken-build-system.scm +++ b/guix/build/chicken-build-system.scm @@ -112,6 +112,17 @@ (define* (check #:key egg-name tests? #:allow-other-keys) (when tests? (invoke "chicken-install" "-cached" "-test" "-no-install" egg-name))) +(define* (insert-missing-version #:key egg-name name #:allow-other-keys) + "Inserts version information into the .egg file if it isn't contained already" + (let* ([filename (string-append egg-name "/" egg-name ".egg")] + [egg-info (call-with-input-file filename read)] + [ver? (find (λ (i) (eqv? (car i) 'version)) egg-info)] + [ver (substring name (1+ (string-rindex name #\-)))]) + (when (not ver?) + (make-file-writable filename) + (call-with-output-file filename + (λ (f) (write (cons `(version ,ver) egg-info) f)))))) + ;; It doesn't look like Chicken generates any unnecessary references. ;; So we don't have to remove them either. Nice. @@ -122,6 +133,7 @@ (define %standard-phases (delete 'configure) (delete 'patch-generated-file-shebangs) (add-before 'unpack 'setup-chicken-environment setup-chicken-environment) + (add-before 'build 'insert-missing-version insert-missing-version) (replace 'build build) (delete 'check) (replace 'install install)