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

Can't connect to built-in Slynk from compiled Nyxt #3159

Closed
fosskers opened this issue Sep 11, 2023 · 10 comments · Fixed by #3169
Closed

Can't connect to built-in Slynk from compiled Nyxt #3159

fosskers opened this issue Sep 11, 2023 · 10 comments · Fixed by #3169
Assignees

Comments

@fosskers
Copy link

fosskers commented Sep 11, 2023

Describe the bug

With Nyxt 3.6.0 installed from my system's package manager, calling start-slynk and then connecting to it via sly-connect from Emacs opens the CL debugger, claiming the following:

Failed to find the TRUENAME of /build/nyxt/src/_build/sly/contrib/slynk-indentation.lisp:

and indeed a file named slynk-indentation.lisp is nowhere to be found in the files provided by the nyxt package (basically all in /usr/share/nyxt/source/).

Note that this doesn't occur with nyxt built from source (probably because all the build files can be found in the local repo clone).

Precise recipe to reproduce the issue

  1. Install nyxt from a system package manager.
  2. Open it and run start-slynk.
  3. Try to connect to it via sly-connect.
  4. Be greeted by the debugger.

Information

Nyxt version: 3.6.0
Renderer: GI-GTK
Operating system kernel: Linux 6.4.12-arch1-1
Lisp implementation: SBCL 2.3.7 (Dynamic space size: 3221225472)
Features: (:NYXT-GI-GTK :NYXT-GTK :NYXT-GI-GTK :NYXT-GTK :NYXT-3.6 :NYXT-3 :NYXT-3.6.0
 :CLIPBOARD-CONTENT-METHOD :SWANK :SLYNK :PLUMP-UTF-32 :PARENSCRIPT :NSYMBOLS
 :FSET-EXT-STRINGS :SBCL+SAFE-STANDARD-READTABLE :NAMED-READTABLES :GLOBAL-VARS
 :CL-FAD :LPARALLEL :21BIT-CHARS :CUSTOM-HASH-TABLE-NATIVE :CL-PPCRE-UNICODE
 :CL-UNICODE :CL-JSON-DOUBLE-FLOAT-IS-SUBSUMED
 :CL-JSON-SINGLE-FLOAT-IS-SUBSUMED :CHUNGA :FLEXI-STREAMS :CL-PPCRE :WEBKIT2
 :WEBKIT-2.40.5 :WEBKIT-2.40 :WEBKIT-2 :WEBKIT2-CORS-ALLOWLIST
 :WEBKIT2-PASTE-PLAINTEXT :WEBKIT2-TRACKING :WEBKIT2-MUTE :WEBKIT2-EMOJI
 :WEBKIT2-MEDIA :WEBKIT2-SANDBOXING :GTK-3-22 :GTK-3-20 :GTK-3-18 :GTK-3-16
 :GTK-3-14 :GTK-3-12 :GTK-3-10 :GTK-3-8 :GTK-3-6 :GTK-3-4 :GTK :GDK-3-22
 :GDK-3-20 :GDK-3-18 :GDK-3-16 :GDK-3-14 :GDK-3-12 :GDK-3-10 :GDK-3-8 :GDK-3-6
 :GDK-3-4 :CAIRO-1-10 :CAIRO-1-12 :GDK-PIXBUF :CLOSER-MOP :GLIB-2-30 :GLIB-2-32
 :GLIB-2-34 :GLIB-2-36 :GLIB-2-38 :GLIB-2-40 :GLIB-2-42 :GLIB-2-44 :GLIB-2-46
 :GLIB-2-48 :GLIB-2-50 :GLIB-2-52 :GLIB-2-54 :GLIB-2-56 :GLIB-2-58 :GLIB
 :BORDEAUX-THREADS :LPARALLEL.WITH-CLTL2 :LPARALLEL.WITH-CAS
 :LPARALLEL.WITH-STEALING-SCHEDULER :SPLIT-SEQUENCE
 CFFI-FEATURES:FLAT-NAMESPACE CFFI-FEATURES:X86-64 CFFI-FEATURES:UNIX :CFFI
 CFFI-SYS::FLAT-NAMESPACE ALEXANDRIA::SEQUENCE-EMPTYP :FAST-IO-SV :FAST-IO
 :CL-JSON-CLOS :CL-JSON :SBCL-USES-SB-ROTATE-BYTE CHIPZ-SYSTEM:GRAY-STREAMS
 :THREAD-SUPPORT :ASDF3.3 :ASDF3.2 :ASDF3.1 :ASDF3 :ASDF2 :ASDF :OS-UNIX
 :NON-BASE-CHARS-EXIST-P :ASDF-UNICODE :ARENA-ALLOCATOR :X86-64 :GENCGC :64-BIT
 :ANSI-CL :COMMON-LISP :ELF :IEEE-FLOATING-POINT :LINUX :LITTLE-ENDIAN
 :PACKAGE-LOCAL-NICKNAMES :SB-CORE-COMPRESSION :SB-LDB :SB-PACKAGE-LOCKS
 :SB-THREAD :SB-UNICODE :SBCL :UNIX)

ASDF version: 3.3.1
ASDF registries: (NYXT-SOURCE-REGISTRY ENVIRONMENT-SOURCE-REGISTRY)
Critical dependencies: (/build/nyxt/src/_build/cl-cffi-gtk/gtk/cl-cffi-gtk.asd
 /build/nyxt/src/_build/cl-gobject-introspection/cl-gobject-introspection.asd
 /build/nyxt/src/_build/cl-webkit/webkit2/cl-webkit2.asd)

Output when started from a shell

Nyxt version 3.6.0
<INFO> [20:18:54] Source location: #P"/usr/share/nyxt/"
<INFO> [20:18:54] Loading Lisp file #P"/home/colin/.config/nyxt/auto-config.3.li<INFO> [20:18:54] Listening to socket: #P"/run/user/1000/nyxt/nyxt.socket"

** (nyxt:58013): WARNING **: 20:18:54.956: Error loading plugin: libnuspell.so.5ject file: No such file or directory

<INFO> [20:18:55] Loading #P"/home/colin/.local/share/nyxt/history/default.lisp".

(WebKitWebProcess:2): Gdk-WARNING **: 20:18:55.487: Failed to read portal settings: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such interface “org.freedesktop.portal.Settings” on object at path /org/freedesktop/portal/desktop

(WebKitWebProcess:2): Gdk-WARNING **: 20:18:55.500: Failed to read portal settings: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such interface “org.freedesktop.portal.Settings” on object at path /org/freedesktop/portal/desktop
<INFO> [20:18:55] Restoring 2 buffers from history.
<INFO> [20:18:55] Loading #P"/home/colin/.local/share/nyxt/auto-rules.lisp".

(WebKitWebProcess:2): Gdk-WARNING **: 20:18:55.858: Failed to read portal settin
gs: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such interface “org
.freedesktop.portal.Settings” on object at path /org/freedesktop/portal/desktop
<WARN> [20:18:55] Warning: Error while processing the "nyxt:" URL: There is no a
pplicable method for the generic function #&lt;STANDARD-GENERIC-FUNCTION NYXT:ST
YLE (17)&gt; when called with arguments (NIL).
See also:
  The ANSI Standard, Section 7.6.6

(WebKitWebProcess:2): Gdk-WARNING **: 20:18:56.030: Failed to read portal settin
gs: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such interface “org
.freedesktop.portal.Settings” on object at path /org/freedesktop/portal/desktop
<WARN> [20:18:56] Warning: Error while processing the "nyxt:" URL: None of the c
ommands are installed: (&quot;wl-copy&quot; &quot;xclip&quot; &quot;xsel&quot;)
<INFO> [20:18:56] Failed to load URL nyxt:show-system-information in buffer 6648
.
<INFO> [20:18:57] Deleting socket #P"/run/user/1000/nyxt/nyxt.socket".
@aadcg
Copy link
Member

aadcg commented Sep 11, 2023

Thanks @fosskers for reporting.

Note that it works on Guix, the only package manager for which the Nyxt team curates the distribution officially.

Duplicate of #3153. I'm still not sure how we should fix it. I need to study where SLY and Slime look for the server files.

As a dirty hot fix, you may copy the files to that directory.

@fosskers
Copy link
Author

Ah apologies, I looked for similar reports but didn't find one, and yet there it is plain as day.

Is there a way to configure Nyxt to look in the usual ASDF locations for CL dependencies? For a build provided by a system package manager, certainly /build/nyxt/src/_build/sly/contrib/ would never normally exist.

@aadcg
Copy link
Member

aadcg commented Sep 12, 2023

@fosskers my impression is as follows (though I need to dig deeper). Nyxt ships Slynk (so that it can start the server) and there's another Slynk available at your machine locally so that you connect to the server. The issue here is that the locally available Slynk is trying to use the Slynk that Nyxt ships, instead of the local one.

@fosskers
Copy link
Author

Ah well I do have the sly Emacs package installed, but when one runs sly-connect it just connects to whatever slynk server is running, even if that's running remotely (say, through an SSH tunnel).

So I suspect the issue is not due to a conflict of two Slynks.

Looking at the path it's trying to find, it looks like an absolute path:

/build/nyxt/src/_build/sly/contrib/

But certainly /build/ would never exist on a normal Unix system. Is Nyxt assuming that those absolute-looking paths would be interpreted in a special way relative to some custom-set Nyxt-specific ASDF path?

@fosskers
Copy link
Author

fosskers commented Sep 13, 2023

Actually, is there a way for me, when connected to the Slynk within Nyxt, to query the runtime about where it thinks /build/nyxt/... is? Like, where Nyxt expects its build files to be?

Doing all of this from master works probably because I have nyxt cloned to ~/common-lisp/, but the same can't be said of the nyxt that comes from the system package manager.

@aadcg aadcg self-assigned this Sep 14, 2023
@aadcg
Copy link
Member

aadcg commented Sep 14, 2023

I'm fixing it soon @fosskers. You'll notify you if you're interested in testing it.

@fosskers
Copy link
Author

Thank you yes, I'd be happy to.

@aadcg
Copy link
Member

aadcg commented Sep 21, 2023

I finally understood it! Look a while unfortunately, but after all it wasn't so hard. I'll open a PR soon.

@aadcg aadcg mentioned this issue Sep 21, 2023
3 tasks
@fosskers
Copy link
Author

Thank you very much!

@aadcg
Copy link
Member

aadcg commented Sep 26, 2023

start-slynk works if you get Nyxt from the official means of distribution.

For other platforms, see this hint or wait until #3169 is merged.

@aadcg aadcg closed this as completed Sep 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants