Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with installation from MELPA #85

Closed
manuel-uberti opened this issue May 13, 2019 · 18 comments
Closed

Problem with installation from MELPA #85

manuel-uberti opened this issue May 13, 2019 · 18 comments

Comments

@manuel-uberti
Copy link

manuel-uberti commented May 13, 2019

Hi,

first of all thanks for this package. Can't wait to see if I finally can use Fish shell in Emacs without any problem.

As I was saying here, I am having issues with the installation from MELPA.

This is what I do:

  • emacs -Q
  • M-x toggle-debug-on-error
  • add and evaluate this in the *scratch* buffer
(setq package-archives '(("GNU ELPA" . "https://elpa.gnu.org/packages/")
                         ("MELPA"    . "https://melpa.org/packages/")))
  • M-x package-initialize RET
  • M-x package-install RET vterm RET

I am getting this error when the installation finishes:

Leaving directory ‘/home/manuel/.emacs.d/elpa/vterm-20190502.1700’

Compiling file /home/manuel/.emacs.d/elpa/vterm-20190502.1700/vterm.el at Mon May 13 08:04:36 2019
Entering directory ‘/home/manuel/.emacs.d/elpa/vterm-20190502.1700/’
vterm.el:77:1:Error: Cannot open load file: No such file or directory, vterm-module

If I evaluate this in the *scratch* buffer, as suggested in the previously linked MELPA PR:

(let (vterm-install)
  (require 'vterm))

I get this:

Debugger entered--Lisp error: (file-missing "Cannot open load file" "No such file or directory" "vterm-module")
  require(vterm-module)
  eval-buffer(#<buffer  *load*> nil "/home/manuel/.emacs.d/elpa/vterm-20190502.1700/vte..." nil t)  ; Reading at buffer position 2561
  load-with-code-conversion("/home/manuel/.emacs.d/elpa/vterm-20190502.1700/vte..." "/home/manuel/.emacs.d/elpa/vterm-20190502.1700/vte..." nil t)
  require(vterm)
  (let (vterm-install) (require 'vterm))
  (progn (let (vterm-install) (require 'vterm)))
  eval((progn (let (vterm-install) (require 'vterm))) t)
  elisp--eval-last-sexp(nil)
  eval-last-sexp(nil)
  funcall-interactively(eval-last-sexp nil)
  call-interactively(eval-last-sexp nil nil)
  command-execute(eval-last-sexp)

To add more context, these are some details on my system:

GNU Emacs 27.0.50 (build 1, x86_64-debian-linux-gnu, GTK+ Version 3.22.30)
 of 2019-05-13

Repository revision: d2d4916046e31e46598f0a0edbc65e75b8cb4cc3
Configured using:
--host=x86_64-debian-linux-gnu --with-modules

Emacs uptime: 13 minutes, 25 seconds
Colour theme: zenburn
Operating system: Ubuntu 18.04.2 LTS
Window system: x11
Desktop environment: GNOME Shell 3.28.3
@dive
Copy link

dive commented May 13, 2019

I have the same issue as above:

Error (use-package): vterm/:init: Cannot open load file: No such file or directory, vterm-module
Error (use-package): vterm/:catch: Cannot open load file: No such file or directory, vterm-module

But on macOS:

$ emacs --version
GNU Emacs 26.1

$ sw_vers 
ProductName:	Mac OS X
ProductVersion:	10.14.4
BuildVersion:	18E226

@jixiuf
Copy link
Collaborator

jixiuf commented May 13, 2019

so can you run

cd ~/.emacs.d/elpa/vterm-20190502.1700;mkdir -p build ;cd build;cmake ..;make

and paste the output of the command

@manuel-uberti
Copy link
Author

Sure thing:

~
❯ cd ~/.emacs.d/elpa/vterm-20190502.1700;mkdir -p build ;cd build;cmake ..;make
-- The C compiler identification is GNU 7.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/manuel/.emacs.d/elpa/vterm-20190502.1700/build
Scanning dependencies of target libvterm
[  8%] Creating directories for 'libvterm'
[ 16%] Performing download step (git clone) for 'libvterm'
Cloning into 'libvterm'...
Note: checking out 'a6293a0e033e7e86c74889b4527787993656883a'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

HEAD is now at a6293a0 The F1 to F4 keys should send SS3 rather than CSI when unmodified
[ 25%] No patch step for 'libvterm'
[ 33%] Performing update step for 'libvterm'
[ 41%] No configure step for 'libvterm'
[ 50%] Performing build step for 'libvterm'
TBL src/encoding/DECdrawing.tbl
TBL src/encoding/uk.tbl
CC src/encoding.c
make[3]: libtool: Command not found
Makefile:62: recipe for target 'src/encoding.lo' failed
make[3]: *** [src/encoding.lo] Error 127
CMakeFiles/libvterm.dir/build.make:110: recipe for target 'libvterm-prefix/src/libvterm-stamp/libvterm-build' failed
make[2]: *** [libvterm-prefix/src/libvterm-stamp/libvterm-build] Error 2
CMakeFiles/Makefile2:136: recipe for target 'CMakeFiles/libvterm.dir/all' failed
make[1]: *** [CMakeFiles/libvterm.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

@manuel-uberti
Copy link
Author

manuel-uberti commented May 13, 2019

I installed libtool-bin (which was missing, and now I get):

~
❯ cd ~/.emacs.d/elpa/vterm-20190502.1700;mkdir -p build ;cd build;cmake ..;make
-- The C compiler identification is GNU 7.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/manuel/.emacs.d/elpa/vterm-20190502.1700/build
Scanning dependencies of target libvterm
[  8%] Creating directories for 'libvterm'
[ 16%] Performing download step (git clone) for 'libvterm'
Cloning into 'libvterm'...
Note: checking out 'a6293a0e033e7e86c74889b4527787993656883a'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

HEAD is now at a6293a0 The F1 to F4 keys should send SS3 rather than CSI when unmodified
[ 25%] No patch step for 'libvterm'
[ 33%] Performing update step for 'libvterm'
[ 41%] No configure step for 'libvterm'
[ 50%] Performing build step for 'libvterm'
TBL src/encoding/DECdrawing.tbl
TBL src/encoding/uk.tbl
CC src/encoding.c
CC src/keyboard.c
CC src/mouse.c
CC src/parser.c
CC src/pen.c
CC src/screen.c
CC src/state.c
CC src/unicode.c
src/unicode.c:306:12: warning: ‘mk_wcswidth_cjk’ defined but not used [-Wunused-function]
 static int mk_wcswidth_cjk(const uint32_t *pwcs, size_t n)
            ^~~~~~~~~~~~~~~
src/unicode.c:215:12: warning: ‘mk_wcswidth’ defined but not used [-Wunused-function]
 static int mk_wcswidth(const uint32_t *pwcs, size_t n)
            ^~~~~~~~~~~
CC src/vterm.c
LINK libvterm.la
ar: `u' modifier ignored since `D' is the default (see `U')
CC bin/unterm.c
CC bin/vterm-ctrl.c
CC bin/vterm-dump.c
[ 58%] No install step for 'libvterm'
[ 66%] Completed 'libvterm'
[ 66%] Built target libvterm
Scanning dependencies of target vterm-module
[ 75%] Building C object CMakeFiles/vterm-module.dir/vterm-module.c.o
[ 83%] Building C object CMakeFiles/vterm-module.dir/utf8.c.o
[ 91%] Building C object CMakeFiles/vterm-module.dir/elisp.c.o
[100%] Linking C shared module ../vterm-module.so
[100%] Built target vterm-module

@manuel-uberti
Copy link
Author

Note also that now I can use M-x vterm with no error. :)

@jojojames
Copy link

I think it'll only install if you build outside of emacs.

mkdir -p build ;cd build;cmake ..;make

I wasn't able to compile/run vterm with this ~

(let (vterm-install)
  (require 'vterm))

but could do it once I built outside of emacs first.

Also melpa errored out during compilation.

@noctuid
Copy link

noctuid commented May 17, 2019

@jojojames The idea is that you shouldn't have to build outside of Emacs first. It works for me on Linux and osx.

@jojojames
Copy link

@noctuid Can you share your steps?

I've gotten a somewhat- automated use-package declaration (definitely open to a better way of course).

(use-package vterm
  :commands (vterm)
  :ensure t
  :init
  (unless (file-exists-p (concat (file-name-directory (locate-library "vterm"))
                                 "vterm-module.so"))
    (message "Set vterm to install.")
    (setq vterm-install t)))

But I still see the byte compile error when initially installing the package.

M-x vterm does indeed work with that use-package declaration above.

@noctuid
Copy link

noctuid commented May 18, 2019

This works fine for me:

(use-package vterm
  :init
  (defvar vterm-install t))

Also vterm already checks if it's already been compiled, so you can just set vterm-install unconditionally. For some reason, it checks boundp instead of just making vterm-install a customizable variable.

I'm using straight.el not package.el, so maybe that's relevant to the errors during installation.

@jojojames
Copy link

@noctuid
Yeah I just get

Error (use-package): Cannot load vterm

I think there's probably something with straight then?

@manuel-uberti
Copy link
Author

I tried this:

(use-package vterm
  :ensure t
  :init
  (defvar vterm-install t))

Same error as the one I reported in the opening post.

I've also tried this:

(use-package vterm
  :commands (vterm)
  :ensure t
  :init
  (unless (file-exists-p (concat (file-name-directory (locate-library "vterm"))
                                 "vterm-module.so"))
    (message "Set vterm to install.")
    (setq vterm-install t)))

But I get:

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  file-name-directory(nil)
  (concat (file-name-directory (locate-library "vterm")) "vterm-module.so")
  (file-exists-p (concat (file-name-directory (locate-library "vterm")) "vterm-module.so"))
  (if (file-exists-p (concat (file-name-directory (locate-library "vterm")) "vterm-module.so")) nil (message "Set vterm to install.") (setq vterm-install t))
  (condition-case err (if (file-exists-p (concat (file-name-directory (locate-library "vterm")) "vterm-module.so")) nil (message "Set vterm to install.") (setq vterm-install t)) ((debug error) (funcall use-package--warning195 :init err)))
  (progn (if (fboundp 'vterm) nil (autoload #'vterm "vterm" nil t)) (condition-case err (if (file-exists-p (concat (file-name-directory (locate-library "vterm")) "vterm-module.so")) nil (message "Set vterm to install.") (setq vterm-install t)) ((debug error) (funcall use-package--warning195 :init err))))
  (condition-case err (progn (if (fboundp 'vterm) nil (autoload #'vterm "vterm" nil t)) (condition-case err (if (file-exists-p (concat (file-name-directory (locate-library "vterm")) "vterm-module.so")) nil (message "Set vterm to install.") (setq vterm-install t)) ((debug error) (funcall use-package--warning195 :init err)))) ((debug error) (funcall use-package--warning195 :catch err)))
  (progn (use-package-ensure-elpa 'vterm '(t) 'nil) (defvar use-package--warning195 #'(lambda (keyword err) (let ((msg (format "%s/%s: %s" ... keyword ...))) (display-warning 'use-package msg :error)))) (condition-case err (progn (if (fboundp 'vterm) nil (autoload #'vterm "vterm" nil t)) (condition-case err (if (file-exists-p (concat (file-name-directory ...) "vterm-module.so")) nil (message "Set vterm to install.") (setq vterm-install t)) ((debug error) (funcall use-package--warning195 :init err)))) ((debug error) (funcall use-package--warning195 :catch err))))
  (progn (progn (use-package-ensure-elpa 'vterm '(t) 'nil) (defvar use-package--warning195 #'(lambda (keyword err) (let ((msg ...)) (display-warning 'use-package msg :error)))) (condition-case err (progn (if (fboundp 'vterm) nil (autoload #'vterm "vterm" nil t)) (condition-case err (if (file-exists-p (concat ... "vterm-module.so")) nil (message "Set vterm to install.") (setq vterm-install t)) ((debug error) (funcall use-package--warning195 :init err)))) ((debug error) (funcall use-package--warning195 :catch err)))))
  eval((progn (progn (use-package-ensure-elpa 'vterm '(t) 'nil) (defvar use-package--warning195 #'(lambda (keyword err) (let (...) (display-warning ... msg :error)))) (condition-case err (progn (if (fboundp 'vterm) nil (autoload #'vterm "vterm" nil t)) (condition-case err (if (file-exists-p ...) nil (message "Set vterm to install.") (setq vterm-install t)) ((debug error) (funcall use-package--warning195 :init err)))) ((debug error) (funcall use-package--warning195 :catch err))))) t)
  elisp--eval-last-sexp(nil)
  #f(compiled-function (eval-last-sexp-arg-internal) "Evaluate sexp before point; print value in the echo area.\nInteractively, with a non `-' prefix argument, print output into\ncurrent buffer.\n\nNormally, this function truncates long output according to the\nvalue of the variables `eval-expression-print-length' and\n`eval-expression-print-level'.  With a prefix argument of zero,\nhowever, there is no such truncation.\nInteger values are printed in several formats (decimal, octal,\nand hexadecimal).  When the prefix argument is -1 or the value\ndoesn't exceed `eval-expression-print-maximum-character', an\ninteger value is also printed as a character of that codepoint.\n\nIf `eval-expression-debug-on-error' is non-nil, which is the default,\nthis command arranges for all errors to enter the debugger." (interactive "P") #<bytecode 0x1fe8e43f3f43>)(nil)
  apply(#f(compiled-function (eval-last-sexp-arg-internal) "Evaluate sexp before point; print value in the echo area.\nInteractively, with a non `-' prefix argument, print output into\ncurrent buffer.\n\nNormally, this function truncates long output according to the\nvalue of the variables `eval-expression-print-length' and\n`eval-expression-print-level'.  With a prefix argument of zero,\nhowever, there is no such truncation.\nInteger values are printed in several formats (decimal, octal,\nand hexadecimal).  When the prefix argument is -1 or the value\ndoesn't exceed `eval-expression-print-maximum-character', an\ninteger value is also printed as a character of that codepoint.\n\nIf `eval-expression-debug-on-error' is non-nil, which is the default,\nthis command arranges for all errors to enter the debugger." (interactive "P") #<bytecode 0x1fe8e43f3f43>) nil)
  eval-last-sexp(nil)
  funcall-interactively(eval-last-sexp nil)
  call-interactively(eval-last-sexp nil nil)
  command-execute(eval-last-sexp)

@easbarba
Copy link

easbarba commented May 20, 2019

@manuel-uberti

Use-package :init feature calls for vterm-install function before loading vterm library.

Use :custom, instead.

(use-package vterm
      :custom  (vterm-install t))

Oh, and its granted that one should have libvterm system package installed!

@manuel-uberti
Copy link
Author

manuel-uberti commented May 20, 2019

@AlexanderBarbosa with :config I get:

Compiling file /home/manuel/.emacs.d/elpa/vterm-20190502.1700/vterm.el at Mon May 20 15:08:52 2019
Entering directory ‘/home/manuel/.emacs.d/elpa/vterm-20190502.1700/’
vterm.el:77:1:Error: Cannot open load file: No such file or directory, vterm-module

And about libvterm:

~
❯ sudo apt-cache policy libvterm0
[sudo] password for manuel: 
libvterm0:
  Installed: 0~bzr715-1
  Candidate: 0~bzr715-1
  Version table:
 *** 0~bzr715-1 500
        500 http://archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
        100 /var/lib/dpkg/status

@easbarba
Copy link

easbarba commented May 20, 2019

@manuel-uberti

Please, delete vterm from elpa folder and install it again (package-install).

I had to restart emacs, tho, i think it is, and should be, unnecessary,

@easbarba
Copy link

@noctuid Can you share your steps?

I've gotten a somewhat- automated use-package declaration (definitely open to a better way of course).

Its unnecessary as vterm-instal do just that!

(defun vterm-module-compile ()

@manuel-uberti
Copy link
Author

manuel-uberti commented May 20, 2019

@AlexanderBarbosa
There was no vterm in my ELPA folder before I ran that use-package snippet. I restarted Emacs and tried again this snippet:

(use-package vterm
  :commands (vterm)
  :ensure t
  :config
  (unless (file-exists-p (concat (file-name-directory (locate-library "vterm"))
                                 "vterm-module.so"))
    (message "Set vterm to install.")
    (setq vterm-install t)))

But I still get this message:

Leaving directory ‘/home/manuel/.emacs.d/elpa/vterm-20190502.1700’

Compiling file /home/manuel/.emacs.d/elpa/vterm-20190502.1700/vterm.el at Mon May 20 15:20:22 2019
Entering directory ‘/home/manuel/.emacs.d/elpa/vterm-20190502.1700/’
vterm.el:77:1:Error: Cannot open load file: No such file or directory, vterm-module

@easbarba
Copy link

easbarba commented May 20, 2019

@manuel-uberti
Use

(use-package vterm
      :custom (vterm-install t))

No need to redo all that statements as vterm-module-compile function do just that.

Just set vterm-install to t.

@manuel-uberti
Copy link
Author

Ok, it works with your latest snippet. Thank you. I guess we can close this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants