From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id yJvwHk25BmUL1gAAG6o9tA:P1 (envelope-from ) for ; Sun, 17 Sep 2023 10:31:09 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id yJvwHk25BmUL1gAAG6o9tA (envelope-from ) for ; Sun, 17 Sep 2023 10:31:09 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id BF9C3616A3 for ; Sun, 17 Sep 2023 10:31:08 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=posteo.de header.s=2017 header.b=XxrO0Ext; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (strict)" header.from=posteo.de (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1694939469; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=mpd7rGSYmwsh42N109Cy5b127qsUdpl9Jhl+xT0uYP0=; b=U6bZrSqasV/AfPtMmsq8YGWQu12f1pOwCwhZ2IM1elp6OFZc5S4sXwEvQqa25ZloKExtkt AiqWFMrKoMI/qtzXz8cWE3AjXM+f9uLpyy+kQMiyv2xS0YNDZjFDIXv90FrJLvsQ9F/HtC XZbp/OAiKxugE+9KG8V6bbmIILhmzptYGApIcMgDb0jlIICLEVWQKfSzjqES+cuL9yiTH+ LcJcaHdLTWnOz7KN4UiTTSWG1tfeqWeKtteW5vnmouYgg/9cYRI4373aHF1YOiKBRFIaec aCXzW4NXwUGVmOE3beJGwv8oxGIObIVPlJ8xY1PW2tZkbRsg9RRCYEhVRJjMWg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=posteo.de header.s=2017 header.b=XxrO0Ext; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (strict)" header.from=posteo.de (policy=none) ARC-Seal: i=1; s=key1; d=yhetil.org; t=1694939469; a=rsa-sha256; cv=none; b=EY2s5BKdaSqfew4vNRH02kQdiRHdHX7+RnlcoW9tYoLuMPAc8Eh8I8NsR3c9BEPrjVvt9p PlnHIRFqYe//2vOXEN3ATv1+6S9DRlEqx0ptaCmocdcSyDTglbh56Mf1iv30lU46JhQ360 BR4Kwo99GZK2hcXXcZbo+W0KOHlqR8Ibqok5+gTb0pX0p+cVvHvK78fpp4TH471zVaK7Vq hmKX4GcKoX2Mh3sYbobpNbFO/L0MB8FsHsGf4iQICJnBYsIS//q3eoXTEuYFxocuBYkArc NGGA4+XdieHyscsvKT5/1EcJLr5r3EBEk72yNumZRFd7JSpCSLBDHwh3570lqw== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qhnBA-0007mW-P5; Sun, 17 Sep 2023 04:30:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qhnB8-0007gu-Iw for guix-patches@gnu.org; Sun, 17 Sep 2023 04:30:54 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qhnB8-0001rz-AI for guix-patches@gnu.org; Sun, 17 Sep 2023 04:30:54 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qhnBF-0000tv-PO for guix-patches@gnu.org; Sun, 17 Sep 2023 04:31:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#60286] [PATCHES] Add guile's implementation for scheme-lsp-server Resent-From: "Ricardo G. Herdt" Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 17 Sep 2023 08:31:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60286 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 60286@debbugs.gnu.org Received: via spool by 60286-submit@debbugs.gnu.org id=B60286.16949394093400 (code B ref 60286); Sun, 17 Sep 2023 08:31:01 +0000 Received: (at 60286) by debbugs.gnu.org; 17 Sep 2023 08:30:09 +0000 Received: from localhost ([127.0.0.1]:49020 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qhnAO-0000sk-UP for submit@debbugs.gnu.org; Sun, 17 Sep 2023 04:30:09 -0400 Received: from mout02.posteo.de ([185.67.36.66]:38329) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qhnAL-0000qe-5f for 60286@debbugs.gnu.org; Sun, 17 Sep 2023 04:30:07 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 713E1240101 for <60286@debbugs.gnu.org>; Sun, 17 Sep 2023 10:29:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1694939391; bh=DLWdTiCth35CZTXMvin8o268DCRkbl+iaVYWZVIw5bA=; h=MIME-Version:Content-Transfer-Encoding:Date:From:To:Subject: Message-ID:From; b=XxrO0ExtlA4ybFzrl19LDg7vfh08bCYjVO1GnTIp4rMssav0bvS+IMakH+iyUELBO hh7pgr5HG2InwNyErv8Qlzjgn45hciB+rMt0+DOUrSLiaqC/YOSf3E2qm/jLwdb4HV wTm5SyQPXS9NnUaFkJBuyLnULA3tflScC9c2/RIBJVhkEoP03dFokQksTBrslKRH3K 6+RhJJ7g71zarEpdE4gfej8Q3ORblwdT4biIcmFfXcALXb5EFO49O7uK1k4o7MRDks aRFvrE4q4S9Qm3EaBxV8DRWTpGPwyS8xSAPw8LaZokBmuLscmrWD1S9ZKPs5PaXwPw 8a5zFlP0fi8ZQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4RpLhH0VG8z9rxF for <60286@debbugs.gnu.org>; Sun, 17 Sep 2023 10:29:50 +0200 (CEST) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Sun, 17 Sep 2023 08:29:50 +0000 From: "Ricardo G. Herdt" In-Reply-To: <871qgfrxu8.fsf@trop.in> References: <826bc5ec20281f371ab62befc19d3b51@posteo.de> <890f1480abf9e421aa3301a0e857ee2f@posteo.de> <871qgfrxu8.fsf@trop.in> Message-ID: <64b9e6079f9ce79d7abecd452059bbce@posteo.de> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Scanner: mx1.migadu.com X-Migadu-Spam-Score: -0.51 X-Spam-Score: -0.51 X-Migadu-Queue-Id: BF9C3616A3 X-TUID: tx1GovZ/iEEV 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!