zevlg / telega.el

GNU Emacs telegram client (unofficial)
https://zevlg.github.io/telega.el/
GNU General Public License v3.0
1.11k stars 86 forks source link

Unable to build telega-server #339

Closed chookity-pokk closed 2 years ago

chookity-pokk commented 2 years ago
## Telega Setup
*OS*: KDE neon User - Plasma 25th Anniversary Edition
*Emacs*: GNU Emacs 27.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.20, cairo version 1.16.0)

When trying to build telega-server after building tdlib from source and installing telega from MELPA, I get the error at the bottom of this issue.

Telega Setup

OS: Linux hank 5.11.0-38-generic #42~20.04.1-Ubuntu SMP Tue Sep 28 20:41:07 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux Emacs: 27.2 Telega: Installed from Melpa but when running telega-version I get an error because telega-server isn't in exec-path

Melpa

Current Behavior

Unable to build telega-server.

Steps to Reproduce

  1. Install telega
  2. Build TDLib from source using the instruction here, https://zevlg.github.io/telega.el/index-master.html#building-tdlib
  3. Run telega and select y when asked to build telega-server
  4. Crashes with the below error log.
make -C server clean
make[1]: Entering directory '/home/hank/.emacs.d/elpa/telega-20211227.2205/server'
/bin/sh: 1: pkg-config: not found
make[1]: Leaving directory '/home/hank/.emacs.d/elpa/telega-20211227.2205/server'
make -C server install
make[1]: Entering directory '/home/hank/.emacs.d/elpa/telega-20211227.2205/server'
/bin/sh: 1: pkg-config: not found
cc -I/usr/local/include -Wall -g -pthread -o telega-server telega-server.c telega-dat.c telega-pngext.c -L/usr/local/lib -Wl,-rpath,/usr/local/lib -ltdjson
telega-server.c:30:10: fatal error: td/telegram/td_json_client.h: No such file or directory
   30 | #include <td/telegram/td_json_client.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [Makefile:35: telega-server] Error 1
make[1]: Leaving directory '/home/hank/.emacs.d/elpa/telega-20211227.2205/server'
make: *** [Makefile:12: server-reinstall] Error 2
chookity-pokk commented 2 years ago

I saw an issue earlier that was basically the same and the issue was they didn't have TDLib built but I have built it successfully without any errors or warnings.

zevlg commented 2 years ago

Don’t forget to install TDLib after building it

chookity-pokk commented 2 years ago

I ran sudo make install after building and get the output below.

-- Install configuration: "Release"
-- Up-to-date: /home/hank/Development/td/build/../tdlib/lib/libtdjson.so.1.7.12
-- Up-to-date: /home/hank/Development/td/build/../tdlib/lib/libtdjson.so
-- Up-to-date: /home/hank/Development/td/build/../tdlib/lib/libtdjson_static.a
-- Up-to-date: /home/hank/Development/td/build/../tdlib/lib/libtdjson_private.a
-- Up-to-date: /home/hank/Development/td/build/../tdlib/lib/libtdclient.a
-- Up-to-date: /home/hank/Development/td/build/../tdlib/lib/libtdcore.a
-- Up-to-date: /home/hank/Development/td/build/../tdlib/lib/libtdapi.a
-- Up-to-date: /home/hank/Development/td/build/../tdlib/lib/pkgconfig/tdutils.pc
-- Up-to-date: /home/hank/Development/td/build/../tdlib/lib/pkgconfig/tdactor.pc
-- Up-to-date: /home/hank/Development/td/build/../tdlib/lib/pkgconfig/tdnet.pc
-- Up-to-date: /home/hank/Development/td/build/../tdlib/lib/pkgconfig/tdsqlite.pc
-- Up-to-date: /home/hank/Development/td/build/../tdlib/lib/pkgconfig/tddb.pc
-- Up-to-date: /home/hank/Development/td/build/../tdlib/lib/pkgconfig/tdcore.pc
-- Up-to-date: /home/hank/Development/td/build/../tdlib/lib/pkgconfig/tdclient.pc
-- Up-to-date: /home/hank/Development/td/build/../tdlib/lib/pkgconfig/tdapi.pc
-- Up-to-date: /home/hank/Development/td/build/../tdlib/lib/pkgconfig/tdjson_private.pc
-- Up-to-date: /home/hank/Development/td/build/../tdlib/lib/pkgconfig/tdjson.pc
-- Up-to-date: /home/hank/Development/td/build/../tdlib/lib/pkgconfig/tdjson_static.pc
-- Up-to-date: /home/hank/Development/td/build/../tdlib/lib/cmake/Td/TdTargets.cmake
-- Up-to-date: /home/hank/Development/td/build/../tdlib/lib/cmake/Td/TdTargets-release.cmake
-- Up-to-date: /home/hank/Development/td/build/../tdlib/include/td/telegram/td_json_client.h
-- Up-to-date: /home/hank/Development/td/build/../tdlib/include/td/telegram/td_log.h
-- Up-to-date: /home/hank/Development/td/build/../tdlib/include/td/telegram/tdjson_export.h
-- Up-to-date: /home/hank/Development/td/build/../tdlib/include/td/telegram/Client.h
-- Up-to-date: /home/hank/Development/td/build/../tdlib/include/td/telegram/Log.h
-- Up-to-date: /home/hank/Development/td/build/../tdlib/include/td/tl/TlObject.h
-- Up-to-date: /home/hank/Development/td/build/../tdlib/include/td/telegram/td_api.h
-- Up-to-date: /home/hank/Development/td/build/../tdlib/include/td/telegram/td_api.hpp
-- Up-to-date: /home/hank/Development/td/build/../tdlib/lib/cmake/Td/TdConfig.cmake
-- Up-to-date: /home/hank/Development/td/build/../tdlib/lib/cmake/Td/TdConfigVersion.cmake
-- Up-to-date: /home/hank/Development/td/build/../tdlib/lib/libtdutils.a
-- Up-to-date: /home/hank/Development/td/build/../tdlib/lib/libtdactor.a
-- Up-to-date: /home/hank/Development/td/build/../tdlib/lib/libtdnet.a
-- Up-to-date: /home/hank/Development/td/build/../tdlib/lib/libtdsqlite.a
-- Up-to-date: /home/hank/Development/td/build/../tdlib/lib/libtddb.a

Also worth noting, I've even restarted my system after doing an install.

zevlg commented 2 years ago

Set telega-server-libs-prefix to "/home/hank/Development/td/build/../tdlib/" before running M-x telega-server-build RET

chookity-pokk commented 2 years ago

How would I do that?

zevlg commented 2 years ago

How would I do that?

Use setq, see https://www.gnu.org/software/emacs/manual/html_node/eintr/Using-setq.html for details

zevlg commented 2 years ago

@ragreenburg any success?

chookity-pokk commented 2 years ago

Sorry, I fell down a rabbit hole here because something unrelated was messing with my entire Emacs config. I got it to launch, plugged in my number and put in the code given then it sent me to this debug buffer:

Debugger entered--Lisp error: (cl-assertion-failed (telega--me-id nil))
  cl--assertion-failed(telega--me-id)
  telega--authorization-ready()
  #f(compiled-function (event) "Proceed with user authorization state change using EVENT." #<bytecode 0x157ad8900011>)((:@type "updateAuthorizationState" :authorization_state (:@type "authorizationStateReady")))
  telega--on-event((:@type "updateAuthorizationState" :authorization_state (:@type "authorizationStateReady")))
  telega-server--dispatch-cmd("event" (:@type "updateAuthorizationState" :authorization_state (:@type "authorizationStateReady")))
  apply(telega-server--dispatch-cmd ("event" (:@type "updateAuthorizationState" :authorization_state (:@type "authorizationStateReady"))))
  telega-server--parse-commands()
  telega-server--filter(#<process telega-server> "event 379\n(:@type \"updateUser\" :user (:@type \"user...")
  recursive-edit()
  debug(error (wrong-type-argument stringp ("BEGIN:VCARD\nVERSION:4.0\nHank\nHank\n+14802522653\nCAR...")))
  string-match("\n" ("BEGIN:VCARD\nVERSION:4.0\nHank\nHank\n+14802522653\nCAR...") 0)
  split-string(("BEGIN:VCARD\nVERSION:4.0\nHank\nHank\n+14802522653\nCAR...") "\n")
  (mapcar #'(lambda (x) (split-string x " " t)) (split-string (list (buffer-substring-no-properties (point-min) (point-max))) "\n"))
  (save-current-buffer (set-buffer (find-file-noselect "test.vcf")) (mapcar #'(lambda (x) (split-string x " " t)) (split-string (list (buffer-substring-no-properties (point-min) (point-max))) "\n")))
  eval((save-current-buffer (set-buffer (find-file-noselect "test.vcf")) (mapcar #'(lambda (x) (split-string x " " t)) (split-string (list (buffer-substring-no-properties (point-min) (point-max))) "\n"))) nil)
  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)

With this in my log:

telega: rootbuf auto fill 70 -> 189 ...done
Entering debugger...
zevlg commented 2 years ago

This looks unrelated to the issue, I'm closing it

Feel free to ask about your runtime error in telegram chat or create a new issue.