7155045 X builds should provide pkgdepend resolve a limited list via -e
authorAlan Coopersmith <Alan.Coopersmith@Oracle.COM>
Fri, 23 Mar 2012 15:47:54 -0700
changeset 1261 3b92d1254188
parent 1260 00de6d69162d
child 1262 b26dab1722a7
7155045 X builds should provide pkgdepend resolve a limited list via -e
pkg/Makefile
pkg/manifests/developer-opensolaris-X.p5m
pkg/transforms/defaults
pkg/transforms/extract_depends
pkg/transforms/post-pkgdepend
--- a/pkg/Makefile	Fri Mar 23 13:16:44 2012 -0700
+++ b/pkg/Makefile	Fri Mar 23 15:47:54 2012 -0700
@@ -2,7 +2,7 @@
 #
 # Makefile for X Consolidation packages
 #
-# Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
 #
 # Permission is hereby granted, free of charge, to any person obtaining a
 # copy of this software and associated documentation files (the "Software"),
@@ -243,9 +243,16 @@
 	$(PKGDEBUG)$(TOUCH) $(@)
 
 ### Dependency detection
+
+# Package manifest containing list of packages to use in dependency
+# resolution, and not containing any dependencies to be detected/resolved.
+DEP_LIST_PKG = developer-opensolaris-X
+
 DEP_PKGS= $(PKGS:%=$(PDIR)/%.dep)
-DEP_CURRENT_PKGS = $(CURRENT_MANIFESTS:%.p5m=$(PDIR)/%.dep)
+DEP_CURRENT_PKGS_1 = $(CURRENT_MANIFESTS:%.p5m=$(PDIR)/%.dep)
+DEP_CURRENT_PKGS = $(DEP_CURRENT_PKGS_1:$(PDIR)/$(DEP_LIST_PKG).dep=)
 DEP_LEGACY_PKGS = $(LEGACY_MANIFESTS:%.p5m=$(PDIR)/%.dep)
+DEP_LEGACY_PKGS += $(DEP_LIST_PKG:%=$(PDIR)/%.dep)
 DEP_SYNTH_PKGS = $(SYNTH_MANIFESTS:%.p5m=$(PDIR)/%.dep)
 
 PKGDEP_TOKENS_i386= \
@@ -277,10 +284,10 @@
 
 ### Dependency resolution
 
-DEP_RES_PKGS = $(PKGS:%=$(PDIR)/%.dep.res)
-DEP_RES_CURRENT_PKGS = $(CURRENT_MANIFESTS:%.p5m=$(PDIR)/%.dep.res)
-DEP_RES_LEGACY_PKGS = $(LEGACY_MANIFESTS:%.p5m=$(PDIR)/%.dep.res)
-DEP_RES_SYNTH_PKGS = $(SYNTH_MANIFESTS:%.p5m=$(PDIR)/%.dep.res)
+DEP_RES_PKGS = $(DEP_PKGS:%=%.res)
+DEP_RES_CURRENT_PKGS = $(DEP_CURRENT_PKGS:%=%.res)
+DEP_RES_LEGACY_PKGS = $(DEP_LEGACY_PKGS:%=%.res)
+DEP_RES_SYNTH_PKGS = $(DEP_SYNTH_PKGS:%=%.res)
 
 PKGDEP_VERBOSE_FLAG_0 =
 PKGDEP_VERBOSE_FLAG_1 = -v
@@ -290,9 +297,19 @@
 # Normally / on the machine used to build the binaries
 PKGDEP_RESOLVE_IMAGE = /
 
+# File listing packages to consider in dependency resolution.
+# Automatically generated from the developer package to ensure they
+# stay in sync.
+PKGDEP_RESOLVE_LIST = $(PDIR)/resolve.deps
+
+$(PKGDEP_RESOLVE_LIST): $(PDIR)/$(DEP_LIST_PKG).mog
+	@print "## Generating package list for dependency resolution"
+	$(PKGDEBUG)$(PKGMOGRIFY) $(PKGMOG_VERBOSE) $(PM_INC:%= -I %) \
+	    -O /dev/null -P $(@) $(PDIR)/$(DEP_LIST_PKG).mog extract_depends
+
 # This rule resolves dependencies across all manifests for packages
 # currently delivering files.
-$(PDIR)/gendeps: $(DEP_CURRENT_PKGS)
+$(PDIR)/gendeps: $(DEP_CURRENT_PKGS) $(PKGDEP_RESOLVE_LIST)
 	$(PKGDEBUG)if [[ "$(SUPPRESSPKGDEP)" = "true" ]]; then \
 		print "## Suppressing dependency resolution"; \
 		for p in $(DEP_CURRENT_PKGS:%.dep=%); do \
@@ -300,8 +317,9 @@
 		done; \
 	else \
 		print "## Resolving dependencies"; \
-		pkgdepend -R $(PKGDEP_RESOLVE_IMAGE) resolve \
-		    $(PKGDEP_VERBOSE_FLAG) -m $(DEP_CURRENT_PKGS) ; \
+		pkgdepend -R $(PKGDEP_RESOLVE_IMAGE) resolve -E \
+		    $(PKGDEP_VERBOSE_FLAG) -e $(PKGDEP_RESOLVE_LIST) \
+		    -m $(DEP_CURRENT_PKGS) ; \
 	fi
 	$(PKGDEBUG)$(TOUCH) $(@)
 
--- a/pkg/manifests/developer-opensolaris-X.p5m	Fri Mar 23 13:16:44 2012 -0700
+++ b/pkg/manifests/developer-opensolaris-X.p5m	Fri Mar 23 15:47:54 2012 -0700
@@ -1,4 +1,4 @@
-# Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
 #
 # Permission is hereby granted, free of charge, to any person obtaining a
 # copy of this software and associated documentation files (the "Software"),
@@ -29,8 +29,20 @@
 # without having to uninstall all the X packages first.
 set name=org.opensolaris.noincorp value=true
 
+#############################################################################
+# This package is used for dual purposes - it defines what build machines
+# should have installed for building X, and it defines the subset of those
+# packages that pkgdepend resolve should look in for dependencies that were
+# detected by pkgdepend generate.
+#
+# Dependencies to be used by pkgdepend generate bear the additional attribute
+# org.opensolaris.pkgdepend.resolve=true which is used by the extract_depends
+# pkgmogrify filter when making the list for pkgdepend resolve -e to use.
+#############################################################################
+
 # Builds need to be able to uncompress upstream tar.bz2 & tar.gz files
-depend type=require fmri=pkg:/compress/bzip2
+depend type=require fmri=pkg:/compress/bzip2 \
+    org.opensolaris.pkgdepend.resolve=true
 depend type=require fmri=pkg:/compress/gzip
 
 # X.Org ships many docs using the DocBook XML DTD's and stylesheets
@@ -107,19 +119,28 @@
 depend type=require fmri=pkg:/driver/usb
 
 # autoconf scripts prefer various gnu utilities (mkdir, install, etc.)
-depend type=require fmri=pkg:/file/gnu-coreutils
+depend type=require fmri=pkg:/file/gnu-coreutils \
+    org.opensolaris.pkgdepend.resolve=true
 
 # tigervnc links with libjpg
-depend type=require fmri=pkg:/image/library/libjpeg
+depend type=require fmri=pkg:/image/library/libjpeg \
+    org.opensolaris.pkgdepend.resolve=true
 
 # app/xcursorgen links with libpng12
-depend type=require fmri=pkg:/image/library/libpng
+depend type=require fmri=pkg:/image/library/libpng \
+    org.opensolaris.pkgdepend.resolve=true
 
 # synergy-plus links against libstdcxx
-depend type=require fmri=pkg:/library/c++/stdcxx
+depend type=require fmri=pkg:/library/c++/stdcxx \
+    org.opensolaris.pkgdepend.resolve=true
 
 # lib/fontconfig links with libexpat
-depend type=require fmri=pkg:/library/expat
+depend type=require fmri=pkg:/library/expat \
+    org.opensolaris.pkgdepend.resolve=true
+
+# TigerVNC links with gnutls libraries
+depend type=require fmri=pkg:/library/gnutls \
+    org.opensolaris.pkgdepend.resolve=true
 
 # xcb-proto runs xmllint
 depend type=require fmri=pkg:/library/libxml2
@@ -128,7 +149,8 @@
 depend type=require fmri=pkg:/library/libxslt
 
 # AccessX & DPS require motif libraries
-depend type=require fmri=pkg:/library/motif
+depend type=require fmri=pkg:/library/motif \
+    org.opensolaris.pkgdepend.resolve=true
 
 # xterm uses ncurses/term.h
 depend type=require fmri=pkg:/library/ncurses
@@ -137,25 +159,39 @@
 depend type=require fmri=pkg:/library/python-2/libxml2-$(PYTHON_PKG_VERSION)
 
 # freetype, libXfont & libfontenc link with libz
-depend type=require fmri=pkg:/library/zlib
+depend type=require fmri=pkg:/library/zlib \
+    org.opensolaris.pkgdepend.resolve=true
 
-# Build runs a number of perl scripts
-depend type=require fmri=pkg:/runtime/perl-$(PERL_PKG_VERSION)
+# Build runs a number of perl scripts, and vncserver is shipped as one
+depend type=require fmri=pkg:/runtime/perl-$(PERL_PKG_VERSION) \
+    org.opensolaris.pkgdepend.resolve=true
 
 # xcb & mesa require python interpreter/compiler
 depend type=require fmri=pkg:/runtime/python-$(PYTHON_PKG_VERSION)
 
+# Build uses and packages deliver a lot of shell/ksh93 scripts
+depend type=require fmri=pkg:/shell/ksh org.opensolaris.pkgdepend.resolve=true
+
+# Build uses and packages depend on core OS commands & files
+depend type=require fmri=pkg:/system/core-os \
+    org.opensolaris.pkgdepend.resolve=true
+
 # Xserver currently links with HAL & Dbus
-depend type=require fmri=pkg:/service/hal
+depend type=require fmri=pkg:/system/hal org.opensolaris.pkgdepend.resolve=true
 
 # Basic system headers & libraries
 depend type=require fmri=pkg:/system/header
-depend type=require fmri=pkg:/system/library
-depend type=require fmri=pkg:/system/library/c++-runtime
+depend type=require fmri=pkg:/system/library \
+    org.opensolaris.pkgdepend.resolve=true
+depend type=require fmri=pkg:/system/library/c++-runtime \
+    org.opensolaris.pkgdepend.resolve=true
 depend type=require fmri=pkg:/system/library/flex-runtime
-depend type=require fmri=pkg:/system/library/gcc-3-runtime
-depend type=require fmri=pkg:/system/library/libdbus
-depend type=require fmri=pkg:/system/library/math
+depend type=require fmri=pkg:/system/library/gcc-3-runtime \
+    org.opensolaris.pkgdepend.resolve=true
+depend type=require fmri=pkg:/system/library/libdbus \
+    org.opensolaris.pkgdepend.resolve=true
+depend type=require fmri=pkg:/system/library/math \
+    org.opensolaris.pkgdepend.resolve=true
 
 # Almost all modules need Solaris ld to link binaries
 depend type=require fmri=pkg:/system/linker
--- a/pkg/transforms/defaults	Fri Mar 23 13:16:44 2012 -0700
+++ b/pkg/transforms/defaults	Fri Mar 23 15:47:54 2012 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
 #
 # Permission is hereby granted, free of charge, to any person obtaining a
 # copy of this software and associated documentation files (the "Software"),
@@ -57,13 +57,6 @@
 # This is set to the final version number delivered as SVR4 format
 <transform legacy -> default version "6.9.0.5.11.14300,REV=0.2010.06.21">
 
-# Ensure we don't accidentally list dependencies on gcc-4 runtime libraries
-# if they're installed on build systems, since we always build with gcc-3
-# Also works around https://defect.opensolaris.org/bz/show_bug.cgi?id=19009
-<transform file -> add pkg.depend.bypass-generate usr/gcc/4.*>
-<transform file -> add pkg.depend.bypass-generate usr/lib(.*)/libgcc_s.so.1>
-<transform file -> add pkg.depend.bypass-generate usr/lib(.*)/libstdc\\+\\+\\.so.*>
-
 #
 # These aren't really transforms, but are valid defaults for
 # current packages, but not the renamed/obsolete ones, which is
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkg/transforms/extract_depends	Fri Mar 23 15:47:54 2012 -0700
@@ -0,0 +1,26 @@
+#
+# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice (including the next
+# paragraph) shall be included in all copies or substantial portions of the
+# Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+# DEALINGS IN THE SOFTWARE.
+#
+
+# Print fmri for each depend line in a manifest
+# Used in pkg/Makefile rule for generating input to pkgdepend resolve -e
+<transform depend org.opensolaris.pkgdepend.resolve=true -> print %(fmri)>
--- a/pkg/transforms/post-pkgdepend	Fri Mar 23 13:16:44 2012 -0700
+++ b/pkg/transforms/post-pkgdepend	Fri Mar 23 15:47:54 2012 -0700
@@ -1,5 +1,5 @@
 #
-# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
 #
 # Permission is hereby granted, free of charge, to any person obtaining a
 # copy of this software and associated documentation files (the "Software"),
@@ -25,8 +25,6 @@
 # published in the packages.
 <transform file dir link org.opensolaris.nopublish=true -> drop>
 
-# Drop incorrect/unwanted debug.osnet variant tags that pkgdepend puts on 
-# ksh/ksh93 script dependencies when run on snv_173 (pkgdepend bug 18884).
-# Can be removed once X builds are guaranteed to be run on machines
-# with that bug fix integrated into the OS build.
-<transform depend -> delete variant.debug.osnet .*>
+# Drop attributes used to filter developer-opensolaris-X.p5m for the
+# pkgdepend resolve -e list of packages to resolve against
+<transform depend -> delete org.opensolaris.pkgdepend.resolve .*>