unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#68709] [PATCH] gnu: emacs-citar: Fix autoloads and restore tests
@ 2024-01-24 22:34 Edward Wilson
  2024-01-26 16:49 ` bug#68709: " Andrew Tropin via Guix-patches via
  0 siblings, 1 reply; 3+ messages in thread
From: Edward Wilson @ 2024-01-24 22:34 UTC (permalink / raw)
  To: 68709
  Cc: Edward Wilson, Andrew Tropin, Katherine Cox-Buday,
	Liliana Marie Prikler

The default build-system emacs doesn't properly expand cl-lib macros when
compiling autoloads. This patch changes the `#:emacs` build argument, fixing a
present bug (reproducible by requiring citar-autoloads in a minimal
environment). This change also allows the validation of compiled autoloads to
succeed, hence the test phase is restored.

* gnu/packages/emacs-xyz.scm (emacs-citar): Change build-system emacs and
restore tests

Change-Id: Id56de922e5220383f8c5015a01e39b4aa2ea8cfb
---
 gnu/packages/emacs-xyz.scm | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index ad8c72e97d..b8c97d1767 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -23633,6 +23633,7 @@ (define-public emacs-citar
     (build-system emacs-build-system)
     (arguments
      (list
+      #:emacs emacs-no-x
       #:tests? #true
       #:test-command #~(list "emacs" "--batch" "-L" "."
                              "-l" "test/citar-test.el"
@@ -23642,10 +23643,7 @@ (define-public emacs-citar
       #:phases #~(modify-phases %standard-phases
                    (add-before 'build 'set-home
                      (lambda _
-                       (setenv "HOME" "/tmp")))
-                   ;; XXX: The following phase reports bogus errors. Suppress
-                   ;; it for now.
-                   (delete 'validate-compiled-autoloads))))
+                       (setenv "HOME" "/tmp"))))))
     (propagated-inputs (list emacs-auctex
                              emacs-citeproc-el
                              emacs-embark

base-commit: ffc5fefce370f5fc01091869e13fdf525be1e0c0
-- 
2.41.0





^ permalink raw reply related	[flat|nested] 3+ messages in thread

* bug#68709: [PATCH] gnu: emacs-citar: Fix autoloads and restore tests
  2024-01-24 22:34 [bug#68709] [PATCH] gnu: emacs-citar: Fix autoloads and restore tests Edward Wilson
@ 2024-01-26 16:49 ` Andrew Tropin via Guix-patches via
  2024-01-27 12:20   ` [bug#68709] " Nicolas Graves via Guix-patches via
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Tropin via Guix-patches via @ 2024-01-26 16:49 UTC (permalink / raw)
  To: Edward Wilson, 68709-done
  Cc: Katherine Cox-Buday, Edward Wilson, Liliana Marie Prikler

[-- Attachment #1: Type: text/plain, Size: 2044 bytes --]

On 2024-01-24 22:34, Edward Wilson wrote:

> The default build-system emacs doesn't properly expand cl-lib macros when
> compiling autoloads. This patch changes the `#:emacs` build argument, fixing a
> present bug (reproducible by requiring citar-autoloads in a minimal
> environment). This change also allows the validation of compiled autoloads to
> succeed, hence the test phase is restored.
>
> * gnu/packages/emacs-xyz.scm (emacs-citar): Change build-system emacs and
> restore tests
>
> Change-Id: Id56de922e5220383f8c5015a01e39b4aa2ea8cfb
> ---
>  gnu/packages/emacs-xyz.scm | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
> index ad8c72e97d..b8c97d1767 100644
> --- a/gnu/packages/emacs-xyz.scm
> +++ b/gnu/packages/emacs-xyz.scm
> @@ -23633,6 +23633,7 @@ (define-public emacs-citar
>      (build-system emacs-build-system)
>      (arguments
>       (list
> +      #:emacs emacs-no-x
>        #:tests? #true
>        #:test-command #~(list "emacs" "--batch" "-L" "."
>                               "-l" "test/citar-test.el"
> @@ -23642,10 +23643,7 @@ (define-public emacs-citar
>        #:phases #~(modify-phases %standard-phases
>                     (add-before 'build 'set-home
>                       (lambda _
> -                       (setenv "HOME" "/tmp")))
> -                   ;; XXX: The following phase reports bogus errors. Suppress
> -                   ;; it for now.
> -                   (delete 'validate-compiled-autoloads))))
> +                       (setenv "HOME" "/tmp"))))))
>      (propagated-inputs (list emacs-auctex
>                               emacs-citeproc-el
>                               emacs-embark
>
> base-commit: ffc5fefce370f5fc01091869e13fdf525be1e0c0

Hi Edward!

Thank you very much for the fix, added a trailing dot to commit message
and pushed as
https://git.savannah.gnu.org/cgit/guix.git/commit/?id=8ae8b9804f

-- 
Best regards,
Andrew Tropin

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [bug#68709] [PATCH] gnu: emacs-citar: Fix autoloads and restore tests
  2024-01-26 16:49 ` bug#68709: " Andrew Tropin via Guix-patches via
@ 2024-01-27 12:20   ` Nicolas Graves via Guix-patches via
  0 siblings, 0 replies; 3+ messages in thread
From: Nicolas Graves via Guix-patches via @ 2024-01-27 12:20 UTC (permalink / raw)
  To: Andrew Tropin, Edward Wilson, 68709-done
  Cc: Katherine Cox-Buday, Edward Wilson, Liliana Marie Prikler

[-- Attachment #1: Type: text/plain, Size: 183 bytes --]


Just to let you know, on my side I had written this patch to provide a
more general solution, I don't know if setting a particular emacs
package is a good solution in the long run.


[-- Attachment #2: 0001-emacs-build-system-cl-defstruct-autoloads.patch --]
[-- Type: text/x-patch, Size: 1755 bytes --]

From d8cbd304da0e4a9a073a213002c9876fe3011fe3 Mon Sep 17 00:00:00 2001
From: Nicolas Graves <ngraves@ngraves.fr>
Date: Wed, 15 Nov 2023 08:48:44 +0100
Subject: [PATCH] emacs-build-system: cl-defstruct autoloads.

Change-Id: If46b1d44fcc7f93da58de2573e1515a702c4dd52
---
 guix/build/emacs-utils.scm | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/guix/build/emacs-utils.scm b/guix/build/emacs-utils.scm
index 8e12b5b6d4..b7820d6390 100644
--- a/guix/build/emacs-utils.scm
+++ b/guix/build/emacs-utils.scm
@@ -4,6 +4,7 @@
 ;;; Copyright © 2018, 2020, 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;; Copyright © 2019 Liliana Marie Prikler <liliana.prikler@gmail.com>
 ;;; Copyright © 2022 Fredrik Salomonsson <plattfot@posteo.net>
+;;; Copyright © 2023 Nicolas Graves <ngraves@ngraves.fr>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -119,7 +120,14 @@ (define (emacs-generate-autoloads name directory)
                    ((fboundp 'make-directory-autoloads)
                     ;; Emacs 28
                     (make-directory-autoloads ,directory ,file))
-                   (t (update-directory-autoloads ,directory))))))
+                   (t (update-directory-autoloads ,directory)))
+                  (when (file-exists-p ,file)
+                    (with-temp-buffer
+                     (insert-file-contents ,file)
+                     (when (search-forward "(cl-defstruct" nil t)
+                       (beginning-of-line)
+                       (insert "(require 'cl-lib)\n")
+                       (write-region (point-min) (point-max) ,file)))))))
     (emacs-batch-eval expr #:dynamic? #t)))
 
 (define* (emacs-byte-compile-directory dir)
-- 
2.41.0


[-- Attachment #3: Type: text/plain, Size: 2195 bytes --]


I'm deleting it from my local guix, feel free to rework on it if useful.

Nicolas


On 2024-01-26 19:49, Andrew Tropin via Guix-patches via wrote:

> On 2024-01-24 22:34, Edward Wilson wrote:
>
>> The default build-system emacs doesn't properly expand cl-lib macros when
>> compiling autoloads. This patch changes the `#:emacs` build argument, fixing a
>> present bug (reproducible by requiring citar-autoloads in a minimal
>> environment). This change also allows the validation of compiled autoloads to
>> succeed, hence the test phase is restored.
>>
>> * gnu/packages/emacs-xyz.scm (emacs-citar): Change build-system emacs and
>> restore tests
>>
>> Change-Id: Id56de922e5220383f8c5015a01e39b4aa2ea8cfb
>> ---
>>  gnu/packages/emacs-xyz.scm | 6 ++----
>>  1 file changed, 2 insertions(+), 4 deletions(-)
>>
>> diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
>> index ad8c72e97d..b8c97d1767 100644
>> --- a/gnu/packages/emacs-xyz.scm
>> +++ b/gnu/packages/emacs-xyz.scm
>> @@ -23633,6 +23633,7 @@ (define-public emacs-citar
>>      (build-system emacs-build-system)
>>      (arguments
>>       (list
>> +      #:emacs emacs-no-x
>>        #:tests? #true
>>        #:test-command #~(list "emacs" "--batch" "-L" "."
>>                               "-l" "test/citar-test.el"
>> @@ -23642,10 +23643,7 @@ (define-public emacs-citar
>>        #:phases #~(modify-phases %standard-phases
>>                     (add-before 'build 'set-home
>>                       (lambda _
>> -                       (setenv "HOME" "/tmp")))
>> -                   ;; XXX: The following phase reports bogus errors. Suppress
>> -                   ;; it for now.
>> -                   (delete 'validate-compiled-autoloads))))
>> +                       (setenv "HOME" "/tmp"))))))
>>      (propagated-inputs (list emacs-auctex
>>                               emacs-citeproc-el
>>                               emacs-embark
>>
>> base-commit: ffc5fefce370f5fc01091869e13fdf525be1e0c0
>
> Hi Edward!
>
> Thank you very much for the fix, added a trailing dot to commit message
> and pushed as
> https://git.savannah.gnu.org/cgit/guix.git/commit/?id=8ae8b9804f

-- 
Best regards,
Nicolas Graves

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-01-27 12:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-24 22:34 [bug#68709] [PATCH] gnu: emacs-citar: Fix autoloads and restore tests Edward Wilson
2024-01-26 16:49 ` bug#68709: " Andrew Tropin via Guix-patches via
2024-01-27 12:20   ` [bug#68709] " Nicolas Graves via Guix-patches via

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).