tech-pkg archive

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

Re: Yacc Shaving, or, Latest macOS CLT Laccs Something



On 11 Mar 2024, at 10:22, Amitai Schleier wrote:

For CLT 15.3.0.0.1.1708646388 users, I expect this to fix much of the fallout, but not all. For instance, packages with configure scripts that invoke "m4" or "yacc" (or "byacc") directly and haven't declared them in USE_TOOLS will pop up a macOS dialog prompting you to install the CLT.

The following patch, which I'll probably commit later this week, is intended to:

1. Have no effect on non-macOS platforms

2. Have no effect on macOS with versions of developer tools such that /usr/bin/m4 and /usr/bin/yacc actually work

3. Preserve the recently added workaround on macOS for non-working Command Line Tools m4 and yacc, so that when packages properly declare their tool dependencies pkgsrc will install working versions

4. Add another workaround on macOS for non-working CLT m4 and yacc, so that when packages _don't_ properly declare yacc or m4 dependencies, they won't accidentally find /usr/bin/m4 or /usr/bin/yacc and therefore won't pop up the useless CLT install dialog

Some examples of "shouldn't affect you in any way": NetBSD, SmartOS, macOS with Xcode, macOS with Command Line Tools before 15.3.0.0.1.1708646388, hopefully macOS with some future update to Command Line Tools.

If you're on macOS with CLT 15.3.0.0.1.1708646388, do this:

1. Go into x11/modular-xorg-xquartz and remove the "m4" I added to USE_TOOLS last week, so it's once again an example of a package that needs to declare m4 but doesn't

2. "bmake clean; bmake" and note the CLT install popup window

3. Apply the below diff

4. "bmake clean; bmake" again in modular-xorg-xquartz and note the lack of CLT install popup window

5. (Put "m4" back in USE_TOOLS)

This particular build doesn't error out when m4 is a no-op script, which makes one wonder whether and how modular-xorg-xquartz is using it. When we're not about to enter a freeze, we can consider switching to TOOLS_FAIL, and/or more generally offering an optional mode in which invoking any undeclared tool on any platform breaks the build.

In the brief meantime, again, the following diff only affects macOS with a particular kind of developer-tool bustage, only with packages that don't declare m4 or yacc in USE_TOOLS when they should, and prevents needless CLT installation dialogs from popping up in those cases.

Please have objections, or not. :-)

- Amitai


Index: mk/tools/replace.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/tools/replace.mk,v
retrieving revision 1.300
diff -u -p -r1.300 replace.mk
--- mk/tools/replace.mk	25 Jul 2023 17:21:07 -0000	1.300
+++ mk/tools/replace.mk	20 Mar 2024 16:14:35 -0000
@@ -430,6 +430,9 @@ TOOLS_CREATE+=			gm4
 TOOLS_PATH.gm4=			${TOOLBASE}/bin/gm4
 .  endif
 TOOLS_ALIASES.gm4=		m4
+.elif !empty(OSX_TOOLS_FORCE_NOOP:Mgm4)
+# After 2024Q1, switch to TOOLS_FAIL
+TOOLS_NOOP+=			gm4
 .endif

 .if !defined(TOOLS_IGNORE.gmake) && !empty(_USE_TOOLS:Mgmake)
@@ -583,6 +586,9 @@ TOOLS_DEPENDS.m4?=		m4>=1.4:../../devel/
 TOOLS_CREATE+=			m4
 TOOLS_PATH.m4=			${TOOLBASE}/bin/gm4
 .  endif
+.elif !empty(OSX_TOOLS_FORCE_NOOP:Mm4)
+# After 2024Q1, switch to TOOLS_FAIL
+TOOLS_NOOP+=			m4
 .endif

 .if !defined(TOOLS_IGNORE.mail) && !empty(_USE_TOOLS:Mmail)
@@ -868,6 +874,11 @@ TOOLS_ARGS.yacc=		-y
 #
 TOOLS_VALUE_GNU.yacc=		${TOOLS_CMDLINE.yacc}
 .  endif
+.elif !empty(OSX_TOOLS_FORCE_NOOP:Myacc)
+.  if defined(TOOLS_IGNORE.byacc) || empty(_USE_TOOLS:Mbyacc)
+# After 2024Q1, switch to TOOLS_FAIL
+TOOLS_NOOP+=			yacc
+.  endif
 .endif

 _TOOLS.zip=	zip zipcloak zipnote zipsplit
Index: mk/tools/tools.Darwin.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/tools/tools.Darwin.mk,v
retrieving revision 1.65
diff -u -p -r1.65 tools.Darwin.mk
--- mk/tools/tools.Darwin.mk	20 Mar 2024 15:59:54 -0000	1.65
+++ mk/tools/tools.Darwin.mk	20 Mar 2024 16:14:35 -0000
@@ -110,6 +110,9 @@ OSX_PATH_TO_M4=			${OSX_PATH_TO_M4_cmd:s
 MAKEFLAGS+=			OSX_PATH_TO_M4=${OSX_PATH_TO_M4:Q}
 .if ${OSX_PATH_TO_M4} != ""
 TOOLS_PLATFORM.m4?=		${OSX_PATH_TO_M4}
+.else
+OSX_TOOLS_FORCE_NOOP+=		m4
+OSX_TOOLS_FORCE_NOOP+=		gm4
 .endif
 TOOLS_PLATFORM.mail?=		/usr/bin/mail
 .if exists(/usr/bin/makeinfo)
@@ -166,4 +169,6 @@ TOOLS_PLATFORM.wish?=		/usr/bin/wish
 TOOLS_PLATFORM.xargs?=		/usr/bin/xargs
 .if ${OSX_PATH_TO_YACC} != ""
 TOOLS_PLATFORM.yacc?=		${OSX_PATH_TO_YACC}
+.else
+OSX_TOOLS_FORCE_NOOP+=		yacc
 .endif


Home | Main Index | Thread Index | Old Index