unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: "Artyom V. Poptsov" <poptsov.artyom@gmail.com>
To: Mathieu Othacehe <othacehe@gnu.org>
Cc: 57365@debbugs.gnu.org
Subject: [bug#57365] [PATCH] gnu: guile-smc: Update to 0.5.0
Date: Sat, 27 Aug 2022 06:15:59 +0300	[thread overview]
Message-ID: <871qt2v0k0.fsf@gmail.com> (raw)
In-Reply-To: <874jxzyvpv.fsf@gnu.org> (Mathieu Othacehe's message of "Fri, 26 Aug 2022 15:34:36 +0200")


[-- 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 --]

  reply	other threads:[~2022-08-27  3:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2022-08-27  7:54   ` Maxime Devos
2022-09-02  6:20   ` Artyom V. Poptsov
2022-09-02  7:38     ` bug#57365: " Mathieu Othacehe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871qt2v0k0.fsf@gmail.com \
    --to=poptsov.artyom@gmail.com \
    --cc=57365@debbugs.gnu.org \
    --cc=othacehe@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).