help-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Newbie: How to edit a faulty package definition?


From: Rodrigo Morales
Subject: Newbie: How to edit a faulty package definition?
Date: Sun, 25 Jun 2023 03:30:42 +0000

Table of Contents
_________________

1. The context
2. The workaround
3. The question
4. Reason why I don't use the `-L' flag


1 The context
=============

  I recently executed `guix pull' and now when I'm trying to install
  `emacs-subed', I get the following error:

  ,----
  | guix package -i emacs-subed
  `----

  ,----
  | The following package will be installed:
  |    emacs-subed 1.2.3
  |
  | The following derivations will be built:
  |   /gnu/store/4s3xv6gqkzaa6gkajhgvxb0dr6wrywcy-profile.drv
  |   /gnu/store/k4h4lnfl0ynd9yrpbkmd423m3k8xwzyx-emacs-subed-1.2.3.drv
  |
  | building 
/gnu/store/k4h4lnfl0ynd9yrpbkmd423m3k8xwzyx-emacs-subed-1.2.3.drv...
  | builder for
`/gnu/store/k4h4lnfl0ynd9yrpbkmd423m3k8xwzyx-emacs-subed-1.2.3.drv'
failed with exit code 1
  | build of /gnu/store/k4h4lnfl0ynd9yrpbkmd423m3k8xwzyx-emacs-subed-1.2.3.drv
failed
  | View build log at
'/var/log/guix/drvs/k4/h4lnfl0ynd9yrpbkmd423m3k8xwzyx-emacs-subed-1.2.3.drv.gz'.
  | cannot build derivation
`/gnu/store/4s3xv6gqkzaa6gkajhgvxb0dr6wrywcy-profile.drv': 1
dependencies couldn't be built
  | guix package: error: build of
`/gnu/store/4s3xv6gqkzaa6gkajhgvxb0dr6wrywcy-profile.drv' failed
  `----

  The build log is shown below.

  ,----
  | zcat 
/var/log/guix/drvs/k4/h4lnfl0ynd9yrpbkmd423m3k8xwzyx-emacs-subed-1.2.3.drv.gz
  `----

  ,----
  | starting phase `set-SOURCE-DATE-EPOCH'
  | phase `set-SOURCE-DATE-EPOCH' succeeded after 0.0 seconds
  | starting phase `set-paths'
  | environment variable `PATH' set to
`/gnu/store/1s82ps0dyi2xw5d3bi6g96lk90d965lf-emacs-minimal-28.2/bin:/gnu/store/sxx22f98vfbavcqmdksm6as8fvskpxiw-tar-1.34/bin:/gnu/store/x24bm49ag5dvki72mjdz195bfb89nrnb-gzip-1.12/bin:/gnu/store/j8wlfmlmfvpbza6is9wv9xsd8psrxn00-bzip2-1.0.8/bin:/gnu/store/gr0sy0m1mv36qv54idm6cn10l3mngshq-file-5.44/bin:/gnu/store/zmcf5kpqiighkbh7wslf91qdjwj06yr1-diffutils-3.8/bin:/gnu/store/210yfax18r2g2inxrml9435ikhfcca6m-patch-2.7.6/bin:/gnu/store/c8jyph2lxw0m9na34fg8h70n4nnnz7is-findutils-4.9.0/bin:/gnu/store/hc05d76f1j3iz3v2bs5jz4fpljl1r4dj-gawk-5.2.1/bin:/gnu/store/xxcfsimvxz7z4dj593gnqbkzc6picwzq-sed-4.8/bin:/gnu/store/yrv5f70mn83a876b78i5s79dd2hsh0zf-grep-3.8/bin:/gnu/store/6k1yys9wqrfn4y41ic1win8gpnimncwj-xz-5.2.8/bin:/gnu/store/a5i8avx826brw5grn3n4qv40g514505c-coreutils-9.1/bin:/gnu/store/wj7casda7rb55rvqjnpm0bm7a2zm6618-make-4.3/bin:/gnu/store/rib9g2ig1xf3kclyl076w28parmncg4k-bash-minimal-5.1.16/bin:/gnu/store/na1dpbbcxjaa3n8wkwrfpch476f90hlf-ld-wrapper-0/bin:/gnu/store/zh4x65snfis7svs6906gj1z8i7dx2j3m-binutils-2.38/bin:/gnu/store/5lqhcv91ijy82p92ac6g5xw48l0lwwz4-gcc-11.3.0/bin:/gnu/store/gsjczqir1wbz8p770zndrpw4rnppmxi3-glibc-2.35/bin:/gnu/store/gsjczqir1wbz8p770zndrpw4rnppmxi3-glibc-2.35/sbin'
  | environment variable `EMACSLOADPATH' set to
`/gnu/store/1s82ps0dyi2xw5d3bi6g96lk90d965lf-emacs-minimal-28.2/share/emacs/site-lisp'
  | environment variable `EMACSNATIVELOADPATH' unset
  | environment variable `INFOPATH' set to
`/gnu/store/1s82ps0dyi2xw5d3bi6g96lk90d965lf-emacs-minimal-28.2/share/info:/gnu/store/sxx22f98vfbavcqmdksm6as8fvskpxiw-tar-1.34/share/info:/gnu/store/x24bm49ag5dvki72mjdz195bfb89nrnb-gzip-1.12/share/info:/gnu/store/zmcf5kpqiighkbh7wslf91qdjwj06yr1-diffutils-3.8/share/info:/gnu/store/c8jyph2lxw0m9na34fg8h70n4nnnz7is-findutils-4.9.0/share/info:/gnu/store/hc05d76f1j3iz3v2bs5jz4fpljl1r4dj-gawk-5.2.1/share/info:/gnu/store/xxcfsimvxz7z4dj593gnqbkzc6picwzq-sed-4.8/share/info:/gnu/store/yrv5f70mn83a876b78i5s79dd2hsh0zf-grep-3.8/share/info:/gnu/store/a5i8avx826brw5grn3n4qv40g514505c-coreutils-9.1/share/info:/gnu/store/wj7casda7rb55rvqjnpm0bm7a2zm6618-make-4.3/share/info:/gnu/store/rib9g2ig1xf3kclyl076w28parmncg4k-bash-minimal-5.1.16/share/info:/gnu/store/zh4x65snfis7svs6906gj1z8i7dx2j3m-binutils-2.38/share/info:/gnu/store/5lqhcv91ijy82p92ac6g5xw48l0lwwz4-gcc-11.3.0/share/info:/gnu/store/gsjczqir1wbz8p770zndrpw4rnppmxi3-glibc-2.35/share/info'
  | environment variable `TREE_SITTER_GRAMMAR_PATH' unset
  | environment variable `BASH_LOADABLES_PATH' unset
  | environment variable `C_INCLUDE_PATH' set to
`/gnu/store/1s82ps0dyi2xw5d3bi6g96lk90d965lf-emacs-minimal-28.2/include:/gnu/store/j8wlfmlmfvpbza6is9wv9xsd8psrxn00-bzip2-1.0.8/include:/gnu/store/gr0sy0m1mv36qv54idm6cn10l3mngshq-file-5.44/include:/gnu/store/hc05d76f1j3iz3v2bs5jz4fpljl1r4dj-gawk-5.2.1/include:/gnu/store/6k1yys9wqrfn4y41ic1win8gpnimncwj-xz-5.2.8/include:/gnu/store/wj7casda7rb55rvqjnpm0bm7a2zm6618-make-4.3/include:/gnu/store/zh4x65snfis7svs6906gj1z8i7dx2j3m-binutils-2.38/include:/gnu/store/5lqhcv91ijy82p92ac6g5xw48l0lwwz4-gcc-11.3.0/include:/gnu/store/gsjczqir1wbz8p770zndrpw4rnppmxi3-glibc-2.35/include:/gnu/store/5iklcps70c0sfkxvlrhg8jhf3q4h18bj-linux-libre-headers-5.15.49/include'
  | environment variable `CPLUS_INCLUDE_PATH' set to
`/gnu/store/1s82ps0dyi2xw5d3bi6g96lk90d965lf-emacs-minimal-28.2/include:/gnu/store/j8wlfmlmfvpbza6is9wv9xsd8psrxn00-bzip2-1.0.8/include:/gnu/store/gr0sy0m1mv36qv54idm6cn10l3mngshq-file-5.44/include:/gnu/store/hc05d76f1j3iz3v2bs5jz4fpljl1r4dj-gawk-5.2.1/include:/gnu/store/6k1yys9wqrfn4y41ic1win8gpnimncwj-xz-5.2.8/include:/gnu/store/wj7casda7rb55rvqjnpm0bm7a2zm6618-make-4.3/include:/gnu/store/zh4x65snfis7svs6906gj1z8i7dx2j3m-binutils-2.38/include:/gnu/store/5lqhcv91ijy82p92ac6g5xw48l0lwwz4-gcc-11.3.0/include/c++:/gnu/store/5lqhcv91ijy82p92ac6g5xw48l0lwwz4-gcc-11.3.0/include:/gnu/store/gsjczqir1wbz8p770zndrpw4rnppmxi3-glibc-2.35/include:/gnu/store/5iklcps70c0sfkxvlrhg8jhf3q4h18bj-linux-libre-headers-5.15.49/include'
  | environment variable `LIBRARY_PATH' set to
`/gnu/store/1s82ps0dyi2xw5d3bi6g96lk90d965lf-emacs-minimal-28.2/lib:/gnu/store/j8wlfmlmfvpbza6is9wv9xsd8psrxn00-bzip2-1.0.8/lib:/gnu/store/gr0sy0m1mv36qv54idm6cn10l3mngshq-file-5.44/lib:/gnu/store/hc05d76f1j3iz3v2bs5jz4fpljl1r4dj-gawk-5.2.1/lib:/gnu/store/6k1yys9wqrfn4y41ic1win8gpnimncwj-xz-5.2.8/lib:/gnu/store/zh4x65snfis7svs6906gj1z8i7dx2j3m-binutils-2.38/lib:/gnu/store/gsjczqir1wbz8p770zndrpw4rnppmxi3-glibc-2.35/lib:/gnu/store/l0yryi5jsa1grnvw01c9nkz9c81cv224-glibc-2.35-static/lib:/gnu/store/visfdda934gvivwihwhlm63fdqhhcc8a-glibc-utf8-locales-2.35/lib'
  | environment variable `GUIX_LOCPATH' set to
`/gnu/store/visfdda934gvivwihwhlm63fdqhhcc8a-glibc-utf8-locales-2.35/lib/locale'
  | phase `set-paths' succeeded after 0.0 seconds
  | starting phase `install-locale'
  | using 'en_US.utf8' locale for category "LC_ALL"
  | phase `install-locale' succeeded after 0.0 seconds
  | starting phase `unpack'
  | subed-1.2.3/
  | subed-1.2.3/README.org
  | subed-1.2.3/
  | subed-1.2.3/subed-common.el
  | subed-1.2.3/subed-waveform.el
  | subed-1.2.3/subed-align.el.license
  | subed-1.2.3/subed-common.el.license
  | subed-1.2.3/subed-ass.el
  | subed-1.2.3/subed-mpv.el.license
  | subed-1.2.3/subed-vtt.el.license
  | subed-1.2.3/subed-ass.el.license
  | subed-1.2.3/subed.el.license
  | subed-1.2.3/subed-word-data.el
  | subed-1.2.3/subed-waveform.el.license
  | subed-1.2.3/subed-srt.el.license
  | subed-1.2.3/subed-vtt.el
  | subed-1.2.3/subed-debug.el
  | subed-1.2.3/subed-tsv.el
  | subed-1.2.3/subed-config.el.license
  | subed-1.2.3/subed-debug.el.license
  | subed-1.2.3/subed-align.el
  | subed-1.2.3/subed-word-data.el.license
  | subed-1.2.3/subed-srt.el
  | subed-1.2.3/subed-mpv.el
  | subed-1.2.3/subed-config.el
  | subed-1.2.3/subed.el
  | subed-1.2.3/README-elpa
  | subed-1.2.3/Makefile
  | subed-1.2.3/screenshot.jpg
  | subed-1.2.3/tests/
  | subed-1.2.3/tests/test-subed-vtt.el.license
  | subed-1.2.3/tests/test-subed-vtt.el
  | subed-1.2.3/tests/test-subed-mpv.el.license
  | subed-1.2.3/tests/test-subed-ass.el.license
  | subed-1.2.3/tests/test-subed-common.el
  | subed-1.2.3/tests/test-subed-mpv.el
  | subed-1.2.3/tests/test-subed-srt.el
  | subed-1.2.3/tests/undercover-init.el
  | subed-1.2.3/tests/test-subed-srt.el.license
  | subed-1.2.3/tests/test-subed-tsv.el
  | subed-1.2.3/tests/test-subed-common.el.license
  | subed-1.2.3/tests/test-subed-ass.el
  | subed-1.2.3/NEWS.org
  | subed-1.2.3/subed-pkg.el
  | subed-1.2.3/LICENSES/
  | subed-1.2.3/LICENSES/GPL-3.0-or-later.txt
  | subed-1.2.3/LICENSES/CC0-1.0.txt
  | subed-1.2.3/AUTHORS.org
  | subed-1.2.3/screenshot.jpg.license
  | subed-1.2.3/.dir-locals.el
  | phase `unpack' succeeded after 0.0 seconds
  | starting phase `expand-load-path'
  | source directory
"/tmp/guix-build-emacs-subed-1.2.3.drv-0/subed-1.2.3" prepended to the
`EMACSLOADPATH' environment variable
  | phase `expand-load-path' succeeded after 0.0 seconds
  | starting phase `add-install-to-native-load-path'
  | phase `add-install-to-native-load-path' succeeded after 0.0 seconds
  | starting phase `patch-usr-bin-file'
  | phase `patch-usr-bin-file' succeeded after 0.0 seconds
  | starting phase `patch-source-shebangs'
  | phase `patch-source-shebangs' succeeded after 0.0 seconds
  | starting phase `patch-generated-file-shebangs'
  | phase `patch-generated-file-shebangs' succeeded after 0.0 seconds
  | starting phase `check'
  | emacs -batch -f package-initialize -L . -f buttercup-run-discover
  | Debugger entered--Lisp error: (void-function buttercup-run-discover)
  |   buttercup-run-discover()
  |   command-line-1(("-f" "package-initialize" "-L" "." "-f"
"buttercup-run-discover"))
  |   command-line()
  |   normal-top-level()
  |
  | make: *** [Makefile:20: test-only] Error 255
  | error: in phase 'check': uncaught exception:
  | %exception #<&invoke-error program: "make" arguments: ("test-only"
"-j" "16") exit-status: 2 term-signal: #f stop-signal: #f>
  | phase `check' failed after 0.1 seconds
  | command "make" "test-only" "-j" "16" failed with status 2
  `----

  As we can see above, the build process fails because the function
  `buttercup-run-discover' is not found. [This commit] deleted
  `emacs-buttercup' from `native-inputs' in the package definition. I
  believe this is the cuase of the problem.


[This commit]
<https://git.savannah.gnu.org/cgit/guix.git/commit/gnu/packages/emacs-xyz.scm?id=79a58ae400caea6dbdf2a4193c732b5d3f3256b6>


2 The workaround
================

  I solved this problem by defining my own package and using the `-L'
  flag. See package definition below. Note that I added
  `emacs-buttercup' to `native-inputs'.

  ,----
  | cat ~/my/git-repos/guix-packages/my/test-2.scm
  `----

  ,----
  | (define-module (my test-2)
  |   #:use-module (guix packages)
  |   #:use-module (guix download)
  |   ;; emacs-build-system
  |   #:use-module (guix build-system emacs)
  |   ;; emacs-buttercup
  |   #:use-module (gnu packages emacs-xyz)
  |   #:use-module (guix gexp)
  |   #:use-module ((guix licenses) #:prefix license:))
  |
  | (define-public emacs-subed
  |   (package
  |     (name "emacs-subed")
  |     (version "1.2.3")
  |     (source (origin
  |               (method url-fetch)
  |               (uri (string-append "https://elpa.nongnu.org/nongnu/subed-";
  |                                   version ".tar"))
  |               (sha256
  |                (base32
  |                 "0np4wp7pmpayz8r9p3cl7z1i7yfq8xmkn862n9d104szf4ffk0if"))))
  |     (arguments
  |      (list
  |       #:tests? #t
  |       #:test-command #~(list "make" "test-only")))
  |     (native-inputs
  |      (list emacs-buttercup))
  |     (build-system emacs-build-system)
  |     (home-page "https://elpa.nongnu.org/nongnu/subed.html";)
  |     (synopsis "Major mode for editing subtitles")
  |     (description
  |      "@code{subed} is an Emacs major mode for editing subtitles
while playing
  | the corresponding video with @code{mpv}.  At the moment, the only supported
  | formats are SubRip (@file{.srt}), WebVTT (@file{.vtt}), and Advanced
  | SubStation Alpha (@file{.ass}).")
  |     (license license:gpl3+)))
  `----

  See installation below. Note that guix complains that there's an
  ambiguous package.

  ,----
  | guix package -L ~/my/git-repos/guix-packages --no-substitutes -i emacs-subed
  | echo "--- Exit code: $?"
  `----

  ,----
  | guix package: warning: ambiguous package specification `emacs-subed'
  | guix package: warning: choosing emacs-subed@1.2.3 from my/test-2.scm:12:2
  | The following package will be installed:
  |    emacs-subed 1.2.3
  |
  | The following derivations will be built:
  |   /gnu/store/bbwwyfnkgpl6gaqfbm8v1mpa5fpba7zb-profile.drv
  |   /gnu/store/zfkprsd6bxhf4wmz5zd5ad7mhck0j76m-emacs-subed-1.2.3.drv
  |
  | building 
/gnu/store/zfkprsd6bxhf4wmz5zd5ad7mhck0j76m-emacs-subed-1.2.3.drv...
  | listing Emacs sub-directories...
  | building profile with 7 packages...
  | --- Exit code: 0
  `----


3 The question
==============

  I know that One way to solve the problem of a faulty package
  definition is: First, send a patch. Second, wait for the patch to be
  added to the source code. Third, once the patch is added, execute
  `guix pull'. At this point, executing `guix package -i <<package>>'
  shouldn't fail. However, I feel that one downside of doing this is
  that the user needs to wait until the patch is added to the source
  code. Sometimes, some users might be in a hurry and they want to be
  able to use a package. This leads to my second question: Is there a
  way to edit the package definitions so that `guix package -i' look at
  them without having to use the `-L' flag? See next section on why I
  don't want to use the `-L' flag.


4 Reason why I don't use the `-L' flag
======================================

  The reason is that I'm currently using `guix home reconfigure' and
  even though I use the `-L' flag, `guix home' gives higher priority to
  `emacs-subed', so the build process fails and `guix home' can't exit
  successfully due to that faulty package.

  ,----
  | guix home -L ~/my/git-repos/guix-packages reconfigure
~/my/git-repos/guix-config/home-configuration.scm
  `----

  ,----
  | substitute:  substitute:  [Kupdating substitutes from
'https://ci.guix.gnu.org'...   0.0% substitute:  [Kupdating
substitutes from 'https://ci.guix.gnu.org'...  33.3% substitute:
 [Kupdating substitutes from 'https://ci.guix.gnu.org'...  66.7%
substitute:  [Kupdating substitutes from 'https://ci.guix.gnu.org'...
100.0%
  | substitute:  substitute:  [Kupdating substitutes from
'https://bordeaux.guix.gnu.org'...   0.0% substitute:  [Kupdating
substitutes from 'https://bordeaux.guix.gnu.org'...  33.3% substitute:
 [Kupdating substitutes from 'https://bordeaux.guix.gnu.org'...  66.7%
substitute:  [Kupdating substitutes from
'https://bordeaux.guix.gnu.org'... 100.0%
  | The following derivations will be built:
  |   /gnu/store/xn5wc23wlz2cc9bc0cagnv0fdvkrhaaz-home.drv
  |   /gnu/store/5fzw0iw5ngihlnj0s5sjcgi4f9i1bmpm-activate.drv
  |   /gnu/store/5g4ddbrbshmy7b1dirlg5yih22abxdxf-update-symlinks.drv
  |   /gnu/store/5kdl497kqhzd3hrbzm019yh4fdrdjm8i-profile.drv
  |   /gnu/store/k4h4lnfl0ynd9yrpbkmd423m3k8xwzyx-emacs-subed-1.2.3.drv
  |   /gnu/store/hhhiw4k4j4finbfn3vpyip9i934k3hyj-setup-environment.drv
  |
  | building /gnu/store/5g4ddbrbshmy7b1dirlg5yih22abxdxf-update-symlinks.drv...
  | building 
/gnu/store/k4h4lnfl0ynd9yrpbkmd423m3k8xwzyx-emacs-subed-1.2.3.drv...
  | builder for
`/gnu/store/k4h4lnfl0ynd9yrpbkmd423m3k8xwzyx-emacs-subed-1.2.3.drv'
failed with exit code 1
  | build of /gnu/store/k4h4lnfl0ynd9yrpbkmd423m3k8xwzyx-emacs-subed-1.2.3.drv
failed
  | View build log at
'/var/log/guix/drvs/k4/h4lnfl0ynd9yrpbkmd423m3k8xwzyx-emacs-subed-1.2.3.drv.gz'.
  | building /gnu/store/5fzw0iw5ngihlnj0s5sjcgi4f9i1bmpm-activate.drv...
  | cannot build derivation
`/gnu/store/5kdl497kqhzd3hrbzm019yh4fdrdjm8i-profile.drv': 1
dependencies couldn't be built
  | cannot build derivation
`/gnu/store/xn5wc23wlz2cc9bc0cagnv0fdvkrhaaz-home.drv': 1 dependencies
couldn't be built
  | guix home: error: build of
`/gnu/store/xn5wc23wlz2cc9bc0cagnv0fdvkrhaaz-home.drv' failed
  `----

  The main topic of this thread could have been: How to make "guix home"
  give higher priority to a path specified through the `-L' flag? But I
  decided not to ask for help on `guix home', because there are less
  "guix home" users than Guix users, so I might need to wait
  significantly more to get some help. I'd rather learn how to edit
  package definitions and make `guix package -i' aware of that. I've
  opened another thread on a question related to "guix edit" [here].


[here]
<https://lists.gnu.org/archive/html/help-guix/2023-06/msg00094.html>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]