diff mbox series

[bug#60386] gnu: Add guile-proba.

Message ID 0R2fGew0iuJD4YBAaHVjCshZMF52BTBE0WeK7DfiPAO5ebcSRE6PWiix30uJUY35OigiDykEQF_ZpjNc18IoQatNgRXsz4_cx6oMriFDo8M=@protonmail.com
State New
Headers show
Series [bug#60386] gnu: Add guile-proba. | expand

Commit Message

Luis Felipe Jan. 18, 2023, 6:20 p.m. UTC
On Tuesday, January 17th, 2023 at 13:50, Ludovic Courtès <ludo@gnu.org> wrote:

> Check out the section on search paths (info "(guix) Search Paths").
> 

> In essence, INFOPATH won’t be set if you don’t have an Info reader
> (‘info-reader’ or ‘emacs’) in the profile, because then you’d have no
> way to read the Info file. Yet, you shouldn’t force a specific Info
> reader on the user via ‘propagated-inputs’.
> 

> The story is similar for ‘guile-3.0’. Here, you should wrap or modify
> the ‘proba’ script such that it automatically adds its own
> $PKG/share/guile/site/3.0 to its .scm search path (and likewise for .go
> files).
> 

> See for example the ‘mcron’ or ‘shepherd’ script of the same-named
> packages, or see the ‘wrap-guilescript’ phase of the ‘guilescript’
> package.

Thanks. I attach a new patch where guile and texinfo are not propagated, and the script is wrapped.

Comments

Ludovic Courtès Jan. 23, 2023, 10:25 p.m. UTC | #1
Hi,

Luis Felipe <luis.felipe.la@protonmail.com> skribis:

> Thanks. I attach a new patch where guile and texinfo are not propagated, and the script is wrapped.
>
> From 4fd946321742e19a44b93e4d6d03fd09e92f70ba Mon Sep 17 00:00:00 2001
> From: Luis Felipe <luis.felipe.la@protonmail.com>
> Date: Wed, 28 Dec 2022 12:45:32 -0500
> Subject: [PATCH] gnu: Add guile-proba.
>
> * gnu/packages/check.scm (guile-proba): New variable.

It LGTM, but it fails to build:

--8<---------------cut here---------------start------------->8---
starting phase `check'
Backtrace:
           7 (primitive-load "/tmp/guix-build-guile-proba-0.2.0.drv-…")
In ice-9/eval.scm:
    619:8  6 (_ #(#<directory (guile-user) 7ffff5d01c80> #<test-ru…>))
   196:43  5 (_ #(#<directory (guile-user) 7ffff5d01c80> #<test-ru…>))
    155:9  4 (_ #(#<directory (guile-user) 7ffff5d01c80> #<test-ru…>))
    159:9  3 (_ #(#<directory (guile-user) 7ffff5d01c80> #<test-ru…>))
   182:19  2 (proc #(#<directory (guile-user) 7ffff5d01c80> #<test…>))
   142:16  1 (compile-top-call #<directory (guile-user) 7ffff5d01c80> …)
In unknown file:
           0 (%resolve-variable (7 . unit-name) #<directory (guile-u…>)

ERROR: In procedure %resolve-variable:
Unbound variable: unit-name
------------------------------------------------------------
TEST SUITE
------------------------------------------------------------
error: in phase 'check': uncaught exception:
%exception #<&invoke-error program: "guile" arguments: ("proba.scm" "run" "tests") exit-status: 1 term-signal: #f stop-signal: #f> 
phase `check' failed after 0.1 seconds
--8<---------------cut here---------------end--------------->8---

Any idea?

Thanks,
Ludo’.
Luis Felipe Jan. 25, 2023, 1:11 a.m. UTC | #2
On Monday, January 23rd, 2023 at 22:25, Ludovic Courtès <ludo@gnu.org> wrote:

> Hi,
>
> Luis Felipe luis.felipe.la@protonmail.com skribis:
>
> > Thanks. I attach a new patch where guile and texinfo are not propagated, and the script is wrapped.
> >
> > From 4fd946321742e19a44b93e4d6d03fd09e92f70ba Mon Sep 17 00:00:00 2001
> > From: Luis Felipe luis.felipe.la@protonmail.com
> > Date: Wed, 28 Dec 2022 12:45:32 -0500
> > Subject: [PATCH] gnu: Add guile-proba.
> >
> > * gnu/packages/check.scm (guile-proba): New variable.
>
>
> It LGTM, but it fails to build:
>
> --8<---------------cut here---------------start------------->8---
>
> starting phase `check'
> Backtrace:
> 7 (primitive-load "/tmp/guix-build-guile-proba-0.2.0.drv-…")
> In ice-9/eval.scm:
> 619:8 6 (_ #(#<directory (guile-user) 7ffff5d01c80> #<test-ru…>))
>
> 196:43 5 (_ #(#<directory (guile-user) 7ffff5d01c80> #<test-ru…>))
>
> 155:9 4 (_ #(#<directory (guile-user) 7ffff5d01c80> #<test-ru…>))
>
> 159:9 3 (_ #(#<directory (guile-user) 7ffff5d01c80> #<test-ru…>))
>
> 182:19 2 (proc #(#<directory (guile-user) 7ffff5d01c80> #<test…>))
>
> 142:16 1 (compile-top-call #<directory (guile-user) 7ffff5d01c80> …)
>
> In unknown file:
> 0 (%resolve-variable (7 . unit-name) #<directory (guile-u…>)
>
>
> ERROR: In procedure %resolve-variable:
> Unbound variable: unit-name
> ------------------------------------------------------------
> TEST SUITE
> ------------------------------------------------------------
> error: in phase 'check': uncaught exception:
> %exception #<&invoke-error program: "guile" arguments: ("proba.scm" "run" "tests") exit-status: 1 term-signal: #f stop-signal: #f>
>
> phase `check' failed after 0.1 seconds
> --8<---------------cut here---------------end--------------->8---
>
>
> Any idea?

It beats me... I built the package several times today on two different machines using the latest patch; the test suite passes and the package is built successfully.

Basically, I did the following:

1. Download latest patch
2. git clone https://git.savannah.gnu.org/git/guix.git
3. git am path/to/the.patch

4. guix shell --pure -D guix
5. ./bootstrap
6. ./configure --localstatedir=/var
7. make
8. ./pre-inst-env guix build [--no-grafts --check] guile-proba
Ludovic Courtès Jan. 26, 2023, 9:35 a.m. UTC | #3
Hi,

Luis Felipe <luis.felipe.la@protonmail.com> skribis:

> It beats me... I built the package several times today on two different machines using the latest patch; the test suite passes and the package is built successfully.

I tried again and it always fails in the same way, on top of
a84ceaa8b2e8e121957afea1d1d3fe7c8141cb8d, even when passing ‘-c1’ (thus
disabling parallel tests).

This is fixed by adding a (proba utils) to the ‘use-modules’ list of
‘tests/test-templates.scm’.

I’ll let you decide whether you want to make a new release or patch it
in some other way.

Thanks,
Ludo’.
Luis Felipe Jan. 26, 2023, 2:29 p.m. UTC | #4
Hey,

On Thursday, January 26th, 2023 at 09:35, Ludovic Courtès <ludo@gnu.org> wrote:


> Hi,
> 

> Luis Felipe luis.felipe.la@protonmail.com skribis:
> 

> > It beats me... I built the package several times today on two different machines using the latest patch; the test suite passes and the package is built successfully.
> 

> 

> I tried again and it always fails in the same way, on top of
> a84ceaa8b2e8e121957afea1d1d3fe7c8141cb8d, even when passing ‘-c1’ (thus
> disabling parallel tests).
> 

> This is fixed by adding a (proba utils) to the ‘use-modules’ list of
> ‘tests/test-templates.scm’.

Dammit, sorry about that :[


> I’ll let you decide whether you want to make a new release or patch it
> in some other way.

Yeah, new release it is. And I need to figure out why it magically builds me...

Thanks for the tutoring,
diff mbox series

Patch

From 4fd946321742e19a44b93e4d6d03fd09e92f70ba Mon Sep 17 00:00:00 2001
From: Luis Felipe <luis.felipe.la@protonmail.com>
Date: Wed, 28 Dec 2022 12:45:32 -0500
Subject: [PATCH] gnu: Add guile-proba.

* gnu/packages/check.scm (guile-proba): New variable.
---
 gnu/packages/check.scm | 63 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 63 insertions(+)

diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm
index aaa41777dc..753d3f597d 100644
--- a/gnu/packages/check.scm
+++ b/gnu/packages/check.scm
@@ -41,6 +41,7 @@ 
 ;;; Copyright © 2022 David Elsing <david.elsing@posteo.net>
 ;;; Copyright © 2022 Sharlatan Hellseher <sharlatanus@gmail.com>
 ;;; Copyright © 2022 jgart <jgart@dismail.de>
+;;; Copyright © 2022 Luis Felipe López Acevedo <luis.felipe.la@protonmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -70,6 +71,8 @@  (define-module (gnu packages check)
   #:use-module (gnu packages gnome)
   #:use-module (gnu packages golang)
   #:use-module (gnu packages gtk)
+  #:use-module (gnu packages guile)
+  #:use-module (gnu packages guile-xyz)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
@@ -78,6 +81,7 @@  (define-module (gnu packages check)
   #:use-module (gnu packages python-web)
   #:use-module (gnu packages python-xyz)
   #:use-module (gnu packages python-science)
+  #:use-module (gnu packages texinfo)
   #:use-module (gnu packages time)
   #:use-module (gnu packages xml)
   #:use-module (guix utils)
@@ -90,6 +94,7 @@  (define-module (gnu packages check)
   #:use-module (guix build-system glib-or-gtk)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system go)
+  #:use-module (guix build-system guile)
   #:use-module (guix build-system meson)
   #:use-module (guix build-system pyproject)
   #:use-module (guix build-system python)
@@ -3455,3 +3460,61 @@  (define-public python-pytest-regressions
 tables by saving expected data in a data directory (courtesy of pytest-datadir)
 that can be used to verify that future runs produce the same data.")
     (license license:expat)))
+
+(define-public guile-proba
+  (package
+    (name "guile-proba")
+    (version "0.2.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 "04si01wzhc9c8rqy9vr12fpkf8gnlx7crkph8djy80s2c7b1lvr7"))))
+    (build-system guile-build-system)
+    (inputs (list bash-minimal))
+    (native-inputs (list guile-3.0 texinfo))
+    (propagated-inputs (list guile-config guile-lib))
+    (arguments
+     (list
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'build 'check
+            (lambda _
+              (invoke "guile" "proba.scm" "run" "tests")))
+          (add-after 'install 'install-wrapped-script
+            (lambda* (#:key outputs #:allow-other-keys)
+              (let* ((out (assoc-ref outputs "out"))
+                     (version (target-guile-effective-version))
+                     (scm (string-append "/share/guile/site/" version))
+                     (go (string-append "/lib/guile/" version "/site-ccache"))
+                     (bin-dir (string-append out "/bin"))
+                     (script (string-append bin-dir "/proba")))
+                (mkdir-p bin-dir)
+                (copy-file "proba.scm" script)
+                (chmod script #o555)
+                (wrap-program script
+                  `("GUILE_LOAD_PATH" prefix
+                    (,(string-append out scm)))
+                  `("GUILE_LOAD_COMPILED_PATH" prefix
+                    (,(string-append out go)))))))
+          (add-after 'install 'install-manual
+            (lambda* (#:key outputs #:allow-other-keys)
+              (let* ((out (assoc-ref outputs "out"))
+                     (info-dir (string-append out "/share/info")))
+                (mkdir-p info-dir)
+                (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)))

base-commit: fc5dc3e04789a15d80a7b35987adaefc1a94b97c
-- 
2.38.1