From mboxrd@z Thu Jan  1 00:00:00 1970
Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail
From: Eli Zaretskii <eliz@gnu.org>
Newsgroups: gmane.emacs.bugs
Subject: bug#64577: 29.0.92;
 configure on NetBSD forces unstable terminfo library
Date: Wed, 12 Jul 2023 15:11:02 +0300
Message-ID: <837cr572jt.fsf@gnu.org>
References: <87v8eqrxq8.fsf@notcom.org>
Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214";
	logging-data="3039"; mail-complaints-to="usenet@ciao.gmane.io"
Cc: 64577@debbugs.gnu.org
To: vuori@notcom.org
Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jul 12 14:12:16 2023
Return-path: <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org>
Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org
Original-Received: from lists.gnu.org ([209.51.188.17])
	by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
	(Exim 4.92)
	(envelope-from <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org>)
	id 1qJYhb-0000Wo-5F
	for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 12 Jul 2023 14:12:15 +0200
Original-Received: from localhost ([::1] helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <bug-gnu-emacs-bounces@gnu.org>)
	id 1qJYhQ-0008LE-Bk; Wed, 12 Jul 2023 08:12:05 -0400
Original-Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>)
 id 1qJYhP-0008L5-9E
 for bug-gnu-emacs@gnu.org; Wed, 12 Jul 2023 08:12:03 -0400
Original-Received: from debbugs.gnu.org ([209.51.188.43])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>)
 id 1qJYhP-00008z-1G
 for bug-gnu-emacs@gnu.org; Wed, 12 Jul 2023 08:12:03 -0400
Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2)
 (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1qJYhO-0005QQ-GD
 for bug-gnu-emacs@gnu.org; Wed, 12 Jul 2023 08:12:02 -0400
X-Loop: help-debbugs@gnu.org
Resent-From: Eli Zaretskii <eliz@gnu.org>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@gnu.org
Resent-Date: Wed, 12 Jul 2023 12:12:02 +0000
Resent-Message-ID: <handler.64577.B64577.168916386920794@debbugs.gnu.org>
Resent-Sender: help-debbugs@gnu.org
X-GNU-PR-Message: followup 64577
X-GNU-PR-Package: emacs
Original-Received: via spool by 64577-submit@debbugs.gnu.org id=B64577.168916386920794
 (code B ref 64577); Wed, 12 Jul 2023 12:12:02 +0000
Original-Received: (at 64577) by debbugs.gnu.org; 12 Jul 2023 12:11:09 +0000
Original-Received: from localhost ([127.0.0.1]:51864 helo=debbugs.gnu.org)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
 id 1qJYgX-0005PK-7u
 for submit@debbugs.gnu.org; Wed, 12 Jul 2023 08:11:09 -0400
Original-Received: from eggs.gnu.org ([209.51.188.92]:58420)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@gnu.org>) id 1qJYgT-0005Op-QS
 for 64577@debbugs.gnu.org; Wed, 12 Jul 2023 08:11:07 -0400
Original-Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@gnu.org>)
 id 1qJYgM-0006x2-Pi; Wed, 12 Jul 2023 08:10:58 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=mpMTH0qYKvHzzN8xPuyYVO6ecCL10b2HCvgDux5KfIk=; b=jY7IeGNFRlAd
 8jtpYK6XgH8OcsxksrP+0W4BzzNMFNpL8IxGtbmXk+YvLDVm5n5f8n+AOlAq4yMRd65fz5Ljnaqs5
 0esV2Gy0+M4z1KyIHhmwY5Ino9kKCm3CPnZWQPcTW+2RmwJXqGamchF0q69d8efDr+obR2keHSYzq
 XjJ3xhnDnC84rSKK+WP2qUgBXcrWqlnbJdpLRxHjPGEZtWn7+7b3Kv98N6V6S5Tr5MI5yo6eQsm2Q
 e/olX7ega9AtKxxqdQNL/bE6ELBcpqCe7Cp/J6xR3uGNCst98ptnXRWB+hXB16RGT5d9auP0QJgb1
 NL8vVmU+bf2MRyHAZG7ndw==;
Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7)
 by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@gnu.org>)
 id 1qJYgE-0008S2-Pd; Wed, 12 Jul 2023 08:10:58 -0400
In-Reply-To: <87v8eqrxq8.fsf@notcom.org> (vuori@notcom.org)
X-BeenThere: debbugs-submit@debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
X-BeenThere: bug-gnu-emacs@gnu.org
List-Id: "Bug reports for GNU Emacs,
 the Swiss army knife of text editors" <bug-gnu-emacs.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-gnu-emacs>,
 <mailto:bug-gnu-emacs-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/bug-gnu-emacs>
List-Post: <mailto:bug-gnu-emacs@gnu.org>
List-Help: <mailto:bug-gnu-emacs-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-gnu-emacs>,
 <mailto:bug-gnu-emacs-request@gnu.org?subject=subscribe>
Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org
Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org
Xref: news.gmane.io gmane.emacs.bugs:264956
Archived-At: <http://permalink.gmane.org/gmane.emacs.bugs/264956>

> From: vuori@notcom.org
> Date: Tue, 11 Jul 2023 20:37:19 +0000
> 
> 
> configure on NetBSD forces using the native libterminfo library, even
> when ncurses is available. When started with a TERM such xterm-256color,
> this results in abort() in tputs1 (TERM=xterm works).
> 
> Hacking configure to use ncurses when available provides stable
> operation on xterm-256color.
> 
> The current special configure logic originates from this issue:
> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=6190 . This check is
> probably not a good idea today. Either NetBSD should do a) what the
> other BSDs do (= force ncurses) or b) what gnu* does (use what
> configure found, otherwise force ncurses).
> 
> My vote goes to b (possibly with a warning from configure if libterminfo
> is picked): keep it possible to build emacs without installing ncurses,
> but use ncurses for terminfo when available.

I'm not sure I understand.  The configure script first looks for a
library with tputs, and it tries tinfo, ncurses, terminfo, curses,
termcap, tinfow, ncursesw, in that order.  I understand that in your
case it finds ncurses, which is good, right?

After that, the configure script decides whether to use terminfo or
termcap.  It is here that for netbsd we decide to use termcap in
certain situations instead of terminfo.  In your case, since ncurses
was found, LIBS_TERMCAP should have been set to -lncurses, and this
code:

  netbsd)
    if test "x$LIBS_TERMCAP" != "x-lterminfo"; then
      TERMINFO=no
      LIBS_TERMCAP="-ltermcap"
    fi

should have set TERMINFO=no, which disables linking against terminfo.

So I don't think I understand what is going on there.

As I don't have access to a netbsd system, could you please post the
config.log you get when configuring with a fresh tree of
emacs-29.0.92, and also show the "set -x" expansion of the relevant
parts of the configure script?  (Please compress those when posting if
they are larger than, say, 0.5MB.)  I would like to use those to
understand what happens on your system and why the configure script
decides to use terminfo.

Once we understand the exact reason, it will be easier to discuss
potential solutions.

Also, do you happen to know when terminfo on NetBSD started to be
buggy?  I would think that the change in bug#6190 did work at the
time, so at least back then NetBSD did have a workable terminfo.  When
did it start failing?

Thanks.