all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#50677: [PATCH] Minetest basic_materials really depends on moreores
@ 2021-09-19 15:23 Vivien Kraus via Bug reports for GNU Guix
  2021-09-19 17:40 ` Maxime Devos
  0 siblings, 1 reply; 16+ messages in thread
From: Vivien Kraus via Bug reports for GNU Guix @ 2021-09-19 15:23 UTC (permalink / raw)
  To: 50677

[-- Attachment #1: Type: text/plain, Size: 333 bytes --]

Dear guix,

basic_materials actually requires moreores, otherwise some craft
recipes are just not possible. For instance,
basic_materials:silver_wire can only be crafted with
moreores:silver_ingot. This silver wire is actually needed for basic
technic machines, such as the LV compressor.

So, let’s add minetest-moreores!

Vivien

[-- Attachment #2: 0002-gnu-minetest-basic-materials-Depend-on-minetest-more.patch --]
[-- Type: text/x-patch, Size: 1144 bytes --]

From 29ad4ee950fae906c90c512dedde7b5198f09f63 Mon Sep 17 00:00:00 2001
From: Vivien Kraus <vivien@planete-kraus.eu>
Date: Sun, 19 Sep 2021 17:00:45 +0200
Subject: [PATCH 2/2] gnu: minetest-basic-materials: Depend on
 minetest-moreores.

* minetest.scm (minetest-basic-materials): Add minetest-moreores as a propagated input.
---
 gnu/packages/minetest.scm | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/gnu/packages/minetest.scm b/gnu/packages/minetest.scm
index 49e5a00fd2..9bcd470634 100644
--- a/gnu/packages/minetest.scm
+++ b/gnu/packages/minetest.scm
@@ -230,6 +230,10 @@ numeric identifier TOPIC-ID on the official Minetest forums."
         (base32 "0v6l3lrjgshy4sccjhfhmfxc3gk0cdy73qb02i9wd2vw506v5asx"))
        (file-name (git-file-name name version))))
     (build-system minetest-mod-build-system)
+    (propagated-inputs
+     ;; basic_materials:silver_wire cannot be crafted without
+     ;; moreores:silver_ingot.
+     `(("minetest-moreores" ,minetest-moreores)))
     (home-page (minetest-topic 21000))
     (synopsis "Some \"basic\" materials and items for other Minetest mods to use")
     (description
-- 
2.33.0


[-- Attachment #3: 0001-gnu-Add-minetest-moreores.patch --]
[-- Type: text/x-patch, Size: 1876 bytes --]

From 7beb382034560802e189a6494b6de40818cc1755 Mon Sep 17 00:00:00 2001
From: Vivien Kraus <vivien@planete-kraus.eu>
Date: Sun, 19 Sep 2021 16:58:53 +0200
Subject: [PATCH 1/2] gnu: Add minetest-moreores.

* gnu/packages/minetest.scm (minetest-moreores): New variable.
---
 gnu/packages/minetest.scm | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/gnu/packages/minetest.scm b/gnu/packages/minetest.scm
index fd1439d4d2..49e5a00fd2 100644
--- a/gnu/packages/minetest.scm
+++ b/gnu/packages/minetest.scm
@@ -187,6 +187,34 @@ numeric identifier TOPIC-ID on the official Minetest forums."
   (string-append "https://forum.minetest.net/viewtopic.php?t="
                  (number->string topic-id)))
 
+(define-public minetest-moreores
+  (package
+    (name "minetest-moreores")
+    (version "v2.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/minetest-mods/moreores")
+             (commit "0b6f669df4c9b7771c03e0e6ba8effb471cdfcae")))
+       (sha256 (base32 "1chfqbc6bb27aacjc67j5l5wcdvmcsvk2rfmangipd7nwini3y34"))
+       (file-name (git-file-name name version))))
+    (build-system minetest-mod-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'install 'install-_config.txt
+           (lambda* (#:key inputs #:allow-other-keys)
+             (copy-file
+              "_config.txt"
+              (string-append %output "/share/minetest/mods/moreores/_config.txt"))
+             #t)))))
+    (home-page (minetest-topic 549))
+    (synopsis "Adds new ore types")
+    (description "More ores for Minetest.")
+    (license license:zlib)
+    (properties `((upstream-name . "Calinou/moreores")))))
+
 (define-public minetest-basic-materials
   (package
     (name "minetest-basic-materials")
-- 
2.33.0


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

* bug#50677: [PATCH] Minetest basic_materials really depends on moreores
  2021-09-19 15:23 bug#50677: [PATCH] Minetest basic_materials really depends on moreores Vivien Kraus via Bug reports for GNU Guix
@ 2021-09-19 17:40 ` Maxime Devos
  2021-09-19 18:54   ` Vivien Kraus via Bug reports for GNU Guix
  0 siblings, 1 reply; 16+ messages in thread
From: Maxime Devos @ 2021-09-19 17:40 UTC (permalink / raw)
  To: Vivien Kraus, 50677

[-- Attachment #1: Type: text/plain, Size: 1306 bytes --]

Vivien Kraus via Bug reports for GNU Guix schreef op zo 19-09-2021 om 17:23 [+0200]:
> Dear guix,
> 
> basic_materials actually requires moreores, otherwise some craft
> recipes are just not possible. For instance,
> basic_materials:silver_wire can only be crafted with
> moreores:silver_ingot. This silver wire is actually needed for basic
> technic machines, such as the LV compressor.
> 
> So, let’s add minetest-moreores!

In creative mode, crafting isn't necessary, you can give yourself all
the items and blocks you want.  OTOH, letting the crafting recipes
work (at least when all the mods are enabled for the world,
they seem to be disabled by default) seems rather important for ‘survival’
players, so adding a propagated-input doesn't seem unreasonable here.

> + (version "v2.1.0")

Versions in guix don't use any leading "v" prefix.  If I'm not mistaken,
Ludovic applied the patched to remove them automatically.

> +          (lambda* (#:key inputs #:allow-other-keys)

inputs is unused, so you can write '(lambda _' here instead (somewhat simpler)

> /share/minetest/mods/moreores/_config.txt

Is this "_config.txt" file moreores-specific?  If not, maybe minetest-mod-build-system
could be modified to install these files by default?

Greetings,
Maxime

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

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

* bug#50677: [PATCH] Minetest basic_materials really depends on moreores
  2021-09-19 17:40 ` Maxime Devos
@ 2021-09-19 18:54   ` Vivien Kraus via Bug reports for GNU Guix
  2021-09-19 18:59     ` Vivien Kraus via Bug reports for GNU Guix
  2021-09-19 19:11     ` Maxime Devos
  0 siblings, 2 replies; 16+ messages in thread
From: Vivien Kraus via Bug reports for GNU Guix @ 2021-09-19 18:54 UTC (permalink / raw)
  To: Maxime Devos, 50677

[-- Attachment #1: Type: text/plain, Size: 1485 bytes --]

Hello,

Le dimanche 19 septembre 2021 à 19:40 +0200, Maxime Devos a écrit :
> > + (version "v2.1.0")
> 
> Versions in guix don't use any leading "v" prefix.  If I'm not
> mistaken,
> Ludovic applied the patched to remove them automatically.
Right, I just had not guix pulled lately, I confirm it works with a
more recent guix version.

> > /share/minetest/mods/moreores/_config.txt
> 
> Is this "_config.txt" file moreores-specific?  If not, maybe
> minetest-mod-build-system
> could be modified to install these files by default?
I don’t know, but a quick web search for:

   minetest mod "_config.txt"

gave me 2 hits, one for moreores, and one for moreblocks, by the same
author. I supposed it is an author preference.

I forgot to say, I could not figure out why the package did not build,
because the check phase in the minetest build system stops after the
first error line of output, which only stated that there was a problem
with init.lua. I had to disable the error line detection in the build
system implementation to know it was a problem with this file. So, I
figured out that what we need to do is gather all error lines, until
either the server stops or starts despite the error, and fail only
then.

I prefer the exceptions API because it can handle multiple lines of
errors while displaying them cleanly (unlike the error function, that
displays an ugly ~a and prints the arguments on 1 line). But, it’s only
for the "new" guile 3.0.

What do you think?

Vivien

[-- Attachment #2: 0003-gnu-minetest-basic-materials-Depend-on-minetest-more.patch --]
[-- Type: text/x-patch, Size: 1144 bytes --]

From eeb9c3a599aa07b36bd8b8ca8000ad6ef594dd99 Mon Sep 17 00:00:00 2001
From: Vivien Kraus <vivien@planete-kraus.eu>
Date: Sun, 19 Sep 2021 17:00:45 +0200
Subject: [PATCH 3/3] gnu: minetest-basic-materials: Depend on
 minetest-moreores.

* minetest.scm (minetest-basic-materials): Add minetest-moreores as a propagated input.
---
 gnu/packages/minetest.scm | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/gnu/packages/minetest.scm b/gnu/packages/minetest.scm
index de1415097d..666f78c6ba 100644
--- a/gnu/packages/minetest.scm
+++ b/gnu/packages/minetest.scm
@@ -230,6 +230,10 @@ numeric identifier TOPIC-ID on the official Minetest forums."
         (base32 "0v6l3lrjgshy4sccjhfhmfxc3gk0cdy73qb02i9wd2vw506v5asx"))
        (file-name (git-file-name name version))))
     (build-system minetest-mod-build-system)
+    (propagated-inputs
+     ;; basic_materials:silver_wire cannot be crafted without
+     ;; moreores:silver_ingot.
+     `(("minetest-moreores" ,minetest-moreores)))
     (home-page (minetest-topic 21000))
     (synopsis "Some \"basic\" materials and items for other Minetest mods to use")
     (description
-- 
2.33.0


[-- Attachment #3: 0002-gnu-Add-minetest-moreores.patch --]
[-- Type: text/x-patch, Size: 1843 bytes --]

From d19f2812f8b77fc2896ff1b8b42b9d99efb42a0c Mon Sep 17 00:00:00 2001
From: Vivien Kraus <vivien@planete-kraus.eu>
Date: Sun, 19 Sep 2021 16:58:53 +0200
Subject: [PATCH 2/3] gnu: Add minetest-moreores.

* gnu/packages/minetest.scm (minetest-moreores): New variable.
---
 gnu/packages/minetest.scm | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/gnu/packages/minetest.scm b/gnu/packages/minetest.scm
index fd1439d4d2..de1415097d 100644
--- a/gnu/packages/minetest.scm
+++ b/gnu/packages/minetest.scm
@@ -187,6 +187,34 @@ numeric identifier TOPIC-ID on the official Minetest forums."
   (string-append "https://forum.minetest.net/viewtopic.php?t="
                  (number->string topic-id)))
 
+(define-public minetest-moreores
+  (package
+    (name "minetest-moreores")
+    (version "2.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/minetest-mods/moreores")
+             (commit "0b6f669df4c9b7771c03e0e6ba8effb471cdfcae")))
+       (sha256 (base32 "1chfqbc6bb27aacjc67j5l5wcdvmcsvk2rfmangipd7nwini3y34"))
+       (file-name (git-file-name name version))))
+    (build-system minetest-mod-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'install 'install-_config.txt
+           (lambda* _
+             (copy-file
+              "_config.txt"
+              (string-append %output "/share/minetest/mods/moreores/_config.txt"))
+             #t)))))
+    (home-page (minetest-topic 549))
+    (synopsis "Adds new ore types")
+    (description "More ores for Minetest.")
+    (license license:zlib)
+    (properties `((upstream-name . "Calinou/moreores")))))
+
 (define-public minetest-basic-materials
   (package
     (name "minetest-basic-materials")
-- 
2.33.0


[-- Attachment #4: 0001-guix-minetest-build-system-Report-all-error-lines-be.patch --]
[-- Type: text/x-patch, Size: 2318 bytes --]

From 48095aa751cef4202e280c2d0ffa35a8d1cb5c12 Mon Sep 17 00:00:00 2001
From: Vivien Kraus <vivien@planete-kraus.eu>
Date: Sun, 19 Sep 2021 20:03:10 +0200
Subject: [PATCH 1/3] guix: minetest-build-system: Report all error lines
 before failing

* minetest-build-system.scm (check): Report all error lines before failing.
---
 guix/build/minetest-build-system.scm | 28 +++++++++++++++++-----------
 1 file changed, 17 insertions(+), 11 deletions(-)

diff --git a/guix/build/minetest-build-system.scm b/guix/build/minetest-build-system.scm
index 477cc3d1d0..badc45112b 100644
--- a/guix/build/minetest-build-system.scm
+++ b/guix/build/minetest-build-system.scm
@@ -23,6 +23,7 @@
   #:use-module (ice-9 rdelim)
   #:use-module (ice-9 receive)
   #:use-module (ice-9 regex)
+  #:use-module (ice-9 exceptions)
   #:use-module ((guix build gnu-build-system) #:prefix gnu:)
   #:use-module ((guix build copy-build-system) #:prefix copy:)
   #:export (%standard-phases
@@ -199,20 +200,25 @@ auth_backend = sqlite3
         (define (stop? line)
           (and (string? line)
                (string-contains line "ACTION[Server]: singleplayer [127.0.0.1] joins game.")))
-        (let loop ()
-          (match (read-line port)
-            ((? error? line)
-             (error "minetest raised an error: ~a" line))
-            ((? stop?)
+        (let loop ((errors '()))
+          (match `(,(read-line port) ,errors)
+            (((? error? line) errors)
+             (loop `(,line ,@errors)))
+            (((? string? line) errors)
+             (display line)
+             (newline)
+             (loop errors))
+            (((? stop?) ())
              (kill pid SIGINT)
              (close-port port)
              (waitpid pid))
-            ((? string? line)
-             (display line)
-             (newline)
-             (loop))
-            ((? eof-object?)
-             (error "minetest didn't start"))))))))
+            (((? eof-object?) ())
+             (error "minetest didn't start"))
+            (((or (? stop?) (? eof-object?)) errors)
+             (raise-exception
+              (apply make-exception
+                     (map make-exception-with-message
+                          (reverse errors)))))))))))
 
 (define %standard-phases
   (modify-phases gnu:%standard-phases
-- 
2.33.0


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

* bug#50677: [PATCH] Minetest basic_materials really depends on moreores
  2021-09-19 18:54   ` Vivien Kraus via Bug reports for GNU Guix
@ 2021-09-19 18:59     ` Vivien Kraus via Bug reports for GNU Guix
  2021-09-19 19:18       ` Maxime Devos
  2021-09-19 19:11     ` Maxime Devos
  1 sibling, 1 reply; 16+ messages in thread
From: Vivien Kraus via Bug reports for GNU Guix @ 2021-09-19 18:59 UTC (permalink / raw)
  To: Maxime Devos, 50677

[-- Attachment #1: Type: text/plain, Size: 907 bytes --]

Le dimanche 19 septembre 2021 à 20:54 +0200, Vivien Kraus a écrit :
> I forgot to say, I could not figure out why the package did not
> build,
> because the check phase in the minetest build system stops after the
> first error line of output, which only stated that there was a
> problem
> with init.lua. I had to disable the error line detection in the build
> system implementation to know it was a problem with this file. So, I
> figured out that what we need to do is gather all error lines, until
> either the server stops or starts despite the error, and fail only
> then.
> 
> I prefer the exceptions API because it can handle multiple lines of
> errors while displaying them cleanly (unlike the error function, that
> displays an ugly ~a and prints the arguments on 1 line). But, it’s
> only
> for the "new" guile 3.0.
Sorry, the patterns were not in the correct order. This version is
better.

[-- Attachment #2: 0001-guix-minetest-build-system-Report-all-error-lines-be.patch --]
[-- Type: text/x-patch, Size: 2260 bytes --]

From 8daeded7ce3eeb02a1b239577fd26ffdf6a2b247 Mon Sep 17 00:00:00 2001
From: Vivien Kraus <vivien@planete-kraus.eu>
Date: Sun, 19 Sep 2021 20:03:10 +0200
Subject: [PATCH 1/3] guix: minetest-build-system: Report all error lines
 before failing

* minetest-build-system.scm (check): Report all error lines before failing.
---
 guix/build/minetest-build-system.scm | 24 +++++++++++++++---------
 1 file changed, 15 insertions(+), 9 deletions(-)

diff --git a/guix/build/minetest-build-system.scm b/guix/build/minetest-build-system.scm
index 477cc3d1d0..985859036c 100644
--- a/guix/build/minetest-build-system.scm
+++ b/guix/build/minetest-build-system.scm
@@ -23,6 +23,7 @@
   #:use-module (ice-9 rdelim)
   #:use-module (ice-9 receive)
   #:use-module (ice-9 regex)
+  #:use-module (ice-9 exceptions)
   #:use-module ((guix build gnu-build-system) #:prefix gnu:)
   #:use-module ((guix build copy-build-system) #:prefix copy:)
   #:export (%standard-phases
@@ -199,20 +200,25 @@ auth_backend = sqlite3
         (define (stop? line)
           (and (string? line)
                (string-contains line "ACTION[Server]: singleplayer [127.0.0.1] joins game.")))
-        (let loop ()
-          (match (read-line port)
-            ((? error? line)
-             (error "minetest raised an error: ~a" line))
-            ((? stop?)
+        (let loop ((errors '()))
+          (match `(,(read-line port) ,errors)
+            (((? error? line) errors)
+             (loop `(,line ,@errors)))
+            (((? stop?) ())
              (kill pid SIGINT)
              (close-port port)
              (waitpid pid))
-            ((? string? line)
+            (((? eof-object?) ())
+             (error "minetest didn't start"))
+            (((or (? stop?) (? eof-object?)) errors)
+             (raise-exception
+              (apply make-exception
+                     (map make-exception-with-message
+                          (reverse errors)))))
+            (((? string? line) errors)
              (display line)
              (newline)
-             (loop))
-            ((? eof-object?)
-             (error "minetest didn't start"))))))))
+             (loop errors))))))))
 
 (define %standard-phases
   (modify-phases gnu:%standard-phases
-- 
2.33.0


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

* bug#50677: [PATCH] Minetest basic_materials really depends on moreores
  2021-09-19 18:54   ` Vivien Kraus via Bug reports for GNU Guix
  2021-09-19 18:59     ` Vivien Kraus via Bug reports for GNU Guix
@ 2021-09-19 19:11     ` Maxime Devos
  2021-09-19 21:05       ` Vivien Kraus via Bug reports for GNU Guix
  1 sibling, 1 reply; 16+ messages in thread
From: Maxime Devos @ 2021-09-19 19:11 UTC (permalink / raw)
  To: Vivien Kraus, 50677

[-- Attachment #1: Type: text/plain, Size: 1283 bytes --]

Vivien Kraus schreef op zo 19-09-2021 om 20:54 [+0200]:
> Hello,
> 
> Le dimanche 19 septembre 2021 à 19:40 +0200, Maxime Devos a écrit :
> > > + (version "v2.1.0")
> > 
> > Versions in guix don't use any leading "v" prefix.  If I'm not
> > mistaken,
> > Ludovic applied the patched to remove them automatically.
> Right, I just had not guix pulled lately, I confirm it works with a
> more recent guix version.
> 
> > > /share/minetest/mods/moreores/_config.txt
> > 
> > Is this "_config.txt" file moreores-specific?  If not, maybe
> > minetest-mod-build-system
> > could be modified to install these files by default?
> I don’t know, but a quick web search for:
> 
>    minetest mod "_config.txt"
> 
> gave me 2 hits, one for moreores, and one for moreblocks, by the same
> author. I supposed it is an author preference.

I found a use of "config.txt" (https://forum.minetest.net/viewtopic.php?t=2290),
"settingstypes.txt" (https://github.com/NathanSalapat/more_fire/blob/master/settingtypes.txt)
and another "_config.txt" (https://forum.minetest.net/viewtopic.php?t=25275).

"settingstypes.txt" is already in mod-install-plan (guix build minetest-build-system).
I suppose you can add "config.txt" and "_config.txt" as well.

Greetings,
Maxime.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

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

* bug#50677: [PATCH] Minetest basic_materials really depends on moreores
  2021-09-19 18:59     ` Vivien Kraus via Bug reports for GNU Guix
@ 2021-09-19 19:18       ` Maxime Devos
  0 siblings, 0 replies; 16+ messages in thread
From: Maxime Devos @ 2021-09-19 19:18 UTC (permalink / raw)
  To: Vivien Kraus, 50677

[-- Attachment #1: Type: text/plain, Size: 1454 bytes --]

Vivien Kraus schreef op zo 19-09-2021 om 20:59 [+0200]:
> Le dimanche 19 septembre 2021 à 20:54 +0200, Vivien Kraus a écrit :
> > I forgot to say, I could not figure out why the package did not
> > build,
> > because the check phase in the minetest build system stops after the
> > first error line of output, which only stated that there was a
> > problem
> > with init.lua. I had to disable the error line detection in the build
> > system implementation to know it was a problem with this file. So, I
> > figured out that what we need to do is gather all error lines, until
> > either the server stops or starts despite the error, and fail only
> > then.
> >
> > I prefer the exceptions API because it can handle multiple lines of
> > errors while displaying them cleanly (unlike the error function, that
> > displays an ugly ~a and prints the arguments on 1 line). But, it’s
> > only
> > for the "new" guile 3.0.

This modified error reporting seems reasonable to me, but I haven't tested
it.  It only being for the "new" guile 3.0 is probably fine.  IIUC, within
the build environment, guile 3.0.SOMETHING is used, and configure.ac
only checks for guile 3.0:

dnl Search for 'guile' and 'guild'.  This macro defines
dnl 'GUILE_EFFECTIVE_VERSION'.
GUILE_PKG([3.0])
GUILE_PROGS
if test "x$GUILD" = "x"; then
   AC_MSG_ERROR(['guild' binary not found; please check your Guile installation.])
fi

Greetings,
Maxime

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

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

* bug#50677: [PATCH] Minetest basic_materials really depends on moreores
  2021-09-19 19:11     ` Maxime Devos
@ 2021-09-19 21:05       ` Vivien Kraus via Bug reports for GNU Guix
  2021-09-22 16:46         ` Vivien Kraus via Bug reports for GNU Guix
  0 siblings, 1 reply; 16+ messages in thread
From: Vivien Kraus via Bug reports for GNU Guix @ 2021-09-19 21:05 UTC (permalink / raw)
  To: Maxime Devos, 50677

[-- Attachment #1: Type: text/plain, Size: 1870 bytes --]

Le dimanche 19 septembre 2021 à 21:11 +0200, Maxime Devos a écrit :
> I found a use of "config.txt" (
> https://forum.minetest.net/viewtopic.php?t=2290),
> "settingstypes.txt" (
> https://github.com/NathanSalapat/more_fire/blob/master/settingtypes.txt
> )
> and another "_config.txt" (
> https://forum.minetest.net/viewtopic.php?t=25275).
> 
> "settingstypes.txt" is already in mod-install-plan (guix build
> minetest-build-system).
> I suppose you can add "config.txt" and "_config.txt" as well.

OK.

> Vivien Kraus schreef op zo 19-09-2021 om 20:59 [+0200]:
> > Le dimanche 19 septembre 2021 à 20:54 +0200, Vivien Kraus a écrit :
> > > I forgot to say, I could not figure out why the package did not
> > > build,
> > > because the check phase in the minetest build system stops after
> the
> > > first error line of output, which only stated that there was a
> > > problem
> > > with init.lua. I had to disable the error line detection in the
> build
> > > system implementation to know it was a problem with this file.
> So, I
> > > figured out that what we need to do is gather all error lines,
> until
> > > either the server stops or starts despite the error, and fail
> only
> > > then.
> > >
> > > I prefer the exceptions API because it can handle multiple lines
> of
> > > errors while displaying them cleanly (unlike the error function,
> that
> > > displays an ugly ~a and prints the arguments on 1 line). But,
> it’s
> > > only
> > > for the "new" guile 3.0.
> 
> This modified error reporting seems reasonable to me, but I haven't
> tested
> it.

I link my output without 0001 (fail at first error line) nor 0002 (fail
because of _config.txt): the build fails without a mention of
_config.txt; and my output just without 0002: the build fails more
nicely. Also, all other packages returned by "guix search minetest"
still build successfully.

Vivien

[-- Attachment #2: 0004-gnu-minetest-basic-materials-Depend-on-minetest-more.patch --]
[-- Type: text/x-patch, Size: 1144 bytes --]

From 154ff4665ededc1af5d088987362975b623d8303 Mon Sep 17 00:00:00 2001
From: Vivien Kraus <vivien@planete-kraus.eu>
Date: Sun, 19 Sep 2021 17:00:45 +0200
Subject: [PATCH 4/4] gnu: minetest-basic-materials: Depend on
 minetest-moreores.

* minetest.scm (minetest-basic-materials): Add minetest-moreores as a propagated input.
---
 gnu/packages/minetest.scm | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/gnu/packages/minetest.scm b/gnu/packages/minetest.scm
index 0730de7351..189889f890 100644
--- a/gnu/packages/minetest.scm
+++ b/gnu/packages/minetest.scm
@@ -221,6 +221,10 @@ numeric identifier TOPIC-ID on the official Minetest forums."
         (base32 "0v6l3lrjgshy4sccjhfhmfxc3gk0cdy73qb02i9wd2vw506v5asx"))
        (file-name (git-file-name name version))))
     (build-system minetest-mod-build-system)
+    (propagated-inputs
+     ;; basic_materials:silver_wire cannot be crafted without
+     ;; moreores:silver_ingot.
+     `(("minetest-moreores" ,minetest-moreores)))
     (home-page (minetest-topic 21000))
     (synopsis "Some \"basic\" materials and items for other Minetest mods to use")
     (description
-- 
2.33.0


[-- Attachment #3: 0003-gnu-Add-minetest-moreores.patch --]
[-- Type: text/x-patch, Size: 1527 bytes --]

From 60eb61bf110a9a3702ae6a7d35efc347363d73f1 Mon Sep 17 00:00:00 2001
From: Vivien Kraus <vivien@planete-kraus.eu>
Date: Sun, 19 Sep 2021 16:58:53 +0200
Subject: [PATCH 3/4] gnu: Add minetest-moreores.

* gnu/packages/minetest.scm (minetest-moreores): New variable.
---
 gnu/packages/minetest.scm | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/gnu/packages/minetest.scm b/gnu/packages/minetest.scm
index fd1439d4d2..0730de7351 100644
--- a/gnu/packages/minetest.scm
+++ b/gnu/packages/minetest.scm
@@ -187,6 +187,25 @@ numeric identifier TOPIC-ID on the official Minetest forums."
   (string-append "https://forum.minetest.net/viewtopic.php?t="
                  (number->string topic-id)))
 
+(define-public minetest-moreores
+  (package
+    (name "minetest-moreores")
+    (version "2.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/minetest-mods/moreores")
+             (commit "0b6f669df4c9b7771c03e0e6ba8effb471cdfcae")))
+       (sha256 (base32 "1chfqbc6bb27aacjc67j5l5wcdvmcsvk2rfmangipd7nwini3y34"))
+       (file-name (git-file-name name version))))
+    (build-system minetest-mod-build-system)
+    (home-page (minetest-topic 549))
+    (synopsis "Adds new ore types")
+    (description "More ores for Minetest.")
+    (license license:zlib)
+    (properties `((upstream-name . "Calinou/moreores")))))
+
 (define-public minetest-basic-materials
   (package
     (name "minetest-basic-materials")
-- 
2.33.0


[-- Attachment #4: 0002-guix-minetest-build-system-Also-install-config.txt-a.patch --]
[-- Type: text/x-patch, Size: 1125 bytes --]

From a2de70e505e5e541a516cb7f2b8f46e58c0d918f Mon Sep 17 00:00:00 2001
From: Vivien Kraus <vivien@planete-kraus.eu>
Date: Sun, 19 Sep 2021 22:42:49 +0200
Subject: [PATCH 2/4] guix: minetest-build-system: Also install config.txt and
 _config.txt

* minetest-build-system.scm (mod-install-plan): Add config.txt and _config.txt to the list of installed files.
---
 guix/build/minetest-build-system.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/guix/build/minetest-build-system.scm b/guix/build/minetest-build-system.scm
index 985859036c..79e5a67b89 100644
--- a/guix/build/minetest-build-system.scm
+++ b/guix/build/minetest-build-system.scm
@@ -41,7 +41,7 @@
      ;; See <https://github.com/minetest/minetest/blob/master/doc/lua_api.txt>
      ;; for an incomple list of files that can be found in mods.
      #:include ("mod.conf" "modpack.conf" "settingtypes.txt" "depends.txt"
-                "description.txt")
+                "description.txt" "config.txt" "_config.txt")
      #:include-regexp (".lua$" ".png$" ".ogg$" ".obj$" ".b3d$" ".tr$"
                        ".mts$"))))
 
-- 
2.33.0


[-- Attachment #5: 0001-guix-minetest-build-system-Report-all-error-lines-be.patch --]
[-- Type: text/x-patch, Size: 2260 bytes --]

From 8daeded7ce3eeb02a1b239577fd26ffdf6a2b247 Mon Sep 17 00:00:00 2001
From: Vivien Kraus <vivien@planete-kraus.eu>
Date: Sun, 19 Sep 2021 20:03:10 +0200
Subject: [PATCH 1/4] guix: minetest-build-system: Report all error lines
 before failing

* minetest-build-system.scm (check): Report all error lines before failing.
---
 guix/build/minetest-build-system.scm | 24 +++++++++++++++---------
 1 file changed, 15 insertions(+), 9 deletions(-)

diff --git a/guix/build/minetest-build-system.scm b/guix/build/minetest-build-system.scm
index 477cc3d1d0..985859036c 100644
--- a/guix/build/minetest-build-system.scm
+++ b/guix/build/minetest-build-system.scm
@@ -23,6 +23,7 @@
   #:use-module (ice-9 rdelim)
   #:use-module (ice-9 receive)
   #:use-module (ice-9 regex)
+  #:use-module (ice-9 exceptions)
   #:use-module ((guix build gnu-build-system) #:prefix gnu:)
   #:use-module ((guix build copy-build-system) #:prefix copy:)
   #:export (%standard-phases
@@ -199,20 +200,25 @@ auth_backend = sqlite3
         (define (stop? line)
           (and (string? line)
                (string-contains line "ACTION[Server]: singleplayer [127.0.0.1] joins game.")))
-        (let loop ()
-          (match (read-line port)
-            ((? error? line)
-             (error "minetest raised an error: ~a" line))
-            ((? stop?)
+        (let loop ((errors '()))
+          (match `(,(read-line port) ,errors)
+            (((? error? line) errors)
+             (loop `(,line ,@errors)))
+            (((? stop?) ())
              (kill pid SIGINT)
              (close-port port)
              (waitpid pid))
-            ((? string? line)
+            (((? eof-object?) ())
+             (error "minetest didn't start"))
+            (((or (? stop?) (? eof-object?)) errors)
+             (raise-exception
+              (apply make-exception
+                     (map make-exception-with-message
+                          (reverse errors)))))
+            (((? string? line) errors)
              (display line)
              (newline)
-             (loop))
-            ((? eof-object?)
-             (error "minetest didn't start"))))))))
+             (loop errors))))))))
 
 (define %standard-phases
   (modify-phases gnu:%standard-phases
-- 
2.33.0


[-- Attachment #6: without-0001-0002-patch.txt --]
[-- Type: text/plain, Size: 1370 bytes --]

2021-09-19 20:52:06: INFO[Main]: Mod "farming" loaded after 2 ms
Backtrace:
           7 (primitive-load "/gnu/store/xrvsdyq9f8wc3am40kmc9yms8c6…")
In ice-9/eval.scm:
   191:35  6 (_ _)
In guix/build/gnu-build-system.scm:
    838:2  5 (gnu-build #:source _ #:outputs _ #:inputs _ #:phases . #)
In ice-9/boot-9.scm:
  1736:10  4 (with-exception-handler _ _ #:unwind? _ # _)
In srfi/srfi-1.scm:
   857:16  3 (every1 #<procedure 7fffeeb28640 at guix/build/gnu-bui…> …)
In guix/build/gnu-build-system.scm:
   847:30  2 (_ _)
In guix/build/minetest-build-system.scm:
   205:13  1 (check #:outputs _ #:tests? _)
In ice-9/boot-9.scm:
  1669:16  0 (raise-exception _ #:continuable? _)

ice-9/boot-9.scm:1669:16: In procedure raise-exception:
minetest raised an error: ~a "2021-09-19 20:52:06: ERROR[Main]: ModError: Failed to load and run script from /gnu/store/fa39r25wskhgv8mzpknc47jjpc5kl1kh-minetest-moreores-2.1.0/share/minetest/mods/moreores/init.lua:"
builder for `/gnu/store/xij2pirv5ycy0xpj6l3alin229r5xj4l-minetest-moreores-2.1.0.drv' failed with exit code 1
build of /gnu/store/xij2pirv5ycy0xpj6l3alin229r5xj4l-minetest-moreores-2.1.0.drv failed
View build log at '/var/log/guix/drvs/xi/j2pirv5ycy0xpj6l3alin229r5xj4l-minetest-moreores-2.1.0.drv.bz2'.
guix build: error: build of `/gnu/store/xij2pirv5ycy0xpj6l3alin229r5xj4l-minetest-moreores-2.1.0.drv' failed

[-- Attachment #7: without-0002-patch.txt --]
[-- Type: text/plain, Size: 3063 bytes --]

2021-09-19 20:46:33: INFO[Main]: Mod "farming" loaded after 2 ms
2021-09-19 20:46:33: INFO[Main]: Audio: Deinitializing...
2021-09-19 20:46:33: INFO[Main]: Audio: Deinitialized.
2021-09-19 20:46:33: ACTION[Main]: Server: Shutting down
2021-09-19 20:46:33: INFO[Main]: Server: Stopping and waiting threads
2021-09-19 20:46:33: INFO[Main]: Server: Threads stopped
2021-09-19 20:46:33: INFO[Main]: BanManager: saving to ./ipban.txt
2021-09-19 20:46:33: INFO[Main]: Server: Deinitializing scripting
2021-09-19 20:46:33: INFO[Main]: saveMapMeta: mapgen_params not present! Server startup was probably interrupted.
2021-09-19 20:46:33: INFO[Main]: ServerMap: Saved map to .
2021-09-19 20:46:33: INFO[Main]: ~TextureSource() before cleanup: 4 after: 2
2021-09-19 20:46:33: INFO[Main]: Irrlicht resources after cleanup:
2021-09-19 20:46:33: INFO[Main]: 	Remaining meshes   : 0
2021-09-19 20:46:33: INFO[Main]: 	Remaining textures : 2
2021-09-19 20:46:33: INFO[Main]: 		0:#DefaultFont
2021-09-19 20:46:33: INFO[Main]: 		1:TTFontGlyphPage_Arimo.Regular.16_0
2021-09-19 20:46:33: INFO[Main]: 	Remaining materials: 24 (note: irrlicht doesn't support removing renderers)
2021-09-19 20:46:33: INFO[Main]: Audio: Global Deinitialized.
Backtrace:
           7 (primitive-load "/gnu/store/xrvsdyq9f8wc3am40kmc9yms8c6…")
In ice-9/eval.scm:
   191:35  6 (_ _)
In guix/build/gnu-build-system.scm:
    838:2  5 (gnu-build #:source _ #:outputs _ #:inputs _ #:phases . #)
In ice-9/boot-9.scm:
  1736:10  4 (with-exception-handler _ _ #:unwind? _ # _)
In srfi/srfi-1.scm:
   857:16  3 (every1 #<procedure 7fffeeb2df40 at guix/build/gnu-bui…> …)
In guix/build/gnu-build-system.scm:
   847:30  2 (_ _)
In guix/build/minetest-build-system.scm:
   214:13  1 (check #:outputs _ #:tests? _)
In ice-9/boot-9.scm:
  1669:16  0 (raise-exception _ #:continuable? _)

ice-9/boot-9.scm:1669:16: In procedure raise-exception:
ERROR:
  1. &message: "2021-09-19 20:46:33: ERROR[Main]: ModError: Failed to load and run script from /gnu/store/qsikdr33697sm16pfxcvf41ijkwwz8d2-minetest-moreores-2.1.0/share/minetest/mods/moreores/init.lua:"
  2. &message: "2021-09-19 20:46:33: ERROR[Main]: /gnu/store/qsikdr33697sm16pfxcvf41ijkwwz8d2-minetest-moreores-2.1.0/share/minetest/mods/moreores/_config.txt: No such file or directory"
  3. &message: "2021-09-19 20:46:33: ERROR[Main]: stack traceback:"
  4. &message: "2021-09-19 20:46:33: ERROR[Main]: \t[C]: in function 'dofile'"
  5. &message: "2021-09-19 20:46:33: ERROR[Main]: \t...est-moreores-2.1.0/share/minetest/mods/moreores/init.lua:18: in main chunk"
  6. &message: "2021-09-19 20:46:33: ERROR[Main]: Check debug.txt for details."
builder for `/gnu/store/qi671jqsaq4k2ah1hr48lbrkzxij9f59-minetest-moreores-2.1.0.drv' failed with exit code 1
build of /gnu/store/qi671jqsaq4k2ah1hr48lbrkzxij9f59-minetest-moreores-2.1.0.drv failed
View build log at '/var/log/guix/drvs/qi/671jqsaq4k2ah1hr48lbrkzxij9f59-minetest-moreores-2.1.0.drv.bz2'.
guix build: error: build of `/gnu/store/qi671jqsaq4k2ah1hr48lbrkzxij9f59-minetest-moreores-2.1.0.drv' failed

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

* bug#50677: [PATCH] Minetest basic_materials really depends on moreores
  2021-09-19 21:05       ` Vivien Kraus via Bug reports for GNU Guix
@ 2021-09-22 16:46         ` Vivien Kraus via Bug reports for GNU Guix
  2021-09-22 17:41           ` Maxime Devos
  0 siblings, 1 reply; 16+ messages in thread
From: Vivien Kraus via Bug reports for GNU Guix @ 2021-09-22 16:46 UTC (permalink / raw)
  To: Maxime Devos, 50677

[-- Attachment #1: Type: text/plain, Size: 165 bytes --]

lylip on the #guix chat suggested to save the log to disk, so that the
errors can be read in context. I think it is the best thing to do, what
do you think?

Vivien

[-- Attachment #2: 0004-gnu-minetest-basic-materials-Depend-on-minetest-more.patch --]
[-- Type: text/x-patch, Size: 1144 bytes --]

From f5cafa5aaf26b065f3627d5e013d06c86c251f8f Mon Sep 17 00:00:00 2001
From: Vivien Kraus <vivien@planete-kraus.eu>
Date: Sun, 19 Sep 2021 17:00:45 +0200
Subject: [PATCH 4/4] gnu: minetest-basic-materials: Depend on
 minetest-moreores.

* minetest.scm (minetest-basic-materials): Add minetest-moreores as a propagated input.
---
 gnu/packages/minetest.scm | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/gnu/packages/minetest.scm b/gnu/packages/minetest.scm
index 0730de7351..189889f890 100644
--- a/gnu/packages/minetest.scm
+++ b/gnu/packages/minetest.scm
@@ -221,6 +221,10 @@ numeric identifier TOPIC-ID on the official Minetest forums."
         (base32 "0v6l3lrjgshy4sccjhfhmfxc3gk0cdy73qb02i9wd2vw506v5asx"))
        (file-name (git-file-name name version))))
     (build-system minetest-mod-build-system)
+    (propagated-inputs
+     ;; basic_materials:silver_wire cannot be crafted without
+     ;; moreores:silver_ingot.
+     `(("minetest-moreores" ,minetest-moreores)))
     (home-page (minetest-topic 21000))
     (synopsis "Some \"basic\" materials and items for other Minetest mods to use")
     (description
-- 
2.33.0


[-- Attachment #3: 0003-gnu-Add-minetest-moreores.patch --]
[-- Type: text/x-patch, Size: 1527 bytes --]

From 92e59ddbcd185faaf0de00d8ac3cc68fdd13f531 Mon Sep 17 00:00:00 2001
From: Vivien Kraus <vivien@planete-kraus.eu>
Date: Sun, 19 Sep 2021 16:58:53 +0200
Subject: [PATCH 3/4] gnu: Add minetest-moreores.

* gnu/packages/minetest.scm (minetest-moreores): New variable.
---
 gnu/packages/minetest.scm | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/gnu/packages/minetest.scm b/gnu/packages/minetest.scm
index fd1439d4d2..0730de7351 100644
--- a/gnu/packages/minetest.scm
+++ b/gnu/packages/minetest.scm
@@ -187,6 +187,25 @@ numeric identifier TOPIC-ID on the official Minetest forums."
   (string-append "https://forum.minetest.net/viewtopic.php?t="
                  (number->string topic-id)))
 
+(define-public minetest-moreores
+  (package
+    (name "minetest-moreores")
+    (version "2.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/minetest-mods/moreores")
+             (commit "0b6f669df4c9b7771c03e0e6ba8effb471cdfcae")))
+       (sha256 (base32 "1chfqbc6bb27aacjc67j5l5wcdvmcsvk2rfmangipd7nwini3y34"))
+       (file-name (git-file-name name version))))
+    (build-system minetest-mod-build-system)
+    (home-page (minetest-topic 549))
+    (synopsis "Adds new ore types")
+    (description "More ores for Minetest.")
+    (license license:zlib)
+    (properties `((upstream-name . "Calinou/moreores")))))
+
 (define-public minetest-basic-materials
   (package
     (name "minetest-basic-materials")
-- 
2.33.0


[-- Attachment #4: 0002-guix-minetest-build-system-Also-install-config.txt-a.patch --]
[-- Type: text/x-patch, Size: 1125 bytes --]

From 9176a157e6cd73fe70549d3796772a944db822ed Mon Sep 17 00:00:00 2001
From: Vivien Kraus <vivien@planete-kraus.eu>
Date: Sun, 19 Sep 2021 22:42:49 +0200
Subject: [PATCH 2/4] guix: minetest-build-system: Also install config.txt and
 _config.txt

* minetest-build-system.scm (mod-install-plan): Add config.txt and _config.txt to the list of installed files.
---
 guix/build/minetest-build-system.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/guix/build/minetest-build-system.scm b/guix/build/minetest-build-system.scm
index df6fb50416..d238056231 100644
--- a/guix/build/minetest-build-system.scm
+++ b/guix/build/minetest-build-system.scm
@@ -41,7 +41,7 @@
      ;; See <https://github.com/minetest/minetest/blob/master/doc/lua_api.txt>
      ;; for an incomple list of files that can be found in mods.
      #:include ("mod.conf" "modpack.conf" "settingtypes.txt" "depends.txt"
-                "description.txt")
+                "description.txt" "config.txt" "_config.txt")
      #:include-regexp (".lua$" ".png$" ".ogg$" ".obj$" ".b3d$" ".tr$"
                        ".mts$"))))
 
-- 
2.33.0


[-- Attachment #5: 0001-guix-minetest-build-system-Save-the-full-test-log.patch --]
[-- Type: text/x-patch, Size: 2515 bytes --]

From ffcd1922af4a1249b78f8e749d37b83e5f20034a Mon Sep 17 00:00:00 2001
From: Vivien Kraus <vivien@planete-kraus.eu>
Date: Sun, 19 Sep 2021 20:03:10 +0200
Subject: [PATCH 1/4] guix: minetest-build-system: Save the full test log

* minetest-build-system.scm (check): Save the full test log.
---
 guix/build/minetest-build-system.scm | 35 +++++++++++++++++-----------
 1 file changed, 21 insertions(+), 14 deletions(-)

diff --git a/guix/build/minetest-build-system.scm b/guix/build/minetest-build-system.scm
index 477cc3d1d0..df6fb50416 100644
--- a/guix/build/minetest-build-system.scm
+++ b/guix/build/minetest-build-system.scm
@@ -23,6 +23,7 @@
   #:use-module (ice-9 rdelim)
   #:use-module (ice-9 receive)
   #:use-module (ice-9 regex)
+  #:use-module (ice-9 exceptions)
   #:use-module ((guix build gnu-build-system) #:prefix gnu:)
   #:use-module ((guix build copy-build-system) #:prefix copy:)
   #:export (%standard-phases
@@ -199,20 +200,26 @@ auth_backend = sqlite3
         (define (stop? line)
           (and (string? line)
                (string-contains line "ACTION[Server]: singleplayer [127.0.0.1] joins game.")))
-        (let loop ()
-          (match (read-line port)
-            ((? error? line)
-             (error "minetest raised an error: ~a" line))
-            ((? stop?)
-             (kill pid SIGINT)
-             (close-port port)
-             (waitpid pid))
-            ((? string? line)
-             (display line)
-             (newline)
-             (loop))
-            ((? eof-object?)
-             (error "minetest didn't start"))))))))
+        (define log-file (open-output-file "guix-test.log"))
+        (let loop ((has-errors? #f))
+          (let ((line (read-line port)))
+            (unless (eof-object? line)
+              (write-line line log-file))
+            (match `(,line ,has-errors?)
+              (((? error? line) _)
+               (loop #t))
+              (((? stop?) #f)
+               (kill pid SIGINT)
+               (close-port port)
+               (waitpid pid))
+              (((? eof-object?) #f)
+               (error "minetest didn't start"))
+              (((or (? stop?) (? eof-object?)) #t)
+               (error "minetest stopped after an error happened, see source/guix_testworld/guix-test.log"))
+              (((? string? line) has-error?)
+               (display line)
+               (newline)
+               (loop has-error?)))))))))
 
 (define %standard-phases
   (modify-phases gnu:%standard-phases
-- 
2.33.0


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

* bug#50677: [PATCH] Minetest basic_materials really depends on moreores
  2021-09-22 16:46         ` Vivien Kraus via Bug reports for GNU Guix
@ 2021-09-22 17:41           ` Maxime Devos
  2021-09-22 18:04             ` Vivien Kraus via Bug reports for GNU Guix
  0 siblings, 1 reply; 16+ messages in thread
From: Maxime Devos @ 2021-09-22 17:41 UTC (permalink / raw)
  To: Vivien Kraus, 50677

[-- Attachment #1: Type: text/plain, Size: 1795 bytes --]

Vivien Kraus schreef op wo 22-09-2021 om 18:46 [+0200]:
> +        (define log-file (open-output-file "guix-test.log"))
> +        (let loop ((has-errors? #f))
> +          (let ((line (read-line port)))
> +            (unless (eof-obj	ect? line)
> +              (write-line line log-file))
> +            (match `(,line ,has-errors?)
> +              (((? error? line) _)
> +               (loop #t))
> +              (((? stop?) #f)
> +               (kill pid SIGINT)
> +               (close-port port)
> +               (waitpid pid))
> +              (((? eof-object?) #f)
> +               (error "minetest didn't start"))
> +              (((or (? stop?) (? eof-object?)) #t)

'(close-port port)' is missing in this branch.
This is important if 'port' is buffered, to flush the buffers.
From a test at the Guile REPL, it appears ports from 'open-output-file'
are buffered.  

> +               (error "minetest stopped after an error happened, see source/guix_testworld/guix-test.log"))

This requires the user to do "--keep-failed".  It would be more convenient
if the output of Minetest was send to current-output-port, that way the
errors can be read from the build log (possibly at <https://ci.guix.gnu.org/>).

Suggestion: don't keep guix-test.log, or only print errors, but rather
output all ouputs of "minetest" to (current-output-port).

Alternative suggestion (to make building less verbose when there are no errors):
this patch, but run "cat" or a guile equivalent thereof (maybe open-input-file
+ sendfile + stat:size) on guix-test.log when there are errors.

> +              (((? string? line) has-error?)
> +               (display line)
> +               (newline)
> +               (loop has-error?)))))))))

Greetings,
Maxime.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

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

* bug#50677: [PATCH] Minetest basic_materials really depends on moreores
  2021-09-22 17:41           ` Maxime Devos
@ 2021-09-22 18:04             ` Vivien Kraus via Bug reports for GNU Guix
  2021-09-22 18:15               ` Maxime Devos
  2021-10-16 15:32               ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
  0 siblings, 2 replies; 16+ messages in thread
From: Vivien Kraus via Bug reports for GNU Guix @ 2021-09-22 18:04 UTC (permalink / raw)
  To: Maxime Devos, 50677

[-- Attachment #1: Type: text/plain, Size: 254 bytes --]

Le mercredi 22 septembre 2021 à 19:41 +0200, Maxime Devos a écrit :
> It would be more convenient
> if the output of Minetest was send to current-output-port,
OK, so it’s like the existing solution, except it should not stop just
at the first error.

[-- Attachment #2: 0004-gnu-minetest-basic-materials-Depend-on-minetest-more.patch --]
[-- Type: text/x-patch, Size: 1144 bytes --]

From ed878447d600aabdfd80073dab4fdb77cef3801d Mon Sep 17 00:00:00 2001
From: Vivien Kraus <vivien@planete-kraus.eu>
Date: Sun, 19 Sep 2021 17:00:45 +0200
Subject: [PATCH 4/4] gnu: minetest-basic-materials: Depend on
 minetest-moreores.

* minetest.scm (minetest-basic-materials): Add minetest-moreores as a propagated input.
---
 gnu/packages/minetest.scm | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/gnu/packages/minetest.scm b/gnu/packages/minetest.scm
index 0730de7351..189889f890 100644
--- a/gnu/packages/minetest.scm
+++ b/gnu/packages/minetest.scm
@@ -221,6 +221,10 @@ numeric identifier TOPIC-ID on the official Minetest forums."
         (base32 "0v6l3lrjgshy4sccjhfhmfxc3gk0cdy73qb02i9wd2vw506v5asx"))
        (file-name (git-file-name name version))))
     (build-system minetest-mod-build-system)
+    (propagated-inputs
+     ;; basic_materials:silver_wire cannot be crafted without
+     ;; moreores:silver_ingot.
+     `(("minetest-moreores" ,minetest-moreores)))
     (home-page (minetest-topic 21000))
     (synopsis "Some \"basic\" materials and items for other Minetest mods to use")
     (description
-- 
2.33.0


[-- Attachment #3: 0003-gnu-Add-minetest-moreores.patch --]
[-- Type: text/x-patch, Size: 1527 bytes --]

From f018ebee7972f49bfd6c3012d822432f9d97b767 Mon Sep 17 00:00:00 2001
From: Vivien Kraus <vivien@planete-kraus.eu>
Date: Sun, 19 Sep 2021 16:58:53 +0200
Subject: [PATCH 3/4] gnu: Add minetest-moreores.

* gnu/packages/minetest.scm (minetest-moreores): New variable.
---
 gnu/packages/minetest.scm | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/gnu/packages/minetest.scm b/gnu/packages/minetest.scm
index fd1439d4d2..0730de7351 100644
--- a/gnu/packages/minetest.scm
+++ b/gnu/packages/minetest.scm
@@ -187,6 +187,25 @@ numeric identifier TOPIC-ID on the official Minetest forums."
   (string-append "https://forum.minetest.net/viewtopic.php?t="
                  (number->string topic-id)))
 
+(define-public minetest-moreores
+  (package
+    (name "minetest-moreores")
+    (version "2.1.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/minetest-mods/moreores")
+             (commit "0b6f669df4c9b7771c03e0e6ba8effb471cdfcae")))
+       (sha256 (base32 "1chfqbc6bb27aacjc67j5l5wcdvmcsvk2rfmangipd7nwini3y34"))
+       (file-name (git-file-name name version))))
+    (build-system minetest-mod-build-system)
+    (home-page (minetest-topic 549))
+    (synopsis "Adds new ore types")
+    (description "More ores for Minetest.")
+    (license license:zlib)
+    (properties `((upstream-name . "Calinou/moreores")))))
+
 (define-public minetest-basic-materials
   (package
     (name "minetest-basic-materials")
-- 
2.33.0


[-- Attachment #4: 0002-guix-minetest-build-system-Also-install-config.txt-a.patch --]
[-- Type: text/x-patch, Size: 1125 bytes --]

From 9b6a7751a3240e6363b231a50f6795aaf0433f76 Mon Sep 17 00:00:00 2001
From: Vivien Kraus <vivien@planete-kraus.eu>
Date: Sun, 19 Sep 2021 22:42:49 +0200
Subject: [PATCH 2/4] guix: minetest-build-system: Also install config.txt and
 _config.txt

* minetest-build-system.scm (mod-install-plan): Add config.txt and _config.txt to the list of installed files.
---
 guix/build/minetest-build-system.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/guix/build/minetest-build-system.scm b/guix/build/minetest-build-system.scm
index c14c6d1fcc..5f68686067 100644
--- a/guix/build/minetest-build-system.scm
+++ b/guix/build/minetest-build-system.scm
@@ -41,7 +41,7 @@
      ;; See <https://github.com/minetest/minetest/blob/master/doc/lua_api.txt>
      ;; for an incomple list of files that can be found in mods.
      #:include ("mod.conf" "modpack.conf" "settingtypes.txt" "depends.txt"
-                "description.txt")
+                "description.txt" "config.txt" "_config.txt")
      #:include-regexp (".lua$" ".png$" ".ogg$" ".obj$" ".b3d$" ".tr$"
                        ".mts$"))))
 
-- 
2.33.0


[-- Attachment #5: 0001-guix-minetest-build-system-Gather-the-whole-output-w.patch --]
[-- Type: text/x-patch, Size: 2192 bytes --]

From f1eec756c9b35442f7f2730585eb671e57ddb50c Mon Sep 17 00:00:00 2001
From: Vivien Kraus <vivien@planete-kraus.eu>
Date: Sun, 19 Sep 2021 20:03:10 +0200
Subject: [PATCH 1/4] guix: minetest-build-system: Gather the whole output when
 a test fails

* minetest-build-system.scm (check): Gather the whole output when a test fails.
---
 guix/build/minetest-build-system.scm | 23 ++++++++++++++---------
 1 file changed, 14 insertions(+), 9 deletions(-)

diff --git a/guix/build/minetest-build-system.scm b/guix/build/minetest-build-system.scm
index 477cc3d1d0..c14c6d1fcc 100644
--- a/guix/build/minetest-build-system.scm
+++ b/guix/build/minetest-build-system.scm
@@ -23,6 +23,7 @@
   #:use-module (ice-9 rdelim)
   #:use-module (ice-9 receive)
   #:use-module (ice-9 regex)
+  #:use-module (ice-9 exceptions)
   #:use-module ((guix build gnu-build-system) #:prefix gnu:)
   #:use-module ((guix build copy-build-system) #:prefix copy:)
   #:export (%standard-phases
@@ -199,20 +200,24 @@ auth_backend = sqlite3
         (define (stop? line)
           (and (string? line)
                (string-contains line "ACTION[Server]: singleplayer [127.0.0.1] joins game.")))
-        (let loop ()
-          (match (read-line port)
-            ((? error? line)
-             (error "minetest raised an error: ~a" line))
-            ((? stop?)
+        (let loop ((has-errors? #f))
+          (match `(,(read-line port) ,has-errors?)
+            (((? error? line) _)
+             (display line)
+             (newline)
+             (loop #t))
+            (((? stop?) #f)
              (kill pid SIGINT)
              (close-port port)
              (waitpid pid))
-            ((? string? line)
+            (((? eof-object?) #f)
+             (error "minetest didn't start"))
+            (((or (? stop?) (? eof-object?)) #t)
+             (error "minetest raised an error"))
+            (((? string? line) has-error?)
              (display line)
              (newline)
-             (loop))
-            ((? eof-object?)
-             (error "minetest didn't start"))))))))
+             (loop has-error?))))))))
 
 (define %standard-phases
   (modify-phases gnu:%standard-phases
-- 
2.33.0


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

* bug#50677: [PATCH] Minetest basic_materials really depends on moreores
  2021-09-22 18:04             ` Vivien Kraus via Bug reports for GNU Guix
@ 2021-09-22 18:15               ` Maxime Devos
  2021-09-22 18:37                 ` Vivien Kraus via Bug reports for GNU Guix
  2021-10-16 15:32               ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
  1 sibling, 1 reply; 16+ messages in thread
From: Maxime Devos @ 2021-09-22 18:15 UTC (permalink / raw)
  To: Vivien Kraus, 50677

[-- Attachment #1: Type: text/plain, Size: 408 bytes --]

Vivien Kraus schreef op wo 22-09-2021 om 20:04 [+0200]:
> Le mercredi 22 septembre 2021 à 19:41 +0200, Maxime Devos a écrit :
> > It would be more convenient
> > if the output of Minetest was send to current-output-port,
> OK, so it’s like the existing solution, except it should not stop just
> at the first error.

The latest patch you sent looks good to me, but I didn't test ti.

Greetings

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

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

* bug#50677: [PATCH] Minetest basic_materials really depends on moreores
  2021-09-22 18:15               ` Maxime Devos
@ 2021-09-22 18:37                 ` Vivien Kraus via Bug reports for GNU Guix
  2021-09-22 18:43                   ` Maxime Devos
  0 siblings, 1 reply; 16+ messages in thread
From: Vivien Kraus via Bug reports for GNU Guix @ 2021-09-22 18:37 UTC (permalink / raw)
  To: Maxime Devos, 50677

Le mercredi 22 septembre 2021 à 20:15 +0200, Maxime Devos a écrit :
> The latest patch you sent looks good to me, but I didn't test ti.

I tested it by comparing the build of minetest-moreores when it fails
because of the missing file and when it succeeds. Do you think it
should be enough if it were to be tested that way?

Vivien





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

* bug#50677: [PATCH] Minetest basic_materials really depends on moreores
  2021-09-22 18:37                 ` Vivien Kraus via Bug reports for GNU Guix
@ 2021-09-22 18:43                   ` Maxime Devos
  2021-10-14 15:14                     ` Vivien Kraus via Bug reports for GNU Guix
  0 siblings, 1 reply; 16+ messages in thread
From: Maxime Devos @ 2021-09-22 18:43 UTC (permalink / raw)
  To: Vivien Kraus, 50677

[-- Attachment #1: Type: text/plain, Size: 458 bytes --]

Vivien Kraus schreef op wo 22-09-2021 om 20:37 [+0200]:
> Le mercredi 22 septembre 2021 à 20:15 +0200, Maxime Devos a écrit :
> > The latest patch you sent looks good to me, but I didn't test ti.
> 
> I tested it by comparing the build of minetest-moreores when it fails
> because of the missing file and when it succeeds. Do you think it
> should be enough if it were to be tested that way?

That should be enough I think.

Greetings,
Maxime.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

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

* bug#50677: [PATCH] Minetest basic_materials really depends on moreores
  2021-09-22 18:43                   ` Maxime Devos
@ 2021-10-14 15:14                     ` Vivien Kraus via Bug reports for GNU Guix
  2021-10-15 20:18                       ` Maxime Devos
  0 siblings, 1 reply; 16+ messages in thread
From: Vivien Kraus via Bug reports for GNU Guix @ 2021-10-14 15:14 UTC (permalink / raw)
  To: Maxime Devos, 50677

Hello Maxime,

Le mercredi 22 septembre 2021 à 20:43 +0200, Maxime Devos a écrit :
> Vivien Kraus schreef op wo 22-09-2021 om 20:37 [+0200]:
> > Le mercredi 22 septembre 2021 à 20:15 +0200, Maxime Devos a écrit :
> > > The latest patch you sent looks good to me, but I didn't test ti.
> > 
> > I tested it by comparing the build of minetest-moreores when it
> > fails
> > because of the missing file and when it succeeds. Do you think it
> > should be enough if it were to be tested that way?
> 
> That should be enough I think.
> 
> Greetings,
> Maxime.

On IRC you said that you did one test. Aside from you, it seems that
noone cares about minetest.

Would you accept this patch? If not, then I’ll trash the error handler
modification and just keep the new packages. What do you think?

Best regards,

Vivien





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

* bug#50677: [PATCH] Minetest basic_materials really depends on moreores
  2021-10-14 15:14                     ` Vivien Kraus via Bug reports for GNU Guix
@ 2021-10-15 20:18                       ` Maxime Devos
  0 siblings, 0 replies; 16+ messages in thread
From: Maxime Devos @ 2021-10-15 20:18 UTC (permalink / raw)
  To: Vivien Kraus, 50677

Vivien Kraus schreef op do 14-10-2021 om 17:14 [+0200]:
> On IRC you said that you did one test. Aside from you, it seems that
> noone cares about minetest.
> 
> Would you accept this patch? [...]

IIRC, I tested the patch, it worked, and it looked good to me. 
However, I'm not a committer.

Anyway, I won't be working on Guix for a while (and I've unsubscribed
from the mailing lists) (though I intend to continue eventually), so I
won't be available for (minetest-related) reviews.

Greetings,
Maxime

--
The computer I'm typing this on doesn't have the secret key,
so the e-mail isn't signed.





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

* bug#50677: [PATCH] Minetest basic_materials really depends on moreores
  2021-09-22 18:04             ` Vivien Kraus via Bug reports for GNU Guix
  2021-09-22 18:15               ` Maxime Devos
@ 2021-10-16 15:32               ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
  1 sibling, 0 replies; 16+ messages in thread
From: Tobias Geerinckx-Rice via Bug reports for GNU Guix @ 2021-10-16 15:32 UTC (permalink / raw)
  To: Vivien Kraus; +Cc: 50677-done

[-- Attachment #1: Type: text/plain, Size: 1803 bytes --]

Vivien,

Thanks!  I've pushed this series as 
df2404482495bc3af03e7fc902af1e6b0d10b4a4 et al.

I made a only few small tweaks, mainly to the commit message:

> gnu: minetest-basic-materials: Depend on minetest-moreores.

‘Depend’ sounds wrong to me; it either does, or it doesn't, we 
don't determine that.  Changed to ‘Propagate …’

> * minetest.scm (minetest-basic-materials): Add minetest-moreores 
> as a propagated input.

Keep Git commit message body lines <=72 characters.  Most 
(non-Guix) tooling is built around that assumption.

Also use full relative file names, and use [field] notation where 
appropriate:

  * gnu/packages/foo.scm (foo)[propagated-inputs]: Add bar.

For the build system patches, I changed

> guix: minetest-build-system: […]

to

  build-system/minetest: […]

Why?  Because it's shorter.  Is this a documented rule?  I can't 
say!

> ;; basic_materials:silver_wire cannot be crafted without
> ;; moreores:silver_ingot.

Documenting this is a great idea.

> (commit "0b6f669df4c9b7771c03e0e6ba8effb471cdfcae")))

I changed this to

  (commit (string-append "v" version))

to use the git tag.

Both have advantages & disadvantages, but this is our currently 
preferred style.

> (synopsis "Adds new ore types")
> (description "More ores for Minetest.")

These aren't acceptable.  See (guix)Synopses and Descriptions.

This was my attempt at improving the importer's lazywork:

  (synopsis "Additional ore types, tools, swords, and rails for 
  Minetest")
  (description
   "This Minetest mod adds new ore types to the game (mithril, 
   silver) as well
as swords and tools made of different materials.  It also adds 
copper rails.")

Bit vague, but you know why.

Closing; thanks!

T G-R

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 247 bytes --]

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

end of thread, other threads:[~2021-10-16 15:49 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-09-19 15:23 bug#50677: [PATCH] Minetest basic_materials really depends on moreores Vivien Kraus via Bug reports for GNU Guix
2021-09-19 17:40 ` Maxime Devos
2021-09-19 18:54   ` Vivien Kraus via Bug reports for GNU Guix
2021-09-19 18:59     ` Vivien Kraus via Bug reports for GNU Guix
2021-09-19 19:18       ` Maxime Devos
2021-09-19 19:11     ` Maxime Devos
2021-09-19 21:05       ` Vivien Kraus via Bug reports for GNU Guix
2021-09-22 16:46         ` Vivien Kraus via Bug reports for GNU Guix
2021-09-22 17:41           ` Maxime Devos
2021-09-22 18:04             ` Vivien Kraus via Bug reports for GNU Guix
2021-09-22 18:15               ` Maxime Devos
2021-09-22 18:37                 ` Vivien Kraus via Bug reports for GNU Guix
2021-09-22 18:43                   ` Maxime Devos
2021-10-14 15:14                     ` Vivien Kraus via Bug reports for GNU Guix
2021-10-15 20:18                       ` Maxime Devos
2021-10-16 15:32               ` Tobias Geerinckx-Rice via Bug reports for GNU Guix

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.