doomemacs / doomemacs

An Emacs framework for the stubborn martian hacker
MIT License
19.2k stars 3.03k forks source link

vterm-module does not compile #3488

Closed fladd closed 3 years ago

fladd commented 4 years ago

I uncommented vterm in init.el, then did a bin/doom syn. I then used SPC-o-T to open a terminal. Emacs told me that it needs vterm-module to work and whether I want to compile it. I answered with y.

What did you expect to happen? I expected a terminal to open.

What actually happened? I got the compilation errors.

Additional details:

-- System libvterm detected
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/fladd/.emacs.d/.local/straight/build/vterm/build
[ 25%] Building C object CMakeFiles/vterm-module.dir/vterm-module.c.o
/Users/fladd/.emacs.d/.local/straight/build/vterm/vterm-module.c:597:20: warning: implicit declaration of function 'vterm_color_is_equal' is invalid in C99 [-Wimplicit-function-declaration]
  equal = equal && vterm_color_is_equal(&a->fg, &b->fg);
                   ^
/Users/fladd/.emacs.d/.local/straight/build/vterm/vterm-module.c:734:7: warning: implicit declaration of function 'VTERM_COLOR_IS_DEFAULT_FG' is invalid in C99 [-Wimplicit-function-declaration]
  if (VTERM_COLOR_IS_DEFAULT_FG(color)) {
      ^
/Users/fladd/.emacs.d/.local/straight/build/vterm/vterm-module.c:737:7: warning: implicit declaration of function 'VTERM_COLOR_IS_DEFAULT_BG' is invalid in C99 [-Wimplicit-function-declaration]
  if (VTERM_COLOR_IS_DEFAULT_BG(color)) {
      ^
/Users/fladd/.emacs.d/.local/straight/build/vterm/vterm-module.c:740:7: warning: implicit declaration of function 'VTERM_COLOR_IS_INDEXED' is invalid in C99 [-Wimplicit-function-declaration]
  if (VTERM_COLOR_IS_INDEXED(color)) {
      ^
/Users/fladd/.emacs.d/.local/straight/build/vterm/vterm-module.c:741:16: error: no member named 'indexed' in 'VTermColor'
    if (color->indexed.idx < 16) {
        ~~~~~  ^
/Users/fladd/.emacs.d/.local/straight/build/vterm/vterm-module.c:742:42: error: no member named 'indexed' in 'VTermColor'
      return vterm_get_color(env, color->indexed.idx);
                                  ~~~~~  ^
/Users/fladd/.emacs.d/.local/straight/build/vterm/vterm-module.c:745:51: error: no member named 'indexed' in 'VTermColor'
      vterm_state_get_palette_color(state, color->indexed.idx, color);
                                           ~~~~~  ^
/Users/fladd/.emacs.d/.local/straight/build/vterm/vterm-module.c:747:14: warning: implicit declaration of function 'VTERM_COLOR_IS_RGB' is invalid in C99 [-Wimplicit-function-declaration]
  } else if (VTERM_COLOR_IS_RGB(color)) {
             ^
/Users/fladd/.emacs.d/.local/straight/build/vterm/vterm-module.c:752:47: error: no member named 'rgb' in 'VTermColor'
  snprintf(buffer, 8, "#%02X%02X%02X", color->rgb.red, color->rgb.green,
                                       ~~~~~  ^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/secure/_stdio.h:57:62: note: expanded from macro 'snprintf'
  __builtin___snprintf_chk (str, len, 0, __darwin_obsz(str), __VA_ARGS__)
                                                             ^~~~~~~~~~~
/Users/fladd/.emacs.d/.local/straight/build/vterm/vterm-module.c:752:63: error: no member named 'rgb' in 'VTermColor'
  snprintf(buffer, 8, "#%02X%02X%02X", color->rgb.red, color->rgb.green,
                                                       ~~~~~  ^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/secure/_stdio.h:57:62: note: expanded from macro 'snprintf'
  __builtin___snprintf_chk (str, len, 0, __darwin_obsz(str), __VA_ARGS__)
                                                             ^~~~~~~~~~~
/Users/fladd/.emacs.d/.local/straight/build/vterm/vterm-module.c:753:19: error: no member named 'rgb' in 'VTermColor'
           color->rgb.blue);
           ~~~~~  ^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/secure/_stdio.h:57:62: note: expanded from macro 'snprintf'
  __builtin___snprintf_chk (str, len, 0, __darwin_obsz(str), __VA_ARGS__)
                                                             ^~~~~~~~~~~
5 warnings and 6 errors generated.
make[2]: *** [CMakeFiles/vterm-module.dir/vterm-module.c.o] Error 1
make[1]: *** [CMakeFiles/vterm-module.dir/all] Error 2
make: *** [all] Error 2
/Users/fladd/.emacs.d/.local/straight/build/vterm

Steps to reproduce:

  1. Uncomment vterm in init.el
  2. Run `bin/doom sync
  3. Type SPC-o-T to open a terminal
  4. Emacs says that it needs vterm-module to work and asks whether to compile it; answer with y

System information:

``` emacs version 26.3 features JPEG RSVG IMAGEMAGICK GLIB NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS MODULES THREADS LCMS2 build Jun 20, 2020 buildopts (--disable-dependency-tracking --disable-silent-rules --enable-locallisppath=/usr/local/share/emacs/site-lisp --infodir=/usr/local/Cellar/emacs-plus@26/26.3/share/info/emacs --prefix=/usr/local/Cellar/emacs-plus@26/26.3 --with-xml2 --with-gnutls --with-imagemagick --with-modules --with-rsvg --with-ns --disable-ns-self-contained) windowsys ns daemonp server-running doom version 2.0.9 build HEAD -> develop, origin/develop, origin/HEAD 042cc781b 2020-06-20 03:02:05 -0400 dir ~/.doom.d/ system type darwin config x86_64-apple-darwin18.6.0 shell /bin/bash uname Darwin 18.6.0 Darwin Kernel Version 18.6.0: Thu Apr 25 23:16:27 PDT 2019; root:xnu-4903.261.4~2/RELEASE_X86_64 x86_64 path (~/.emacs.d/bin /usr/local/sbin ~/miniconda3/bin /Library/Frameworks/Python.framework/Versions/3.8/bin /usr/local/fsl/bin ~/.nix-profile/bin ~/.nix-profile/sbin /usr/local/bin /usr/bin /bin /usr/sbin /sbin /opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/ /usr/texbin /opt/X11/bin /Library/TeX/Distributions/.DefaultTeX/Contents/Programs/texbin /usr/local/Cellar/emacs-plus@26/26.3/libexec/emacs/26.3/x86_64-apple-darwin18.6.0/) config envfile envvar-file elc-files 0 modules (:completion company ivy :ui deft doom doom-dashboard doom-quit hl-todo modeline ophints (popup +defaults) tabs treemacs unicode vc-gutter vi-tilde-fringe workspaces zen :editor (evil +everywhere) file-templates fold multiple-cursors snippets :emacs dired electric ibuffer undo vc :term vterm :checkers syntax :tools ein (eval +overlay) gist lookup macos magit pdf rgb :lang emacs-lisp json latex lua markdown nim (org +dragndrop +journal) python sh yaml :app calendar :config (default +bindings +smartparens)) packages (n/a) unpin (n/a) elpa (n/a) ```
dangom commented 4 years ago

DId you run doom doctor? You may be missing libvterm. brew install libvterm

MikeGitIt commented 4 years ago

I have libvterm installed and I am having the same exact experience as @fladd. I ran the sync and doom doctor as well but to no avail. The 'doom doctor' command results are attached. I see that I get an error for `rg' binary but pretty sure it is unrelated.

doom-doctor-2020-07-05-at-11 06 08-AM
MikeGitIt commented 4 years ago

Because I could afford to, I backed up my existing .emacs.d directory and then cloned the repository once again. Emacs worked fine, up until I had to forcibly run doom sync due to being prompted to by emacs.

calharding commented 3 years ago

Had the same issue here. Kept being prompted to build libvterm, but hitting y did nothing.

I just quickly hit C-c o T (I don't use evil), and when the prompt popped up again, hitting y seemed to be recognised. The module was downloaded and built successfully.

shadowrylander commented 3 years ago

@calharding I had to keep hitting random keys several times before my y was registered!

shadowrylander commented 3 years ago

Oh! I see how it works: when the prompt comes up, DON'T PRESS y! PRESS DOWN TO TRIGGER THE END OF HISTORY MESSAGE, THEN y WILL REGISTER!

It should work after the first or second try.

shadowrylander commented 3 years ago

In addition, there's also a vterm variable which will auto-compile the module on startup.

github-actions[bot] commented 3 years ago

This issue has been automatically marked stale because of a lack of recent activity. If this issue is still valid, reply to it or remove the label or it will be closed in 7 days.