NetBSD Problem Report #58060

From www@netbsd.org  Thu Mar 21 18:12:48 2024
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 07FB41A9239
	for <gnats-bugs@gnats.NetBSD.org>; Thu, 21 Mar 2024 18:12:48 +0000 (UTC)
Message-Id: <20240321181246.E56611A923A@mollari.NetBSD.org>
Date: Thu, 21 Mar 2024 18:12:46 +0000 (UTC)
From: sotiris@lamprinidis.com
Reply-To: sotiris@lamprinidis.com
To: gnats-bugs@NetBSD.org
Subject: www/nghttp2 needs c++ in USE_LANGUAGES when using clang
X-Send-Pr-Version: www-1.0

>Number:         58060
>Category:       pkg
>Synopsis:       www/nghttp2 needs c++ in USE_LANGUAGES when using clang
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    gdt
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Mar 21 18:15:00 +0000 2024
>Last-Modified:  Sat Mar 23 18:05:26 +0000 2024
>Originator:     Sotiris Lamprinidis
>Release:        NetBSD 10.0-RC6 / pkgsrc current 21 Mar 2024
>Organization:
>Environment:
NetBSD virt 10.0_RC6 NetBSD 10.0_RC6 (GENERIC64.202403191940Z) evbarm (in qemu)
>Description:
In www/nghttp2 Makefile there is this comment:
 > # Upstream documents that c++14 is required for C++ parts of the code;
 > # the base package does not use C++.
 > USE_LANGUAGES=          c

However, when using clang configure fails with
 > checking how to run the C++ preprocessor... /usr/bin/cpp
 > configure: error: in `/usr/pkgsrc/www/nghttp2/work/nghttp2-1.60.0':
 > configure: error: C++ preprocessor "/usr/bin/cpp" fails sanity check

as the appropriate wrapper is not created.

>How-To-Repeat:
make configure -C /usr/pkgsrc/www/nghttp2 on a system with non-existing /usr/bin/cpp
>Fix:
Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/www/nghttp2/Makefile,v
retrieving revision 1.85
diff -u -r1.85 Makefile
--- Makefile    21 Jan 2024 19:58:51 -0000      1.85
+++ Makefile    21 Mar 2024 18:10:00 -0000
@@ -6,7 +6,7 @@ ADD c++ to USE LANGUAGES

 # Upstream documents that c++14 is required for C++ parts of the code;
 # the base package does not use C++.
-USE_LANGUAGES=         c
+USE_LANGUAGES=         c c++
 USE_LIBTOOL=           yes
 USE_TOOLS+=            gmake pkg-config
 GNU_CONFIGURE=         yes

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: pkg-manager->gdt
Responsible-Changed-By: wiz@NetBSD.org
Responsible-Changed-When: Thu, 21 Mar 2024 18:31:01 +0000
Responsible-Changed-Why:
Over to the person who added the comment now in dispute.

>Unformatted:

 I just built this on a mac, with clang.  Configure did probe for C++,
 and prints
  configure: No compiler with C++14 support was found

 Then, the build calls only CC, and succeeds.

 As the upstream docs say, this is a C library.  There is
 "--enable-app", not enabled by pkgsrc in www/ngttp2, that builds a
 program that needs C++.

 The C++ program is built by www/nghttp2-tools, which does require C++.

 Can you provide details of your build setup?  What does "using clang"
 mean?  Building NetBSD with clang instead?  Configuring pkgsrc clang?

 It looks like this is an upstream bug, failing hard rather than just
 deciding C++ is not available.  Or perhaps a wrapper bug.  cpp should
 work within the wrapper framework with only C; that 'pp' is
 preprocessor, not plusplus :-)

 I mean to say that you are finding a bug and we should
  - figure it out
  - file upstream if in nghttp2 sources
  - fix in pkgsrc if a pkgsrc bug
  - work around in pkgsrc if an nghttp2 bug
 but that adding C++ to a package that does not need it is not the fix.

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2024 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.