NetBSD Problem Report #50214
From www@NetBSD.org Mon Sep 7 02:25:37 2015
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
by mollari.NetBSD.org (Postfix) with ESMTPS id 799D8A65BA
for <gnats-bugs@gnats.NetBSD.org>; Mon, 7 Sep 2015 02:25:37 +0000 (UTC)
Message-Id: <20150907022535.F2A66A65BE@mollari.NetBSD.org>
Date: Mon, 7 Sep 2015 02:25:35 +0000 (UTC)
From: davshao@gmail.com
Reply-To: davshao@gmail.com
To: gnats-bugs@NetBSD.org
Subject: devel/cmake USE_NCURSES considered harmful
X-Send-Pr-Version: www-1.0
>Number: 50214
>Category: pkg
>Synopsis: devel/cmake USE_NCURSES considered harmful
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: pkg-manager
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Sep 07 02:30:00 +0000 2015
>Closed-Date: Mon Dec 28 12:29:01 +0000 2015
>Last-Modified: Tue Dec 29 00:50:02 +0000 2015
>Originator: David Shao
>Release: pkgsrc current
>Organization:
>Environment:
DragonFly 4.3-DEVELOPMENT DragonFly v4.3.1.453.gc87aec-DEVELOPMENT #8: Sun Sep 6 15:15:50 PDT 2015 xxxxxx@:/usr/obj/usr/src/sys/X86_64_GENERIC x86_64
>Description:
devel/cmake has
USE_NCURSES
in its Makefile. Anyone building say xfce4 through pkgsrc source could well pull in devel/ncurses through a dependency chain similar to
graphics/openjpeg has USE_CMAKE
print/poppler depends on graphics/openjpeg
print/poppler-glib depends on print/poppler
xfce4-tumbler has suggested option pdf which pulls in poppler-glib
Installing cmake with USE_NCURSES sets in place a time bomb that will sooner or later break someone like this trying to keep pkgsrc up-to-date through source. The reason is that probably something similar to
devel/gettext-tools
was installed earlier before the attempt to install xfce4, before pkgsrc ncurses was installed. This version of gettext-tools will link against a perfectly usable curses / ncurses base library. Sometime later, but maybe a long time later, it comes time to update gettext-tools. Now pkgsrc ncurses is installed, and gettext-tools seems to like to pick up this version of pkgsrc ncurses over base curses / ncurses. This instantly breaks a whole lot of useful parts of a gui such as xfce4-terminal, gvim, other things.
At this point it is not clear that rebuilding everything is the answer. Does one really want to replace every previous usage of base curses / ncurses with pkgsrc ncurses?
There is a good reason for USE_NCURSES in devel/cmake, but only from what I have seen on NetBSD. There is an include file in various bases
/usr/include/form.h
that defines a struct FORM. cmake defines its own version of FORM. But is also includes a simple
#include <form.h>
The FORM that cmake expects has a field curcol that NetBSD's base FORM does not. There are probably a lot more inconsistencies that magically go away when pkgsrc ncurses is installed.
This problem does not exist from what I can tell on OSes such as relatively recent DragonFly and FreeBSD, probably a lot more that have a base equivalent to ncurses. There is absolutely zero need for these platforms installing say xfce4 to use pkgsrc ncurses at all.
>How-To-Repeat:
>Fix:
The following patch is for DragonFly and FreeBSD. If the problem is just NetBSD, the test can be flipped to test for NetBSD.
diff -Nurb cmake.orig/CVS/Entries.Log cmake/CVS/Entries.Log
--- cmake.orig/CVS/Entries.Log 2015-09-06 17:48:04.899568000 -0700
+++ cmake/CVS/Entries.Log 1969-12-31 16:00:00.000000000 -0800
@@ -1 +0,0 @@
-A D/patches////
diff -Nurb cmake.orig/Makefile cmake/Makefile
--- cmake.orig/Makefile 2015-08-20 04:35:33.000000000 -0700
+++ cmake/Makefile 2015-08-28 22:16:39.608277000 -0700
@@ -13,7 +13,6 @@
USE_TOOLS+= gmake
USE_LANGUAGES= c c++
-USE_NCURSES= yes
HAS_CONFIGURE= yes
CONFIGURE_SCRIPT= bootstrap
@@ -31,6 +30,10 @@
.include "../../mk/bsd.prefs.mk"
+.if ${OPSYS} != "FreeBSD" && ${OPSYS} != "DragonFly"
+USE_NCURSES= yes
+.endif
+
.if !empty(MAKE_JOBS)
CONFIGURE_ARGS+= --parallel=${MAKE_JOBS:Q}
.endif
>Release-Note:
>Audit-Trail:
From: Joerg Sonnenberger <joerg@britannica.bec.de>
To: gnats-bugs@NetBSD.org
Cc: pkg-manager@netbsd.org, gnats-admin@netbsd.org, pkgsrc-bugs@netbsd.org
Subject: Re: pkg/50214: devel/cmake USE_NCURSES considered harmful
Date: Mon, 7 Sep 2015 11:18:42 +0200
On Mon, Sep 07, 2015 at 02:30:00AM +0000, davshao@gmail.com wrote:
> diff -Nurb cmake.orig/CVS/Entries.Log cmake/CVS/Entries.Log
> --- cmake.orig/CVS/Entries.Log 2015-09-06 17:48:04.899568000 -0700
> +++ cmake/CVS/Entries.Log 1969-12-31 16:00:00.000000000 -0800
> @@ -1 +0,0 @@
> -A D/patches////
> diff -Nurb cmake.orig/Makefile cmake/Makefile
> --- cmake.orig/Makefile 2015-08-20 04:35:33.000000000 -0700
> +++ cmake/Makefile 2015-08-28 22:16:39.608277000 -0700
> @@ -13,7 +13,6 @@
>
> USE_TOOLS+= gmake
> USE_LANGUAGES= c c++
> -USE_NCURSES= yes
> HAS_CONFIGURE= yes
> CONFIGURE_SCRIPT= bootstrap
>
> @@ -31,6 +30,10 @@
>
> .include "../../mk/bsd.prefs.mk"
>
> +.if ${OPSYS} != "FreeBSD" && ${OPSYS} != "DragonFly"
> +USE_NCURSES= yes
> +.endif
> +
> .if !empty(MAKE_JOBS)
> CONFIGURE_ARGS+= --parallel=${MAKE_JOBS:Q}
> .endif
This patch is completely wrong. If the systems ship a ncurses in base,
make sure the builtin.mk logic can detect that properly.
Joerg
From: Thomas Klausner <wiz@NetBSD.org>
To: NetBSD bugtracking <gnats-bugs@NetBSD.org>
Cc:
Subject: Re: pkg/50214: devel/cmake USE_NCURSES considered harmful
Date: Mon, 7 Sep 2015 11:47:41 +0200
On Mon, Sep 07, 2015 at 02:30:00AM +0000, davshao@gmail.com wrote:
> Installing cmake with USE_NCURSES sets in place a time bomb that will sooner or later break someone like this trying to keep pkgsrc up-to-date through source. The reason is that probably something similar to
>
> devel/gettext-tools
>
> was installed earlier before the attempt to install xfce4, before pkgsrc ncurses was installed. This version of gettext-tools will link against a perfectly usable curses / ncurses base library. Sometime later, but maybe a long time later, it comes time to update gettext-tools. Now pkgsrc ncurses is installed, and gettext-tools seems to like to pick up this version of pkgsrc ncurses over base curses / ncurses. This instantly breaks a whole lot of useful parts of a gui such as xfce4-terminal, gvim, other things.
Can you explain this part a bit more?
You say gettext-tools picks up pkgsrc ncurses in preference to base
(n)curses. 'make show-buildlink3' for gettext-tools gives me:
gettext
iconv
expat
termcap
I.e., no curses at all; and even if that's different for your
platform, it should always be the same and not depend on the
installation of an ncurses package.
Also, how does that change "instantly break a whole lot of useful
parts of a gui"?
Thomas
From: David Shao <davshao@gmail.com>
To: gnats-bugs@netbsd.org
Cc:
Subject: Re: pkg/50214: devel/cmake USE_NCURSES considered harmful
Date: Sun, 13 Sep 2015 22:03:12 -0700
For my use case of the most recent NetBSD OS version possible, NetBSD
7.99.21 amd64 with X11_TYPE=modular, I have found the latest cmake
patches to be a complete blessing. I am now able to do without pkgsrc
ncurses on DragonFly, FreeBSD, and recent NetBSD systems as described
above. The systems will therefore not suffer the catastrophe of
pkgsrc ncurses later being picked up by packages such as
gettext-tools, and therefore will not suffer the threat of instantly
breaking many other packages. Thank you.
State-Changed-From-To: open->closed
State-Changed-By: bsiegert@NetBSD.org
State-Changed-When: Mon, 28 Dec 2015 12:29:01 +0000
State-Changed-Why:
This sounds like it was fixed by the recent cmake update?
From: Joerg Sonnenberger <joerg@britannica.bec.de>
To: gnats-bugs@NetBSD.org
Cc: pkg-manager@netbsd.org, pkgsrc-bugs@netbsd.org, gnats-admin@netbsd.org,
bsiegert@NetBSD.org, davshao@gmail.com
Subject: Re: pkg/50214 (devel/cmake USE_NCURSES considered harmful)
Date: Tue, 29 Dec 2015 01:49:12 +0100
On Mon, Dec 28, 2015 at 12:29:01PM +0000, bsiegert@NetBSD.org wrote:
> Synopsis: devel/cmake USE_NCURSES considered harmful
>
> State-Changed-From-To: open->closed
> State-Changed-By: bsiegert@NetBSD.org
> State-Changed-When: Mon, 28 Dec 2015 12:29:01 +0000
> State-Changed-Why:
> This sounds like it was fixed by the recent cmake update?
The problem here is actually devel/ncurses and not cmake. It is using the
same major of libform as NetBSD's system version, but it is not ABI
compatible.
Joerg
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.