unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: "Ricardo G. Herdt" <r.herdt@posteo.de>
To: 60286@debbugs.gnu.org
Subject: [bug#60286] [PATCHES] Add guile's implementation for scheme-lsp-server
Date: Sun, 17 Sep 2023 08:29:50 +0000	[thread overview]
Message-ID: <64b9e6079f9ce79d7abecd452059bbce@posteo.de> (raw)
In-Reply-To: <871qgfrxu8.fsf@trop.in>

Hi Andrew,

Thanks for the feedback. Could you please show the error you get when 
running guile-lsp-server? I'm using Guix on top of Debian, and running 
`guile-lsp-server` with the prefixes set works:

GUILE_LOAD_PATH=...:${HOME}/.guix-profile/share/guile/site/3.0/ 
GUILE_LOAD_COMPILED_PATH=...:${HOME}/.guix-profile/lib/guile/3.0/site-ccache 
./guile-lsp-server --version

Regards,

Ricardo


Am 07.08.2023 11:44 schrieb Andrew Tropin:
> On 2023-06-21 19:27, Ricardo G. Herdt wrote:
> 
> Hi Ricardo, thank you very much for the patches and working on
> guile-lsp-server.
> 
>> * gnu/packages/guile-xyz.scm: add guile-lsp-server;
>>    (guile-scheme-json-rpc): update to 0.4.0, change dependencies
>> 
>> Original package author Giacomo Leidi. Adapted to use
>> guile-scheme-json-rpc.
>> ---
>>   gnu/packages/guile-xyz.scm | 97 
>> +++++++++++++++++++++++++++++++++++---
>>   1 file changed, 91 insertions(+), 6 deletions(-)
>> 
>> diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm
>> index db7be432cc..1195e0e328 100644
>> --- a/gnu/packages/guile-xyz.scm
>> +++ b/gnu/packages/guile-xyz.scm
>> @@ -1054,9 +1054,9 @@ (define-public guile2.2-sjson
>>       (inputs (list guile-2.2))))
>> 
>>   (define-public guile-scheme-json-rpc
>> -  (let ((commit "45ae6890f6619286f5679f88c094c88127b54c4a")
>> +  (let ((commit "50acef7b824e2d23140e48242020f5fdc85cc67d")
> 
> For tagged release there is no need for commit and revision, I'll 
> remove
> them and apply the part of the patch related to guile-scheme-json-rpc
> version update as separate commit.
> 
>>           (revision "0")
>> -        (version "0.2.11"))
>> +        (version "0.4.0"))
>>       (package
>>         (name "guile-scheme-json-rpc")
>>         (version (git-version version revision commit))
>> @@ -1068,16 +1068,20 @@ (define-public guile-scheme-json-rpc
>>                   (file-name (git-file-name name version))
>>                   (sha256
>>                    (base32
>> -
>> "0w4m8xx8yyj0rv0q57mjr8ja87l7yikscj33i3ck26wg7230ppa5"))))
>> +
>> "0jsampz2ahs18z6yh9b5l3lkj8ycnavs0vg9sjngdj3w3zvrdcvm"))))
>>         (build-system gnu-build-system)
>>         (arguments
>>          `(#:phases (modify-phases %standard-phases
>>                       (add-after 'unpack 'change-to-guile-dir
>>                         (lambda _
>>                           (chdir "guile"))))))
>> -      (inputs (list guile-3.0 guile-json-3))
>> -      (native-inputs (list pkg-config))
>> -      (synopsis "Library providing JSON-RPC capability in Scheme")
>> +      (inputs (list guile-3.0 guile-srfi-145 guile-srfi-180))
>> +      (native-inputs (list autoconf
>> +                           automake
>> +                           pkg-config
>> +                           texinfo
>> +                           guile-3.0))
> 
> auto tools is already provided by gnu-build-system, no need to provide
> them one more time.  I don't see any texi docs, so probably texinfo is
> not needed.  Also guile-3.0 in native (build host side) inputs also not
> needed.  Removed.
> 
>> +      (synopsis "Library providing JSON-RPC capability for Guile
>> Scheme")
>>         (description
>>          "This library implements parts of the
>>   @uref{https://www.jsonrpc.org/specification,JSON-RPC specification},
>> allowing
>> @@ -1085,6 +1089,87 @@ (define-public guile-scheme-json-rpc
>>         (home-page "https://codeberg.org/rgherdt/scheme-json-rpc/")
>>         (license license:expat))))
>> 
>> +(define-public guile-lsp-server
>> +  (package
>> +    (name "guile-lsp-server")
>> +    (version "0.4.0")
>> +    (source
>> +     (origin
>> +      (method git-fetch)
>> +      (uri (git-reference
>> +            (url 
>> "https://codeberg.org/rgherdt/scheme-lsp-server.git")
>> +            (commit version)))
>> +      (file-name (git-file-name name version))
>> +      (sha256
>> +       (base32
>> +        "04fc76pnl8mrwrjw49xhzs4r0dx2vh4gy2y151p33hahylf5z1xs"))))
>> +    (build-system gnu-build-system)
>> +    (arguments
>> +     (list #:modules `((ice-9 match)
>> +                       (ice-9 ftw)
>> +                       ,@%gnu-build-system-modules)
>> +           #:phases
>> +           #~(modify-phases %standard-phases
>> +               (add-after 'unpack 'move-to-guile-directory
>> +                 (lambda _
>> +                   (chdir "./guile")))
>> +               (add-after 'install 'wrap-entrypoint
>> +                 (lambda _
>> +                   (let* ((bin (string-append #$output "/bin"))
>> +                          (site (string-append #$output
>> +                                               "/share/guile/site"))
>> +                          (deps (list #$guile-scheme-json-rpc)))
> 
> It's better to use (assoc-ref inputs ...) here, because
> #$guile-scheme-json-rpc will hardcode the exact package and if someone
> will try to inherit from guile-lsp-server and override
> guile-scheme-json-rpc input, it won't make a desired effect and
> hardcoded version of guile-scheme-json-rpc will be used.
> 
> Also, guile-lsp-server executable doesn't run, it's very likely that
> other required dependencies are missing here in the deps variable.
> 
>> +                     (match (scandir site)
>> +                       (("." ".." version)
>> +                        (let ((modules (string-append site "/"
>> +                                                      version))
>> +                              (compiled-modules (string-append 
>> #$output
>> +                                                 "/lib/guile/"
>> +                                                 version
>> +                                                 "/site-ccache")))
>> +                          (wrap-program (string-append bin
>> +                                         "/guile-lsp-server")
>> +                                        `("GUILE_LOAD_PATH" ":"
>> +                                          prefix
>> +                                          (,modules
>> +                                           ,@(map (lambda (dep)
>> +                                                    (string-append
>> +                                                     dep
>> +
>> "/share/guile/site/"
>> +                                                     version))
>> +                                                  deps)))
>> +                                        `("GUILE_LOAD_COMPILED_PATH"
>> +                                          ":" prefix
>> +                                          (,compiled-modules
>> +                                           ,@(map (lambda (dep)
>> +                                                    (string-append
>> +                                                     dep
>> +                                                     "/lib/guile/"
>> +                                                     version
>> +                                                     "/site-ccache"))
>> +                                              deps))))
>> +                          #t)))))))))
>> +    (native-inputs (list pkg-config))
>> +    (inputs
>> +     ;; Depend on the latest Guile to avoid bytecode compatibility
>> issues when
>> +     ;; using modules built against the latest version.
>> +     (list bash-minimal
>> +           guile-3.0-latest))
>> +    (propagated-inputs (list guile-irregex
>> +                             guile-scheme-json-rpc
>> +                             guile-srfi-145
>> +                             guile-srfi-180))
> 
> For standalone programs like guile-lsp-server, where we manually
> construct GUILE_LOAD_PATH it's not needed to propagate dependencies in
> the profile, where package is installed.  It should be just inputs.
> 
>> +    (synopsis "LSP (Language Server Protocol) server for Scheme")
>> +    (description
>> +     "@code{guile-lsp-server} is an implementation for Guile of the 
>> LSP
>> +specification.  This software aims to support several Scheme
>> implementations.
>> +To achieve this, the code is designed to contain as much logic as
>> possible in
>> +R7RS Scheme, separating implementation-specific code in different
>> modules.
>> +
>> +This package delivers Guile's implementation for
>> @code{scheme-lsp-server}.")
>> +    (home-page "https://codeberg.org/rgherdt/scheme-lsp-server")
>> +    (license license:expat)))
>> +
>>   (define-public guile-squee
>>     (let ((commit "fab9d9590792f3ededd4abd8cfa6be5e56659678")
>>           (revision "4"))
>> 
>> base-commit: 392f9db97687bfb6195e65a28e1710f22b6cb972
> 
> Applied first part of the patch, pushed as
> https://git.savannah.gnu.org/cgit/guix.git/commit/?id=56667ee55c
> 
> Please update the guile-lsp-server package definition to make it work
> (right now package builds, but executable fails to run).
> 
> P.S. Thanks to Giacomo for spinning up this thread!




  reply	other threads:[~2023-09-17  8:31 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-23 20:26 [bug#60286] [PATCHES] Add guile's implementation for scheme-lsp-server goodoldpaul--- via Guix-patches via
2022-12-23 20:46 ` [bug#60286] [PATCH 1/2] gnu: Add guile-scheme-json-rpc Giacomo Leidi via Guix-patches via
2022-12-23 20:46   ` [bug#60286] [PATCH 2/2] gnu: Add guile-scheme-lsp-server Giacomo Leidi via Guix-patches via
2022-12-31 16:23 ` [bug#60286] [PATCHES] Add guile's implementation for scheme-lsp-server Abhishek Cherath
2023-01-02  1:52 ` goodoldpaul--- via Guix-patches via
2023-04-12 20:43   ` goodoldpaul--- via Guix-patches via
2023-01-02  2:00 ` [bug#60286] [PATCHv2 1/2] gnu: Add guile-scheme-json-rpc Giacomo Leidi via Guix-patches via
2023-01-02  2:00   ` [bug#60286] [PATCHv2 2/2] gnu: Add guile-scheme-lsp-server Giacomo Leidi via Guix-patches via
2023-04-12 20:44 ` [bug#60286] [v3 1/2] gnu: Add guile-scheme-json-rpc Giacomo Leidi via Guix-patches via
2023-04-12 20:44   ` [bug#60286] [v3 2/2] gnu: Add guile-scheme-lsp-server Giacomo Leidi via Guix-patches via
2023-06-21 19:16 ` [bug#60286] [PATCHES] Add guile's implementation for scheme-lsp-server Ricardo G. Herdt
2023-06-21 19:27   ` Ricardo G. Herdt
2023-08-07  9:44     ` Andrew Tropin
2023-09-17  8:29       ` Ricardo G. Herdt [this message]
2023-09-05  3:59 ` [bug#60286] [PATCH v2] gnu: Add emacs-flymake-guile Distopico

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=64b9e6079f9ce79d7abecd452059bbce@posteo.de \
    --to=r.herdt@posteo.de \
    --cc=60286@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).