Subject: Re: [bug#71239] [PATCH] gnu: Add emacs-dape.

From: Jelle Licht <[email-masked]>
Date: Sun, 09 Jun 2024 22:52:32 +0200

Hi Nicolas,

I've got some nitpicks, and one question as the package does not seem to
run for me, which could very well be an issue on my end.

Nicolas Graves via Guix-patches via <[email-masked]> writes:

> * gnu/packages/emacs-xyz.scm (emacs-dape): New variable.
>
> Change-Id: Ia07745dd47b2e1e5b85654a5b4b2400dd4c4cc13
> ---
>  gnu/packages/emacs-xyz.scm | 52 ++++++++++++++++++++++++++++++++++++++
>  1 file changed, 52 insertions(+)
>
> diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
> index 1c890a5b008..9f93d582f3f 100644
> --- a/gnu/packages/emacs-xyz.scm
> +++ b/gnu/packages/emacs-xyz.scm
> @@ -31088,6 +31088,58 @@ (define-public emacs-lsp-docker
>  in Docker environment.")
>        (license license:gpl3+))))
>  
> +(define-public emacs-dape
> +  (let ((commit "51fad7df7473778fbc4bac703317de7f7713b307")
> +        (revision "0"))
> +    (package
> +      (name "emacs-dape")
> +      (version (git-version "0.12.0" revision commit))
Is there a particular reason not to stick to the 'proper' releases? 
If so, could you add a comment explaining why?

> +      (source
> +       (origin
> +         (method git-fetch)
> +         (uri (git-reference
> +               (url "https://github.com/svaante/dape")
> +               (commit commit)))
> +         (file-name (git-file-name name version))
> +         (sha256
> +          (base32 "1jics02b9fxjs0lykiv7z924z18id550mqhf6piqzv0sgan91pg2"))))
> +      (build-system emacs-build-system)
> +      (arguments
> +       ;; FIXME python tests pass, JS tests require additional dependencies
> +       ;; See https://lists.sr.ht/~abcdw/rde-devel/patches/51878
> +       (list #:tests? #f
Can't we patch out or disable the JS tests, instead of not running any tests?

> +             #:test-command #~'("emacs" "--batch" "-l" "dape.el"
> +                                "-l" "dape-tests.el"
> +                                "-f" "ert-run-tests-batch-and-exit")
> +             #:phases
> +             #~(modify-phases %standard-phases
> +                 (add-after 'unpack 'support-unwrapped-python
> +                   (lambda _
> +                     (substitute* "dape.el"
> +                       (("command \"python\"")
> +                        "command \"python3\""))))

I don't think we do this kind of patching for other packages, but I
could be mistaken of course. If this was needed to get the python tests
to succeed, maybe it could also work with python-minimal-wrapper instead
of patching.

> +                 (add-before 'check 'pre-check
> +                   (lambda* (#:key tests? inputs #:allow-other-keys)
> +                     (if tests?
> +                         (setenv
> +                          "PATH"
> +                          (string-append
> +                           (getenv "PATH")
> +                           ":" (dirname (search-input-file inputs "/bin/python3"))
> +                           ":" (dirname (search-input-file inputs "/bin/node"))))

Ditto wrt my earlier remark about the JS tests.

> +                         (format #t "test suite not run~%")))))))
> +      (native-inputs (list node-lts python-minimal python-debugpy))
> +      (propagated-inputs (list emacs-jsonrpc))

Did running this package once installed actually work on your local
setup?  If so, I'd love to know how you are running this package, as I'm
running into the issue as the one I reported at
https://issues.guix.gnu.org/71065

> +      (home-page "https://github.com/svaante/dape")
> +      (synopsis "Debug Adapter Protocol for Emacs")
> +      (description
> +       "Dape is a debug adapter client for Emacs.  The debug adapter protocol,
> +much like its more well-known counterpart, the language server protocol,
> +aims to establish a common API for programming tools.  However, instead of
> +functionalities such as code completions, it provides a standardized
> +interface for debuggers.")
> +      (license license:gpl3+))))
> +
>  (define-public emacs-dap-mode
>    (package
>      (name "emacs-dap-mode")
> -- 
> 2.41.0

Thanks for the package,
 - Jelle