Re: Welcome to Zheng (z572) as a new committer!

2024-05-11 Thread John Kehayias
On Thu, May 02, 2024 at 12:01 AM, Ludovic Courtès wrote:

> Maxim Cournoyer  skribis:
>
>> Zheng has joined the committers to help improving cross-compilation,
>> riscv64, and KDE, among others.
>
> Welcome on board, Zheng!
>
> Ludo’.

Yes, welcome!




Re: [Nicolas Graves] [PATCH v6 01/10] rde: emacs: Start emacs in --daemon mode, with shepherd and pid-file

2024-05-11 Thread Development of GNU Guix and the GNU System distribution.

A lightly cleaned-up version attached.

>From 8ba972aec7026878bfbbe5cfb387c5c723672380 Mon Sep 17 00:00:00 2001
From: Nicolas Graves 
Date: Sat, 13 Apr 2024 19:37:34 +0200
Subject: [PATCH] Implement systemd socket.

---
 configure.ac |  19 +--
 lib/Makefile.in  |   2 +-
 lib/gnulib.mk.in |   2 -
 lib/sd-socket.c  | 137 +++
 lib/sd-socket.h  |  57 
 msdos/sed1v2.inp |   3 --
 src/Makefile.in  |   9 ++--
 src/deps.mk  |   2 +-
 src/emacs.c  |  50 -
 9 files changed, 226 insertions(+), 55 deletions(-)
 create mode 100644 lib/sd-socket.c
 create mode 100644 lib/sd-socket.h

diff --git a/configure.ac b/configure.ac
index 29b71ea2730..a245a7b5ccc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -457,7 +457,6 @@ AC_DEFUN
 OPTION_DEFAULT_ON([webp],[don't compile with WebP image support])
 OPTION_DEFAULT_ON([sqlite3],[don't compile with sqlite3 support])
 OPTION_DEFAULT_ON([lcms2],[don't compile with Little CMS support])
-OPTION_DEFAULT_ON([libsystemd],[don't compile with libsystemd support])
 OPTION_DEFAULT_ON([cairo],[don't compile with Cairo drawing])
 OPTION_DEFAULT_OFF([cairo-xcb], [use XCB surfaces for Cairo support])
 OPTION_DEFAULT_ON([xml2],[don't compile with XML parsing support])
@@ -3203,21 +3202,6 @@ AC_DEFUN
 AC_SUBST([LIBGNUTLS_LIBS])
 AC_SUBST([LIBGNUTLS_CFLAGS])
 
-HAVE_LIBSYSTEMD=no
-if test "${with_libsystemd}" = "yes" ; then
-  dnl This code has been tested with libsystemd 222 and later.
-  dnl FIXME: Find the earliest version number for which Emacs should work,
-  dnl and change '222' to that number.
-  EMACS_CHECK_MODULES([LIBSYSTEMD], [libsystemd >= 222],
-[HAVE_LIBSYSTEMD=yes], [HAVE_LIBSYSTEMD=no])
-  if test "${HAVE_LIBSYSTEMD}" = "yes"; then
-AC_DEFINE([HAVE_LIBSYSTEMD], [1], [Define if using libsystemd.])
-  fi
-fi
-
-AC_SUBST([LIBSYSTEMD_LIBS])
-AC_SUBST([LIBSYSTEMD_CFLAGS])
-
 HAVE_JSON=no
 JSON_OBJ=
 
@@ -6652,7 +6636,7 @@ AC_DEFUN
 optsep=
 emacs_config_features=
 for opt in ACL BE_APP CAIRO DBUS FREETYPE GCONF GIF GLIB GMP GNUTLS GPM GSETTINGS \
- HARFBUZZ IMAGEMAGICK JPEG JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 \
+ HARFBUZZ IMAGEMAGICK JPEG JSON LCMS2 LIBOTF LIBSELINUX LIBXML2 \
  M17N_FLT MODULES NATIVE_COMP NOTIFY NS OLDXMENU PDUMPER PGTK PNG RSVG SECCOMP \
  SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER \
  UNEXEC WEBP X11 XAW3D XDBE XFT XIM XINPUT2 XPM XWIDGETS X_TOOLKIT \
@@ -6721,7 +6705,6 @@ AC_DEFUN
   Does Emacs use -lm17n-flt?  ${HAVE_M17N_FLT}
   Does Emacs use -lotf?   ${HAVE_LIBOTF}
   Does Emacs use -lxft?   ${HAVE_XFT}
-  Does Emacs use -lsystemd?   ${HAVE_LIBSYSTEMD}
   Does Emacs use -ljansson?   ${HAVE_JSON}
   Does Emacs use -ltree-sitter?   ${HAVE_TREE_SITTER}
   Does Emacs use the GMP library? ${HAVE_GMP}
diff --git a/lib/Makefile.in b/lib/Makefile.in
index 71199c32277..d934a755e85 100644
--- a/lib/Makefile.in
+++ b/lib/Makefile.in
@@ -74,7 +74,7 @@ Makefile:
 not_emacs_OBJECTS = regex.o malloc/%.o free.o
 
 libgnu_a_OBJECTS = fingerprint.o $(gl_LIBOBJS) \
-  $(patsubst %.c,%.o,$(filter %.c,$(libgnu_a_SOURCES)))
+  $(patsubst %.c,%.o,$(filter %.c,$(libgnu_a_SOURCES))) sd-socket.o
 for_emacs_OBJECTS = $(filter-out $(not_emacs_OBJECTS),$(libgnu_a_OBJECTS))
 libegnu_a_OBJECTS = $(patsubst %.o,e-%.o,$(for_emacs_OBJECTS))
 
diff --git a/lib/gnulib.mk.in b/lib/gnulib.mk.in
index 9ab4b741595..f9ed4a4cb23 100644
--- a/lib/gnulib.mk.in
+++ b/lib/gnulib.mk.in
@@ -912,8 +912,6 @@ LIBSECCOMP_CFLAGS = @LIBSECCOMP_CFLAGS@
 LIBSECCOMP_LIBS = @LIBSECCOMP_LIBS@
 LIBSELINUX_LIBS = @LIBSELINUX_LIBS@
 LIBSOUND = @LIBSOUND@
-LIBSYSTEMD_CFLAGS = @LIBSYSTEMD_CFLAGS@
-LIBSYSTEMD_LIBS = @LIBSYSTEMD_LIBS@
 LIBS_ECLIENT = @LIBS_ECLIENT@
 LIBS_GNUSTEP = @LIBS_GNUSTEP@
 LIBS_MAIL = @LIBS_MAIL@
diff --git a/lib/sd-socket.c b/lib/sd-socket.c
new file mode 100644
index 000..205ddcf433d
--- /dev/null
+++ b/lib/sd-socket.c
@@ -0,0 +1,137 @@
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+/* Copied and adapted from systemd source code. */
+
+#define _GNU_SOURCE 1
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "sd-socket.h"
+#define _cleanup_(f) __attribute__((cleanup(f)))
+
+int sd_is_socket(int fd, int type, int listening) {
+struct stat st_fd;
+
+assert(fd >= 0);
+assert(type >= 0);
+
+if (fstat(fd, _fd) < 0)
+return -errno;
+
+if (!S_ISSOCK(st_fd.st_mode))
+return 0;
+
+if (type != 0) {
+int other_type = 0;
+socklen_t l = sizeof(other_type);
+
+if (getsockopt(fd, SOL_SOCKET, SO_TYPE, _type, ) < 0)
+return -errno;
+
+if (l != sizeof(other_type))
+  

Re: [Nicolas Graves] [PATCH v6 01/10] rde: emacs: Start emacs in --daemon mode, with shepherd and pid-file

2024-05-11 Thread Development of GNU Guix and the GNU System distribution.

On 2024-04-13 11:16, Stefan Monnier wrote:

>> Maybe some feedback on the Emacs side about this? There are indeed very
>> few places where systemd sd_* functions are called in emacs.c, should we
>> try and re-implement them instead of using the library as is? Would that
>> be a contribution Emacs devs would be interested in? That would
>> definitely be beneficial for Emacs on Guix as highlighted by Ludo'.
>
> It's hard to tell without seeing the actual patch.

Seems to work properly on my side with the following patch, on Guix with
the shepherd service I sent a few weeks ago. The patch is actually
pretty simple.

Some choices :

- I removed most of the code in former function sd_listen_fds' upstream
source code, because it didn't seem related to integration functionality
with emacs but rather to systemd inner workings. Some edge cases might
not be as well covered (strtol with defaults instead of systemd's
safe_atoi), but it works on my side. The functionality is directly
integrated in emacs.c rather than the function itself reproduced.

- I simplified the sd_is_socket function to instead use the upstream
untouched sd_is_socket_internal function. This is because the default
family argument was set in emacs.c.

- The sd_notify code is taken from
https://www.freedesktop.org/software/systemd/man/devel/sd_notify.html#Notes

Disclaimer : I'm not a seasoned C nor emacs developer, some things are
probably odd, but I would need for feedback to make things more emacsy /
rigorous in C.

>From c9f3af7dc4accc4da352ef8ffdb95478bcf2bd16 Mon Sep 17 00:00:00 2001
From: Nicolas Graves 
Date: Sat, 13 Apr 2024 19:37:34 +0200
Subject: [PATCH] Implement systemd socket.

---
 configure.ac |  19 +-
 lib/Makefile.in  |   2 +-
 lib/gnulib.mk.in |   2 -
 lib/sd-socket.c  | 149 +++
 lib/sd-socket.h  | 127 
 msdos/sed1v2.inp |   3 -
 src/Makefile.in  |   9 +--
 src/deps.mk  |   2 +-
 src/emacs.c  |  50 
 9 files changed, 308 insertions(+), 55 deletions(-)
 create mode 100644 lib/sd-socket.c
 create mode 100644 lib/sd-socket.h

diff --git a/configure.ac b/configure.ac
index 29b71ea2730..a245a7b5ccc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -457,7 +457,6 @@ AC_DEFUN
 OPTION_DEFAULT_ON([webp],[don't compile with WebP image support])
 OPTION_DEFAULT_ON([sqlite3],[don't compile with sqlite3 support])
 OPTION_DEFAULT_ON([lcms2],[don't compile with Little CMS support])
-OPTION_DEFAULT_ON([libsystemd],[don't compile with libsystemd support])
 OPTION_DEFAULT_ON([cairo],[don't compile with Cairo drawing])
 OPTION_DEFAULT_OFF([cairo-xcb], [use XCB surfaces for Cairo support])
 OPTION_DEFAULT_ON([xml2],[don't compile with XML parsing support])
@@ -3203,21 +3202,6 @@ AC_DEFUN
 AC_SUBST([LIBGNUTLS_LIBS])
 AC_SUBST([LIBGNUTLS_CFLAGS])
 
-HAVE_LIBSYSTEMD=no
-if test "${with_libsystemd}" = "yes" ; then
-  dnl This code has been tested with libsystemd 222 and later.
-  dnl FIXME: Find the earliest version number for which Emacs should work,
-  dnl and change '222' to that number.
-  EMACS_CHECK_MODULES([LIBSYSTEMD], [libsystemd >= 222],
-[HAVE_LIBSYSTEMD=yes], [HAVE_LIBSYSTEMD=no])
-  if test "${HAVE_LIBSYSTEMD}" = "yes"; then
-AC_DEFINE([HAVE_LIBSYSTEMD], [1], [Define if using libsystemd.])
-  fi
-fi
-
-AC_SUBST([LIBSYSTEMD_LIBS])
-AC_SUBST([LIBSYSTEMD_CFLAGS])
-
 HAVE_JSON=no
 JSON_OBJ=
 
@@ -6652,7 +6636,7 @@ AC_DEFUN
 optsep=
 emacs_config_features=
 for opt in ACL BE_APP CAIRO DBUS FREETYPE GCONF GIF GLIB GMP GNUTLS GPM GSETTINGS \
- HARFBUZZ IMAGEMAGICK JPEG JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 \
+ HARFBUZZ IMAGEMAGICK JPEG JSON LCMS2 LIBOTF LIBSELINUX LIBXML2 \
  M17N_FLT MODULES NATIVE_COMP NOTIFY NS OLDXMENU PDUMPER PGTK PNG RSVG SECCOMP \
  SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER \
  UNEXEC WEBP X11 XAW3D XDBE XFT XIM XINPUT2 XPM XWIDGETS X_TOOLKIT \
@@ -6721,7 +6705,6 @@ AC_DEFUN
   Does Emacs use -lm17n-flt?  ${HAVE_M17N_FLT}
   Does Emacs use -lotf?   ${HAVE_LIBOTF}
   Does Emacs use -lxft?   ${HAVE_XFT}
-  Does Emacs use -lsystemd?   ${HAVE_LIBSYSTEMD}
   Does Emacs use -ljansson?   ${HAVE_JSON}
   Does Emacs use -ltree-sitter?   ${HAVE_TREE_SITTER}
   Does Emacs use the GMP library? ${HAVE_GMP}
diff --git a/lib/Makefile.in b/lib/Makefile.in
index 71199c32277..d934a755e85 100644
--- a/lib/Makefile.in
+++ b/lib/Makefile.in
@@ -74,7 +74,7 @@ Makefile:
 not_emacs_OBJECTS = regex.o malloc/%.o free.o
 
 libgnu_a_OBJECTS = fingerprint.o $(gl_LIBOBJS) \
-  $(patsubst %.c,%.o,$(filter %.c,$(libgnu_a_SOURCES)))
+  $(patsubst %.c,%.o,$(filter %.c,$(libgnu_a_SOURCES))) sd-socket.o
 for_emacs_OBJECTS = $(filter-out $(not_emacs_OBJECTS),$(libgnu_a_OBJECTS))
 libegnu_a_OBJECTS = $(patsubst 

New mumi www and mumi compose subcommands

2024-05-11 Thread Arun Isaac


Hi all,

The latest mumi CLI (version 0.1.0) comes with two new
subcommands—www and compose.

Now, when an issue is current, you can open that issue in your web
browser using the www subcommand; and, you can compose a mail to that
issue using the compose subcommand.

For example,

$ mumi current 22138
#22138 Search paths of dependencies are not honored
opened on 10 Dec 2015 09:36 by Ludovic Courtès

$ mumi www
[opens the issue in your web browser]

$ mumi compose
[opens your mail client to compose an email to that issue with addresses
pre-filled correctly]

The www and compose subcommands rely on xdg-open to open your browser
and mail client correctly.

Cheers!
Arun



Re: [PATCH] doc: Clarify need to update search paths on foreign distro (was Re: Feedback of the GNU Guix manual)

2024-05-11 Thread pelzflorian (Florian Pelz)
Hello Matt, Vagrant and all.  As I understand, we should not advice all
users to add these exports to .bashrc, because users with
guix-install.sh’s sys_create_init_profile or Debian’s
/etc/profile.d/guix.sh do not need it.

Instead, there already is advice for .config/guix/current documented in
the Guix manual’s Getting Started section.  The advice should be a
cross-reference that users should follow the steps from Getting Started,
so search paths are set up properly instead of advising to set PATH and
INFOPATH.

The advice of setting PATH really should go away.

Regards,
Florian