Subject: RFC: recommended dependencies (diffs attached)
To: None <>
From: Rene Hexel <>
List: tech-pkg
Date: 01/08/2004 16:15:45
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;

   Hi Folks,

   There has been some discussion lately about what to do
about PKGREVISION bumps that might cause incompatible
binary packages.  Without reproducing the whole
discussion, here is a quick summary:

   Current practice is to bump PKGREVISIONs and
dependencies for all directly or indirectly dependent
packages, regardless of whether there actually is any
technical requirement to bump dependencies or not.

   While this helps binary package consistency, it also
causes a lot of overhead with users/developers who compile
packages from source.  Often huge portions of an installed
package base need to be recompiled unnecessarily.

   I have attached diffs to pkgsrc that do the following:

   - Introduce a new variable, RECOMMENDED, that has
     the same syntax as DEPENDS.

   - Introduce BUILDINK_RECOMMENDED.<foo> that sets
     the recommended version of a package through
     buildlink the same way BUILDLINK_DEPENDS.<foo>
     sets dependencies.

   - Introduce a switch IGNORE_RECOMMENDED (defaults
     to "no") that causes recommendations to be
     ignored and a corresponding warning to be

   The default behaviour is to simply add all
recommendations (RECOMMENDED and
BUILDLINK_RECOMMENDED.*) to the the list of
dependencies (DEPENDS).  This allows us to bump
PKGREVISIONS and update RECOMMENDED whenever a change
occurs that requires a new set of binary packages.

   If IGNORE_RECOMMENDED is set to "yes", the
list of RECOMMENDED prerequisites will be ignored
and only 'hard' DEPENDS will be used.  A warning
will be printed upon creation of a binary package
that recommendations are ignored and such a package
should not be uploaded or otherwise be used where
an inconsistent mix of binary packages could cause

   Here is an example: for the latest tiff update,
we could have left BUILDLINK_DEPENDS.tiff>=3.5.4
as all our packages compile and work nicely with
this version of tiff.

   Since tiff-3.6.1 may have introduced an ABI change,
a setting of BUILDLINK_RECOMMENDED.tiff>=3.6.1 plus
bumping PKGREVISIONs (the same way it was done during
the update) will then cause the same set of binary
package to be built as during the last update.

   If someone doesn't want to (or can't afford to)
update tiff and a huge number of packages straight
away, they can set IGNORE_RECOMMENDED=yes and still
compile perfectly working binaries against their
installed package base.  But they will be warned
that their binaries may be incompatible with
binaries compiled against the latest version of
tiff and should therefore not be uploaded.

   Comments?  Suggestions?  Flames?

   If nobody objects, I'd like to commit this in
the next days ...


Content-Transfer-Encoding: 7bit
Content-Type: application/octet-stream;
Content-Disposition: attachment;

Index: mk/
RCS file: /cvsroot/pkgsrc/mk/,v
retrieving revision 1.200
diff -u -r1.200
--- mk/	7 Jan 2004 21:45:18 -0000	1.200
+++ mk/	8 Jan 2004 05:04:03 -0000
@@ -85,6 +85,14 @@
 # Possible: defined, not defined
 # Default: not defined
+# ignore package prerequisite recommendations.  If this is set to
+# "no", all entries in RECOMMENDED will be added to DEPENDS.
+# If set to "yes", a warning will be printed if recommendations
+# are possibly ignored.
+# Possible: yes, no
+# Default: no
 # Automatically register shells in /etc/shells
 # Possible: YES, NO
Index: mk/
RCS file: /cvsroot/pkgsrc/mk/,v
retrieving revision 1.1340
diff -u -r1.1340
--- mk/	7 Jan 2004 15:30:54 -0000	1.1340
+++ mk/	8 Jan 2004 05:04:06 -0000
@@ -406,6 +406,10 @@
 BUILD_DEPENDS+=		gettext>=0.10.35nb1:../../devel/gettext
+.if defined(RECOMMENDED) && !empty(IGNORE_RECOMMENDED:M[nN][oO])
 EXTRACT_COOKIE=		${WRKDIR}/.extract_done
 BUILDLINK_COOKIE=	${WRKDIR}/.buildlink_done
 CONFIGURE_COOKIE=	${WRKDIR}/.configure_done
@@ -2477,6 +2481,11 @@
 	@${ECHO_MSG} "${_PKGSRC_IN}> Warning: ${PKGNAME} may not be made available through FTP:"
 	@${ECHO_MSG} "${_PKGSRC_IN}>         " ${NO_BIN_ON_FTP:Q}
 .  endif
+.  if defined(RECOMMENDED) && !empty(IGNORE_RECOMMENDED:M[yY][eE][sS])
+	@${ECHO_MSG} "${_PKGSRC_IN}> Warning: dependency recommendations are being ignored!"
+	@${ECHO_MSG} "${_PKGSRC_IN}>          ${PKGNAME} should not be uploaded nor"
+	@${ECHO_MSG} "${_PKGSRC_IN}>          otherwise be used as a binary package!"
+.  endif
 # Some support rules for real-su-package
Index: mk/buildlink2/
RCS file: /cvsroot/pkgsrc/mk/buildlink2/,v
retrieving revision 1.104
diff -u -r1.104
--- mk/buildlink2/	19 Dec 2003 19:22:28 -0000	1.104
+++ mk/buildlink2/	8 Jan 2004 05:04:06 -0000
@@ -6,6 +6,7 @@
 #	foo-lib
 #	foo-lib>=1.0
+#	foo-lib>=1.0nb1
 #	../../category/foo-lib
@@ -140,6 +141,7 @@
 .  endif
 .  if !empty(BUILDLINK_DEPMETHOD.${_pkg_}:Mfull)
 .  elif !empty(BUILDLINK_DEPMETHOD.${_pkg_}:Mbuild)
 .  endif
@@ -150,6 +152,14 @@
 .    endfor
 .  endif
+.  if defined(BUILDLINK_RECOMMENDED.${_pkg_}) && \
+      defined(_BUILDLINK_RECMETHOD.${_pkg_}) && \
+      defined(BUILDLINK_PKGSRCDIR.${_pkg_})
+.    for _rec_ in ${BUILDLINK_RECOMMENDED.${_pkg_}}
+${_BUILDLINK_RECMETHOD.${_pkg_}}+= \
+	${_rec_}:${BUILDLINK_PKGSRCDIR.${_pkg_}}
+.    endfor
+.  endif
 # BUILDLINK_PLIST_CMD.<pkg> is a sequence of shell commands that extracts
 # a list of all of the files installed by <pkg>.  This list is relative to