emacs-ess (native-compilation): tramp and local shell used by tests

  • Open
  • quality assurance status badge
Details
2 participants
  • Ricardo Wurmus
  • zimoun
Owner
unassigned
Submitted by
zimoun
Severity
normal
Z
Z
zimoun wrote on 21 Oct 2022 16:51
(address . bug-guix@gnu.org)
871qr1jkl8.fsf@gmail.com
Hi,

The package ESS is not often released and we rely on some pinned
commit. The current one is from August 2020 and it does not correctly
support native-compilation (see below). Upstream fixed some; for
instance let use f45542e723d7415f5e22bcf39f25e31d055d168c. But then the
test suite is failing with,

Toggle snippet (40 lines)
Test ess-mock-remote-process backtrace:
signal(file-error ("Couldn’t find local shell prompt for /bin/sh"))
tramp-error(nil file-error "Couldn’t find local shell prompt for /bin/sh")
tramp-signal-hook-function(file-error ("Couldn’t find local shell prompt for /bin/sh"))
signal(file-error ("Couldn’t find local shell prompt for /bin/sh"))
tramp-maybe-open-connection((tramp-file-name "mock" nil nil #("localhost" 0 9 (tramp-default t)) nil "/tmp/guix-build-emacs-ess-

[...]

Test ess-mock-remote-process condition:
(file-error "Couldn’t find local shell prompt for /bin/sh")
FAILED 48/157 ess-mock-remote-process (0.018617 sec)

[...]

Test ess-r-load-ESSR-github-fetch-no backtrace:
signal(file-error ("Couldn’t find local shell prompt for /bin/sh"))
tramp-error(nil file-error "Couldn’t find local shell prompt for /bin/sh")
tramp-signal-hook-function(file-error ("Couldn’t find local shell prompt for /bin/sh"))
signal(file-error ("Couldn’t find local shell prompt for /bin/sh"))
tramp-maybe-open-connection((tramp-file-name "mock" nil nil #("localhost" 0 9 (tramp-default t)) nil "/tmp/guix-build-emacs-ess-

[...]

Test ess-r-load-ESSR-github-fetch-no condition:
(file-error "Couldn’t find local shell prompt for /bin/sh")
FAILED 70/157 ess-r-load-ESSR-github-fetch-no (0.337567 sec)
Test ess-r-load-ESSR-github-fetch-yes backtrace:
signal(file-error ("Couldn’t find local shell prompt for /bin/sh"))
tramp-error(nil file-error "Couldn’t find local shell prompt for /bin/sh")
tramp-signal-hook-function(file-error ("Couldn’t find local shell prompt for /bin/sh"))
signal(file-error ("Couldn’t find local shell prompt for /bin/sh"))
tramp-maybe-open-connection((tramp-file-name "mock" nil nil #("localhost" 0 9 (tramp-default t)) nil "/tmp/guix-build-emacs-ess-

[...]

Test ess-r-load-ESSR-github-fetch-yes condition:
(file-error "Couldn’t find local shell prompt for /bin/sh")

And the package ’emacs’ contains,

Toggle snippet (25 lines)
;; Make sure Tramp looks for binaries in the right places on
;; remote Guix System machines, where 'getconf PATH' returns
;; something bogus.
(substitute* "net/tramp.el"
;; Patch the line after "(defcustom tramp-remote-path".
(("\\(tramp-default-remote-path")
(format #f "(tramp-default-remote-path ~s ~s ~s ~s "
"~/.guix-profile/bin" "~/.guix-profile/sbin"
"/run/current-system/profile/bin"
"/run/current-system/profile/sbin")))
[...]

(add-after 'unpack 'patch-program-file-names
(lambda* (#:key inputs #:allow-other-keys)
(substitute* '("src/callproc.c"
"lisp/term.el"
"lisp/htmlfontify.el"
"lisp/textmodes/artist.el"
"lisp/progmodes/sh-script.el")
(("\"/bin/sh\"")
(format #f "~s" (search-input-file inputs "/bin/sh"))))



Well, for the record, the starting point is AOT native-compilation
failing with Guix 00ff6f7,

Toggle snippet (18 lines)
$ guix build emacs-ess --with-input=emacs-minimal=emacs
[...]

In toplevel form:
ess-inf.el:39:1: Error: Cannot find suitable directory for output in ‘native-comp-eln-load-path’
make[1]: *** [Makefile:48: ess-inf.elc] Error 1
make[1]: Leaving directory '/tmp/guix-build-emacs-ess-18.10.2-0.24da603.drv-0/source/lisp'
make: *** [Makefile:29: lisp] Error 2
error: in phase 'build': uncaught exception:
%exception #<&invoke-error program: "make" arguments: ("-j" "16" "PREFIX=/gnu/store/p3wxpf95l1rc8kgxsrsgisad1ir1bac6-emacs-ess-18.10.2-0.24da603" "ETCDIR=/gnu/store/p3wxpf95l1rc8kgxsrsgisad1ir1bac6-emacs-ess-18.10.2-0.24da603/share/emacs/site-lisp/etc" "LISPDIR=/gnu/store/p3wxpf95l1rc8kgxsrsgisad1ir1bac6-emacs-ess-18.10.2-0.24da603/share/emacs/site-lisp" "INFODIR=/gnu/store/p3wxpf95l1rc8kgxsrsgisad1ir1bac6-emacs-ess-18.10.2-0.24da603/share/info") exit-status: 2 term-signal: #f stop-signal: #f>
phase `build' failed after 1.0 seconds
command "make" "-j" "16" "PREFIX=/gnu/store/p3wxpf95l1rc8kgxsrsgisad1ir1bac6-emacs-ess-18.10.2-0.24da603" "ETCDIR=/gnu/store/p3wxpf95l1rc8kgxsrsgisad1ir1bac6-emacs-ess-18.10.2-0.24da603/share/emacs/site-lisp/etc" "LISPDIR=/gnu/store/p3wxpf95l1rc8kgxsrsgisad1ir1bac6-emacs-ess-18.10.2-0.24da603/share/emacs/site-lisp" "INFODIR=/gnu/store/p3wxpf95l1rc8kgxsrsgisad1ir1bac6-emacs-ess-18.10.2-0.24da603/share/info" failed with status 2
builder for `/gnu/store/hhy8qm9wfsqxask40iy9z564fcz1qw9n-emacs-ess-18.10.2-0.24da603.drv' failed with exit code 1
build of /gnu/store/hhy8qm9wfsqxask40iy9z564fcz1qw9n-emacs-ess-18.10.2-0.24da603.drv failed
View build log at '/var/log/guix/drvs/hh/y8qm9wfsqxask40iy9z564fcz1qw9n-emacs-ess-18.10.2-0.24da603.drv.gz'.
guix build: error: build of `/gnu/store/hhy8qm9wfsqxask40iy9z564fcz1qw9n-emacs-ess-18.10.2-0.24da603.drv' failed

but this AOT native-compilation issues need another bug report. :-)


Cheers,
simon
R
R
Ricardo Wurmus wrote on 30 Nov 2022 22:55
[PATCH] gnu: emacs-ess: Update to 18.10.2-1.01e7f5b.
(address . 58690@debbugs.gnu.org)(name . Ricardo Wurmus)(address . rekado@elephly.net)
20221130215547.1438-1-rekado@elephly.net
* gnu/packages/statistics.scm (emacs-ess): Update to 18.10.2-1.01e7f5b.
[source]: Update snippet; remove patch.
[arguments]: Use gexp; add phase "patch-test-suite"; run tests conditionally.
[inputs]: Drop package labels.
* gnu/packages/patches/emacs-ess-fix-obsolete-function-alias.patch: Remove file.
* gnu/local.mk (dist_patch_DATA): Remove it.
---
gnu/local.mk | 1 -
...macs-ess-fix-obsolete-function-alias.patch | 23 -----
gnu/packages/statistics.scm | 87 +++++++++++++------
3 files changed, 60 insertions(+), 51 deletions(-)
delete mode 100644 gnu/packages/patches/emacs-ess-fix-obsolete-function-alias.patch

Toggle diff (168 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index 9443dd617a..f61141dd27 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1055,7 +1055,6 @@ dist_patch_DATA = \
%D%/packages/patches/elogind-revert-polkit-detection.patch \
%D%/packages/patches/emacs-deferred-fix-number-of-arguments.patch \
%D%/packages/patches/emacs-exec-path.patch \
- %D%/packages/patches/emacs-ess-fix-obsolete-function-alias.patch \
%D%/packages/patches/emacs-git-email-missing-parens.patch \
%D%/packages/patches/emacs-fix-scheme-indent-function.patch \
%D%/packages/patches/emacs-json-reformat-fix-tests.patch \
diff --git a/gnu/packages/patches/emacs-ess-fix-obsolete-function-alias.patch b/gnu/packages/patches/emacs-ess-fix-obsolete-function-alias.patch
deleted file mode 100644
index f7b61391c3..0000000000
--- a/gnu/packages/patches/emacs-ess-fix-obsolete-function-alias.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-From 9cc5520e1998d03f5dec0fbb1fe71b7cdec38b65 Mon Sep 17 00:00:00 2001
-From: Alex Branham <alex.branham@gmail.com>
-Date: Wed, 6 Jan 2021 06:41:20 -0500
-Subject: [PATCH] Add required when to obsolete function alias
-
-Closes #1085
----
- lisp/ess-r-package.el | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/lisp/ess-r-package.el b/lisp/ess-r-package.el
-index 260959955..397ce14e6 100644
---- a/lisp/ess-r-package.el
-+++ b/lisp/ess-r-package.el
-@@ -577,7 +577,7 @@ package mode. Use this function if state of the buffer such as
- (error "As of ESS 16.04, `ess-developer' is deprecated. Use `ess-r-set-evaluation-env' instead"))
-
- (defalias 'ess-toggle-developer 'ess-developer)
--(define-obsolete-function-alias 'ess-r-devtools-check-package-buildwin 'ess-r-devtools-check-with-winbuilder)
-+(define-obsolete-function-alias 'ess-r-devtools-check-package-buildwin 'ess-r-devtools-check-with-winbuilder "18.04")
- (define-obsolete-function-alias 'ess-r-devtools-ask 'ess-r-devtools-execute-command "18.04")
-
- (make-obsolete-variable 'ess-developer "Please use `ess-developer-select-package' and `ess-r-set-evaluation-env' instead." "16.04")
diff --git a/gnu/packages/statistics.scm b/gnu/packages/statistics.scm
index 16fb06e35a..3be9aea6cd 100644
--- a/gnu/packages/statistics.scm
+++ b/gnu/packages/statistics.scm
@@ -6426,11 +6426,10 @@ (define-public java-jdistlib
(license license:gpl2+)))
(define-public emacs-ess
- ;; Latest release is old. This is not the latest commit either due to bug
- ;; reported here: <https://github.com/emacs-ess/ESS/issues/987>.
- (let ((commit "24da603184ce39246611dd5b8602e769d7ebd5bf")
+ ;; Latest release is old.
+ (let ((commit "01e7f5b482b8a3331f1341483dedf2bd30403423")
(version "18.10.2")
- (revision "0"))
+ (revision "1"))
(package
(name "emacs-ess")
(version (git-version version revision commit))
@@ -6441,7 +6440,7 @@ (define-public emacs-ess
(url "https://github.com/emacs-ess/ESS")
(commit commit)))
(sha256
- (base32 "0j98lv07nzwzd54d4dgcfz01wy5gj48m0mnirxzh5r45ik2myh1r"))
+ (base32 "1b40rbbqzgfxj88357aixq646g3v3f88k9kwhgmyyjy9lb2dljkb"))
(file-name (git-file-name name version))
(modules '((guix build utils)))
(snippet
@@ -6459,9 +6458,6 @@ (define-public emacs-ess
;; Stop install-info from trying to update the info directory.
(substitute* "doc/Makefile"
((".*/dir.*") ""))
- ;; Fix r-help-mode test.
- (substitute* "test/ess-test-r.el"
- (("\\(equal ess-help-object \"plot.default\")") "t"))
;; Avoid generating ess-autoloads.el twice.
(substitute* "Makefile"
(("all: lisp doc etc autoloads")
@@ -6471,30 +6467,67 @@ (define-public emacs-ess
(("mkdir -p \\$\\(ESSDESTDIR)")
"$(MAKE) -C lisp install; $(MAKE) -C doc install")
(("\\$\\(INSTALL) -R \\./\\* \\$\\(ESSDESTDIR)/")
- "$(MAKE) -C etc install"))
- #t))
- (patches
- (search-patches "emacs-ess-fix-obsolete-function-alias.patch"))))
+ "$(MAKE) -C etc install"))))))
(build-system gnu-build-system)
(arguments
- (let ((base-directory "/share/emacs/site-lisp"))
- `(#:make-flags (list (string-append "PREFIX=" %output)
- (string-append "ETCDIR=" %output
- ,base-directory "/etc")
- (string-append "LISPDIR=" %output
- ,base-directory)
- (string-append "INFODIR=" %output
- "/share/info"))
- #:phases
- (modify-phases %standard-phases
- (delete 'configure)
- (replace 'check
- (lambda _ (invoke "make" "test")))))))
+ (list
+ #:make-flags
+ #~(let ((base-directory "/share/emacs/site-lisp"))
+ (list (string-append "PREFIX=" #$output)
+ (string-append "ETCDIR=" #$output
+ base-directory "/etc")
+ (string-append "LISPDIR=" #$output
+ base-directory)
+ (string-append "INFODIR=" #$output
+ "/share/info")))
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'unpack 'patch-test-suite
+ (lambda* (#:key inputs #:allow-other-keys)
+ (let ((sh (search-input-file inputs "/bin/sh")))
+ ;; Make the TRAMP method "mock" find the shell and ls.
+ (substitute* "test/run-tests"
+ (("\\(require 'ess-test-r-utils\\)" m)
+ (string-append
+ "
+(setq tramp-remote-path (parse-colon-path (getenv \"PATH\")))
+(setq tramp-encoding-shell \"" sh "\")" m)))
+ (substitute* "test/ess-test-r-utils.el"
+ (("\\(tramp-remote-shell.*\"/bin/sh\"\\)")
+ (string-append "(tramp-remote-shell \"" sh "\")")))
+ ;; ess-r-beginning/end-of-defun-ignore-inner-fn-test does
+ ;; not start at the beginning, so the search fails.
+ (substitute* "test/ess-test-r.el"
+ (("\\(with-ess-test-r-file \\(expand-file-name \"navigation.R\" ess-test-fixtures-directory\\)" m)
+ (string-append m "(goto-char (point-min))"))
+ ;; XXX: Disable this test. It's off by one sub-directory.
+ (("ert-deftest ess-test-r-startup-directory")
+ "defun ess-test-r-startup-directory"))
+ ;; XXX: This test is flaky, but seems harmless. Sometimes
+ ;; it will capture the previous empty prompt ("> \n> "). It
+ ;; is not clear whether this is deterministic behavior.
+ (substitute* "test/ess-test-inf.el"
+ (("etest-deftest command-without-trailing-newline-test")
+ "defun command-without-trailing-newline-test"))
+ ;; XXX: It seems that disabling individual keyword classes does
+ ;; not work as expected.
+ (substitute* "test/literate/fontification.R"
+ (("\\(should \\(eq \\(face-at-point\\) 'default\\)\\)")
+ "(should (member (face-at-point)
+(list nil 'ess-operator-face 'ess-keyword-face)))")))))
+ (delete 'configure)
+ (replace 'check
+ (lambda* (#:key tests? #:allow-other-keys)
+ (when tests?
+ ;; Skip tests that require an internet connection.
+ (setenv "TRAVIS" "true")
+ ;; Needed for some tests that try to access ~/.tramp_history
+ (setenv "HOME" (getcwd))
+ (invoke "make" "test")))))))
(native-inputs
(list perl r-roxygen2 texinfo))
(inputs
- `(("emacs" ,emacs-minimal)
- ("r-minimal" ,r-minimal)))
+ (list emacs-minimal r-minimal))
(propagated-inputs
(list emacs-julia-mode))
(home-page "https://ess.r-project.org/")
--
2.36.1
Z
Z
zimoun wrote on 2 Dec 2022 16:31
(name . Ricardo Wurmus)(address . rekado@elephly.net)
87y1rprfds.fsf@gmail.com
Hi Ricardo,

On Wed, 30 Nov 2022 at 22:55, Ricardo Wurmus <rekado@elephly.net> wrote:
Toggle quote (7 lines)
> * gnu/packages/statistics.scm (emacs-ess): Update to 18.10.2-1.01e7f5b.
> [source]: Update snippet; remove patch.
> [arguments]: Use gexp; add phase "patch-test-suite"; run tests conditionally.
> [inputs]: Drop package labels.
> * gnu/packages/patches/emacs-ess-fix-obsolete-function-alias.patch: Remove file.
> * gnu/local.mk (dist_patch_DATA): Remove it.

LGTM. But then,

./pre-inst-env guix shell emacs emacs-ess r \
-- emacs -q /tmp/example.R

and after starting the *R* session, Emacs is frozen. Does it work for
you?


Cheers,
simon
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 58690@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 58690
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch