unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Packaging: Need some help replacing a check phase
@ 2022-12-26 16:15 Luis Felipe
  2022-12-26 18:22 ` Kaelyn
  2022-12-26 19:04 ` Maxime Devos
  0 siblings, 2 replies; 5+ messages in thread
From: Luis Felipe @ 2022-12-26 16:15 UTC (permalink / raw)
  To: guix-devel


[-- Attachment #1.1: Type: text/plain, Size: 4042 bytes --]

Hi,

I'm packaging a Guile software but the package fails to build when I try to replace the check phase, and I can't see what I'm doing wrong.

This is the package definition:

٭٭٭٭٭٭٭٭٭٭
(define-module (packages guile-proba)
  #:use-module (gnu packages guile)
  #:use-module (gnu packages guile-xyz)
  #:use-module (gnu packages texinfo)
  #:use-module (guix build-system guile)
  #:use-module (guix git-download)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix packages))


(define-public guile-proba
  (package
    (name "guile-proba")
    (version "0.1.0")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://codeberg.org/luis-felipe/guile-proba")
             (commit version)))
       (file-name (git-file-name name version))
       (sha256
        (base32 "0bai3nhdmzpcxkp55a74afp92sq609hh9dy5a5w01aysvchp4715"))))
    (build-system guile-build-system)
    (native-inputs (list guile-3.0 texinfo))
    (propagated-inputs (list guile-config guile-lib texinfo))
    (arguments
     `(#:phases
       (modify-phases %standard-phases
         ;; FIXME: Replacing 'check phase makes build fail.
         (replace 'check
           (lambda* (#:key tests? #:allow-other-keys)
             (when tests?
               (invoke "guile" "proba.scm" "run" "tests"))))
         (add-after 'install 'install-script-and-manual
           (lambda* (#:key outputs #:allow-other-keys)
             (let* ((out (assoc-ref outputs "out"))
                    (bin-dir (string-append out "/bin"))
                    (info-dir (string-append out "/share/info"))
                    (script (string-append bin-dir "/proba")))
               (mkdir-p bin-dir)
               (mkdir-p info-dir)
               (copy-file "proba.scm" script)
               (chmod script #o555)
               (invoke "makeinfo" "manual/main.texi")
               (install-file "guile-proba" info-dir)))))
       #:not-compiled-file-regexp
       "((packages|tests)\\/.*.scm|(proba|manifest).scm)$"))
    (home-page "https://luis-felipe.gitlab.io/guile-proba/")
    (synopsis "Testing tools for GNU Guile projects with SRFI 64 test suites")
    (description
     "This software is a set of testing tools for GNU Guile projects
with SRFI 64-based test suites.  It comes with a command-line interface
to run test collections, and a library that includes a test runner and
helpers for writing tests.")
    (license license:public-domain)))
٭٭٭٭٭٭٭٭٭٭


And this is the error after running "guix build -L . guile-proba" (using guix 9cb42f7):

٭٭٭٭٭٭٭٭٭٭
Backtrace:
          14 (primitive-load "/gnu/store/36iw346l6n6s9wrd4qr923zywj1?")
In ice-9/eval.scm:
   214:21 13 (_ #f)
   217:50 12 (lp (#<procedure 7ffff5f41ca0 at ice-9/eval.scm:282:?> ?))
   217:50 11 (lp (#<procedure 7ffff5f41c80 at ice-9/eval.scm:282:?> ?))
   217:50 10 (lp (#<procedure 7ffff5f41c60 at ice-9/eval.scm:282:?> ?))
   217:50  9 (lp (#<procedure 7ffff5f41c40 at ice-9/eval.scm:282:?> ?))
   217:50  8 (lp (#<procedure 7ffff5f41c20 at ice-9/eval.scm:282:?> ?))
   217:50  7 (lp (#<procedure 7ffff5f41c00 at ice-9/eval.scm:282:?> ?))
   217:50  6 (lp (#<procedure 7ffff5f41be0 at ice-9/eval.scm:282:?> ?))
   217:50  5 (lp (#<procedure 7ffff5f41bc0 at ice-9/eval.scm:282:?> ?))
   217:50  4 (lp (#<procedure 7ffff5f41ba0 at ice-9/eval.scm:282:?> ?))
   217:50  3 (lp (#<procedure 7ffff5f41b80 at ice-9/eval.scm:282:?> ?))
   217:33  2 (lp (#<procedure 7ffff5f41a40 at ice-9/eval.scm:649:?> ?))
   293:34  1 (_ #(#<directory (guile-user) 7ffff5fdbc80> ((# . #) ?)))
In guix/build/utils.scm:
    713:4  0 (alist-replace check #<procedure 7ffff5f40ea0 at ice-9?> ?)

guix/build/utils.scm:713:4: In procedure alist-replace:
Throw to key `match-error' with args `("match" "no matching pattern" ())'.
٭٭٭٭٭٭٭٭٭٭


Thanks in advance.


---
Luis Felipe López Acevedo
https://luis-felipe.gitlab.io/

[-- Attachment #1.2: publickey - luis.felipe.la@protonmail.com - 0x12DE1598.asc --]
[-- Type: application/pgp-keys, Size: 1722 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 509 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Packaging: Need some help replacing a check phase
  2022-12-26 16:15 Packaging: Need some help replacing a check phase Luis Felipe
@ 2022-12-26 18:22 ` Kaelyn
  2022-12-26 19:54   ` Luis Felipe
  2022-12-26 19:04 ` Maxime Devos
  1 sibling, 1 reply; 5+ messages in thread
From: Kaelyn @ 2022-12-26 18:22 UTC (permalink / raw)
  To: Luis Felipe; +Cc: guix-devel

Hi Luis,

------- Original Message -------
On Monday, December 26th, 2022 at 4:15 PM, Luis Felipe <luis.felipe.la@protonmail.com> wrote:


> 
> 
> Hi,
> 
> I'm packaging a Guile software but the package fails to build when I try to replace the check phase, and I can't see what I'm doing wrong.
> 
> This is the package definition:
> 
> ٭٭٭٭٭٭٭٭٭٭
> (define-module (packages guile-proba)
> #:use-module (gnu packages guile)
> #:use-module (gnu packages guile-xyz)
> #:use-module (gnu packages texinfo)
> #:use-module (guix build-system guile)
> #:use-module (guix git-download)
> #:use-module ((guix licenses) #:prefix license:)
> #:use-module (guix packages))
> 
> 
> (define-public guile-proba
> (package
> (name "guile-proba")
> (version "0.1.0")
> (source
> (origin
> (method git-fetch)
> (uri (git-reference
> (url "https://codeberg.org/luis-felipe/guile-proba")
> (commit version)))
> (file-name (git-file-name name version))
> (sha256
> (base32 "0bai3nhdmzpcxkp55a74afp92sq609hh9dy5a5w01aysvchp4715"))))
> (build-system guile-build-system)
> (native-inputs (list guile-3.0 texinfo))
> (propagated-inputs (list guile-config guile-lib texinfo))
> (arguments
> `(#:phases
> (modify-phases %standard-phases
> ;; FIXME: Replacing 'check phase makes build fail.
> (replace 'check
> (lambda* (#:key tests? #:allow-other-keys)
> (when tests?
> (invoke "guile" "proba.scm" "run" "tests"))))
> (add-after 'install 'install-script-and-manual
> (lambda* (#:key outputs #:allow-other-keys)
> (let* ((out (assoc-ref outputs "out"))
> (bin-dir (string-append out "/bin"))
> (info-dir (string-append out "/share/info"))
> (script (string-append bin-dir "/proba")))
> (mkdir-p bin-dir)
> (mkdir-p info-dir)
> (copy-file "proba.scm" script)
> (chmod script #o555)
> (invoke "makeinfo" "manual/main.texi")
> (install-file "guile-proba" info-dir)))))
> #:not-compiled-file-regexp
> "((packages|tests)\\/.*.scm|(proba|manifest).scm)$"))
> (home-page "https://luis-felipe.gitlab.io/guile-proba/")
> (synopsis "Testing tools for GNU Guile projects with SRFI 64 test suites")
> (description
> "This software is a set of testing tools for GNU Guile projects
> with SRFI 64-based test suites. It comes with a command-line interface
> to run test collections, and a library that includes a test runner and
> helpers for writing tests.")
> (license license:public-domain)))
> ٭٭٭٭٭٭٭٭٭٭
> 
> 
> And this is the error after running "guix build -L . guile-proba" (using guix 9cb42f7):
> 
> ٭٭٭٭٭٭٭٭٭٭
> Backtrace:
> 14 (primitive-load "/gnu/store/36iw346l6n6s9wrd4qr923zywj1?")
> In ice-9/eval.scm:
> 214:21 13 (_ #f)
> 217:50 12 (lp (#<procedure 7ffff5f41ca0 at ice-9/eval.scm:282:?> ?))
> 
> 217:50 11 (lp (#<procedure 7ffff5f41c80 at ice-9/eval.scm:282:?> ?))
> 
> 217:50 10 (lp (#<procedure 7ffff5f41c60 at ice-9/eval.scm:282:?> ?))
> 
> 217:50 9 (lp (#<procedure 7ffff5f41c40 at ice-9/eval.scm:282:?> ?))
> 
> 217:50 8 (lp (#<procedure 7ffff5f41c20 at ice-9/eval.scm:282:?> ?))
> 
> 217:50 7 (lp (#<procedure 7ffff5f41c00 at ice-9/eval.scm:282:?> ?))
> 
> 217:50 6 (lp (#<procedure 7ffff5f41be0 at ice-9/eval.scm:282:?> ?))
> 
> 217:50 5 (lp (#<procedure 7ffff5f41bc0 at ice-9/eval.scm:282:?> ?))
> 
> 217:50 4 (lp (#<procedure 7ffff5f41ba0 at ice-9/eval.scm:282:?> ?))
> 
> 217:50 3 (lp (#<procedure 7ffff5f41b80 at ice-9/eval.scm:282:?> ?))
> 
> 217:33 2 (lp (#<procedure 7ffff5f41a40 at ice-9/eval.scm:649:?> ?))
> 
> 293:34 1 (_ #(#<directory (guile-user) 7ffff5fdbc80> ((# . #) ?)))
> 
> In guix/build/utils.scm:
> 713:4 0 (alist-replace check #<procedure 7ffff5f40ea0 at ice-9?> ?)
> 
> 
> guix/build/utils.scm:713:4: In procedure alist-replace:
> Throw to key `match-error' with args` ("match" "no matching pattern" ())'.
> ٭٭٭٭٭٭٭٭٭٭

I believe the build fails because the guile-build-system deletes the 'check phase. From guix/build/guile-build-system.scm:

(define %standard-phases
  (modify-phases gnu:%standard-phases
    (delete 'bootstrap)
    (delete 'configure)
    (add-before 'install-locale 'set-locale-path
      set-locale-path)
    (replace 'build build)
    (add-after 'build 'install-documentation
      install-documentation)
    (delete 'check)
    (delete 'strip)
    (delete 'validate-runpath)
    (delete 'install)))

Hope that helps!

Cheers,
Kaelyn

> 
> 
> Thanks in advance.
> 
> 
> ---
> Luis Felipe López Acevedo
> https://luis-felipe.gitlab.io/


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Packaging: Need some help replacing a check phase
  2022-12-26 16:15 Packaging: Need some help replacing a check phase Luis Felipe
  2022-12-26 18:22 ` Kaelyn
@ 2022-12-26 19:04 ` Maxime Devos
  2022-12-26 20:31   ` Luis Felipe
  1 sibling, 1 reply; 5+ messages in thread
From: Maxime Devos @ 2022-12-26 19:04 UTC (permalink / raw)
  To: Luis Felipe, guix-devel


[-- Attachment #1.1.1: Type: text/plain, Size: 551 bytes --]



On 26-12-2022 17:15, Luis Felipe wrote:
> Hi,
> 
> I'm packaging a Guile software but the package fails to build when I try to replace the check phase, and I can't see what I'm doing wrong.
> 

As mentioned by Kaelyn, guile-build-system doesn't have a check phase to 
replace. The patch series at <https://issues.guix.gnu.org/58365> adds 
support for tests to guile-build-system; you could apply those patches 
and then replace a phase (and maybe replace 'guile-test-driver' by 
'guile-proba' for autodiscovery).

Greetings,
Maxime.

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 929 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Packaging: Need some help replacing a check phase
  2022-12-26 18:22 ` Kaelyn
@ 2022-12-26 19:54   ` Luis Felipe
  0 siblings, 0 replies; 5+ messages in thread
From: Luis Felipe @ 2022-12-26 19:54 UTC (permalink / raw)
  To: Kaelyn; +Cc: guix-devel


[-- Attachment #1.1: Type: text/plain, Size: 660 bytes --]

Hi Kaelyn,

On Monday, December 26th, 2022 at 18:22, Kaelyn <kaelyn.alexi@protonmail.com> wrote:

> I believe the build fails because the guile-build-system deletes the 'check phase. From guix/build/guile-build-system.scm:
> 

> (define %standard-phases
> (modify-phases gnu:%standard-phases
> (delete 'bootstrap)
> (delete 'configure)
> (add-before 'install-locale 'set-locale-path
> set-locale-path)
> (replace 'build build)
> (add-after 'build 'install-documentation
> install-documentation)
> (delete 'check)
> (delete 'strip)
> (delete 'validate-runpath)
> (delete 'install)))
> 

> Hope that helps!

Ooooh, thanks a lot, Kaelyn :)

[-- Attachment #1.2: publickey - luis.felipe.la@protonmail.com - 0x12DE1598.asc --]
[-- Type: application/pgp-keys, Size: 1722 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 509 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Packaging: Need some help replacing a check phase
  2022-12-26 19:04 ` Maxime Devos
@ 2022-12-26 20:31   ` Luis Felipe
  0 siblings, 0 replies; 5+ messages in thread
From: Luis Felipe @ 2022-12-26 20:31 UTC (permalink / raw)
  To: Maxime Devos; +Cc: guix-devel


[-- Attachment #1.1: Type: text/plain, Size: 710 bytes --]

Hi Maxime,

On Monday, December 26th, 2022 at 19:04, Maxime Devos <maximedevos@telenet.be> wrote:

> 

> On 26-12-2022 17:15, Luis Felipe wrote:
> 

> > Hi,
> > 

> > I'm packaging a Guile software but the package fails to build when I try to replace the check phase, and I can't see what I'm doing wrong.
> 

> As mentioned by Kaelyn, guile-build-system doesn't have a check phase to
> replace. The patch series at https://issues.guix.gnu.org/58365 adds
> support for tests to guile-build-system; you could apply those patches
> and then replace a phase (and maybe replace 'guile-test-driver' by
> 'guile-proba' for autodiscovery).

Thanks for working on that, Maxime, I had no idea. 


[-- Attachment #1.2: publickey - luis.felipe.la@protonmail.com - 0x12DE1598.asc --]
[-- Type: application/pgp-keys, Size: 1722 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 509 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-12-26 20:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-26 16:15 Packaging: Need some help replacing a check phase Luis Felipe
2022-12-26 18:22 ` Kaelyn
2022-12-26 19:54   ` Luis Felipe
2022-12-26 19:04 ` Maxime Devos
2022-12-26 20:31   ` Luis Felipe

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).