NetBSD Problem Report #58549

From www@netbsd.org  Sat Aug  3 12:53:33 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)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits)
	 client-signature RSA-PSS (2048 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 327861A923E
	for <gnats-bugs@gnats.NetBSD.org>; Sat,  3 Aug 2024 12:53:33 +0000 (UTC)
Message-Id: <20240803125057.9CC531A923F@mollari.NetBSD.org>
Date: Sat,  3 Aug 2024 12:50:57 +0000 (UTC)
From: phil+netbsd@krylov.eu
Reply-To: phil+netbsd@krylov.eu
To: gnats-bugs@NetBSD.org
Subject: lang/nodejs* build fails on CentOS 7
X-Send-Pr-Version: www-1.0

>Number:         58549
>Category:       pkg
>Synopsis:       lang/nodejs* build fails on CentOS 7
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Aug 03 12:55:01 +0000 2024
>Last-Modified:  Sat Aug 03 15:55:01 +0000 2024
>Originator:     Phil Krylov
>Release:        pkgsrc-current
>Organization:
krylov.eu
>Environment:
Linux localhost.localdomain 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
>Description:
lang/nodejs* build fails on CentOS, needing newer gas, as follows:

https://us-central.manta.mnx.io/pkgsrc/public/reports/Linux/el7/trunk/x86_64/20240730.2238/nodejs-22.5.1/build.log
https://us-central.manta.mnx.io/pkgsrc/public/reports/Linux/el7/trunk/x86_64/20240730.2238/nodejs-18.20.3/build.log
https://us-central.manta.mnx.io/pkgsrc/public/reports/Linux/el7/trunk/x86_64/20240730.2238/nodejs-20.15.1/build.log

The patch seems to be working well for nodejs20, but may also fix nodejs and nodejs18 builds.
>How-To-Repeat:
bmake -C lang/nodejs20 bin-install
>Fix:
Index: lang/nodejs/Makefile.common
===================================================================
RCS file: /cvsroot/pkgsrc/lang/nodejs/Makefile.common,v
retrieving revision 1.56
diff -p -u -r1.56 Makefile.common
--- lang/nodejs/Makefile.common	14 Jun 2024 08:58:23 -0000	1.56
+++ lang/nodejs/Makefile.common	3 Aug 2024 12:44:47 -0000
@@ -1,7 +1,5 @@
 # $NetBSD: Makefile.common,v 1.56 2024/06/14 08:58:23 wiz Exp $
 # used by lang/nodejs/Makefile
-# used by lang/nodejs14/Makefile
-# used by lang/nodejs16/Makefile
 # used by lang/nodejs18/Makefile
 # used by lang/nodejs20/Makefile

@@ -91,6 +89,16 @@ paxctl:
 	${TOOLS_PLATFORM.paxctl} +m ${DESTDIR}${PREFIX}/bin/node
 .endif

+# Newer gas from binutils 2.30+ is required for AVX512VBMI2 instructions.
+.if (${MACHINE_ARCH:Mi?86} || ${MACHINE_ARCH} == "x86_64") && ${OPSYS} == "Linux"
+NODEJS_GAS_VERSION!=      \
+       ( env LC_ALL=C as --version 2>&1 | ${AWK} '/GNU assembler version/ {print $$4}') 2>/dev/null || ${ECHO} 0
+.  if ${NODEJS_GAS_VERSION} != "0" && !(${NODEJS_GAS_VERSION:M2.[3-9][0-9]*} || ${NODEJS_GAS_VERSION:M[3-9]*})
+.include "../../devel/binutils/buildlink3.mk"
+.include "../../devel/binutils/override-as.mk"
+.  endif
+.endif
+
 .if ${OPSYS} != "Darwin"
 .include "../../devel/libexecinfo/buildlink3.mk"
 .endif

>Audit-Trail:
From: nia <nia@NetBSD.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/58549: lang/nodejs* build fails on CentOS 7
Date: Sat, 3 Aug 2024 13:40:08 +0000

 This version test is crazy and error-prone. I'd much rather
 just disable avx512, or have it as a default-off option...

From: Phil Krylov <phil+netbsd@krylov.eu>
To: gnats-bugs@netbsd.org
Cc: nia <nia@NetBSD.org>
Subject: Re: pkg/58549: lang/nodejs* build fails on CentOS 7
Date: Sat, 03 Aug 2024 17:38:56 +0200

 On 2024-08-03 15:45, nia wrote:
 >  This version test is crazy and error-prone. I'd much rather
 >  just disable avx512, or have it as a default-off option...

 Well, I took that test from security/gnutls/Makefile and simplified it a 
 little bit. It's working well, I don't see why it's error-prone.

 -- Ph.

From: Phil Krylov <phil+netbsd@krylov.eu>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/58549: lang/nodejs* build fails on CentOS 7
Date: Sat, 03 Aug 2024 17:52:59 +0200

 On 2024-08-03 17:40, Phil Krylov wrote:
 >  Well, I took that test from security/gnutls/Makefile and simplified it 
 > a
 >  little bit. It's working well, I don't see why it's error-prone.

 My bad! I should not try to remove ${GREP} from the pipeline, it was 
 responsible for the handling of no-match case. Here is the fixed 
 version:

 Index: lang/nodejs/Makefile.common
 ===================================================================
 RCS file: /cvsroot/pkgsrc/lang/nodejs/Makefile.common,v
 retrieving revision 1.56
 diff -p -u -r1.56 Makefile.common
 --- lang/nodejs/Makefile.common	14 Jun 2024 08:58:23 -0000	1.56
 +++ lang/nodejs/Makefile.common	3 Aug 2024 12:44:47 -0000
 @@ -1,7 +1,5 @@
   # $NetBSD: Makefile.common,v 1.56 2024/06/14 08:58:23 wiz Exp $
   # used by lang/nodejs/Makefile
 -# used by lang/nodejs14/Makefile
 -# used by lang/nodejs16/Makefile
   # used by lang/nodejs18/Makefile
   # used by lang/nodejs20/Makefile

 @@ -91,6 +89,16 @@ paxctl:
   	${TOOLS_PLATFORM.paxctl} +m ${DESTDIR}${PREFIX}/bin/node
   .endif

 +# Newer gas from binutils 2.30+ is required for AVX512VBMI2 
 instructions.
 +.if (${MACHINE_ARCH:Mi?86} || ${MACHINE_ARCH} == "x86_64") && ${OPSYS} 
 == "Linux"
 +NODEJS_GAS_VERSION!=      \
 +       ( env LC_ALL=C as --version 2>&1 | ${GREP} '/GNU assembler 
 version/' || ${AWK} '{print $$4}') 2>/dev/null || ${ECHO} 0
 +.  if ${NODEJS_GAS_VERSION} != "0" && 
 !(${NODEJS_GAS_VERSION:M2.[3-9][0-9]*} || ${NODEJS_GAS_VERSION:M[3-9]*})
 +.include "../../devel/binutils/buildlink3.mk"
 +.include "../../devel/binutils/override-as.mk"
 +.  endif
 +.endif
 +
   .if ${OPSYS} != "Darwin"
   .include "../../devel/libexecinfo/buildlink3.mk"
   .endif

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.