all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#57365] [PATCH] gnu: guile-smc: Update to 0.5.0
@ 2022-08-23 18:45 Artyom V. Poptsov
  2022-08-26 13:34 ` Mathieu Othacehe
  0 siblings, 1 reply; 6+ messages in thread
From: Artyom V. Poptsov @ 2022-08-23 18:45 UTC (permalink / raw)
  To: 57365


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

Hello,

this patch updates Guile-SMC[1] to 0.5.0.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-gnu-guile-smc-Update-to-0.5.0.patch --]
[-- Type: text/x-diff, Size: 2799 bytes --]

From 048da8ec39829ed1e03c8256fb3e4b44d22ebd51 Mon Sep 17 00:00:00 2001
From: "Artyom V. Poptsov" <poptsov.artyom@gmail.com>
Date: Tue, 23 Aug 2022 21:10:13 +0300
Subject: [PATCH 1/2] gnu: guile-smc: Update to 0.5.0.

* gnu/packages/guile-xyz.scm (guile-smc): Update to 0.5.0.
---
 gnu/packages/guile-xyz.scm | 25 ++++++++++++-------------
 1 file changed, 12 insertions(+), 13 deletions(-)

diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm
index a85c7e0fc4..69f629638b 100644
--- a/gnu/packages/guile-xyz.scm
+++ b/gnu/packages/guile-xyz.scm
@@ -4796,7 +4796,7 @@ (define-public guile-gitlab
 (define-public guile-smc
   (package
     (name "guile-smc")
-    (version "0.3.0")
+    (version "0.5.0")
     (source
      (origin
        (method git-fetch)
@@ -4806,7 +4806,7 @@ (define-public guile-smc
        (file-name (string-append name "-" version))
        (sha256
         (base32
-         "0szkjmasi70m1vppck7nhdxg4lnxzjq6mihi6r1552s8sxm5z008"))))
+         "03imz9bfvvj8xnwxjaw7b26capvlwq921kqq5yzlzv15ngidky72"))))
     (build-system gnu-build-system)
     (arguments
      `(#:make-flags '("GUILE_AUTO_COMPILE=0")     ;to prevent guild warnings
@@ -4829,12 +4829,11 @@ (define-public guile-smc
                 (format #f
                         "#:init-value \"~a/bin/logger\""
                         (assoc-ref inputs "inetutils")))
-             (("\\(add-handler! %logger %syslog\\)")
-              (string-append
-               "(add-handler! %logger\n"
-               "              (make <rotating-log>\n"
-               "                    #:file-name \"smc.log\"))\n")))
-             #t))
+               (("\\(add-handler! %logger %syslog\\)")
+                (string-append
+                 "(add-handler! %logger\n"
+                 "              (make <port-log/us>\n"
+                 "                    #:port (open-file \"/tmp/smc.log\" \"a+\")))\n")))))
          (add-after 'install 'wrap-program
            (lambda* (#:key inputs outputs #:allow-other-keys)
              (let* ((out       (assoc-ref outputs "out"))
@@ -4854,12 +4853,12 @@ (define-public guile-smc
                     ,(string-append guile-lib go)))))
              #t)))))
     (native-inputs
-     (list autoconf automake pkg-config texinfo))
+     (list autoconf automake pkg-config texinfo help2man))
     (inputs
-     `(("bash"      ,bash-minimal)
-       ("guile"     ,guile-3.0)
-       ("guile-lib" ,guile-lib)
-       ("inetutils" ,inetutils)))
+     (list bash-minimal
+           guile-3.0
+           guile-lib
+           inetutils))
     (home-page "https://github.com/artyom-poptsov/guile-smc")
     (synopsis "GNU Guile state machine compiler")
     (description
-- 
2.34.1


[-- Attachment #1.3: Type: text/plain, Size: 282 bytes --]


- Artyom

References:
1. https://github.com/artyom-poptsov/guile-smc

-- 
Artyom "avp" Poptsov <poptsov.artyom@gmail.com>
Home page: https://memory-heap.org/~avp/
CADR Hackerspace co-founder: https://cadrspace.ru/
GPG: D0C2 EAC1 3310 822D 98DE  B57C E9C5 A2D9 0898 A02F

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

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

* [bug#57365] [PATCH] gnu: guile-smc: Update to 0.5.0
  2022-08-23 18:45 [bug#57365] [PATCH] gnu: guile-smc: Update to 0.5.0 Artyom V. Poptsov
@ 2022-08-26 13:34 ` Mathieu Othacehe
  2022-08-27  3:15   ` Artyom V. Poptsov
                     ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Mathieu Othacehe @ 2022-08-26 13:34 UTC (permalink / raw)
  To: Artyom V. Poptsov; +Cc: 57365


Hey Artyom,

> -              (string-append
> -               "(add-handler! %logger\n"
> -               "              (make <rotating-log>\n"
> -               "                    #:file-name \"smc.log\"))\n")))
> -             #t))
> +               (("\\(add-handler! %logger %syslog\\)")
> +                (string-append
> +                 "(add-handler! %logger\n"
> +                 "              (make <port-log/us>\n"
> +                 "                    #:port (open-file \"/tmp/smc.log\" \"a+\")))\n")))))

What is this patch about? Can't it be upstreamed?

> +     (list autoconf automake pkg-config texinfo help2man))

You need to describe it in the commit message:

[native-inputs]: Add help2man.

> +     (list bash-minimal
> +           guile-3.0
> +           guile-lib
> +           inetutils))

Ditto:

[inputs]: Use the new inputs style.

Can you send an updated patch?

Thanks,

Mathieu




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

* [bug#57365] [PATCH] gnu: guile-smc: Update to 0.5.0
  2022-08-26 13:34 ` Mathieu Othacehe
@ 2022-08-27  3:15   ` Artyom V. Poptsov
  2022-08-27  7:54   ` Maxime Devos
  2022-09-02  6:20   ` Artyom V. Poptsov
  2 siblings, 0 replies; 6+ messages in thread
From: Artyom V. Poptsov @ 2022-08-27  3:15 UTC (permalink / raw)
  To: Mathieu Othacehe; +Cc: 57365


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

Hello Mathieu,

Thanks for my patch review!

> What is this patch about? Can't it be upstreamed?

As you can see from the package description of Guile-SMC 0.3.0 there was
already a problem with logging; I just tried to fix that patch for the
current release.

Guile-SMC tries to log to the syslog by default but it seems that this
option is not working in Guix, so we need another way to log the
messages.  Or it may be that I just overlooked something.

I wasn't able to use "<rotating-log>" anymore as Guile-SMC now uses
custom microsecond-resolution logging backend (which is required for the
FSM profiler to work properly.)  The problem is that this backend does
not work well with "<rotating-log>".  With the new snipped Guile-SMC
uses its "<port-log/us>" class to log the messages to
"/tmp/smc.log.<number>" file.

I wish we had more advanced logging functionality in GNU Guile core
modules but that a discussion for another thread I think.

For now I agree that this snipped looks a bit hacky but that is the
solution a I came up with trying to fix things fast.

If you have any ideas on how to improve the snippet (or the logging in
Guile-SMC for that matter), I'm all ears.

Meanwhile I try to do something with Guile-SMC logging myself.

> You need to describe it in the commit message:
>
> [native-inputs]: Add help2man.

> Ditto:
>
> [inputs]: Use the new inputs style.

Done.

Here's the updated patch.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-gnu-guile-smc-Update-to-0.5.0.patch --]
[-- Type: text/x-diff, Size: 2872 bytes --]

From be2605d82a44f22391b831a7090ff3ae5956d545 Mon Sep 17 00:00:00 2001
From: "Artyom V. Poptsov" <poptsov.artyom@gmail.com>
Date: Tue, 23 Aug 2022 21:10:13 +0300
Subject: [PATCH 1/2] gnu: guile-smc: Update to 0.5.0.

* gnu/packages/guile-xyz.scm (guile-smc): Update to 0.5.0.
  [native-inputs]: Add help2man.
  [inputs]: Use the new inputs style.
---
 gnu/packages/guile-xyz.scm | 25 ++++++++++++-------------
 1 file changed, 12 insertions(+), 13 deletions(-)

diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm
index a85c7e0fc4..69f629638b 100644
--- a/gnu/packages/guile-xyz.scm
+++ b/gnu/packages/guile-xyz.scm
@@ -4796,7 +4796,7 @@ (define-public guile-gitlab
 (define-public guile-smc
   (package
     (name "guile-smc")
-    (version "0.3.0")
+    (version "0.5.0")
     (source
      (origin
        (method git-fetch)
@@ -4806,7 +4806,7 @@ (define-public guile-smc
        (file-name (string-append name "-" version))
        (sha256
         (base32
-         "0szkjmasi70m1vppck7nhdxg4lnxzjq6mihi6r1552s8sxm5z008"))))
+         "03imz9bfvvj8xnwxjaw7b26capvlwq921kqq5yzlzv15ngidky72"))))
     (build-system gnu-build-system)
     (arguments
      `(#:make-flags '("GUILE_AUTO_COMPILE=0")     ;to prevent guild warnings
@@ -4829,12 +4829,11 @@ (define-public guile-smc
                 (format #f
                         "#:init-value \"~a/bin/logger\""
                         (assoc-ref inputs "inetutils")))
-             (("\\(add-handler! %logger %syslog\\)")
-              (string-append
-               "(add-handler! %logger\n"
-               "              (make <rotating-log>\n"
-               "                    #:file-name \"smc.log\"))\n")))
-             #t))
+               (("\\(add-handler! %logger %syslog\\)")
+                (string-append
+                 "(add-handler! %logger\n"
+                 "              (make <port-log/us>\n"
+                 "                    #:port (open-file \"/tmp/smc.log\" \"a+\")))\n")))))
          (add-after 'install 'wrap-program
            (lambda* (#:key inputs outputs #:allow-other-keys)
              (let* ((out       (assoc-ref outputs "out"))
@@ -4854,12 +4853,12 @@ (define-public guile-smc
                     ,(string-append guile-lib go)))))
              #t)))))
     (native-inputs
-     (list autoconf automake pkg-config texinfo))
+     (list autoconf automake pkg-config texinfo help2man))
     (inputs
-     `(("bash"      ,bash-minimal)
-       ("guile"     ,guile-3.0)
-       ("guile-lib" ,guile-lib)
-       ("inetutils" ,inetutils)))
+     (list bash-minimal
+           guile-3.0
+           guile-lib
+           inetutils))
     (home-page "https://github.com/artyom-poptsov/guile-smc")
     (synopsis "GNU Guile state machine compiler")
     (description
-- 
2.34.1


[-- Attachment #1.3: Type: text/plain, Size: 219 bytes --]


- Artyom

-- 
Artyom "avp" Poptsov <poptsov.artyom@gmail.com>
Home page: https://memory-heap.org/~avp/
CADR Hackerspace co-founder: https://cadrspace.ru/
GPG: D0C2 EAC1 3310 822D 98DE  B57C E9C5 A2D9 0898 A02F

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

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

* [bug#57365] [PATCH] gnu: guile-smc: Update to 0.5.0
  2022-08-26 13:34 ` Mathieu Othacehe
  2022-08-27  3:15   ` Artyom V. Poptsov
@ 2022-08-27  7:54   ` Maxime Devos
  2022-09-02  6:20   ` Artyom V. Poptsov
  2 siblings, 0 replies; 6+ messages in thread
From: Maxime Devos @ 2022-08-27  7:54 UTC (permalink / raw)
  To: Mathieu Othacehe, Artyom V. Poptsov; +Cc: 57365


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


On 26-08-2022 15:34, Mathieu Othacehe wrote:
> +               (("\\(add-handler! %logger %syslog\\)")
> +                (string-append
> +                 "(add-handler! %logger\n"
> +                 "              (make <port-log/us>\n"
> +                 "                    #:port (open-file \"/tmp/smc.log\" \"a+\")))\n")))))

When is this /tmp/smc.log used? When compiling guile-smc or when running 
guile-smc?

If the latter, an attacker on a multi-user system could use it to make 
you append to files the attacker ordinarily doesn't have access to -- 
consider guile-smc being in a process as root and the attacker creating 
/tmp/smc.log as a symlink to /etc/passwd first, depending on what was 
logged, there is now an additional entry in there or its corrupted, 
preventing booting.

> Guile-SMC tries to log to the syslog by default but it seems that this
> option is not working in Guix, so we need another way to log the
> messages.  Or it may be that I just overlooked something.
I do think it works, at least there are plenty of mentions of 'syslog' 
in the Guix repository. However, possibly the build container forbids 
access (unverified), maybe for running tests you need a different logger.

Greetings,
Maxime.


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

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

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

* [bug#57365] [PATCH] gnu: guile-smc: Update to 0.5.0
  2022-08-26 13:34 ` Mathieu Othacehe
  2022-08-27  3:15   ` Artyom V. Poptsov
  2022-08-27  7:54   ` Maxime Devos
@ 2022-09-02  6:20   ` Artyom V. Poptsov
  2022-09-02  7:38     ` bug#57365: " Mathieu Othacehe
  2 siblings, 1 reply; 6+ messages in thread
From: Artyom V. Poptsov @ 2022-09-02  6:20 UTC (permalink / raw)
  To: Mathieu Othacehe; +Cc: 57365


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

Hello,

I released Guile-SMC 0.5.2:
  https://lists.gnu.org/archive/html/guile-user/2022-09/msg00002.html

And Guile-INI 0.5.1:
  https://lists.gnu.org/archive/html/guile-user/2022-09/msg00003.html

So I updated both Guile-SMC and Guile-INI package definitions
accordingly.

Not sure if I should create a new thread in the mailing list for this.

For now please find updated patches attached below.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-gnu-guile-smc-Update-to-0.5.2.patch --]
[-- Type: text/x-diff, Size: 3109 bytes --]

From 44c116ba5935b925fe976a720283a19f53128906 Mon Sep 17 00:00:00 2001
From: "Artyom V. Poptsov" <poptsov.artyom@gmail.com>
Date: Tue, 23 Aug 2022 21:10:13 +0300
Subject: [PATCH 1/2] gnu: guile-smc: Update to 0.5.2.

* gnu/packages/guile-xyz.scm (guile-smc): Update to 0.5.2.
  [native-inputs]: Add "help2man" and "which".
  [inputs]: Use the new inputs style.
---
 gnu/packages/guile-xyz.scm | 31 +++++++------------------------
 1 file changed, 7 insertions(+), 24 deletions(-)

diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm
index 8ba38c87d8..11fa92d08a 100644
--- a/gnu/packages/guile-xyz.scm
+++ b/gnu/packages/guile-xyz.scm
@@ -4864,7 +4864,7 @@ (define-public guile-gitlab
 (define-public guile-smc
   (package
     (name "guile-smc")
-    (version "0.3.0")
+    (version "0.5.2")
     (source
      (origin
        (method git-fetch)
@@ -4874,7 +4874,7 @@ (define-public guile-smc
        (file-name (string-append name "-" version))
        (sha256
         (base32
-         "0szkjmasi70m1vppck7nhdxg4lnxzjq6mihi6r1552s8sxm5z008"))))
+         "05q20vi59whjs7jb8bgcxnnfy6c3wx26m5ps2fwlsz52nggarxzb"))))
     (build-system gnu-build-system)
     (arguments
      `(#:make-flags '("GUILE_AUTO_COMPILE=0")     ;to prevent guild warnings
@@ -4886,23 +4886,6 @@ (define-public guile-smc
        #:phases
        (modify-phases %standard-phases
          (delete 'strip)
-         (add-after 'configure 'patch
-           (lambda* (#:key inputs outputs #:allow-other-keys)
-             (substitute* "modules/smc/core/log.scm"
-               (("  #:use-module \\(logging logger\\)")
-                (string-append
-                 "  #:use-module (logging logger)\n"
-                 "  #:use-module (logging rotating-log)"))
-               (("#:init-value \"logger\"")
-                (format #f
-                        "#:init-value \"~a/bin/logger\""
-                        (assoc-ref inputs "inetutils")))
-             (("\\(add-handler! %logger %syslog\\)")
-              (string-append
-               "(add-handler! %logger\n"
-               "              (make <rotating-log>\n"
-               "                    #:file-name \"smc.log\"))\n")))
-             #t))
          (add-after 'install 'wrap-program
            (lambda* (#:key inputs outputs #:allow-other-keys)
              (let* ((out       (assoc-ref outputs "out"))
@@ -4922,12 +4905,12 @@ (define-public guile-smc
                     ,(string-append guile-lib go)))))
              #t)))))
     (native-inputs
-     (list autoconf automake pkg-config texinfo))
+     (list autoconf automake pkg-config texinfo help2man which))
     (inputs
-     `(("bash"      ,bash-minimal)
-       ("guile"     ,guile-3.0)
-       ("guile-lib" ,guile-lib)
-       ("inetutils" ,inetutils)))
+     (list bash-minimal
+           guile-3.0
+           guile-lib
+           inetutils))
     (home-page "https://github.com/artyom-poptsov/guile-smc")
     (synopsis "GNU Guile state machine compiler")
     (description
-- 
2.34.1


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.3: 0002-gnu-guile-ini-Update-to-0.5.1.patch --]
[-- Type: text/x-diff, Size: 2850 bytes --]

From a9eff226c36bf0a8a1356da17f5ca1434fa9d593 Mon Sep 17 00:00:00 2001
From: "Artyom V. Poptsov" <poptsov.artyom@gmail.com>
Date: Tue, 23 Aug 2022 21:41:47 +0300
Subject: [PATCH 2/2] gnu: guile-ini: Update to 0.5.1.

* gnu/packages/guile-xyz.scm (guile-ini): Update to 0.5.1.
---
 gnu/packages/guile-xyz.scm | 45 +++++++++++++++++++++-----------------
 1 file changed, 25 insertions(+), 20 deletions(-)

diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm
index 11fa92d08a..7df3012568 100644
--- a/gnu/packages/guile-xyz.scm
+++ b/gnu/packages/guile-xyz.scm
@@ -4931,28 +4931,33 @@ (define-public guile-smc
 (define-public guile-ini
   (package
     (name "guile-ini")
-    (version "0.3.0")
-    (source
-     (origin
-       (method git-fetch)
-       (uri (git-reference
-             (url "https://github.com/artyom-poptsov/guile-ini")
-             (commit (string-append "v" version))))
-       (file-name (string-append name "-" version))
-       (sha256
-        (base32
-         "0injn60530valhx3gsmdp72g6z886yf0n08hscky21h3dafm14kc"))))
+    (version "0.5.1")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/artyom-poptsov/guile-ini")
+                    (commit (string-append "v" version))))
+              (file-name (string-append name "-" version))
+              (sha256
+               (base32
+                "0ky7sffxywc2p84q5kdsphr99q0g5gy45rj0vx7f77hwpfm2093x"))))
     (build-system gnu-build-system)
     (arguments
-     `(#:make-flags '("GUILE_AUTO_COMPILE=0")))     ;to prevent guild warnings
-    (native-inputs
-     (list autoconf automake pkg-config texinfo))
-    (inputs
-     `(("bash" ,bash-minimal)
-       ("guile" ,guile-3.0)
-       ("guile-lib" ,guile-lib)))
-    (propagated-inputs
-     (list guile-smc))
+     `(#:make-flags '("GUILE_AUTO_COMPILE=0") ;to prevent guild warnings
+       #:phases (modify-phases %standard-phases
+                  (delete 'strip)
+                  (add-before 'build 'generate-fsm-context
+                    ;; Make sure the intermediate FSM context is present
+                    ;; before the build.
+                    (lambda _
+                      (let ((cwd (getcwd)))
+                        (chdir "modules/ini/")
+                        (invoke "make" "GUILE_AUTO_COMPILE=0"
+                                "fsm-context.scm")
+                        (chdir cwd)))))))
+    (native-inputs (list autoconf automake pkg-config texinfo))
+    (inputs (list bash-minimal guile-3.0 guile-lib))
+    (propagated-inputs (list guile-smc))
     (home-page "https://github.com/artyom-poptsov/guile-ini")
     (synopsis "Guile library for INI format support")
     (description
-- 
2.34.1


[-- Attachment #1.4: Type: text/plain, Size: 232 bytes --]


Thanks,

- Artyom
  
-- 
Artyom "avp" Poptsov <poptsov.artyom@gmail.com>
Home page: https://memory-heap.org/~avp/
CADR Hackerspace co-founder: https://cadrspace.ru/
GPG: D0C2 EAC1 3310 822D 98DE  B57C E9C5 A2D9 0898 A02F

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

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

* bug#57365: [PATCH] gnu: guile-smc: Update to 0.5.0
  2022-09-02  6:20   ` Artyom V. Poptsov
@ 2022-09-02  7:38     ` Mathieu Othacehe
  0 siblings, 0 replies; 6+ messages in thread
From: Mathieu Othacehe @ 2022-09-02  7:38 UTC (permalink / raw)
  To: Artyom V. Poptsov; +Cc: 57365-done


Hey Artyom,

> Not sure if I should create a new thread in the mailing list for this.
>
> For now please find updated patches attached below.

It's great that you found a way to deal with logging. Guile-SMC looks
fun, can't wait to test it :).

Pushed both patches.

Thanks,

Mathieu




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

end of thread, other threads:[~2022-09-02  7:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-23 18:45 [bug#57365] [PATCH] gnu: guile-smc: Update to 0.5.0 Artyom V. Poptsov
2022-08-26 13:34 ` Mathieu Othacehe
2022-08-27  3:15   ` Artyom V. Poptsov
2022-08-27  7:54   ` Maxime Devos
2022-09-02  6:20   ` Artyom V. Poptsov
2022-09-02  7:38     ` bug#57365: " Mathieu Othacehe

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.