Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Sep 2014 18:06:17 +0000 (UTC)
From:      Michael Gmelin <grembo@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r368054 - in head/devel/ice: . files
Message-ID:  <201409121806.s8CI6H7N075621@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: grembo
Date: Fri Sep 12 18:06:17 2014
New Revision: 368054
URL: http://svnweb.freebsd.org/changeset/ports/368054
QAT: https://qat.redports.org/buildarchive/r368054/

Log:
  This adds patches No 3 [1] and No 5 [2] from upstream.
  Also fixes LIB_DEPENDS handling (previous versions of the slave
  ports won't depend on libIce.so), move LIB_DEPENDS and LIB_VRS
  for slaves to master, upgrade to USES= python
  
  [1] http://www.zeroc.com/forums/patches/6183-patch-3-ice-3-5-1-marshaling-bug-nested-optionals.html
  [2] http://www.zeroc.com/forums/patches/6285-patch-5-ice-3-5-1-fix-icegrid-registry-issue-shared-replica-groups.html
  
  Approved by:	mentors (implicit)

Added:
  head/devel/ice/files/patch-cpp-src-IceGrid-AdapterCache.cpp   (contents, props changed)
  head/devel/ice/files/patch-cpp-src-IceGrid-AdapterCache.h   (contents, props changed)
  head/devel/ice/files/patch-cpp-src-IceGrid-Database.cpp   (contents, props changed)
  head/devel/ice/files/patch-py-modules-IcePy-Types.cpp   (contents, props changed)
Modified:
  head/devel/ice/Makefile
  head/devel/ice/files/patch-cpp-test-Glacier2-staticFiltering-run.py

Modified: head/devel/ice/Makefile
==============================================================================
--- head/devel/ice/Makefile	Fri Sep 12 17:48:26 2014	(r368053)
+++ head/devel/ice/Makefile	Fri Sep 12 18:06:17 2014	(r368054)
@@ -3,7 +3,7 @@
 
 PORTNAME=		Ice
 PORTVERSION=		3.5.1
-PORTREVISION=		2
+PORTREVISION=		3
 CATEGORIES=		devel
 MASTER_SITES=		http://download.zeroc.com/Ice/3.5/
 
@@ -12,8 +12,16 @@ COMMENT=		Modern alternative to object m
 
 LICENSE=		GPLv2
 
+SLAVE_PORT?=		no
+
+.if ${SLAVE_PORT} == "no"
 LIB_DEPENDS=		libexpat.so:${PORTSDIR}/textproc/expat2 \
 			libmcpp.so:${PORTSDIR}/devel/mcpp
+.else
+LIB_VRS=		${PORTVERSION:R:S|.||g}
+LIB_DEPENDS+=		libIce.so.${LIB_VRS}:${PORTSDIR}/devel/ice
+PLIST_SUB+=		LIB_VERSION="${PORTVERSION}" LIB_VRS="${LIB_VRS}"
+.endif
 
 OPTIONS_DEFINE?=	DEBUG DEMOS DOCS TESTS
 OPTIONS_DEFAULT?=	DEMOS TESTS
@@ -22,11 +30,12 @@ DEMOS_DESC?=		Build demos
 
 .include <bsd.port.options.mk>
 
-.if ${PORT_OPTIONS:MTESTS}
-USE_PYTHON_BUILD=	yes
+USES+=			iconv gmake
+
+.if ${PORT_OPTIONS:MTESTS} && ${SLAVE_PORT} == "no"
+USES+=			python:build
 .endif
 
-USES=			iconv gmake
 USE_BDB=		yes
 WANT_BDB_VER=		5
 INVALID_BDB_VER=	40 41 42 43 44 46 47 48 6

Added: head/devel/ice/files/patch-cpp-src-IceGrid-AdapterCache.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/ice/files/patch-cpp-src-IceGrid-AdapterCache.cpp	Fri Sep 12 18:06:17 2014	(r368054)
@@ -0,0 +1,102 @@
+--- cpp/src/IceGrid/AdapterCache.cpp.orig	2013-03-11 15:19:47.000000000 +0000
++++ cpp/src/IceGrid/AdapterCache.cpp	2014-09-08 14:21:13.335195726 +0000
+@@ -202,8 +202,12 @@ AdapterCache::addServerAdapter(const AdapterDescriptor& desc, const ServerEntryP
+         ReplicaGroupEntryPtr repEntry = ReplicaGroupEntryPtr::dynamicCast(getImpl(desc.replicaGroupId));
+         if(!repEntry)
+         {
+-            Ice::Error out(_communicator->getLogger());
+-            out << "can't add adapter `" << desc.id << "' to unknown replica group `" << desc.replicaGroupId << "'";
++            //
++            // Add an un-assigned replica group, the replica group will in theory be added
++            // shortly after when its application is loaded.
++            //
++            repEntry = new ReplicaGroupEntry(*this, desc.replicaGroupId, "", new RandomLoadBalancingPolicy("0"));
++            addImpl(desc.replicaGroupId, repEntry);
+         }
+         repEntry->addReplica(desc.id, entry);
+     }
+@@ -213,13 +217,24 @@ void
+ AdapterCache::addReplicaGroup(const ReplicaGroupDescriptor& desc, const string& app)
+ {
+     Lock sync(*this);
+-    if(getImpl(desc.id))
++    ReplicaGroupEntryPtr repEntry = ReplicaGroupEntryPtr::dynamicCast(getImpl(desc.id));
++    if(repEntry)
+     {
+-        Ice::Error out(_communicator->getLogger());
+-        out << "can't add duplicate replica group `" << desc.id << "'";
++        //
++        // If the replica group isn't assigned to an application,
++        // assign it. Otherwise, it's a duplicate so we log an error.
++        //
++        if(repEntry->getApplication().empty())
++        {
++            repEntry->update(app, desc.loadBalancing);
++        }
++        else
++        {
++            Ice::Error out(_communicator->getLogger());
++            out << "can't add duplicate replica group `" << desc.id << "'";
++        }
+         return;
+     }
+-
+     addImpl(desc.id, new ReplicaGroupEntry(*this, desc.id, app, desc.loadBalancing));
+ }
+ 
+@@ -258,7 +273,16 @@ AdapterCache::removeServerAdapter(const string& id)
+             Ice::Error out(_communicator->getLogger());
+             out << "can't remove adapter `" << id << "' from unknown replica group `" << replicaGroupId << "'";
+         }
+-        repEntry->removeReplica(id);
++        else
++        {
++            //
++            // If the replica group is empty and it's not assigned, remove it.
++            //
++            if(repEntry->removeReplica(id))
++            {
++                removeImpl(replicaGroupId);
++            }
++        }
+     }
+ }
+ 
+@@ -440,7 +464,7 @@ ReplicaGroupEntry::ReplicaGroupEntry(AdapterCache& cache,
+     _lastReplica(0),
+     _requestInProgress(false)
+ {
+-    update(policy);
++    update(application, policy);
+ }
+ 
+ bool
+@@ -502,7 +526,7 @@ ReplicaGroupEntry::addReplica(const string& /*replicaId*/, const ServerAdapterEn
+     _replicas.push_back(adapter);
+ }
+ 
+-void
++bool
+ ReplicaGroupEntry::removeReplica(const string& replicaId)
+ {
+     Lock sync(*this);
+@@ -516,14 +540,18 @@ ReplicaGroupEntry::removeReplica(const string& replicaId)
+             break;
+         }
+     }
++
++    // Replica group can be removed if not assigned to an application and there's no more replicas
++    return _replicas.empty() && _application.empty();
+ }
+ 
+ void
+-ReplicaGroupEntry::update(const LoadBalancingPolicyPtr& policy)
++ReplicaGroupEntry::update(const string& application, const LoadBalancingPolicyPtr& policy)
+ {
+     Lock sync(*this);
+     assert(policy);
+ 
++    _application = application;
+     _loadBalancing = policy;
+ 
+     istringstream is(_loadBalancing->nReplicas);

Added: head/devel/ice/files/patch-cpp-src-IceGrid-AdapterCache.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/ice/files/patch-cpp-src-IceGrid-AdapterCache.h	Fri Sep 12 18:06:17 2014	(r368054)
@@ -0,0 +1,23 @@
+--- cpp/src/IceGrid/AdapterCache.h.orig	2013-03-11 15:19:47.000000000 +0000
++++ cpp/src/IceGrid/AdapterCache.h	2014-09-08 14:21:13.335195726 +0000
+@@ -62,7 +62,7 @@ protected:
+ 
+     AdapterCache& _cache;
+     const std::string _id;
+-    const std::string _application;
++    std::string _application;
+ };
+ typedef IceUtil::Handle<AdapterEntry> AdapterEntryPtr;
+ 
+@@ -105,9 +105,9 @@ public:
+     virtual AdapterPrx getProxy(const std::string&, bool) const { return 0; }
+ 
+     void addReplica(const std::string&, const ServerAdapterEntryPtr&);
+-    void removeReplica(const std::string&);
++    bool removeReplica(const std::string&);
+ 
+-    void update(const LoadBalancingPolicyPtr&);
++    void update(const std::string&, const LoadBalancingPolicyPtr&);
+     bool hasAdaptersFromOtherApplications() const;
+ 
+ private:

Added: head/devel/ice/files/patch-cpp-src-IceGrid-Database.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/ice/files/patch-cpp-src-IceGrid-Database.cpp	Fri Sep 12 18:06:17 2014	(r368054)
@@ -0,0 +1,11 @@
+--- cpp/src/IceGrid/Database.cpp.orig	2013-03-11 15:19:47.000000000 +0000
++++ cpp/src/IceGrid/Database.cpp	2014-09-08 14:21:13.335195726 +0000
+@@ -2088,7 +2088,7 @@ Database::reload(const ApplicationHelper& oldApp,
+         {
+             ReplicaGroupEntryPtr entry = ReplicaGroupEntryPtr::dynamicCast(_adapterCache.get(r->id));
+             assert(entry);
+-            entry->update(r->loadBalancing);
++            entry->update(application, r->loadBalancing);
+         }
+         catch(const AdapterNotExistException&)
+         {

Modified: head/devel/ice/files/patch-cpp-test-Glacier2-staticFiltering-run.py
==============================================================================
--- head/devel/ice/files/patch-cpp-test-Glacier2-staticFiltering-run.py	Fri Sep 12 17:48:26 2014	(r368053)
+++ head/devel/ice/files/patch-cpp-test-Glacier2-staticFiltering-run.py	Fri Sep 12 18:06:17 2014	(r368054)
@@ -14,11 +14,11 @@
      domainname = ""
  
 +print "Network and process debug output:"
-+subprocess.call(["/usr/bin/netstat", "-an"])
-+subprocess.call(["/bin/ps", "-alxww"])
-+subprocess.call(["/usr/bin/sockstat"])
 +subprocess.call(["/sbin/ifconfig", "-a"])
 +subprocess.call(["/sbin/sysctl", "-a"])
++subprocess.call(["/bin/ps", "-alxww"])
++subprocess.call(["/usr/bin/sockstat"])
++subprocess.call(["/usr/bin/netstat", "-an"])
  testcases = [
          ('testing category filter',
                  ('', '', '', 'foo "a cat with spaces"', '', ''),

Added: head/devel/ice/files/patch-py-modules-IcePy-Types.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/devel/ice/files/patch-py-modules-IcePy-Types.cpp	Fri Sep 12 18:06:17 2014	(r368054)
@@ -0,0 +1,112 @@
+--- py/modules/IcePy/Types.cpp.orig	2013-03-11 15:19:47.000000000 +0000
++++ py/modules/IcePy/Types.cpp	2014-09-08 14:21:13.335195726 +0000
+@@ -1232,11 +1232,15 @@ IcePy::StructInfo::marshal(PyObject* p, const Ice::OutputStreamPtr& os, ObjectMa
+ {
+     assert(PyObject_IsInstance(p, pythonType.get()) == 1); // validate() should have caught this.
+ 
++    int sizePos = -1;
+     if(optional)
+     {
+         if(_variableLength)
+         {
+-            os->startSize();
++            // BUGFIX: #5481 startSize/endSize can't be nested
++            //os->startSize();
++            sizePos = os->pos();
++            os->write(Ice::Int(0));
+         }
+         else
+         {
+@@ -1266,7 +1270,9 @@ IcePy::StructInfo::marshal(PyObject* p, const Ice::OutputStreamPtr& os, ObjectMa
+ 
+     if(optional && _variableLength)
+     {
+-        os->endSize();
++        assert(sizePos != -1);
++        //os->endSize();
++        os->rewrite(os->pos() - sizePos - 4, sizePos);
+     }
+ }
+ 
+@@ -1402,11 +1408,15 @@ IcePy::SequenceInfo::marshal(PyObject* p, const Ice::OutputStreamPtr& os, Object
+ {
+     PrimitiveInfoPtr pi = PrimitiveInfoPtr::dynamicCast(elementType);
+ 
++    int sizePos = -1;
+     if(optional)
+     {
+         if(elementType->variableLength())
+         {
+-            os->startSize();
++            // BUGFIX: #5481 startSize/endSize can't be nested
++            //os->startSize();
++            sizePos = os->pos();
++            os->write(Ice::Int(0));
+         }
+         else if(elementType->wireSize() > 1)
+         {
+@@ -1490,7 +1500,9 @@ IcePy::SequenceInfo::marshal(PyObject* p, const Ice::OutputStreamPtr& os, Object
+ 
+     if(optional && elementType->variableLength())
+     {
+-        os->endSize();
++        assert(sizePos != -1);
++        //os->endSize();
++        os->rewrite(os->pos() - sizePos - 4, sizePos);
+     }
+ }
+ 
+@@ -2480,11 +2492,15 @@ IcePy::DictionaryInfo::marshal(PyObject* p, const Ice::OutputStreamPtr& os, Obje
+ 
+     const Ice::Int sz = p == Py_None ? 0 : static_cast<Ice::Int>(PyDict_Size(p));
+ 
++    int sizePos = -1;
+     if(optional)
+     {
+         if(_variableLength)
+         {
+-            os->startSize();
++            // BUGFIX: #5481 startSize/endSize can't be nested
++            //os->startSize();
++            sizePos = os->pos();
++            os->write(Ice::Int(0));
+         }
+         else
+         {
+@@ -2523,7 +2539,9 @@ IcePy::DictionaryInfo::marshal(PyObject* p, const Ice::OutputStreamPtr& os, Obje
+ 
+     if(optional && _variableLength)
+     {
+-        os->endSize();
++        assert(sizePos != -1);
++        //os->endSize();
++        os->rewrite(os->pos() - sizePos - 4, sizePos);
+     }
+ }
+ 
+@@ -2958,9 +2976,13 @@ IcePy::ProxyInfo::optionalFormat() const
+ void
+ IcePy::ProxyInfo::marshal(PyObject* p, const Ice::OutputStreamPtr& os, ObjectMap*, bool optional, const Ice::StringSeq*)
+ {
++    int sizePos = -1;
+     if(optional)
+     {
+-        os->startSize();
++        // BUGFIX: #5481 startSize/endSize can't be nested
++        //os->startSize();
++        sizePos = os->pos();
++        os->write(Ice::Int(0));
+     }
+ 
+     if(p == Py_None)
+@@ -2978,7 +3000,9 @@ IcePy::ProxyInfo::marshal(PyObject* p, const Ice::OutputStreamPtr& os, ObjectMap
+ 
+     if(optional)
+     {
+-        os->endSize();
++        assert(sizePos != -1);
++        //os->endSize();
++        os->rewrite(os->pos() - sizePos - 4, sizePos);
+     }
+ }
+ 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201409121806.s8CI6H7N075621>