FS#70400 - [emacs-nox] daemon doesn't notify systemd user instance of startup in 27.2-1

Attached to Project: Arch Linux
Opened by Jérôme Tamba (sprsd) - Saturday, 10 April 2021, 15:52 GMT
Last edited by freswa (frederik) - Thursday, 09 June 2022, 21:12 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Jürgen Hötzel (juergen)
freswa (frederik)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 4
Private No

Details

Description:

After upgrading to emacs-nox 27.2-1, the emacs systemd user service stays in the 'activating' state after being started or restarted, like it's never notifying systemd. Thus it gets killed and restarted by systemd frequently. Other than that the daemon seems to be functional.

This feels exactly like  FS#67718  but it doesn't seem to be for the same reasons: I first tried bisecting through the changes from emacs 27.1 to 27.2 but never found a bad revision. Then I simply tried rebuilding the package locally (asp + makepkg), and this simple rebuild fixes the bug.

With emacs-nox 27.2-1 (NOK):

~ > emacsclient --eval "(emacs-version)"
"GNU Emacs 27.2 (build 1, x86_64-pc-linux-gnu)\n of 2021-04-05"
~ > emacsclient --eval "system-configuration-options"
"--prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib --with-libsystemd --localstatedir=/var --without-x --without-sound --with-modules 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fno-plt' CPPFLAGS=-D_FORTIFY_SOURCE=2 LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now"

It was built with --with-libsystemd, so it's not the same cause as  FS#67718 .
With my local build (OK):

~ > emacsclient --eval "(emacs-version)"
"GNU Emacs 27.2 (build 1, x86_64-pc-linux-gnu)\n of 2021-04-10"
~ > emacsclient --eval "system-configuration-options"
"--prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib --with-libsystemd --localstatedir=/var --without-x --without-sound --with-modules 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt' CPPFLAGS=-D_FORTIFY_SOURCE=2 LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now"

So, no real difference apart from -fstack-protector-strong. Just for the sake of it I tried building locally without it and it still worked.

I noticed that systemd and libs got an update on the same day as emacs-nox so I tried downgrading systemd-libs and try with the 27.2-1 package but it still doesn't work.

Note that the emacs package doesn't seem to have the problem, the daemon starts correctly.

Steps to reproduce:
- install/upgrade emacs-nox to 27.2-1
- systemctl --user start emacs
This task depends upon

Closed by  freswa (frederik)
Thursday, 09 June 2022, 21:12 GMT
Reason for closing:  Implemented
Comment by Doug Newgard (Scimmia) - Saturday, 10 April 2021, 16:06 GMT
If you didn't build in a clean chroot, it's not really a good test. Sounds like there could be a missing makedep. Maybe systemd.
Comment by loqs (loqs) - Saturday, 10 April 2021, 16:41 GMT
It is missing systemd  FS#66762 

end of configure output from clean chroot:
Configured for 'x86_64-pc-linux-gnu'.

Where should the build process find the source code? .
What compiler should emacs be built with? gcc -march=x86-64 -mtune=generic -O2 -pipe -fno-plt
Should Emacs use the GNU version of malloc? no
(The GNU allocators don't work with this system configuration.)
Should Emacs use a relocating allocator for buffers? no
Should Emacs use mmap(2) for buffer allocation? no
What window system should Emacs use? none
What toolkit should Emacs use? none
Where do we find X Windows header files? NONE
Where do we find X Windows libraries? NONE
Does Emacs use -lXaw3d? no
Does Emacs use -lXpm? no
Does Emacs use -ljpeg? no
Does Emacs use -ltiff? no
Does Emacs use a gif library? no
Does Emacs use a png library? no
Does Emacs use -lrsvg-2? no
Does Emacs use cairo? no
Does Emacs use -llcms2? no
Does Emacs use imagemagick? no
Does Emacs support sound? no
Does Emacs use -lgpm? no
Does Emacs use -ldbus? yes
Does Emacs use -lgconf? no
Does Emacs use GSettings? no
Does Emacs use a file notification library? yes -lglibc (inotify)
Does Emacs use access control lists? yes -lacl
Does Emacs use -lselinux? no
Does Emacs use -lgnutls? yes
Does Emacs use -lxml2? yes
Does Emacs use -lfreetype? no
Does Emacs use HarfBuzz? no
Does Emacs use -lm17n-flt? no
Does Emacs use -lotf? no
Does Emacs use -lxft? no
Does Emacs use -lsystemd? no
Does Emacs use -ljansson? yes
Does Emacs use -lgmp? yes
Does Emacs directly use zlib? yes
Does Emacs have dynamic modules support? yes
Does Emacs use toolkit scroll bars? no
Does Emacs support Xwidgets (requires gtk3)? no
Does Emacs have threading support in lisp? yes
Does Emacs support the portable dumper? yes
Does Emacs support legacy unexec dumping? no
Which dumping strategy does Emacs use? pdumper

Edit:
Adding systemd to makedepends and support is then detected and --with-libsystemd can be dropped.
Comment by Paulo F (beholder) - Monday, 03 May 2021, 22:14 GMT
I can confirm "loqs" suggestion worked for me

```
diff --git a/PKGBUILD b/PKGBUILD
index 6ccf3c3..07678a4 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -9,6 +9,7 @@ arch=('x86_64')
url="https://www.gnu.org/software/emacs/emacs.html"
license=('GPL3')
depends=('dbus' 'ncurses' 'perl' 'libxml2' 'glib2' 'gnutls' 'jansson')
+makedepends=('systemd')
provides=('emacs')
conflicts=('emacs')
changelog=$pkgname.changelog
@@ -20,7 +21,7 @@ sha256sums=('b4a7cc4e78e63f378624e0919215b910af5bb2a0afc819fad298272e9f40c1b9'
build() {
cd "${srcdir}"/emacs-$pkgver

- ./configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib --with-libsystemd \
+ ./configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib \
--localstatedir=/var --without-x --without-sound --with-modules
make
}
```
Comment by Paulo F (beholder) - Friday, 29 April 2022, 22:49 GMT
I think we can close this ticket now.

Now that I've upgraded to emacs-nox 28.1-7 - I am no longer getting the systemd restarts that would happen in 27.2-1
Comment by loqs (loqs) - Saturday, 30 April 2022, 00:01 GMT
I believe it was fixed by [1] where it was moved to become part of the emacs PKGBUILD which has gtk3 in the global depends providing a transitive dependency on systemd.

[1] https://github.com/archlinux/svntogit-packages/commit/4777ddb29868888e3c3d7578739e59ffc0e94df9

Loading...