pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

HEADS UP: SunOS users with TOOLS_PLATFORM.sh=bash



Hi,

With the attached change, anyone building pkgsrc on SunOS platforms that use bash as their TOOLS_PLATFORM.sh will need to rebuild at least libtool, and anything else that hardcoded "print" as the way to print strings.

The failures won't be immediately obvious, it'll only be after looking at .work.log that you'll see it returning "false". See for example the top failures for this bulk build:

  https://us-central.manta.mnx.io/pkgsrc/public/reports/upstream-trunk/20221123.2250/meta/report.html

Once that's done, however, you'll have a nice performance increase from not having to execute a separate command every time libtool wants to print something, which it does quite a lot!

Cheers,

--
Jonathan Perkin   -   mnx.io   -   pkgsrc.smartos.org
Open Source Complete Cloud   www.tritondatacenter.com
--- Begin Message ---
Module Name:	pkgsrc
Committed By:	jperkin
Date:		Tue Nov 22 09:15:51 UTC 2022

Modified Files:
	pkgsrc/mk/tools: tools.SunOS.mk

Log Message:
mk/tools: Avoid print(1) when using bash on SunOS.

bash does not have a print builtin, and on SunOS there is a /usr/bin/print
which is found by the libtool configure script (which has also made its way
into lots of third-party packages) and used for printing strings.

Create a broken print wrapper so that this is not found and the printf builtin
is used instead, significantly improving performance.


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 pkgsrc/mk/tools/tools.SunOS.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/mk/tools/tools.SunOS.mk
diff -u pkgsrc/mk/tools/tools.SunOS.mk:1.54 pkgsrc/mk/tools/tools.SunOS.mk:1.55
--- pkgsrc/mk/tools/tools.SunOS.mk:1.54	Tue Nov 22 09:09:19 2022
+++ pkgsrc/mk/tools/tools.SunOS.mk	Tue Nov 22 09:15:51 2022
@@ -1,4 +1,4 @@
-# $NetBSD: tools.SunOS.mk,v 1.54 2022/11/22 09:09:19 jperkin Exp $
+# $NetBSD: tools.SunOS.mk,v 1.55 2022/11/22 09:15:51 jperkin Exp $
 #
 # System-supplied tools for the Solaris and illumos operating systems.
 #
@@ -229,3 +229,18 @@ TOOLS_PLATFORM.zipcloak?=	/usr/bin/zipcl
 TOOLS_PLATFORM.zipnote?=	/usr/bin/zipnote
 TOOLS_PLATFORM.zipsplit?=	/usr/bin/zipsplit
 .endif
+
+#
+# If we've bootstrapped with bash as the default shell then ensure print is a
+# broken wrapper to work around a bug in the libtool configure script that
+# assumes print, if available, is always a builtin.  bash does not have print
+# builtin and /usr/bin/print gets called instead, affecting performance.
+#
+# Also ensure we do use any bash builtins instead of separate commands.
+#
+.if ${TOOLS_PLATFORM.sh:M*bash}
+TOOLS_CREATE+=		print
+TOOLS_PATH.print=	${FALSE}
+
+TOOLS_PLATFORM.printf=	printf
+.endif


--- End Message ---


Home | Main Index | Thread Index | Old Index