~eshel/dev

1

Sweep v0.27.3; Failed to locate 'sweep-module'

Details
Message ID
<878r4b3sp5.fsf@gmail.com>
DKIM signature
pass
Download raw message
 

Hello. I tried to install sweep today (yesterday), and ran into a few problems.

First, I installed SWI Prolog from my distributions (arch linux) package
manager, here is the version:
     -> % swipl --version                                                                                              
     SWI-Prolog version 9.0.4 for x86_64-linux

Then, I installed the sweep package using straight.el package manager,
after mostly following the instructions in
<https://swi-prolog.discourse.group/t/help-getting-sweep-running-failed-to-locate-sweep-module/5997>
(That means I copied the installation recipe from there and changed it a
bit so it can be used by vanilla straight.el and not doom-emacs, and
while I tried to start emacs with LD_PRELOAD set, it didn't seem to
change anything)

Here is the version of straight.el package manager I have installed:
prerelease (HEAD -> master, origin/master, origin/develop, origin/HEAD) b3760f5 2023-10-21

I ended up using the following recipe to install sweep:
  (straight-use-package '(sweeprolog :type git
   :host nil
   :repo "https://git.sr.ht/~eshel/sweep"
   :branch "main"
   :files ("*.el" "sweep.pl")))

Now that sweep.pl is present I am running into a different problem,
namely that when I try to open any prolog file in sweeprolog-mode, I get
the following errors:
    if: Failed to locate ‘sweep-module’. Make sure SWI-Prolog is
    installed and up to dateError during redisplay: (jit-lock-function
    1) signaled (error "Failed to locate ‘sweep-module’. Make sure
    SWI-Prolog is installed and up to date")
    
    Error during redisplay: (eval (when
    (sweeprolog-buffer-loaded-since-last-modification-p) "/Loaded"))
    signaled (error "Failed to locate ‘sweep-module’. Make sure
    SWI-Prolog is installed and up to date")

I also tried to run some stuff that was requested in the aforementioned
linked thread, here is what I got:
      -> % swipl -q -g write_sweep_module_location -t halt /home/dizzar/.config/emacs/straight/build/sweeprolog/sweep.pl
      V 1
      ERROR: -g write_sweep_module_location: source_sink `foreign('sweep-module')' does not exist

Here are the contents of the package directory that straight.el built:
lrwxrwxrwx 1 dizzar dizzar   61 Jan 26 21:58 sweep.pl -> /home/dizzar/.config/emacs/straight/repos/sweeprolog/sweep.pl
-rw-r--r-- 1 dizzar dizzar 8270 Jan 26 21:58 sweeprolog-autoloads.el
lrwxrwxrwx 1 dizzar dizzar   76 Jan 26 21:58 sweeprolog-pce-theme.el -> /home/dizzar/.config/emacs/straight/repos/sweeprolog/sweeprolog-pce-theme.el
-rw-r--r-- 1 dizzar dizzar 5673 Jan 26 21:58 sweeprolog-pce-theme.elc
lrwxrwxrwx 1 dizzar dizzar   72 Jan 26 21:58 sweeprolog-tests.el -> /home/dizzar/.config/emacs/straight/repos/sweeprolog/sweeprolog-tests.el
lrwxrwxrwx 1 dizzar dizzar   66 Jan 26 21:58 sweeprolog.el -> /home/dizzar/.config/emacs/straight/repos/sweeprolog/sweeprolog.el
-rw-r--r-- 1 dizzar dizzar  566 Jan 26 21:58 theme-loaddefs.el

And here are the contents of the repository directory that straight used
to build the package and from which it links files:
-rw-r--r-- 1 dizzar dizzar    614 Jan 26 21:42 CMakeLists.txt
-rw-r--r-- 1 dizzar dizzar   1304 Jan 26 21:42 LICENSE
-rw-r--r-- 1 dizzar dizzar  48947 Jan 26 21:42 NEWS.org
-rw-r--r-- 1 dizzar dizzar   2355 Jan 26 21:42 README.md
-rw-r--r-- 1 dizzar dizzar  24673 Jan 26 21:42 emacs-module.h
-rw-r--r-- 1 dizzar dizzar  19927 Jan 26 21:42 sweep.c
-rw-r--r-- 1 dizzar dizzar   1779 Jan 26 21:42 sweep.doc
-rw-r--r-- 1 dizzar dizzar  94299 Jan 26 21:42 sweep.pl
-rw-r--r-- 1 dizzar dizzar 145449 Jan 26 21:42 sweep.texi
-rw-r--r-- 1 dizzar dizzar   2336 Jan 26 21:42 sweep_link.pl
-rw-r--r-- 1 dizzar dizzar   7985 Jan 26 21:42 sweeprolog-pce-theme.el
-rw-r--r-- 1 dizzar dizzar  61356 Jan 26 21:42 sweeprolog-tests.el
-rw-r--r-- 1 dizzar dizzar 307793 Jan 26 21:42 sweeprolog.el

I am not sure if it is me who is doing something wrong, straight.el or
maybe it is actually a bug, but I couldn't find anything about this issue
on the internet aside from the aforementioned thread.

Have a nice day.

Emacs  : GNU Emacs 29.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.40, cairo version 1.18.0)
Package: Sweep v0.27.3

current state:
==============
(setq
 sweeprolog--directory "/home/dizzar/.config/emacs/straight/build/sweeprolog/"
 sweeprolog--initialized nil
 sweeprolog-init-args '("-q" "--no-signals" "-g" "create_prolog_flag(sweep,true,[access(read_only),type(boolean)])" "-O" "-l"
			"/home/dizzar/.config/emacs/straight/build/sweeprolog/sweep.pl")
 sweeprolog-swipl-path "/usr/lib/swipl/bin/x86_64-linux/swipl"
 system-configuration-features "ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG JSON LCMS2 LIBOTF LIBSYSTEMD LIBXML2 M17N_FLT MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB"
 )
Details
Message ID
<m1wmrvaqhk.fsf@dazzs-mbp.home>
In-Reply-To
<878r4b3sp5.fsf@gmail.com> (view parent)
DKIM signature
pass
Download raw message
Hi,

amtoaster <toastergithubmail@gmail.com> writes:

> Hello. I tried to install sweep today (yesterday), and ran into a few
> problems.

Thank you for this detailed report.  ISTM that the issue is with your
SWI-Prolog installation, see below.

> First, I installed SWI Prolog from my distributions (arch linux) package
> manager, here is the version:
>      -> % swipl --version
>      SWI-Prolog version 9.0.4 for x86_64-linux

The most relevant question is whether your SWI-Prolog installation
provides the `sweep-module` shared library (see
https://eshelyaron.com/man/sweep/Architecture.html for some details).
This version is recent enough to provide this shared library, but it
still depends on how your distribution builds SWI-Prolog.  To check if
you got `sweep-module`, say:

  $ swipl -g check_installation -t halt

If you have it, you should see something like:

  % Loading library(sweep_link) .................. ok
  %   GNU-Emacs plugin loads
  %     M /usr/local/lib/swipl/lib/x86_64-darwin/sweep-module.so

> Then, I installed the sweep package using straight.el package manager,
> after mostly following the instructions in
> <https://swi-prolog.discourse.group/t/help-getting-sweep-running-failed-to-locate-sweep-module/5997>
> (That means I copied the installation recipe from there and changed it a
> bit so it can be used by vanilla straight.el and not doom-emacs, and
> while I tried to start emacs with LD_PRELOAD set, it didn't seem to
> change anything)
>
> Here is the version of straight.el package manager I have installed:
> prerelease (HEAD -> master, origin/master, origin/develop, origin/HEAD) b3760f5 2023-10-21
>
> I ended up using the following recipe to install sweep:
>   (straight-use-package '(sweeprolog :type git
>    :host nil
>    :repo "https://git.sr.ht/~eshel/sweep"
>    :branch "main"
>    :files ("*.el" "sweep.pl")))

This should work fine if you got `sweep-module` with your SWI-Prolog
installation, AFAICT.

One thing that I'm wondering, since I don't use straight.el myself, is
whether this recipe installs the Sweep Info manual along with the code.
Does `M-x sweeprolog-info-manual` work for you?  I'd like to add a
known-good recipe for installing Sweep with straight.el to the
installation instructions, to make it easier for users in the future.

> Now that sweep.pl is present I am running into a different problem,
> namely that when I try to open any prolog file in sweeprolog-mode, I get
> the following errors:
>     if: Failed to locate ‘sweep-module’. Make sure SWI-Prolog is
>     installed and up to dateError during redisplay: (jit-lock-function
>     1) signaled (error "Failed to locate ‘sweep-module’. Make sure
>     SWI-Prolog is installed and up to date")
>
>     Error during redisplay: (eval (when
>     (sweeprolog-buffer-loaded-since-last-modification-p) "/Loaded"))
>     signaled (error "Failed to locate ‘sweep-module’. Make sure
>     SWI-Prolog is installed and up to date")
>
> I also tried to run some stuff that was requested in the aforementioned
> linked thread, here is what I got:
>       -> % swipl -q -g write_sweep_module_location -t halt /home/dizzar/.config/emacs/straight/build/sweeprolog/sweep.pl
>       V 1
>       ERROR: -g write_sweep_module_location: source_sink `foreign('sweep-module')' does not exist

These seem to indicate that your SWI-Prolog installation does not
include `sweep-module.so`.  Can you confirm that this file is absent?

> Here are the contents of the package directory that straight.el built:
> lrwxrwxrwx 1 dizzar dizzar   61 Jan 26 21:58 sweep.pl -> /home/dizzar/.config/emacs/straight/repos/sweeprolog/sweep.pl
> -rw-r--r-- 1 dizzar dizzar 8270 Jan 26 21:58 sweeprolog-autoloads.el
> lrwxrwxrwx 1 dizzar dizzar   76 Jan 26 21:58 sweeprolog-pce-theme.el -> /home/dizzar/.config/emacs/straight/repos/sweeprolog/sweeprolog-pce-theme.el
> -rw-r--r-- 1 dizzar dizzar 5673 Jan 26 21:58 sweeprolog-pce-theme.elc
> lrwxrwxrwx 1 dizzar dizzar   72 Jan 26 21:58 sweeprolog-tests.el -> /home/dizzar/.config/emacs/straight/repos/sweeprolog/sweeprolog-tests.el
> lrwxrwxrwx 1 dizzar dizzar   66 Jan 26 21:58 sweeprolog.el -> /home/dizzar/.config/emacs/straight/repos/sweeprolog/sweeprolog.el
> -rw-r--r-- 1 dizzar dizzar  566 Jan 26 21:58 theme-loaddefs.el
>
> And here are the contents of the repository directory that straight used
> to build the package and from which it links files:
> -rw-r--r-- 1 dizzar dizzar    614 Jan 26 21:42 CMakeLists.txt
> -rw-r--r-- 1 dizzar dizzar   1304 Jan 26 21:42 LICENSE
> -rw-r--r-- 1 dizzar dizzar  48947 Jan 26 21:42 NEWS.org
> -rw-r--r-- 1 dizzar dizzar   2355 Jan 26 21:42 README.md
> -rw-r--r-- 1 dizzar dizzar  24673 Jan 26 21:42 emacs-module.h
> -rw-r--r-- 1 dizzar dizzar  19927 Jan 26 21:42 sweep.c
> -rw-r--r-- 1 dizzar dizzar   1779 Jan 26 21:42 sweep.doc
> -rw-r--r-- 1 dizzar dizzar  94299 Jan 26 21:42 sweep.pl
> -rw-r--r-- 1 dizzar dizzar 145449 Jan 26 21:42 sweep.texi
> -rw-r--r-- 1 dizzar dizzar   2336 Jan 26 21:42 sweep_link.pl
> -rw-r--r-- 1 dizzar dizzar   7985 Jan 26 21:42 sweeprolog-pce-theme.el
> -rw-r--r-- 1 dizzar dizzar  61356 Jan 26 21:42 sweeprolog-tests.el
> -rw-r--r-- 1 dizzar dizzar 307793 Jan 26 21:42 sweeprolog.el
>
> I am not sure if it is me who is doing something wrong, straight.el or
> maybe it is actually a bug, but I couldn't find anything about this issue
> on the internet aside from the aforementioned thread.

See above, so far it looks like an incomplete SWI-Prolog installation.

> Have a nice day.

Likewise!


Eshel
Reply to thread Export thread (mbox)