unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#60386] [PATCH] gnu: Add guile-proba.
@ 2022-12-28 18:07 Luis Felipe via Guix-patches via
  2023-01-10 10:48 ` Ludovic Courtès
  2023-02-15 21:59 ` [bug#60386] [PATCH v4] " sirgazil--- via Guix-patches via
  0 siblings, 2 replies; 14+ messages in thread
From: Luis Felipe via Guix-patches via @ 2022-12-28 18:07 UTC (permalink / raw)
  To: 60386


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

Hi, a new package here.



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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-gnu-Add-guile-proba.patch --]
[-- Type: text/x-patch; filename="0001-gnu-Add-guile-proba.patch"; name="0001-gnu-Add-guile-proba.patch", Size: 4137 bytes --]

From 332ea52f1f060a4fa1b8af7100b4cbd2f481f24b 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 | 51 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 51 insertions(+)

diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm
index aaa41777dc..3967a22f76 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,49 @@ (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)
+    (native-inputs (list guile-3.0 texinfo))
+    (propagated-inputs (list guile-3.0 guile-config guile-lib texinfo))
+    (arguments
+     (list
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'build 'check
+            (lambda _
+              (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)))

base-commit: fc5dc3e04789a15d80a7b35987adaefc1a94b97c
-- 
2.38.1


[-- Attachment #1.3: 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 related	[flat|nested] 14+ messages in thread

* [bug#60386] [PATCH] gnu: Add guile-proba.
  2022-12-28 18:07 [bug#60386] [PATCH] gnu: Add guile-proba Luis Felipe via Guix-patches via
@ 2023-01-10 10:48 ` Ludovic Courtès
  2023-01-13 15:41   ` Luis Felipe via Guix-patches via
  2023-02-15 21:59 ` [bug#60386] [PATCH v4] " sirgazil--- via Guix-patches via
  1 sibling, 1 reply; 14+ messages in thread
From: Ludovic Courtès @ 2023-01-10 10:48 UTC (permalink / raw)
  To: Luis Felipe; +Cc: 60386

Hello!

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

> From 332ea52f1f060a4fa1b8af7100b4cbd2f481f24b 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.

[...]

> +    (native-inputs (list guile-3.0 texinfo))
> +    (propagated-inputs (list guile-3.0 guile-config guile-lib texinfo))

I don’t think ‘guile-3.0’ and ‘texinfo’ need to be propagated, do they?

Apart from that it LGTM, thanks!

Ludo’.




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

* [bug#60386] [PATCH] gnu: Add guile-proba.
  2023-01-10 10:48 ` Ludovic Courtès
@ 2023-01-13 15:41   ` Luis Felipe via Guix-patches via
  2023-01-17 13:50     ` Ludovic Courtès
  0 siblings, 1 reply; 14+ messages in thread
From: Luis Felipe via Guix-patches via @ 2023-01-13 15:41 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 60386


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

On Tuesday, January 10th, 2023 at 10:48, Ludovic Courtès <ludo@gnu.org> wrote:

> I don’t think ‘guile-3.0’ and ‘texinfo’ need to be propagated, do they?

They do? If I don't propagate them, running the "proba" script fails because the "proba" library can't be found and running "info guile-proba" the info command is not found (I just tried in a foreign distro and also using a pure shell on my Guix system). 


Things only work as expected if I propagate "guile-3.0" and "texinfo" or if I don't propagate them but tell users to install them themselves (guix install guile-proba guile texinfo).

So I'm not sure what I should do...

[-- 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] 14+ messages in thread

* [bug#60386] [PATCH] gnu: Add guile-proba.
  2023-01-13 15:41   ` Luis Felipe via Guix-patches via
@ 2023-01-17 13:50     ` Ludovic Courtès
  2023-01-18 18:20       ` Luis Felipe via Guix-patches via
  0 siblings, 1 reply; 14+ messages in thread
From: Ludovic Courtès @ 2023-01-17 13:50 UTC (permalink / raw)
  To: Luis Felipe; +Cc: 60386

Hi!

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

> On Tuesday, January 10th, 2023 at 10:48, Ludovic Courtès <ludo@gnu.org> wrote:
>
>> I don’t think ‘guile-3.0’ and ‘texinfo’ need to be propagated, do they?
>
> They do? If I don't propagate them, running the "proba" script fails because the "proba" library can't be found and running "info guile-proba" the info command is not found (I just tried in a foreign distro and also using a pure shell on my Guix system). 

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.

HTH!

Ludo’.




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

* [bug#60386] [PATCH] gnu: Add guile-proba.
  2023-01-17 13:50     ` Ludovic Courtès
@ 2023-01-18 18:20       ` Luis Felipe via Guix-patches via
  2023-01-23 22:25         ` Ludovic Courtès
  0 siblings, 1 reply; 14+ messages in thread
From: Luis Felipe via Guix-patches via @ 2023-01-18 18:20 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 60386


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

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.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-gnu-Add-guile-proba.patch --]
[-- Type: text/x-patch; filename="0001-gnu-Add-guile-proba.patch"; name="0001-gnu-Add-guile-proba.patch", Size: 4767 bytes --]

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


[-- Attachment #1.3: 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 related	[flat|nested] 14+ messages in thread

* [bug#60386] [PATCH] gnu: Add guile-proba.
  2023-01-18 18:20       ` Luis Felipe via Guix-patches via
@ 2023-01-23 22:25         ` Ludovic Courtès
  2023-01-25  1:11           ` Luis Felipe via Guix-patches via
  0 siblings, 1 reply; 14+ messages in thread
From: Ludovic Courtès @ 2023-01-23 22:25 UTC (permalink / raw)
  To: Luis Felipe; +Cc: 60386

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




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

* [bug#60386] [PATCH] gnu: Add guile-proba.
  2023-01-23 22:25         ` Ludovic Courtès
@ 2023-01-25  1:11           ` Luis Felipe via Guix-patches via
  2023-01-26  9:35             ` Ludovic Courtès
  0 siblings, 1 reply; 14+ messages in thread
From: Luis Felipe via Guix-patches via @ 2023-01-25  1:11 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 60386


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

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

[-- 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] 14+ messages in thread

* [bug#60386] [PATCH] gnu: Add guile-proba.
  2023-01-25  1:11           ` Luis Felipe via Guix-patches via
@ 2023-01-26  9:35             ` Ludovic Courtès
  2023-01-26 14:29               ` Luis Felipe via Guix-patches via
  0 siblings, 1 reply; 14+ messages in thread
From: Ludovic Courtès @ 2023-01-26  9:35 UTC (permalink / raw)
  To: Luis Felipe; +Cc: 60386

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




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

* [bug#60386] [PATCH] gnu: Add guile-proba.
  2023-01-26  9:35             ` Ludovic Courtès
@ 2023-01-26 14:29               ` Luis Felipe via Guix-patches via
  2023-02-06 15:40                 ` Luis Felipe via Guix-patches via
  0 siblings, 1 reply; 14+ messages in thread
From: Luis Felipe via Guix-patches via @ 2023-01-26 14:29 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 60386


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

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,

[-- 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] 14+ messages in thread

* [bug#60386] [PATCH] gnu: Add guile-proba.
  2023-01-26 14:29               ` Luis Felipe via Guix-patches via
@ 2023-02-06 15:40                 ` Luis Felipe via Guix-patches via
  2023-02-13 13:44                   ` Jelle Licht
  0 siblings, 1 reply; 14+ messages in thread
From: Luis Felipe via Guix-patches via @ 2023-02-06 15:40 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 60386


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

Hello again,

This is a new patch with guile-proba version 0.3.0, which solves the missing module import problem.

🤞

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-gnu-Add-guile-proba.patch --]
[-- Type: text/x-patch; filename="0001-gnu-Add-guile-proba.patch"; name="0001-gnu-Add-guile-proba.patch", Size: 4785 bytes --]

From 528f7d43933aa5e5a5528499b852ed274f33e406 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..c5b3b825e1 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 © 2023 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.3.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 "1mjnrbb6gv5f95i1ihn75yh7ya445pcnj13cy34x2v58h9n2r80s"))))
+    (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
+      "((bogus|bogus-tests|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


[-- Attachment #1.3: 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 related	[flat|nested] 14+ messages in thread

* [bug#60386] [PATCH] gnu: Add guile-proba.
  2023-02-06 15:40                 ` Luis Felipe via Guix-patches via
@ 2023-02-13 13:44                   ` Jelle Licht
  2023-02-15 21:56                     ` Luis Felipe via Guix-patches via
  0 siblings, 1 reply; 14+ messages in thread
From: Jelle Licht @ 2023-02-13 13:44 UTC (permalink / raw)
  To: Luis Felipe, Ludovic Courtès; +Cc: 60386

Hi Luis,

Luis Felipe via Guix-patches via <guix-patches@gnu.org> writes:

> Hello again,
>
> This is a new patch with guile-proba version 0.3.0, which solves the missing module import problem.

Thank you for working on this, both upstream and the package itself. 

> [snip]

> +
> +(define-public guile-proba
> +  (package
> +    (name "guile-proba")
> +    (version "0.3.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 "1mjnrbb6gv5f95i1ihn75yh7ya445pcnj13cy34x2v58h9n2r80s"))))
> +    (build-system guile-build-system)
> +    (inputs (list bash-minimal))
> +    (native-inputs (list guile-3.0 texinfo))

I think guile should be a normal input.  Other packages like this
(e.g. guilescript, ccwl) seem to do it that way.

> +    (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)))))))

This seems almost correct, as it extends the GUILE_LOAD_{,COMPILED}_PATH
at runtime; the user would for still need to have the guile-config and
guile in their profile. Although guile-config is also listed as a
propagated input, when the guile search paths specifications are not
active, the following would not work:

`guix shell --pure guile-proba -- proba run tests'

You could have a look at the 'wrap phase of the ccwl package; they use
the value of (getenv "GUILE_LOAD_{,COMPILED}_PATH") retrieved while
building the package to wrap their script.

> +          (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)))))
Nitpick, so feel free to ignore:
You could split up building and installing the manual.

> +      #:not-compiled-file-regexp
> +      "((bogus|bogus-tests|packages|tests)\\/.*.scm|(proba|manifest).scm)$"))

All of the files listed in this regex are still installed in
<out>/share/guile/site/3.0.  Do you think it would be possible to ensure
these files are not installed?

> +    (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







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

* [bug#60386] [PATCH] gnu: Add guile-proba.
  2023-02-13 13:44                   ` Jelle Licht
@ 2023-02-15 21:56                     ` Luis Felipe via Guix-patches via
  2023-02-21 17:54                       ` bug#60386: " Jelle Licht
  0 siblings, 1 reply; 14+ messages in thread
From: Luis Felipe via Guix-patches via @ 2023-02-15 21:56 UTC (permalink / raw)
  To: Jelle Licht; +Cc: Ludovic Courtès, 60386


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

Hi Jelle, thanks for taking a look.

I'm sending a new patch after this message, but I'm replying to your review below.


On Monday, February 13th, 2023 at 13:44, Jelle Licht <jlicht@fsfe.org> wrote:

> > + (native-inputs (list guile-3.0 texinfo))
> 

> 

> I think guile should be a normal input. Other packages like this
> (e.g. guilescript, ccwl) seem to do it that way.

I moved it to inputs now. But I placed it in native-inputs following the guile-build-system documentation in the manual:

"Packages built with ‘guile-build-system’ must provide a Guile package in their ‘native-inputs’ field."

Did I misunderstand or should that part of the manual be updated?


> > + (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)))))))
> 

> 

> This seems almost correct, as it extends the GUILE_LOAD_{,COMPILED}PATH
> at runtime; the user would for still need to have the guile-config and
> guile in their profile. Although guile-config is also listed as a
> propagated input, when the guile search paths specifications are not
> active, the following would not work:
> 

> `guix shell --pure guile-proba -- proba run tests'
> 

> You could have a look at the 'wrap phase of the ccwl package; they use
> the value of (getenv "GUILE_LOAD{,COMPILED}_PATH") retrieved while
> building the package to wrap their script.

I added a new phase to set Guile load paths so that they take (getenv "GUILE_LOAD{,COMPILED}_PATH") into account, and modified the wrapping accordingly. In my test, running "guix shell --pure guile-proba -- proba run tests" works now.


> > + (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)))))
> 

> Nitpick, so feel free to ignore:
> You could split up building and installing the manual.

I put building into a separate phase.


> > + #:not-compiled-file-regexp
> > + "((bogus|bogus-tests|packages|tests)\\/.*.scm|(proba|manifest).scm)$"))
> 

> 

> All of the files listed in this regex are still installed in
> <out>/share/guile/site/3.0. Do you think it would be possible to ensure
> these files are not installed?

It was possible. Now it looks like this:

/gnu/store/xaqmf7n83h5dq9xv6is46ybjk98ssakr-guile-proba-0.3.0
|-- bin
|   `-- proba
|-- lib
|   `-- guile
|       `-- 3.0
|           `-- site-ccache
|               `-- proba
|                   |-- cli.go
|                   |-- commands.go
|                   |-- runners.go
|                   |-- templates.go
|                   `-- utils.go
`-- share
    |-- doc
    |   `-- guile-proba-0.3.0
    |       |-- README.org
    |       `-- index.html
    |-- guile
    |   `-- site
    |       `-- 3.0
    |           `-- proba
    |               |-- cli.scm
    |               |-- commands.scm
    |               |-- runners.scm
    |               |-- templates.scm
    |               `-- utils.scm
    `-- info
        `-- guile-proba

[-- 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] 14+ messages in thread

* [bug#60386] [PATCH v4] gnu: Add guile-proba.
  2022-12-28 18:07 [bug#60386] [PATCH] gnu: Add guile-proba Luis Felipe via Guix-patches via
  2023-01-10 10:48 ` Ludovic Courtès
@ 2023-02-15 21:59 ` sirgazil--- via Guix-patches via
  1 sibling, 0 replies; 14+ messages in thread
From: sirgazil--- via Guix-patches via @ 2023-02-15 21:59 UTC (permalink / raw)
  To: 60386; +Cc: Luis Felipe, jlicht

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

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

diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm
index aaa41777dc..d9e547b308 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 © 2023 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,79 @@ (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.3.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 "1mjnrbb6gv5f95i1ihn75yh7ya445pcnj13cy34x2v58h9n2r80s"))))
+    (build-system guile-build-system)
+    (inputs (list bash-minimal guile-3.0))
+    (native-inputs (list texinfo))
+    (propagated-inputs (list guile-config guile-lib))
+    (arguments
+     (list
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'set-paths 'add-output-to-guile-load-paths
+            (lambda* (#:key outputs #:allow-other-keys)
+              (let* ((out (assoc-ref outputs "out"))
+                     (guile-version (target-guile-effective-version))
+                     (scm-path (string-append out
+                                              "/share/guile/site/"
+                                              guile-version))
+                     (go-path (string-append out
+                                             "/lib/guile/"
+                                             guile-version
+                                             "/site-ccache")))
+                (setenv "GUILE_LOAD_PATH"
+                        (string-append scm-path ":"
+                                       (getenv "GUILE_LOAD_PATH")))
+                (setenv "GUILE_LOAD_COMPILED_PATH"
+                        (string-append
+                         go-path ":"
+                         (getenv "GUILE_LOAD_COMPILED_PATH"))))))
+          (add-after 'build 'build-manual
+            (lambda _
+              (invoke "makeinfo" "manual/main.texi")))
+          (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"))
+                     (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" = (,(getenv "GUILE_LOAD_PATH")))
+                  `("GUILE_LOAD_COMPILED_PATH" =
+                    (,(getenv "GUILE_LOAD_COMPILED_PATH")))))))
+          (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)
+                (install-file "guile-proba" info-dir)))))
+      #:scheme-file-regexp
+      #~(begin
+          (use-modules (ice-9 regex))
+          (lambda (file stat) (string-match "/proba/.*\\.scm$" file)))))
+    (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.39.1





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

* bug#60386: [PATCH] gnu: Add guile-proba.
  2023-02-15 21:56                     ` Luis Felipe via Guix-patches via
@ 2023-02-21 17:54                       ` Jelle Licht
  0 siblings, 0 replies; 14+ messages in thread
From: Jelle Licht @ 2023-02-21 17:54 UTC (permalink / raw)
  To: Luis Felipe; +Cc: Ludovic Courtès, 60386-done

Hi Luis,

Pushed to master! Some comments still follow.

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

> Hi Jelle, thanks for taking a look.
>
> I'm sending a new patch after this message, but I'm replying to your review below.
>
>
> On Monday, February 13th, 2023 at 13:44, Jelle Licht <jlicht@fsfe.org> wrote:
>
>> > + (native-inputs (list guile-3.0 texinfo))
>> 
>
>> 
>
>> I think guile should be a normal input. Other packages like this
>> (e.g. guilescript, ccwl) seem to do it that way.
>
> I moved it to inputs now. But I placed it in native-inputs following the guile-build-system documentation in the manual:
>
> "Packages built with ‘guile-build-system’ must provide a Guile package in their ‘native-inputs’ field."
>
> Did I misunderstand or should that part of the manual be updated?

You are correct, but in order to cleanly cross compile, we'd need to:
- add guile to both inputs (for the shebang) and native-inputs (for
cross compilation)
- add all guile libraries to both propagated-inputs and native-inputs
- ensure all guile libraries we depend on can be cross compiled.
- rework the `(getenv ...)' trick again, to be constructed out of the
guile libraries in (propagated-)inputs, instead of the native-inputs.

A quick bit of research makes me think guix is one of few packages
written in guile using autotools that supports cross compilation. I
think we can just leave the entire cross-compilation thing to be done
later, and then have it be done properly for all guile packages at once.

>> > + (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)))))))
>> 
>
>> 
>
>> This seems almost correct, as it extends the GUILE_LOAD_{,COMPILED}PATH
>> at runtime; the user would for still need to have the guile-config and
>> guile in their profile. Although guile-config is also listed as a
>> propagated input, when the guile search paths specifications are not
>> active, the following would not work:
>> 
>
>> `guix shell --pure guile-proba -- proba run tests'
>> 
>
>> You could have a look at the 'wrap phase of the ccwl package; they use
>> the value of (getenv "GUILE_LOAD{,COMPILED}_PATH") retrieved while
>> building the package to wrap their script.
>
> I added a new phase to set Guile load paths so that they take (getenv "GUILE_LOAD{,COMPILED}_PATH") into account, and modified the wrapping accordingly. In my test, running "guix shell --pure guile-proba -- proba run tests" works now.
>
>
>> > + (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)))))
>> 
>
>> Nitpick, so feel free to ignore:
>> You could split up building and installing the manual.
>
> I put building into a separate phase.
>
>
>> > + #:not-compiled-file-regexp
>> > + "((bogus|bogus-tests|packages|tests)\\/.*.scm|(proba|manifest).scm)$"))
>> 
>
>> 
>
>> All of the files listed in this regex are still installed in
>> <out>/share/guile/site/3.0. Do you think it would be possible to ensure
>> these files are not installed?
>
> It was possible. Now it looks like this:
>
> /gnu/store/xaqmf7n83h5dq9xv6is46ybjk98ssakr-guile-proba-0.3.0
> |-- bin
> |   `-- proba
> |-- lib
> |   `-- guile
> |       `-- 3.0
> |           `-- site-ccache
> |               `-- proba
> |                   |-- cli.go
> |                   |-- commands.go
> |                   |-- runners.go
> |                   |-- templates.go
> |                   `-- utils.go
> `-- share
>     |-- doc
>     |   `-- guile-proba-0.3.0
>     |       |-- README.org
>     |       `-- index.html
>     |-- guile
>     |   `-- site
>     |       `-- 3.0
>     |           `-- proba
>     |               |-- cli.scm
>     |               |-- commands.scm
>     |               |-- runners.scm
>     |               |-- templates.scm
>     |               `-- utils.scm
>     `-- info
>         `-- guile-proba




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

end of thread, other threads:[~2023-02-21 17:55 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-28 18:07 [bug#60386] [PATCH] gnu: Add guile-proba Luis Felipe via Guix-patches via
2023-01-10 10:48 ` Ludovic Courtès
2023-01-13 15:41   ` Luis Felipe via Guix-patches via
2023-01-17 13:50     ` Ludovic Courtès
2023-01-18 18:20       ` Luis Felipe via Guix-patches via
2023-01-23 22:25         ` Ludovic Courtès
2023-01-25  1:11           ` Luis Felipe via Guix-patches via
2023-01-26  9:35             ` Ludovic Courtès
2023-01-26 14:29               ` Luis Felipe via Guix-patches via
2023-02-06 15:40                 ` Luis Felipe via Guix-patches via
2023-02-13 13:44                   ` Jelle Licht
2023-02-15 21:56                     ` Luis Felipe via Guix-patches via
2023-02-21 17:54                       ` bug#60386: " Jelle Licht
2023-02-15 21:59 ` [bug#60386] [PATCH v4] " sirgazil--- via Guix-patches via

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