17231570 full userland build sporadically fails during 'pkgsend publish'
authorNorm Jacobs <Norm.Jacobs@Oracle.COM>
Thu, 01 Aug 2013 10:53:56 -0700
changeset 1416 a87a9e85090e
parent 1415 cbda05bf5f9d
child 1417 5158e071d299
17231570 full userland build sporadically fails during 'pkgsend publish'
components/Makefile
components/meta-packages/history/Makefile
make-rules/ips.mk
--- a/components/Makefile	Wed Jul 31 09:36:35 2013 -0600
+++ b/components/Makefile	Thu Aug 01 10:53:56 2013 -0700
@@ -66,6 +66,13 @@
 publish:		MAKEFLAGS += PKGLINT=/bin/true
 endif
 
+# In order to work around an IPS simultaneous publication issue and to improve
+# top level build performance, we postpone catalog and index updates until the
+# end of the build.  Individual component builds postpone the updates until
+# they have published all of their packages.
+publish:		MAKEFLAGS += DISABLE_IPS_CATALOG_AND_INDEX_UPDATES=yes
+
+
 .DEFAULT:	publish
 
 build install publish test: $(COMPONENT_DIRS)
@@ -125,7 +132,7 @@
 			 $(@:%=--component %) --make $(TARGET) $(LOG)
 
 publish:
-	$(PKGREPO) rebuild -s $(PKG_REPO)
+	$(PKGREPO) refresh -s $(PKG_REPO)
 	$(WS_TOOLS)/userland-incorporator --repository $(PKG_REPO) \
 	  -p pkg:/consolidation/$(CONSOLIDATION)/$(CONSOLIDATION)-incorporation@0.$(OS_VERSION),$(BUILD_VERSION) \
 	  -s "$(CONSOLIDATION) consolidation incorporation" \
@@ -133,6 +140,7 @@
 	  -c $(CONSOLIDATION) >$(WS_LOGS)/$(CONSOLIDATION)-incorporation.p5m
 	$(PKGSEND) -s $(PKG_REPO) publish --fmri-in-manifest \
 	  $(WS_LOGS)/$(CONSOLIDATION)-incorporation.p5m
+	$(PKGREPO) refresh -s $(PKG_REPO)
 # pkglint all of the published manifests in one batch.
 ifdef CANONICAL_REPO
 	@echo 'pkglinting all package manifests...'
--- a/components/meta-packages/history/Makefile	Wed Jul 31 09:36:35 2013 -0600
+++ b/components/meta-packages/history/Makefile	Thu Aug 01 10:53:56 2013 -0700
@@ -18,7 +18,7 @@
 #
 # CDDL HEADER END
 #
-# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
 #
 
 include ../../../make-rules/shared-macros.mk
@@ -54,7 +54,7 @@
 	$(PKGMOGRIFY) -D CONSOLIDATION=$(CONSOLIDATION) $< > $@
 
 $(MANIFEST_BASE)-%.published: $(MANIFEST_BASE)-%.mogrified $(BUILD_DIR)
-	$(PKGSEND) -s $(PKG_REPO) publish --fmri-in-manifest $<
+	$(PKGSEND) -s $(PKG_REPO) publish --fmri-in-manifest --no-catalog $<
 	$(CP) $< $@
 
 $(BUILD_DIR)/.linted-$(MACH): $(MOGRIFIED) $(BUILD_DIR)
@@ -64,6 +64,9 @@
 	$(TOUCH) $@
 
 $(BUILD_DIR)/.published-$(MACH): $(BUILD_DIR)/.linted-$(MACH) $(PUBLISHED)
+ifndef DISABLE_IPS_CATALOG_AND_INDEX_UPDATES
+	$(PKGREPO) refresh -s $(PKG_REPO)
+endif
 	$(TOUCH) $@
 
 publish: $(BUILD_DIR)/.published-$(MACH)
--- a/make-rules/ips.mk	Wed Jul 31 09:36:35 2013 -0600
+++ b/make-rules/ips.mk	Thu Aug 01 10:53:56 2013 -0700
@@ -286,14 +286,19 @@
 
 
 # published
-PKGSEND_PUBLISH_OPTIONS = -s $(WS_REPO) publish --fmri-in-manifest
+PKGSEND_PUBLISH_OPTIONS = -s $(PKG_REPO) publish --fmri-in-manifest
+PKGSEND_PUBLISH_OPTIONS += --no-catalog
 PKGSEND_PUBLISH_OPTIONS += $(PKG_PROTO_DIRS:%=-d %)
 PKGSEND_PUBLISH_OPTIONS += -T \*.py
+
 $(MANIFEST_BASE)-%.published:	$(MANIFEST_BASE)-%.depend.res $(BUILD_DIR)/.linted-$(MACH)
 	$(PKGSEND) $(PKGSEND_PUBLISH_OPTIONS) $<
 	$(PKGFMT) <$< >$@
 
 $(BUILD_DIR)/.published-$(MACH):	$(PUBLISHED)
+ifndef DISABLE_IPS_CATALOG_AND_INDEX_UPDATES
+	$(PKGREPO) refresh -s $(PKG_REPO)
+endif
 	$(TOUCH) $@
 
 print-package-names:	canonical-manifests