Source: emacs
Version: 1:29.1+1-2
tags: patch

Hello, some people (e.g. Ubuntu builders) might have a different TERM set other 
than the default, in this case emacs FTBFS with an error similar to this:

DEB_BUILD_GNU_CPU=x86_64 -env DEB_HOST_ARCH_OS=linux -env DEB_HOST_GNU_CPU=x86_64 -env DFLAGS=-frelease -env OBJCXXFLAGS=-g&_-O2&_-ffile-prefix-map=/<<PKGBUILDDIR>>=.&_-fstack-protector-strong&_-Wformat&_-Werror=format-security&_-fdebug-prefix-map=/<<PKGBUILDDIR>>=/usr/src/emacs-1:29.1+1-2 -env 
CFLAGS=-g&_-O2&_-ffile-prefix-map=/<<PKGBUILDDIR>>=.&_-fstack-protector-strong&_-Wformat&_-Werror=format-security&_-fdebug-prefix-map=/<<PKGBUILDDIR>>=/usr/src/emacs-1:29.1+1-2&_-Wall -env DEB_HOST_ARCH_CPU=amd64 -env DEB_BUILD_ARCH_ENDIAN=little -env PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games -env SCHROOT_UID=2001 -env LC_ALL=C.UTF-8 -env DEB_HOST_GNU_TYPE=x86_64-linux-gnu -env DEB_HOST_ARCH_ENDIAN=little -env 
DEB_HOST_ARCH=amd64 -env DEB_TARGET_ARCH_ENDIAN=little -env DEB_TARGET_GNU_CPU=x86_64 -env SCHROOT_GID=2501 -env DH_INTERNAL_OPTIONS= -env DEB_BUILD_GNU_SYSTEM=linux-gnu -env MAKELEVEL=6 -env SHLVL=1 -env DEB_BUILD_OPTIONS=parallel=4 -env SELECTOR=(not&_(or&_(tag&_:expensive-test)&_(tag&_:unstable))) -env DEB_BUILD_GNU_TYPE=x86_64-linux-gnu -env DEB_HOST_ARCH_BITS=64 -env USER=buildd -env 
OBJCFLAGS=-g&_-O2&_-ffile-prefix-map=/<<PKGBUILDDIR>>=.&_-fstack-protector-strong&_-Wformat&_-Werror=format-security&_-fdebug-prefix-map=/<<PKGBUILDDIR>>=/usr/src/emacs-1:29.1+1-2 -env DEB_BUILD_ARCH_LIBC=gnu -env DEB_BUILD_ARCH_CPU=amd64 -env DEB_TARGET_MULTIARCH=x86_64-linux-gnu -env TERM=unknown -env MAKEFLAGS=kw&_--&_SELECTOR=(not\&_(or\&_(tag\&_:expensive-test)\&_(tag\&_:unstable))) -env 
FCFLAGS=-g&_-O2&_-ffile-prefix-map=/<<PKGBUILDDIR>>=.&_-fstack-protector-strong&_-fdebug-prefix-map=/<<PKGBUILDDIR>>=/usr/src/emacs-1:29.1+1-2 -env MFLAGS=-kw -env APT_CONFIG=/var/lib/sbuild/apt.conf -env DEB_TARGET_ARCH_OS=linux -env DEB_BUILD_ARCH=amd64 -env DEB_TARGET_ARCH=amd64 -env CPPFLAGS=-Wdate-time&_-D_FORTIFY_SOURCE=2 -env DEB_TARGET_ARCH_ABI=base -env DEB_TARGET_GNU_TYPE=x86_64-linux-gnu -env DEB_TARGET_ARCH_LIBC=gnu -env DEB_HOST_ARCH_ABI=base -env 
LDFLAGS=-Wl,-Bsymbolic-functions&_-Wl,-z,relro -env DEB_BUILD_PROFILES=noudeb -env SCHROOT_USER=buildd -env V=0 -env SCHROOT_GROUP=buildd -env SCHROOT_ALIAS_NAME=build-PACKAGEBUILD-26469628 -env _=../src/emacs -env DEB_BUILD_ARCH_OS=linux -env CXXFLAGS=-g&_-O2&_-ffile-prefix-map=/<<PKGBUILDDIR>>=.&_-fstack-protector-strong&_-Wformat&_-Werror=format-security&_-fdebug-prefix-map=/<<PKGBUILDDIR>>=/usr/src/emacs-1:29.1+1-2 -env 
MAKEOVERRIDES=${-*-command-variables-*-} -env DEB_BUILD_ARCH_BITS=64 -env DEB_RULES_REQUIRES_ROOT=binary-targets -env DEB_HOST_GNU_SYSTEM=linux-gnu -env LOGNAME=buildd -env SOURCE_DATE_EPOCH=1690914267 -env DEB_BUILD_MULTIARCH=x86_64-linux-gnu -env FFLAGS=-g&_-O2&_-ffile-prefix-map=/<<PKGBUILDDIR>>=.&_-fstack-protector-strong&_-fdebug-prefix-map=/<<PKGBUILDDIR>>=/usr/src/emacs-1:29.1+1-2 -env DEB_TARGET_ARCH_BITS=64 -env SCHROOT_SESSION_ID=build-PACKAGEBUILD-26469628 
-env DH_INTERNAL_OVERRIDE=dh_auto_test -env SCHROOT_COMMAND=dpkg-buildpackage&_-us&_-uc&_-mLaunchpad&_Build&_Daemon&_<buildd@bos03-amd64-016.buildd>&_-b&_-rfakeroot -env DEB_TARGET_ARCH_CPU=amd64 -env DEB_HOST_MULTIARCH=x86_64-linux-gnu -env GCJFLAGS=-g&_-O2&_-ffile-prefix-map=/<<PKGBUILDDIR>>=.&_-fstack-protector-strong&_-fdebug-prefix-map=/<<PKGBUILDDIR>>=/usr/src/emacs-1:29.1+1-2 -env DEB_TARGET_GNU_SYSTEM=linux-gnu -env 
TEST_LOAD_EL=no -env SCHROOT_CHROOT_NAME=build-PACKAGEBUILD-26469628 -env DEB_HOST_ARCH_LIBC=gnu -env SHELL=/bin/sh -env LANG=C -env EMACS_TEST_DIRECTORY=/<<PKGBUILDDIR>>/debian/build-src/test -env HOME=/nonexistent -dir /<<PKGBUILDDIR>>/debian/build-lucid/test/ -tty /dev/pts/0 unknown
                 Tue Aug  1 23:42:11 2023 /tmp/server-testsZoZbqS/test-server 
<5>: Sent -emacs-pid 58211
                 Tue Aug  1 23:42:11 2023 /tmp/server-testsZoZbqS/test-server <5>: Sent -error 
Terminal&_type&_unknown&_is&_not&_defined
                 Tue Aug  1 23:42:11 2023 /tmp/server-testsZoZbqS/test-server 
<5>: Terminal type unknown is not defined
                 Tue Aug  1 23:42:11 2023 /tmp/server-testsZoZbqS/test-server 
<5>: Status changed to closed: connection broken by remote peer
                 Tue Aug  1 23:42:11 2023 /tmp/server-testsZoZbqS/test-server 
<5>: server-delete-client
                 Tue Aug  1 23:42:11 2023 /tmp/server-testsZoZbqS/test-server 
<5>: Deleted
                 Tue Aug  1 23:42:16 2023 /tmp/server-testsZoZbqS/test-server: 
Status changed to closed: deleted
                 Tue Aug  1 23:42:16 2023 /tmp/server-testsZoZbqS/test-server: 
server-delete-client
                 Tue Aug  1 23:42:16 2023 Stopped server
Client output: *ERROR*: Terminal type unknown is not defined Process /<<PKGBUILDDIR>>/debian/build-lucid/lib-src/emacsclient exited abnormally with code 1 (ert-test-failed
     ((should
       (length=
        (frame-list)
        2))
      :form
      (length=
       (#<frame F1 0x55b0a7a802b8>)
       2)
      :value nil))
   FAILED  7/7  server-tests/server-start/stop-prompt-with-client (5.006554 
sec) at ../../build-src/test/lisp/server-tests.el:129

Ran 7 tests, 4 results as expected, 3 unexpected (2023-08-01 23:42:16+0000, 
15.440815 sec)

3 unexpected results:
   FAILED  server-tests/emacsclient/create-frame
   FAILED  server-tests/server-force-stop/keeps-frames
   FAILED  server-tests/server-start/stop-prompt-with-client



A trivial patch fixes the issue:

diff -Nru emacs-29.1+1/debian/rules emacs-29.1+1/debian/rules
--- emacs-29.1+1/debian/rules   2023-08-01 20:24:27.000000000 +0200
+++ emacs-29.1+1/debian/rules   2023-08-04 08:25:21.000000000 +0200
@@ -21,6 +21,7 @@
 # Uncomment this to turn on verbose mode.
 #export DH_VERBOSE=1
+TERM := linux
 SHELL := /bin/bash
 quilt := QUILT_PATCHES=debian/patches QUILT_PATCHES_PREFIX=y quilt
 pf := set -o pipefail


thanks for considering it!

G.

Attachment: OpenPGP_signature
Description: OpenPGP digital signature

Reply via email to