Subject: Re: bug#66762: emacs-ess test fails

From: Simon Tournier <[email-masked]>
Date: Fri, 27 Oct 2023 11:22:53 +0200

Hi,

On Thu, 26 Oct 2023 at 15:17, Kyle Andrews <[email-masked]> wrote:
> The emacs-ess package no longer install as of guix revision
> 33f5b74. It's dependency emacs-julia-mode fails to build.
>
> $ guix shell --keep-failed --pure emacs emacs-julia-mode
>
> According to the build log, the test julia--test-end-of-defun-nested-2
> fails.

Reported upstream:
https://github.com/JuliaEditorSupport/julia-emacs/issues/199

It comes from a discrepancy introduced by Emacs 29; also reported:
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=66763

Well, I fixed the build of emacs-julia-mode.  See attached.

But emacs-ess is not passing.  I have updated ESS to the most recent
revision, added phases for skipping the tests requiring network but it
still fails:

--8<---------------cut here---------------start------------->8---
Ran 187 tests, 176 results as expected, 6 unexpected, 5 skipped
(2023-10-27 01:12:40+0000, 17.661319 sec) 2 expected failures

6 unexpected results:
   FAILED ess-eval-line-test FAILED ess-eval-region-test FAILED
   ess-mock-remote-process FAILED ess-r-load-ESSR-github-fetch-no FAILED
   ess-set-working-directory-test FAILED ess-test-r-startup-directory
--8<---------------cut here---------------end--------------->8---

To be continued…

Cheers, simon

>From 5bd2f8c9b6a8065890b4ae38ec78657bcb7ef9a7 Mon Sep 17 00:00:00 2001
Message-ID: <5bd2f8[email-masked]>
From: Simon Tournier <[email-masked]>
Date: Fri, 27 Oct 2023 01:41:26 +0200
Subject: [PATCH 1/2] gnu: emacs-julia-mode: Exclude failing test introduced by
 Emacs 29.

* gnu/packages/emacs-xyz.scm (emacs-julia-mode)[arguments]: Add phases before
check that marks the test as expected failed.

Change-Id: I1da1077a7e7e077392458243b2d3cd44592ebd45
---
 gnu/packages/emacs-xyz.scm | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index 0bf3096216..7511a2de21 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -95,7 +95,7 @@
 ;;; Copyright © 2021 Alexey Abramov <[email-masked]>
 ;;; Copyright © 2021 Xinglu Chen <[email-masked]>
 ;;; Copyright © 2021, 2022 Stefan Reichör <[email-masked]>
-;;; Copyright © 2021, 2022 Simon Tournier <[email-masked]>
+;;; Copyright © 2021, 2022, 2023 Simon Tournier <[email-masked]>
 ;;; Copyright © 2021 Eugene Klimov <[email-masked]>
 ;;; Copyright © 2021 Zheng Junjie <[email-masked]>
 ;;; Copyright © 2021 David Dashyan <[email-masked]>
@@ -13550,7 +13550,17 @@ (define-public emacs-julia-mode
        `(#:tests? #t
          #:test-command '("emacs" "--batch"
                           "-l" "julia-mode-tests.el"
-                          "-f" "ert-run-tests-batch-and-exit")))
+                          "-f" "ert-run-tests-batch-and-exit")
+         #:phases
+         (modify-phases %standard-phases
+           (add-before 'check 'fix-test
+             (lambda _
+               (substitute* "julia-mode-tests.el"
+                 ;; The test started failing with Emacs 29; see
+                 ;; <https://github.com/JuliaEditorSupport/julia-emacs/issues/199>
+                 ;; and discrepancy reported <https://issues.guix.gnu.org/66763>.
+                 (("julia--test-end-of-defun-nested-2.*" all)
+                  (string-append all "  :expected-result :failed\n"))))))))
       (home-page "https://github.com/JuliaEditorSupport/julia-emacs")
       (synopsis "Major mode for Julia")
       (description "This Emacs package provides a mode for the Julia

base-commit: 6d7e181ba18d11c92409a93936025fb46b9c8171
prerequisite-patch-id: b9d5f8d81be6974fb52062c781924fb5387d4602
prerequisite-patch-id: bee3c38a1dbcf56e8c3d58891dc317d8a5901be8
prerequisite-patch-id: 08e88430d6fdc51aa4afa2891fddae9865a64a7c
prerequisite-patch-id: f276d7bebe3fdcda36e27fd027fd75d1c2e6369c
prerequisite-patch-id: ef6db31909314fd83b53b6e610547064a14d9551
prerequisite-patch-id: 4311408226f9b085a893bc9c32cce00611ba8401
-- 
2.41.0

>From 9b8715d29fc1543b9d624f26e8946c5a919b4946 Mon Sep 17 00:00:00 2001
Message-ID: <9b8715[email-masked]>
In-Reply-To: <5bd2f8[email-masked]>
References: <5bd2f8[email-masked]>
From: Simon Tournier <[email-masked]>
Date: Fri, 27 Oct 2023 01:51:18 +0200
Subject: [PATCH 2/2] gnu: emacs-julia-mode: Update to 0.4-0.7a8c868.

* gnu/packages/emacs-xyz.scm (emacs-julia-mode): Update to 0.4-0.7a8c868.
[arguments]: Use G-exp.

Change-Id: I3d06dbe824ce989400d801118e8bca496ae4b3e2
---
 gnu/packages/emacs-xyz.scm | 40 +++++++++++++++++++++-----------------
 1 file changed, 22 insertions(+), 18 deletions(-)

diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index 7511a2de21..471d938910 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -13532,40 +13532,44 @@ (define-public emacs-eprime
       (license license:gpl3+))))
 
 (define-public emacs-julia-mode
+  ;; Last release was in March 2020.
+  (let ((commit "7a8c868e0d3e51ba4a2c621ee22ca9599e0e4bbb")
+        (revision "0"))
     (package
       (name "emacs-julia-mode")
-      (version "0.4")
+      (version (git-version "0.4" revision commit))
       (source
        (origin
          (method git-fetch)
          (uri (git-reference
                (url "https://github.com/JuliaEditorSupport/julia-emacs")
-               (commit version)))
+               (commit commit)))
          (file-name (git-file-name name version))
          (sha256
           (base32
-           "1w131jb9mhvyjxa0p93iwfhzidgbcs6b8i6jg79yisqb9wchik99"))))
+           "0xwd4kq69ray6bk8hwjxnqf7myc3mn36chc2l9jn7a0x1f8x6k10"))))
       (build-system emacs-build-system)
       (arguments
-       `(#:tests? #t
-         #:test-command '("emacs" "--batch"
-                          "-l" "julia-mode-tests.el"
-                          "-f" "ert-run-tests-batch-and-exit")
-         #:phases
-         (modify-phases %standard-phases
-           (add-before 'check 'fix-test
-             (lambda _
-               (substitute* "julia-mode-tests.el"
-                 ;; The test started failing with Emacs 29; see
-                 ;; <https://github.com/JuliaEditorSupport/julia-emacs/issues/199>
-                 ;; and discrepancy reported <https://issues.guix.gnu.org/66763>.
-                 (("julia--test-end-of-defun-nested-2.*" all)
-                  (string-append all "  :expected-result :failed\n"))))))))
+       (list
+        #:tests? #t
+        #:test-command #~(list "emacs" "--batch"
+                               "-l" "julia-mode-tests.el"
+                               "-f" "ert-run-tests-batch-and-exit")
+        #:phases
+        #~(modify-phases %standard-phases
+            (add-before 'check 'fix-test
+              (lambda _
+                (substitute* "julia-mode-tests.el"
+                  ;; The test started failing with Emacs 29; see
+                  ;; <https://github.com/JuliaEditorSupport/julia-emacs/issues/199>
+                  ;; and discrepancy reported <https://issues.guix.gnu.org/66763>.
+                  (("julia--test-end-of-defun-nested-2.*" all)
+                   (string-append all "  :expected-result :failed\n"))))))))
       (home-page "https://github.com/JuliaEditorSupport/julia-emacs")
       (synopsis "Major mode for Julia")
       (description "This Emacs package provides a mode for the Julia
 programming language.")
-      (license license:expat)))
+      (license license:expat))))
 
 (define-public emacs-julia-repl
   (package
-- 
2.41.0