unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: Rodrigo Morales <moralesrodrigo1100@gmail.com>
To: help-guix@gnu.org
Subject: Newbie: How to debug my custom packages? Is there something like Emacs' edebug but for Guix packages?
Date: Fri, 7 Apr 2023 04:20:46 +0000	[thread overview]
Message-ID: <CAGxMbPaXDZu8StdSDhE78W5kpU6UQbqXvEUr8zS9LeL2MeRDBA@mail.gmail.com> (raw)

Table of Contents
_________________

1. The problem
2. Additional information


1 The problem
=============

  I'm learning how to define my own Guix packages. To debug the packages
  that I write, I'm currently repeatedly executing the command `guix
  package -i' , check whether the downloaded files have been placed in
  the correct locations. If the installation failed, I switched back to
  the previous generation, do some changes and repeat the same
  process. However, I feel there's a better way to do this, because this
  is a rather slow process. Besides that, there are some variables whose
  value I don't know how to print or see their current value during the
  entire installation of the package.

  For example, I've defined the following Guix package (see code block
  below). In this package, I'd like to be able to know the result of the
  evaluation of `(string-append #$output "/share/rime-data")' during
  installation. I know this can be inferred, because `#$output' is a
  commonly used term. However, some sexps are more complex and I'd also
  be interested in see the results they yield to.

  ,----
  | (define-module (rime)
  |   #:use-module (guix licenses)
  |   #:use-module (guix packages)
  |   #:use-module (guix gexp)
  |   #:use-module (guix build-system trivial)
  |   #:use-module (guix git-download))
  |
  | (define-public rime-wubi-8105
  |   (package
  |    (name "rime-wubi-8105")
  |    (version "1.0")
  |    (source (origin
  |             (method git-fetch)
  |             (uri (git-reference
  |                   (url "https://github.com/rdrg109/wubi-8105")
  |                   (commit "3e81f26ac6f261ad5bb361ef23bc4a7df6a088d1")))
  |             (file-name (git-file-name name version))
  |             (sha256
  |              (base32
  |               "133vf7gsicqikv4kyl1rx0d1yiblgihis1x8gm9h21k59ql8gadn"))))
  |    (build-system trivial-build-system)
  |    (arguments
  |     (list
  |      #:modules `((guix build utils))
  |      #:builder
  |      #~(begin
  |          (use-modules (guix build utils))
  |          (chdir (assoc-ref %build-inputs "source"))
  |          (install-file "wubi86_8105.dict.yaml" (string-append #$output
"/share/rime-data"))
  |          (install-file "wubi86_8105.schema.yaml" (string-append
#$output "/share/rime-data")))))
  |    (synopsis "Wubi86 input method of standard Chinese characters for
RIME")
  |    (description "This package contains a RIME dictionary and schema for
the 86 version
  | of Wubi, a shape-based input method for Chinese characters. The domain
  | of characters are those characters from the Table of General Standard
  | Chinese Characters (https://www.wikidata.org/wiki/Q14941454).")
  |    (home-page "https://github.com/rdrg109/wubi-8105")
  |    (license lgpl3)))
  `----


2 Additional information
========================

  I have previously defined my own Emacs packages and what I found
  useful was the [edebug utility] which allows me to step through any
  step of the function and see the value of any variable at any point.
  I'm wondering if there's something like that but for Guix packages.
  Any other tool that can help me debug the packages that I write is
  also appreciated.

  [edebug utility]:
https://www.gnu.org/software/emacs/manual/html_node/elisp/Using-Edebug.html)

             reply	other threads:[~2023-04-07  5:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-07  4:20 Rodrigo Morales [this message]
2023-04-07  8:33 ` Newbie: How to debug my custom packages? Is there something like Emacs' edebug but for Guix packages? Simon Tournier

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=CAGxMbPaXDZu8StdSDhE78W5kpU6UQbqXvEUr8zS9LeL2MeRDBA@mail.gmail.com \
    --to=moralesrodrigo1100@gmail.com \
    --cc=help-guix@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.
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).