atlas-engineer / nyxt

Nyxt - the hacker's browser.
https://nyxt-browser.com/
9.88k stars 413 forks source link

Unable to load webkit when trying to run in guix container #938

Closed elais closed 4 years ago

elais commented 4 years ago

Describe the bug When trying to run Nyxt in a container I get the error: 'Problem running initialization hook GLIB::RUN-INITIALIZERS' followed by a message saying unable to load webkit errors. See below. Are the docs outdated or am I missing something? Running IceCat in a container works just fine.

Unhandled SIMPLE-ERROR in thread #<SB-THREAD:THREAD "main thread" RUNNING
                                    {10007380D3}>:
  Problem running initialization hook GLIB::RUN-INITIALIZERS:
  Unable to load any of the alternatives:
   ("/gnu/store/614fwp0ar47czqywa9x68msidp374iz6-webkitgtk-2.28.4/lib/libwebkit2gtk-4.0.so"
    "/gnu/store/614fwp0ar47czqywa9x68msidp374iz6-webkitgtk-2.28.4/lib/libwebkit2gtk-3.0.so.25.10.9"
    "/gnu/store/614fwp0ar47czqywa9x68msidp374iz6-webkitgtk-2.28.4/lib/libwebkit2gtk-3.0.so.25.10.8"
    "/gnu/store/614fwp0ar47czqywa9x68msidp374iz6-webkitgtk-2.28.4/lib/libwebkit2gtk-3.0.so.25.10.7"
    "/gnu/store/614fwp0ar47czqywa9x68msidp374iz6-webkitgtk-2.28.4/lib/libwebkit2gtk-3.0.so.25")

Backtrace for: #<SB-THREAD:THREAD "main thread" RUNNING {10007380D3}>
0: (SB-DEBUG::DEBUGGER-DISABLED-HOOK #<SIMPLE-ERROR "Problem running ~A hook ~S:~%  ~A" {1005DB38A3}> #<unused argument> :QUIT T)
1: (SB-DEBUG::RUN-HOOK *INVOKE-DEBUGGER-HOOK* #<SIMPLE-ERROR "Problem running ~A hook ~S:~%  ~A" {1005DB38A3}>)
2: (INVOKE-DEBUGGER #<SIMPLE-ERROR "Problem running ~A hook ~S:~%  ~A" {1005DB38A3}>)
3: (ERROR #<SIMPLE-ERROR "Problem running ~A hook ~S:~%  ~A" {1005DB38A3}>)
4: (SB-KERNEL:WITH-SIMPLE-CONDITION-RESTARTS ERROR NIL "Problem running ~A hook ~S:~%  ~A" "initialization" GLIB::RUN-INITIALIZERS #<CFFI:LOAD-FOREIGN-LIBRARY-ERROR "Unable to load any of the alternatives:~%   ~S" {1005DB3803}>)
5: (SB-INT:CALL-HOOKS "initialization" (GLIB::RUN-INITIALIZERS LOG4CL-IMPL::INIT-HOOK) :ON-ERROR :ERROR)
6: ((FLET SB-UNIX::BODY :IN SB-IMPL::START-LISP))
7: ((FLET "WITHOUT-INTERRUPTS-BODY-1" :IN SB-IMPL::START-LISP))
8: (SB-IMPL::START-LISP)

Precise recipe to reproduce the issue Just try to run this command as shown in the documentation.

guix environment --container --network --preserve='^DISPLAY$' --expose=/etc/ssl/certs --expose="$HOME/.config/nyxt/" --share="$HOME/.local/share/nyxt/" --ad-hoc nss-certs nyxt -- nyxt

Information

Output when started from a shell Nyxt version 2-pre-release-1

[02:07:38] Loading Lisp file "/home/elais/.config/nyxt/init.lisp". [02:07:38] Using data profile "default". [02:07:38] Listening to socket "/home/elais/.local/share/nyxt/nyxt.socket". [02:07:38] Restoring session "/home/elais/.local/share/nyxt/sessions/default.lisp". [02:07:38] Restoring (https://github.com/atlas-engineer/nyxt/issues/492 https://old.reddit.com/r/unixporn/comments/64mihc/i3_kde_plasma_a_match_made_in_heaven/ https://blogs.oracle.com/pranav/how-to-find-out-cpu-utilization-in-linux https://stumpwm.github.io/git/stumpwm-git_8.html#Groups https://github.com/atlas-engineer/nyxt/tree/master/documents https://lists.gnu.org/archive/html/help-guix/2018-01/msg00056.html). (process:28593): libsoup-WARNING **: 02:07:39.128: Failed to execute query: table soup_hsts_policies already exists
Ambrevar commented 4 years ago

Looks like a grafting issue. Which command did you run?

elais commented 4 years ago

When installing or running? The command I ran with is up there.

I'll try reinstalling with --no-grafts

Ambrevar commented 4 years ago

Sorry, I initially missed the command you shared. Try running with --no-grafts and let me know if it does the trick!

elais commented 4 years ago

Thanks Ambrevar running with --no grafts indeed solved my problem! Now on to the work of making sure everything I need is in the environment.

I'm closing this issue but for posterity's sake why did running with --no-grafts fix it? Were dependencies just out of scope?

Ambrevar commented 4 years ago

I'll add --no-grafts to the doc, thanks for confirming!

The issue is with Guix "reference scanner" which does not support non-ASCII non-UTF8 encodings.

See https://issues.guix.info/33848 for a discussion.