GNU bug report logs - #55920
[PATCH] build-system: chicken: Added insert-missing-version phase

Previous Next

Package: guix-patches;

Reported by: Michal Atlas <michal_atlas <at> posteo.net>

Date: Sun, 12 Jun 2022 07:55:01 UTC

Severity: normal

Tags: moreinfo, patch

Done: Liliana Marie Prikler <liliana.prikler <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#55920: closed ([PATCH] build-system: chicken: Added
 insert-missing-version phase)
Date: Tue, 21 Jun 2022 19:45:03 +0000
[Message part 1 (text/plain, inline)]
Your message dated Tue, 21 Jun 2022 21:44:02 +0200
with message-id <580d9e32db0bc3036ad0d7e7a8be910281312693.camel <at> gmail.com>
and subject line Re: [PATCH] build-system: chicken: Added stamp-egg-version phase
has caused the debbugs.gnu.org bug report #55920,
regarding [PATCH] build-system: chicken: Added insert-missing-version phase
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
55920: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=55920
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Michal Atlas <michal_atlas <at> posteo.net>
To: guix-patches <at> gnu.org
Cc: Michal Atlas <michal_atlas <at> posteo.net>
Subject: [PATCH] build-system: chicken: Added insert-missing-version phase
Date: Sun, 12 Jun 2022 00:45:20 +0000
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(+)

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)

base-commit: 1643402950b2d2384ec74fb69e059cc6a4c4ebed
-- 
2.36.1



[Message part 3 (message/rfc822, inline)]
From: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
To: Michal Atlas <michal_atlas <at> posteo.net>, 55920-done <at> debbugs.gnu.org
Subject: Re: [PATCH] build-system: chicken: Added stamp-egg-version phase
Date: Tue, 21 Jun 2022 21:44:02 +0200
Am Sonntag, dem 19.06.2022 um 20:36 +0000 schrieb Michal Atlas:
> * guix/build/chicken-build-system.scm (stamp-egg-version): New phase
> Compiled eggs will now always contain some version,
> falling back to the guix package version if none is provided by the
> egg.
> (%standard-phases): Inserted the new phase
Pushed with some wording fixes.  Cheers


This bug report was last modified 2 years and 337 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.