emacs-libvterm icon indicating copy to clipboard operation
emacs-libvterm copied to clipboard

Vterm module must be re-compiled every restart when using straight.el.

Open akoen opened this issue 4 years ago • 4 comments

Whenever Emacs is restarted, the vterm module must be recompiled:

image Once the module is compiled vterm works normally.

Here is the output of the module build:

-- Configuring done
-- Generating done
-- Build files have been written to: /home/alex/.config/emacs/.local/straight/build/vterm/build
Scanning dependencies of target libvterm
[  8%] Creating directories for 'libvterm'
[ 16%] Performing download step (git clone) for 'libvterm'
Cloning into 'libvterm'...
Note: switching to '65dbda3ed214f036ee799d18b2e693a833a0e591'.

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 switching back to a branch.

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

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at 65dbda3 Bump version to 0.1.3
[ 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]
  306 | 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]
  215 | static int mk_wcswidth(const uint32_t *pwcs, size_t n)
      |            ^~~~~~~~~~~
CC src/vterm.c
LINK libvterm.la
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
/home/alex/.config/emacs/.local/straight/build/vterm

and here is the content of the messages buffer:

Loading /home/alex/.config/emacs/init.el (source)...
Loading /home/alex/.config/emacs/config.el (source)...
[yas] Prepared just-in-time loading of snippets successfully.
Building vterm...done
org-super-agenda-mode enabled.
Loading /home/alex/.config/emacs/config.el (source)...done
Loading ‘/home/alex/.config/emacs/config.el’: unescaped character literals `?[', `?]' detected, `?\[', `?\]' expected!
Loaded /home/alex/.config/emacs/config.el
Loading /home/alex/.config/emacs/custom.el (source)...done
Loading /home/alex/.config/emacs/init.el (source)...done
(org-roam) files: 0, headlines: 0, links: 0, tags: 0, titles: 0, refs: 0, deleted: 0
Starting Emacs daemon.
Package cl is deprecated
When done with this frame, type C-x 5 0
Vterm needs `vterm-module' to work.  Compile it now? (y or n) y
Compilation of ‘emacs-libvterm’ module succeeded
End of buffer
Beginning of buffer [7 times]
File .local/straight/repos/emacs-libvterm/vterm.el added to project /home/alex/.config/emacs/ cache.
Followed link to /home/alex/.config/emacs/.local/straight/repos/emacs-libvterm/vterm.el
Quit
File .local/straight/build/vterm/vterm-module.so added to project /home/alex/.config/emacs/ cache.
Projectile is initializing cache for /home/alex/.config/emacs/ ...
Mark set [2 times]

Note that straight.el says building vterm during initialization. This occurs every restart.

Any help would be greatly appreciated!

akoen avatar Jun 22 '20 01:06 akoen

I bet this is related to akhramov/org-wild-notifier.el#21, or rather, the fix is very similar.

codygman avatar Jun 22 '20 04:06 codygman

It looks like you are using Doom Emacs. When I try to use vterm with Doom Emacs, I don't have this problem. How do you install vterm?

Sbozzolo avatar Jun 28 '20 15:06 Sbozzolo

I am using vanilla emacs with the doom modeline. Here is my configuration:

(use-package vterm
  :ensure-system-package (vterm-ctrl . libvterm)
  :commands vterm vterm-mode
  :init
  (setq vterm-kill-buffer-on-exit t)
  :config
  (add-hook 'vterm-mode-hook 'evil-emacs-state)) ;; Evil in terminal is simply wack

That being said, I can reproduce the bug with a blank use-package declaration:

(use-package vterm)

akoen avatar Jun 29 '20 16:06 akoen

Is there a way to customize the location of build directory?

failable avatar Mar 07 '21 13:03 failable