From 5e4d9643105ac1ab5eac3696f8a6e120fc70684e Mon Sep 17 00:00:00 2001 From: jsdelfino Date: Tue, 29 May 2012 06:05:43 +0000 Subject: Fix PyObject reference counting bugs causing memory violations in the Python component implementation. Build Python runtime from source with pydebug to diagnose memory issues. git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1343550 13f79535-47bb-0310-9956-ffa450edef68 --- sca-cpp/trunk/INSTALL | 2 +- sca-cpp/trunk/etc/memgrind | 3 +- sca-cpp/trunk/etc/valgrind-apr.supp | 27 ++++ sca-cpp/trunk/macos/macos-install | 18 ++- sca-cpp/trunk/modules/python/eval.hpp | 214 ++++++++++++++++++++++++------ sca-cpp/trunk/modules/wsgi/wsgi-start | 1 + sca-cpp/trunk/ubuntu/ubuntu-backup | 4 +- sca-cpp/trunk/ubuntu/ubuntu-backup-all | 4 +- sca-cpp/trunk/ubuntu/ubuntu-bin-all-image | 2 +- sca-cpp/trunk/ubuntu/ubuntu-bin-image | 2 +- sca-cpp/trunk/ubuntu/ubuntu-install | 20 ++- sca-cpp/trunk/ubuntu/ubuntu-install-all | 20 ++- 12 files changed, 258 insertions(+), 59 deletions(-) create mode 100644 sca-cpp/trunk/etc/valgrind-apr.supp (limited to 'sca-cpp') diff --git a/sca-cpp/trunk/INSTALL b/sca-cpp/trunk/INSTALL index 50ae0f30b3..f4f3d3d577 100644 --- a/sca-cpp/trunk/INSTALL +++ b/sca-cpp/trunk/INSTALL @@ -238,7 +238,7 @@ dependencies installed under $build: --enable-libcloud \ --with-libcloud=$build/libcloud-0.3.1-bin \ --enable-threads \ ---enable-python --with-python=/usr \ +--enable-python --with-python=$build/python-2.6.6-bin \ --enable-opencl --with-opencl-include=/usr/include --with-opencl-lib=/usr/lib \ --enable-gae --with-gae=$build/google_appengine \ --enable-java --with-java=/usr/lib/jvm/default-java \ diff --git a/sca-cpp/trunk/etc/memgrind b/sca-cpp/trunk/etc/memgrind index 079adca595..312058cc85 100755 --- a/sca-cpp/trunk/etc/memgrind +++ b/sca-cpp/trunk/etc/memgrind @@ -18,6 +18,7 @@ # under the License. # Run valgrind to analyze memory usage and track memory leaks +here=`echo "import os; print os.path.realpath('$0')" | python`; here=`dirname $here` -valgrind --tool=memcheck --leak-check=yes --show-reachable=yes --num-callers=40 --track-fds=yes --trace-children=yes $* 2>&1 | tee memgrind.log +valgrind --tool=memcheck --leak-check=yes --show-reachable=yes --num-callers=50 --track-fds=yes --trace-children=yes --suppressions=$here/../../Python-2.6.6/Misc/valgrind-python.supp --suppressions=$here/valgrind-apr.supp $* 2>&1 | tee memgrind.log diff --git a/sca-cpp/trunk/etc/valgrind-apr.supp b/sca-cpp/trunk/etc/valgrind-apr.supp new file mode 100644 index 0000000000..9a58600ee7 --- /dev/null +++ b/sca-cpp/trunk/etc/valgrind-apr.supp @@ -0,0 +1,27 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# This is a valgrind suppression file. + +{ + Suppress APR pool cleanup registrations. + Memcheck:Leak + fun:malloc + fun:apr_palloc + fun:apr_pool_cleanup_register +} + diff --git a/sca-cpp/trunk/macos/macos-install b/sca-cpp/trunk/macos/macos-install index e8332edfd2..82c802a901 100755 --- a/sca-cpp/trunk/macos/macos-install +++ b/sca-cpp/trunk/macos/macos-install @@ -299,6 +299,18 @@ if [ "$?" != "0" ]; then fi cd $build +# Build Python +curl -OL http://www.python.org/ftp/python/2.6.6/Python-2.6.6.tgz +tar xzf Python-2.6.6.tgz +cd Python-2.6.6 +./configure --prefix=$build/python-2.6.6-bin --enable-shared +make +make install +if [ "$?" != "0" ]; then + exit $? +fi +cd $build + # Build Apache Libcloud curl -OL http://archive.apache.org/dist/incubator/libcloud/apache-libcloud-incubating-0.4.2.tar.bz2 tar xjf apache-libcloud-incubating-0.4.2.tar.bz2 @@ -321,7 +333,7 @@ cd $build git clone git://git.apache.org/tuscany-sca-cpp.git cd tuscany-sca-cpp ./bootstrap -./configure --prefix=$build/tuscany-sca-cpp-bin --with-curl=$build/curl-7.24.0-bin --with-apr=$build/apr-1.4.x-bin --with-httpd=$build/httpd-2.3.15-bin --with-memcached=$build/memcached-1.4.7-bin --with-tinycdb=$build/tinycdb-bin --with-leveldb=$build/leveldb --with-js-include=$build/js-1.8.5-bin/include/js --with-js-lib=$build/js-1.8.5-bin/lib --enable-libcloud --with-libcloud=$build/libcloud-0.4.2-bin --enable-threads --enable-python --enable-opencl --with-libxml2=$build/libxml2-2.7.7-bin --enable-chat --with-libstrophe=$build/libstrophe-bin --enable-sqldb --with-pgsql=$build/postgresql-9.1.2-bin --with-pgbouncer=$build/pgbouncer-1.5-bin --enable-openid --with-mod-auth-openid=$build/mod-auth-openid-bin --enable-oauth --with-liboauth=$build/liboauth-0.9.1-bin --enable-mod-security --with-mod-security=$build/modsecurity-apache-2.6.1-bin +./configure --prefix=$build/tuscany-sca-cpp-bin --with-curl=$build/curl-7.24.0-bin --with-apr=$build/apr-1.4.x-bin --with-httpd=$build/httpd-2.3.15-bin --with-memcached=$build/memcached-1.4.7-bin --with-tinycdb=$build/tinycdb-bin --with-leveldb=$build/leveldb --with-js-include=$build/js-1.8.5-bin/include/js --with-js-lib=$build/js-1.8.5-bin/lib --enable-libcloud --with-libcloud=$build/libcloud-0.4.2-bin --enable-threads --enable-python --with-python=$build/python-2.6.6-bin --enable-opencl --with-libxml2=$build/libxml2-2.7.7-bin --enable-chat --with-libstrophe=$build/libstrophe-bin --enable-sqldb --with-pgsql=$build/postgresql-9.1.2-bin --with-pgbouncer=$build/pgbouncer-1.5-bin --enable-openid --with-mod-auth-openid=$build/mod-auth-openid-bin --enable-oauth --with-liboauth=$build/liboauth-0.9.1-bin --enable-mod-security --with-mod-security=$build/modsecurity-apache-2.6.1-bin make make install if [ "$?" != "0" ]; then @@ -330,8 +342,8 @@ fi cd $build # Create src archive -tar czf tuscany-sca-cpp-1.0-src.tar.gz apache-libcloud-incubating-0.4.2 apache-libcloud-incubating-0.4.2.tar.bz2 apr-1.4.x apr-1.4.x-bin autoconf-2.13 autoconf-2.13-bin autoconf-2.13.tar.gz curl-7.24.0 curl-7.24.0-bin curl-7.24.0.tar.gz expat-2.0.1 expat-2.0.1-bin expat-2.0.1.tar.gz htmltidy-bin httpd-2.3.15-beta httpd-2.3.15-beta.tar.gz httpd-2.3.15-bin js-1.8.5-bin js-1.8.5 js185-1.0.0.tar.gz libcloud-0.4.2-bin libevent-2.0.13-stable libevent-2.0.13-stable-bin libevent-2.0.13-stable.tar.gz liboauth-0.9.1 liboauth-0.9.1-bin liboauth-0.9.1.tar.gz libopkele libopkele-bin libstrophe libstrophe-bin libxml2-2.7.7 libxml2-2.7.7-bin libxml2-sources-2.7.7.tar.gz memcached-1.4.7 memcached-1.4.7-bin memcached-1.4.7.tar.gz mod_auth_openid mod-auth-openid-bin modsecurity-apache_2.6.1 modsecurity-apache-2.6.0-bin modsecurity-apache_2.6.0.tar.gz modsecurity-crs_2.2.2 modsecurity-crs_2.2.2.tar.gz nspr-4.8.8-bin nspr-4.8.8 nspr-4.8.8.tar.gz nuvem pcre-8.12 pcre-8.12-bin pcre-8.12.zip pkg-config-0.25 pkg-config-0.25-bin pkg-config-0.25.tar.gz pgbouncer-1.5 pgbouncer-1.5-bin pgbouncer-1.5.tar.gz postgresql-9.1.2 postgresql-9.1.2-bin postgresql-9.1.2.tar.gz tidy tinycdb tinycdb-bin leveldb tuscany-sca-cpp tuscany-sca-cpp-bin +tar czf tuscany-sca-cpp-1.0-src.tar.gz apache-libcloud-incubating-0.4.2 apache-libcloud-incubating-0.4.2.tar.bz2 apr-1.4.x apr-1.4.x-bin autoconf-2.13 autoconf-2.13-bin autoconf-2.13.tar.gz curl-7.24.0 curl-7.24.0-bin curl-7.24.0.tar.gz expat-2.0.1 expat-2.0.1-bin expat-2.0.1.tar.gz htmltidy-bin httpd-2.3.15-beta httpd-2.3.15-beta.tar.gz httpd-2.3.15-bin js-1.8.5-bin js-1.8.5 js185-1.0.0.tar.gz libcloud-0.4.2-bin libevent-2.0.13-stable libevent-2.0.13-stable-bin libevent-2.0.13-stable.tar.gz liboauth-0.9.1 liboauth-0.9.1-bin liboauth-0.9.1.tar.gz libopkele libopkele-bin libstrophe libstrophe-bin libxml2-2.7.7 libxml2-2.7.7-bin libxml2-sources-2.7.7.tar.gz memcached-1.4.7 memcached-1.4.7-bin memcached-1.4.7.tar.gz mod_auth_openid mod-auth-openid-bin modsecurity-apache_2.6.1 modsecurity-apache-2.6.0-bin modsecurity-apache_2.6.0.tar.gz modsecurity-crs_2.2.2 modsecurity-crs_2.2.2.tar.gz nspr-4.8.8-bin nspr-4.8.8 nspr-4.8.8.tar.gz nuvem pcre-8.12 pcre-8.12-bin pcre-8.12.zip pkg-config-0.25 pkg-config-0.25-bin pkg-config-0.25.tar.gz pgbouncer-1.5 pgbouncer-1.5-bin pgbouncer-1.5.tar.gz postgresql-9.1.2 postgresql-9.1.2-bin postgresql-9.1.2.tar.gz Python-2.6.6 python-2.6.6-bin Python-2.6.6.tgz tidy tinycdb tinycdb-bin leveldb tuscany-sca-cpp tuscany-sca-cpp-bin # Create bin archive -tar czf tuscany-sca-cpp-1.0.tar.gz apr-1.4.x-bin curl-7.24.0-bin expat-2.0.1-bin htmltidy-bin httpd-2.3.15-bin js-1.8.5-bin libcloud-0.4.2-bin libevent-2.0.13-stable-bin liboauth-0.9.1-bin libopkele-bin libstrophe-bin libxml2-2.7.7-bin memcached-1.4.7-bin mod-auth-openid-bin modsecurity-apache-2.6.1-bin nspr-4.8.8-bin nuvem/nuvem-parallel pcre-8.12-bin pgbouncer-1.5-bin postgresql-9.1.2-bin tinycdb-bin leveldb tuscany-sca-cpp tuscany-sca-cpp-bin +tar czf tuscany-sca-cpp-1.0.tar.gz apr-1.4.x-bin curl-7.24.0-bin expat-2.0.1-bin htmltidy-bin httpd-2.3.15-bin js-1.8.5-bin libcloud-0.4.2-bin libevent-2.0.13-stable-bin liboauth-0.9.1-bin libopkele-bin libstrophe-bin libxml2-2.7.7-bin memcached-1.4.7-bin mod-auth-openid-bin modsecurity-apache-2.6.1-bin nspr-4.8.8-bin nuvem/nuvem-parallel pcre-8.12-bin pgbouncer-1.5-bin postgresql-9.1.2-bin python-2.6.6-bin tinycdb-bin leveldb tuscany-sca-cpp tuscany-sca-cpp-bin diff --git a/sca-cpp/trunk/modules/python/eval.hpp b/sca-cpp/trunk/modules/python/eval.hpp index 41f45ac5ff..da5d226789 100644 --- a/sca-cpp/trunk/modules/python/eval.hpp +++ b/sca-cpp/trunk/modules/python/eval.hpp @@ -27,8 +27,14 @@ */ #if PYTHON_VERSION == 27 #include +#include +#include #else +#undef _POSIX_C_SOURCE +#undef _XOPEN_SOURCE #include +#include +#include #endif #include "list.hpp" @@ -40,6 +46,21 @@ namespace python { class PythonThreadIn; class PythonThreadOut; class PythonRuntimeLock; +class PythonRuntime; + +/** + * Maintain a garbage collected reference to a Python object. + */ +const bool pyIncRef(PyObject* o); +const bool pyDecRef(PyObject* o, PythonRuntime* py); + +/** + * Write to debug log from Python. + */ +const value pyDebug(const list& args) { + debug(args, "python::debug"); + return true; +} /** * Represent a Python runtime. @@ -63,10 +84,12 @@ public: // Initialize the Python interpreter #ifdef IS_DARWIN debug("python::pythonruntime::initialize"); + Py_SetPythonHome(const_cast(PYTHON_PREFIX)); Py_InitializeEx(0); #else if (!Py_IsInitialized()) { debug("python::pythonruntime::initialize"); + Py_SetPythonHome(const_cast(PYTHON_PREFIX)); Py_InitializeEx(0); } #endif @@ -84,12 +107,22 @@ public: #endif #endif - // Set default interpreter args #ifdef WANT_THREADS PyGILState_STATE gstate = PyGILState_Ensure(); #endif + + // Set default interpreter args const char* arg0 = ""; PySys_SetArgv(0, const_cast(&arg0)); + + // Install debug log function + PyObject* mkPyLambda(const lambda&)>& l, PythonRuntime* py); + PyObject* pyd= mkPyLambda(pyDebug, this); + PyObject* sys = PyImport_ImportModule("sys"); + PyObject_SetAttrString(sys, "debug", pyd); + pyDecRef(pyd, this); + pyDecRef(sys, this); + #ifdef WANT_THREADS PyGILState_Release(gstate); #endif @@ -115,24 +148,46 @@ private: /** * Return the last python error. */ -const string lastError() { +const string lastErrorTrace(PyObject *trace) { + if (trace == NULL) + return ""; + PyTracebackObject* tb = (PyTracebackObject*)trace; + const int limit = 16; + int depth = 0; + PyTracebackObject *tb1 = tb; + while (tb1 != NULL) { + depth++; + tb1 = tb1->tb_next; + } + ostringstream os; + while (tb != NULL) { + if (depth <= limit) + os << ", File " << PyString_AsString(tb->tb_frame->f_code->co_filename) << + " line " << tb->tb_lineno << " in " << PyString_AsString(tb->tb_frame->f_code->co_name); + depth--; + tb = tb->tb_next; + } + return str(os); +} + +const string lastError(PythonRuntime* py) { if(PyErr_Occurred()) { - PyObject* type; - PyObject* val; - PyObject* trace; + PyObject* type = NULL; + PyObject* val = NULL; + PyObject* trace = NULL; PyErr_Fetch(&type, &val, &trace); if (type != NULL && val != NULL) { PyObject* stype = PyObject_Str(type); PyObject* sval = PyObject_Str(val); - string msg = string() + PyString_AsString(stype) + " : " + PyString_AsString(sval); - Py_DECREF(stype); - Py_DECREF(sval); + string msg = string() + PyString_AsString(stype) + " : " + PyString_AsString(sval) + lastErrorTrace(trace); + pyDecRef(stype, py); + pyDecRef(sval, py); PyErr_Restore(type, val, trace); - PyErr_Print(); + PyErr_Clear(); return msg; } PyErr_Restore(type, val, trace); - PyErr_Print(); + PyErr_Clear(); return "Unknown Python error"; } return ""; @@ -234,6 +289,44 @@ private: #endif }; +/** + * A gargabe collected Python object reference. + */ +class PyGCRef { +public: + PyGCRef(PyObject* o, PythonRuntime* py) : o(o), py(py) { + } + + ~PyGCRef() { + if (o == NULL) + return; + PythonThreadIn pyin(py); + Py_DECREF(o); + } + +private: + PyObject* o; + PythonRuntime* py; +}; + +/** + * Maintain a garbage collected reference to a Python object. + */ +const bool pyIncRef(PyObject* o) { + if (o == NULL) + return true; + Py_INCREF(o); + return true; +} + +const bool pyDecRef(unused PyObject* o, unused PythonRuntime* py) { + if (o == NULL) + return true; + //new (gc_new()) PyGCRef(o, py); + Py_DECREF(o); + return true; +} + /** * Declare conversion functions. */ @@ -254,14 +347,14 @@ typedef struct { PyObject *mkPyLambda(const lambda&)>& l, PythonRuntime* py); void pyLambda_dealloc(PyObject* self) { - debug(self, "python::pylambda_dealloc"); + //debug(self, "python::pylambda_dealloc"); PyObject_Del(self); } -const string pyRepr(PyObject* o) { +const string pyRepr(PyObject* o, PythonRuntime* py) { PyObject* r = PyObject_Repr(o); const string s = PyString_AsString(r); - Py_DECREF(r); + pyDecRef(r, py); return s; } @@ -300,7 +393,7 @@ PyObject* pyLambda_getattr(PyObject *self, PyObject *attrname) { return PyObject_GenericGetAttr(self, attrname); if (name == "eval") { - Py_INCREF(self); + pyIncRef(self); return self; } @@ -371,7 +464,7 @@ PyObject *mkPyLambda(const lambda&)>& l, PythonRuntime* pyl->func = new (gc_new&)> >()) lambda&)>(l); pyl->py = py; } - debug(pyl, "python::mkpylambda"); + //debug(pyl, "python::mkpylambda"); return (PyObject*)pyl; } @@ -383,14 +476,14 @@ PyObject* valuesToPyListHelper(PyObject* l, const list& v, PythonRuntime* return l; PyObject* pyv = valueToPyObject(car(v), py); PyList_Append(l, pyv); - Py_DECREF(pyv); + pyDecRef(pyv, py); return valuesToPyListHelper(l, cdr(v), py); } PyObject* valuesToPyTuple(const list& v, PythonRuntime* py) { PyObject* pyl = valuesToPyListHelper(PyList_New(0), v, py); PyObject* pyt = PyList_AsTuple(pyl); - Py_DECREF(pyl); + pyDecRef(pyl, py); return pyt; } @@ -411,10 +504,16 @@ PyObject* valueToPyObject(const value& v, PythonRuntime* py) { } case value::Number: return PyFloat_FromDouble((double)v); - case value::Bool: - return (bool)v? Py_True : Py_False; - default: - return Py_None; + case value::Bool: { + PyObject* b = (bool)v? Py_True : Py_False; + pyIncRef(b); + return b; + } + default: { + PyObject* n = Py_None; + pyIncRef(n); + return n; + } } } @@ -438,22 +537,46 @@ const list pyTupleToValues(PyObject* o, PythonRuntime* py) { struct pyCallable { PyObject* func; PythonRuntime* py; + bool owner; - pyCallable(PyObject* func, PythonRuntime* py) : func(func), py(py) { - Py_INCREF(func); + pyCallable(PyObject* func, PythonRuntime* py) : func(func), py(py), owner(true) { + pyIncRef(func); + } + + pyCallable(const pyCallable& c) : func(c.func), py(c.py), owner(false) { } ~pyCallable() { - Py_DECREF(func); + if (!owner) + return; + pyDecRef(func, py); } const value operator()(const list& args) const { PythonThreadIn pyin(py); + { + // Temp + PyObject* rfunc = PyObject_Repr(func); + char* s = NULL; + Py_ssize_t l = 0; + PyString_AsStringAndSize(rfunc, &s, &l); + debug(string(s, l), "python::operator()::func"); + pyDecRef(rfunc, py); + } PyObject* pyargs = valuesToPyTuple(args, py); + { + // Temp + PyObject* rargs = PyObject_Repr(pyargs); + char* s = NULL; + Py_ssize_t l = 0; + PyString_AsStringAndSize(rargs, &s, &l); + debug(string(s, l), "python::operator()::args"); + pyDecRef(rargs, py); + } PyObject* result = PyObject_CallObject(func, pyargs); const value v = pyObjectToValue(result, py); - Py_DECREF(pyargs); - Py_DECREF(result); + pyDecRef(pyargs, py); + pyDecRef(result, py); return v; } }; @@ -462,6 +585,8 @@ struct pyCallable { * Convert a python object to a value. */ const value pyObjectToValue(PyObject *o, PythonRuntime* py) { + if (o == NULL) + return value(); if (PyString_Check(o)) { char* s = NULL; Py_ssize_t l = 0; @@ -509,10 +634,10 @@ const failable evalScript(const value& expr, PyObject* script, PythonRunt return value(lambda&)>()); } - return mkfailure(string("Couldn't find function: ") + car(expr) + " : " + lastError()); + return mkfailure(string("Couldn't find function: ") + car(expr) + " : " + lastError(&py)); } if (!PyCallable_Check(func)) { - Py_DECREF(func); + pyDecRef(func, &py); return mkfailure(string("Couldn't find callable function: ") + car(expr)); } @@ -521,14 +646,14 @@ const failable evalScript(const value& expr, PyObject* script, PythonRunt // Call the function PyObject* result = PyObject_CallObject(func, args); - Py_DECREF(func); - Py_DECREF(args); + pyDecRef(func, &py); + pyDecRef(args, &py); if (result == NULL) - return mkfailure(string("Function call failed: ") + car(expr) + " : " + lastError()); + return mkfailure(string("Function call failed: ") + car(expr) + " : " + lastError(&py)); // Convert python result to a value const value v = pyObjectToValue(result, &py); - Py_DECREF(result); + pyDecRef(result, &py); return v; } @@ -538,27 +663,35 @@ const failable evalScript(const value& expr, PyObject* script, PythonRunt const failable readScript(const string& name, const string& path, istream& is, PythonRuntime& py) { PythonThreadIn pyin(&py); + // Lookup already loaded module + PyObject *mods = PyImport_GetModuleDict(); + PyObject *emod = PyDict_GetItemString(mods, const_cast(c_str(name))); + if (emod != NULL) + return emod; + + // Compile and import new module + debug(name, "python::readScript::compile::name"); + debug(path, "python::readScript::compile::path"); const list ls = streamList(is); ostringstream os; write(ls, os); PyObject* code = Py_CompileStringFlags(c_str(str(os)), c_str(path), Py_file_input, NULL); if (code == NULL) - return mkfailure(string("Couldn't compile script: ") + path + " : " + lastError()); + return mkfailure(string("Couldn't compile script: ") + path + " : " + lastError(&py)); PyObject* mod = PyImport_ExecCodeModuleEx(const_cast(c_str(name)), code, const_cast(c_str(path))); if (mod == NULL) { - Py_DECREF(code); - return mkfailure(string("Couldn't import module: ") + path + " : " + lastError()); + pyDecRef(code, &py); + return mkfailure(string("Couldn't import module: ") + path + " : " + lastError(&py)); } - Py_DECREF(code); return mod; } /** * Release a python script. */ -const failable releaseScript(PyObject* script, PythonRuntime& py) { +const failable releaseScript(unused PyObject* script, PythonRuntime& py) { PythonThreadIn pyin(&py); - Py_DECREF(script); + // No need to decref the script here, as it's referenced only once from sys.modules return true; } @@ -566,9 +699,10 @@ const failable releaseScript(PyObject* script, PythonRuntime& py) { * Evaluate an expression against a script provided as an input stream. */ const failable evalScript(const value& expr, istream& is, PythonRuntime& py) { - failable script = readScript("script", "script.py", is, py); + const value uuid = mkuuid(); + failable script = readScript(string("script") + string(uuid), string("script") + string(uuid) + string(".py"), is, py); if (!hasContent(script)) - return mkfailure(reason(script)); + return mkfailure(script); return evalScript(expr, content(script), py); } diff --git a/sca-cpp/trunk/modules/wsgi/wsgi-start b/sca-cpp/trunk/modules/wsgi/wsgi-start index 685dab3c82..1bda4f33fa 100755 --- a/sca-cpp/trunk/modules/wsgi/wsgi-start +++ b/sca-cpp/trunk/modules/wsgi/wsgi-start @@ -24,5 +24,6 @@ port=$2 python_prefix=`cat $here/../python/python.prefix` cd $root +export LD_LIBRARY_PATH=$python_prefix/lib:$LD_LIBRARY_PATH $python_prefix/bin/python composite.py $port & diff --git a/sca-cpp/trunk/ubuntu/ubuntu-backup b/sca-cpp/trunk/ubuntu/ubuntu-backup index 62e0bc5415..ac20e6cc1e 100755 --- a/sca-cpp/trunk/ubuntu/ubuntu-backup +++ b/sca-cpp/trunk/ubuntu/ubuntu-backup @@ -23,8 +23,8 @@ set -x # Create src archive -tar czf tuscany-sca-cpp-1.0-src.tar.gz apache-libcloud-incubating-0.4.2 apache-libcloud-incubating-0.4.2.tar.bz2 apr-1.4.x apr-1.4.x-bin curl-7.24.0 curl-7.24.0-bin curl-7.24.0.tar.gz expat-2.0.1 expat-2.0.1-bin expat-2.0.1.tar.gz htmltidy-bin httpd-2.3.15-beta httpd-2.3.15-beta.tar.gz httpd-2.3.15-bin js-1.8.5-bin js-1.8.5 js185-1.0.0.tar.gz libcloud-0.4.2-bin liboauth-0.9.1 liboauth-0.9.1-bin liboauth-0.9.1.tar.gz libopkele libopkele-bin libstrophe libstrophe-bin libxml2-2.7.7 libxml2-2.7.7-bin libxml2-sources-2.7.7.tar.gz memcached-1.4.7 memcached-1.4.7-bin memcached-1.4.7.tar.gz mod_auth_openid mod-auth-openid-bin modsecurity-apache_2.6.1 modsecurity-apache-2.6.1-bin modsecurity-apache_2.6.1.tar.gz modsecurity-crs_2.2.2 modsecurity-crs_2.2.2.tar.gz nspr-4.8.8-bin nspr-4.8.8 nspr-4.8.8.tar.gz nuvem page-speed-1.9 page-speed-1.9-bin page-speed-sdk.zip pgbouncer-1.5 pgbouncer-1.5-bin pgbouncer-1.5.tar.gz postgresql-9.1.2 postgresql-9.1.2-bin postgresql-9.1.2.tar.gz scribe scribe-2.2-bin scribe-2.2.tar.gz thrift-0.2.0 thrift-0.2.0-bin thrift-0.2.0-incubating.tar.gz tidy tinycdb-0.77 tinycdb-0.77-bin tinycdb_0.77.tar.gz tuscany-sca-cpp tuscany-sca-cpp-bin +tar czf tuscany-sca-cpp-1.0-src.tar.gz apache-libcloud-incubating-0.4.2 apache-libcloud-incubating-0.4.2.tar.bz2 apr-1.4.x apr-1.4.x-bin curl-7.24.0 curl-7.24.0-bin curl-7.24.0.tar.gz expat-2.0.1 expat-2.0.1-bin expat-2.0.1.tar.gz htmltidy-bin httpd-2.3.15-beta httpd-2.3.15-beta.tar.gz httpd-2.3.15-bin js-1.8.5-bin js-1.8.5 js185-1.0.0.tar.gz libcloud-0.4.2-bin liboauth-0.9.1 liboauth-0.9.1-bin liboauth-0.9.1.tar.gz libopkele libopkele-bin libstrophe libstrophe-bin libxml2-2.7.7 libxml2-2.7.7-bin libxml2-sources-2.7.7.tar.gz memcached-1.4.7 memcached-1.4.7-bin memcached-1.4.7.tar.gz mod_auth_openid mod-auth-openid-bin modsecurity-apache_2.6.1 modsecurity-apache-2.6.1-bin modsecurity-apache_2.6.1.tar.gz modsecurity-crs_2.2.2 modsecurity-crs_2.2.2.tar.gz nspr-4.8.8-bin nspr-4.8.8 nspr-4.8.8.tar.gz nuvem page-speed-1.9 page-speed-1.9-bin page-speed-sdk.zip pgbouncer-1.5 pgbouncer-1.5-bin pgbouncer-1.5.tar.gz postgresql-9.1.2 postgresql-9.1.2-bin postgresql-9.1.2.tar.gz Python-2.6.6 python-2.6.6-bin Python-2.6.6.tgz scribe scribe-2.2-bin scribe-2.2.tar.gz thrift-0.2.0 thrift-0.2.0-bin thrift-0.2.0-incubating.tar.gz tidy tinycdb-0.77 tinycdb-0.77-bin tinycdb_0.77.tar.gz tuscany-sca-cpp tuscany-sca-cpp-bin # Create bin archive -tar czf tuscany-sca-cpp-1.0.tar.gz apr-1.4.x-bin curl-7.24.0-bin expat-2.0.1-bin htmltidy-bin httpd-2.3.15-bin js-1.8.5-bin libcloud-0.4.2-bin liboauth-0.9.1-bin libopkele-bin libstrophe-bin libxml2-2.7.7-bin memcached-1.4.7-bin mod-auth-openid-bin modsecurity-apache-2.6.1-bin nspr-4.8.8-bin nuvem/nuvem-parallel page-speed-1.9-bin pgbouncer-1.5-bin postgresql-9.1.2-bin scribe-2.2-bin thrift-0.2.0-bin tinycdb-0.77-bin tuscany-sca-cpp tuscany-sca-cpp-bin +tar czf tuscany-sca-cpp-1.0.tar.gz apr-1.4.x-bin curl-7.24.0-bin expat-2.0.1-bin htmltidy-bin httpd-2.3.15-bin js-1.8.5-bin libcloud-0.4.2-bin liboauth-0.9.1-bin libopkele-bin libstrophe-bin libxml2-2.7.7-bin memcached-1.4.7-bin mod-auth-openid-bin modsecurity-apache-2.6.1-bin nspr-4.8.8-bin nuvem/nuvem-parallel page-speed-1.9-bin pgbouncer-1.5-bin postgresql-9.1.2-bin python-2.6.6-bin scribe-2.2-bin thrift-0.2.0-bin tinycdb-0.77-bin tuscany-sca-cpp tuscany-sca-cpp-bin diff --git a/sca-cpp/trunk/ubuntu/ubuntu-backup-all b/sca-cpp/trunk/ubuntu/ubuntu-backup-all index 609a570bed..80dccdaf81 100755 --- a/sca-cpp/trunk/ubuntu/ubuntu-backup-all +++ b/sca-cpp/trunk/ubuntu/ubuntu-backup-all @@ -23,8 +23,8 @@ set -x # Create src archive -tar czf tuscany-sca-cpp-all-1.0-src.tar.gz apache-libcloud-incubating-0.4.2 apache-libcloud-incubating-0.4.2.tar.bz2 apr-1.4.x apr-1.4.x-bin axis2c-1.6.0-bin axis2c-src-1.6.0 axis2c-src-1.6.0.tar.gz curl-7.24.0 curl-7.24.0-bin curl-7.24.0.tar.gz expat-2.0.1 expat-2.0.1-bin expat-2.0.1.tar.gz google_appengine google_appengine_1.4.0.zip htmltidy-bin httpd-2.3.15-beta httpd-2.3.15-beta.tar.gz httpd-2.3.15-bin js-1.8.5-bin js-1.8.5 js185-1.0.0.tar.gz libcloud-0.4.2-bin liboauth-0.9.1 liboauth-0.9.1-bin liboauth-0.9.1.tar.gz libopkele libopkele-bin libstrophe libstrophe-bin libxml2-2.7.7 libxml2-2.7.7-bin libxml2-sources-2.7.7.tar.gz memcached-1.4.7 memcached-1.4.7-bin memcached-1.4.7.tar.gz mod_auth_openid mod-auth-openid-bin modsecurity-apache_2.6.1 modsecurity-apache-2.6.1-bin modsecurity-apache_2.6.1.tar.gz modsecurity-crs_2.2.2 modsecurity-crs_2.2.2.tar.gz nspr-4.8.8-bin nspr-4.8.8 nspr-4.8.8.tar.gz nuvem page-speed-1.9 page-speed-1.9-bin page-speed-sdk.zip pgbouncer-1.5 pgbouncer-1.5-bin pgbouncer-1.5.tar.gz postgresql-9.1.2 postgresql-9.1.2-bin postgresql-9.1.2.tar.gz qpidc-0.6 qpidc-0.6-bin qpid-cpp-0.6.tar.gz scribe scribe-2.2-bin scribe-2.2.tar.gz thrift-0.2.0 thrift-0.2.0-bin thrift-0.2.0-incubating.tar.gz tidy tinycdb-0.77 tinycdb-0.77-bin tinycdb_0.77.tar.gz tuscany-sca-cpp tuscany-sca-cpp-bin vysper-0.6 vysper-0.6-bin.tar.gz +tar czf tuscany-sca-cpp-all-1.0-src.tar.gz apache-libcloud-incubating-0.4.2 apache-libcloud-incubating-0.4.2.tar.bz2 apr-1.4.x apr-1.4.x-bin axis2c-1.6.0-bin axis2c-src-1.6.0 axis2c-src-1.6.0.tar.gz curl-7.24.0 curl-7.24.0-bin curl-7.24.0.tar.gz expat-2.0.1 expat-2.0.1-bin expat-2.0.1.tar.gz google_appengine google_appengine_1.4.0.zip htmltidy-bin httpd-2.3.15-beta httpd-2.3.15-beta.tar.gz httpd-2.3.15-bin js-1.8.5-bin js-1.8.5 js185-1.0.0.tar.gz libcloud-0.4.2-bin liboauth-0.9.1 liboauth-0.9.1-bin liboauth-0.9.1.tar.gz libopkele libopkele-bin libstrophe libstrophe-bin libxml2-2.7.7 libxml2-2.7.7-bin libxml2-sources-2.7.7.tar.gz memcached-1.4.7 memcached-1.4.7-bin memcached-1.4.7.tar.gz mod_auth_openid mod-auth-openid-bin modsecurity-apache_2.6.1 modsecurity-apache-2.6.1-bin modsecurity-apache_2.6.1.tar.gz modsecurity-crs_2.2.2 modsecurity-crs_2.2.2.tar.gz nspr-4.8.8-bin nspr-4.8.8 nspr-4.8.8.tar.gz nuvem page-speed-1.9 page-speed-1.9-bin page-speed-sdk.zip pgbouncer-1.5 pgbouncer-1.5-bin pgbouncer-1.5.tar.gz postgresql-9.1.2 postgresql-9.1.2-bin postgresql-9.1.2.tar.gz Python-2.6.6 python-2.6.6-bin Python-2.6.6.tgz qpidc-0.6 qpidc-0.6-bin qpid-cpp-0.6.tar.gz scribe scribe-2.2-bin scribe-2.2.tar.gz thrift-0.2.0 thrift-0.2.0-bin thrift-0.2.0-incubating.tar.gz tidy tinycdb-0.77 tinycdb-0.77-bin tinycdb_0.77.tar.gz tuscany-sca-cpp tuscany-sca-cpp-bin vysper-0.6 vysper-0.6-bin.tar.gz # Create bin archive -tar czf tuscany-sca-cpp-all-1.0.tar.gz apr-1.4.x-bin axis2c-1.6.0-bin curl-7.24.0-bin expat-2.0.1-bin google_appengine htmltidy-bin httpd-2.3.15-bin js-1.8.5-bin libcloud-0.4.2-bin liboauth-0.9.1-bin libopkele-bin libstrophe-bin libxml2-2.7.7-bin memcached-1.4.7-bin mod-auth-openid-bin modsecurity-apache-2.6.1-bin nspr-4.8.8-bin nuvem/nuvem-parallel page-speed-1.9-bin pgbouncer-1.5-bin postgresql-9.1.2-bin qpidc-0.6-bin scribe-2.2-bin thrift-0.2.0-bin tinycdb-0.77-bin tuscany-sca-cpp tuscany-sca-cpp-bin vysper-0.6 +tar czf tuscany-sca-cpp-all-1.0.tar.gz apr-1.4.x-bin axis2c-1.6.0-bin curl-7.24.0-bin expat-2.0.1-bin google_appengine htmltidy-bin httpd-2.3.15-bin js-1.8.5-bin libcloud-0.4.2-bin liboauth-0.9.1-bin libopkele-bin libstrophe-bin libxml2-2.7.7-bin memcached-1.4.7-bin mod-auth-openid-bin modsecurity-apache-2.6.1-bin nspr-4.8.8-bin nuvem/nuvem-parallel page-speed-1.9-bin pgbouncer-1.5-bin postgresql-9.1.2-bin python-2.6.6-bin qpidc-0.6-bin scribe-2.2-bin thrift-0.2.0-bin tinycdb-0.77-bin tuscany-sca-cpp tuscany-sca-cpp-bin vysper-0.6 diff --git a/sca-cpp/trunk/ubuntu/ubuntu-bin-all-image b/sca-cpp/trunk/ubuntu/ubuntu-bin-all-image index c76af435a6..b230d75728 100755 --- a/sca-cpp/trunk/ubuntu/ubuntu-bin-all-image +++ b/sca-cpp/trunk/ubuntu/ubuntu-bin-all-image @@ -74,7 +74,7 @@ if [ "$?" != "0" ]; then exit $? fi # Required by Apache Thrift -sudo apt-get -y install bison flex python-dev +sudo apt-get -y install bison flex if [ "$?" != "0" ]; then exit $? fi diff --git a/sca-cpp/trunk/ubuntu/ubuntu-bin-image b/sca-cpp/trunk/ubuntu/ubuntu-bin-image index 032c4e4978..6c1082ac3a 100755 --- a/sca-cpp/trunk/ubuntu/ubuntu-bin-image +++ b/sca-cpp/trunk/ubuntu/ubuntu-bin-image @@ -59,7 +59,7 @@ if [ "$?" != "0" ]; then exit $? fi # Required by Apache Thrift -sudo apt-get -y install bison flex python-dev libboost-dev libboost-filesystem-dev +sudo apt-get -y install bison flex libboost-dev libboost-filesystem-dev if [ "$?" != "0" ]; then exit $? fi diff --git a/sca-cpp/trunk/ubuntu/ubuntu-install b/sca-cpp/trunk/ubuntu/ubuntu-install index 71fd6d7d0f..ef2209122b 100755 --- a/sca-cpp/trunk/ubuntu/ubuntu-install +++ b/sca-cpp/trunk/ubuntu/ubuntu-install @@ -285,7 +285,7 @@ curl -OL http://archive.apache.org/dist/incubator/thrift/0.2.0-incubating/thrift tar xzf thrift-0.2.0-incubating.tar.gz cd thrift-0.2.0 ./bootstrap.sh -./configure --prefix=$build/thrift-0.2.0-bin --with-java=no --with-erlang=no --with-perl=no --with-ruby=no --with-csharp=no --disable-static +./configure --prefix=$build/thrift-0.2.0-bin --with-java=no --with-erlang=no --with-py=no --with-perl=no --with-ruby=no --with-csharp=no --disable-static make make install if [ "$?" != "0" ]; then @@ -324,6 +324,18 @@ fi cp src/lib/libscribe.so $build/scribe-2.2-bin/lib cd $build +# Build Python +curl -OL http://www.python.org/ftp/python/2.6.6/Python-2.6.6.tgz +tar xzf Python-2.6.6.tgz +cd Python-2.6.6 +./configure --prefix=$build/python-2.6.6-bin --enable-shared +make +make install +if [ "$?" != "0" ]; then + exit $? +fi +cd $build + # Build Apache Libcloud curl -OL http://archive.apache.org/dist/incubator/libcloud/apache-libcloud-incubating-0.4.2.tar.bz2 tar xjf apache-libcloud-incubating-0.4.2.tar.bz2 @@ -356,7 +368,7 @@ cd $build git clone git://git.apache.org/tuscany-sca-cpp.git cd tuscany-sca-cpp ./bootstrap -./configure --prefix=$build/tuscany-sca-cpp-bin --with-curl=$build/curl-7.24.0-bin --with-apr=$build/apr-1.4.x-bin --with-httpd=$build/httpd-2.3.15-bin --with-memcached=$build/memcached-1.4.7-bin --with-tinycdb=$build/tinycdb-0.77-bin --with-js-include=$build/js-1.8.5-bin/include/js --with-js-lib=$build/js-1.8.5-bin/lib --enable-pagespeed --with-pagespeed=$build/page-speed-1.9-bin --enable-libcloud --with-libcloud=$build/libcloud-0.4.2-bin --enable-threads --enable-python --with-libxml2=$build/libxml2-2.7.7-bin --enable-chat --with-libstrophe=$build/libstrophe-bin --enable-sqldb --with-pgsql=$build/postgresql-9.1.2-bin --with-pgbouncer=$build/pgbouncer-1.5-bin --enable-log --with-thrift=$build/thrift-0.2.0-bin --with-scribe=$build/scribe-2.2-bin --enable-openid --with-mod-auth-openid=$build/mod-auth-openid-bin --enable-oauth --with-liboauth=$build/liboauth-0.9.1-bin --enable-mod-security --with-mod-security=$build/modsecurity-apache-2.6.1-bin +./configure --prefix=$build/tuscany-sca-cpp-bin --with-curl=$build/curl-7.24.0-bin --with-apr=$build/apr-1.4.x-bin --with-httpd=$build/httpd-2.3.15-bin --with-memcached=$build/memcached-1.4.7-bin --with-tinycdb=$build/tinycdb-0.77-bin --with-js-include=$build/js-1.8.5-bin/include/js --with-js-lib=$build/js-1.8.5-bin/lib --enable-pagespeed --with-pagespeed=$build/page-speed-1.9-bin --enable-libcloud --with-libcloud=$build/libcloud-0.4.2-bin --enable-threads --enable-python --with-python=$build/python-2.6.6-bin --with-libxml2=$build/libxml2-2.7.7-bin --enable-chat --with-libstrophe=$build/libstrophe-bin --enable-sqldb --with-pgsql=$build/postgresql-9.1.2-bin --with-pgbouncer=$build/pgbouncer-1.5-bin --enable-log --with-thrift=$build/thrift-0.2.0-bin --with-scribe=$build/scribe-2.2-bin --enable-openid --with-mod-auth-openid=$build/mod-auth-openid-bin --enable-oauth --with-liboauth=$build/liboauth-0.9.1-bin --enable-mod-security --with-mod-security=$build/modsecurity-apache-2.6.1-bin make make install if [ "$?" != "0" ]; then @@ -365,8 +377,8 @@ fi cd $build # Create src archive -tar czf tuscany-sca-cpp-1.0-src.tar.gz apache-libcloud-incubating-0.4.2 apache-libcloud-incubating-0.4.2.tar.bz2 apr-1.4.x apr-1.4.x-bin curl-7.24.0 curl-7.24.0-bin curl-7.24.0.tar.gz expat-2.0.1 expat-2.0.1-bin expat-2.0.1.tar.gz htmltidy-bin httpd-2.3.15-beta httpd-2.3.15-beta.tar.gz httpd-2.3.15-bin js-1.8.5-bin js-1.8.5 js185-1.0.0.tar.gz libcloud-0.4.2-bin liboauth-0.9.1 liboauth-0.9.1-bin liboauth-0.9.1.tar.gz libopkele libopkele-bin libstrophe libstrophe-bin libxml2-2.7.7 libxml2-2.7.7-bin libxml2-sources-2.7.7.tar.gz memcached-1.4.7 memcached-1.4.7-bin memcached-1.4.7.tar.gz mod_auth_openid mod-auth-openid-bin modsecurity-apache_2.6.1 modsecurity-apache-2.6.1-bin modsecurity-apache_2.6.1.tar.gz modsecurity-crs_2.2.2 modsecurity-crs_2.2.2.tar.gz nspr-4.8.8-bin nspr-4.8.8 nspr-4.8.8.tar.gz nuvem page-speed-1.9 page-speed-1.9-bin page-speed-sdk.zip pgbouncer-1.5 pgbouncer-1.5-bin pgbouncer-1.5.tar.gz postgresql-9.1.2 postgresql-9.1.2-bin postgresql-9.1.2.tar.gz scribe scribe-2.2-bin scribe-2.2.tar.gz thrift-0.2.0 thrift-0.2.0-bin thrift-0.2.0-incubating.tar.gz tidy tinycdb-0.77 tinycdb-0.77-bin tinycdb_0.77.tar.gz tuscany-sca-cpp tuscany-sca-cpp-bin +tar czf tuscany-sca-cpp-1.0-src.tar.gz apache-libcloud-incubating-0.4.2 apache-libcloud-incubating-0.4.2.tar.bz2 apr-1.4.x apr-1.4.x-bin curl-7.24.0 curl-7.24.0-bin curl-7.24.0.tar.gz expat-2.0.1 expat-2.0.1-bin expat-2.0.1.tar.gz htmltidy-bin httpd-2.3.15-beta httpd-2.3.15-beta.tar.gz httpd-2.3.15-bin js-1.8.5-bin js-1.8.5 js185-1.0.0.tar.gz libcloud-0.4.2-bin liboauth-0.9.1 liboauth-0.9.1-bin liboauth-0.9.1.tar.gz libopkele libopkele-bin libstrophe libstrophe-bin libxml2-2.7.7 libxml2-2.7.7-bin libxml2-sources-2.7.7.tar.gz memcached-1.4.7 memcached-1.4.7-bin memcached-1.4.7.tar.gz mod_auth_openid mod-auth-openid-bin modsecurity-apache_2.6.1 modsecurity-apache-2.6.1-bin modsecurity-apache_2.6.1.tar.gz modsecurity-crs_2.2.2 modsecurity-crs_2.2.2.tar.gz nspr-4.8.8-bin nspr-4.8.8 nspr-4.8.8.tar.gz nuvem page-speed-1.9 page-speed-1.9-bin page-speed-sdk.zip pgbouncer-1.5 pgbouncer-1.5-bin pgbouncer-1.5.tar.gz postgresql-9.1.2 postgresql-9.1.2-bin postgresql-9.1.2.tar.gz Python-2.6.6 python-2.6.6-bin Python-2.6.6.tgz scribe scribe-2.2-bin scribe-2.2.tar.gz thrift-0.2.0 thrift-0.2.0-bin thrift-0.2.0-incubating.tar.gz tidy tinycdb-0.77 tinycdb-0.77-bin tinycdb_0.77.tar.gz tuscany-sca-cpp tuscany-sca-cpp-bin # Create bin archive -tar czf tuscany-sca-cpp-1.0.tar.gz apr-1.4.x-bin curl-7.24.0-bin expat-2.0.1-bin htmltidy-bin httpd-2.3.15-bin js-1.8.5-bin libcloud-0.4.2-bin liboauth-0.9.1-bin libopkele-bin libstrophe-bin libxml2-2.7.7-bin memcached-1.4.7-bin mod-auth-openid-bin modsecurity-apache-2.6.1-bin nspr-4.8.8-bin nuvem/nuvem-parallel page-speed-1.9-bin pgbouncer-1.5-bin postgresql-9.1.2-bin scribe-2.2-bin thrift-0.2.0-bin tinycdb-0.77-bin tuscany-sca-cpp tuscany-sca-cpp-bin +tar czf tuscany-sca-cpp-1.0.tar.gz apr-1.4.x-bin curl-7.24.0-bin expat-2.0.1-bin htmltidy-bin httpd-2.3.15-bin js-1.8.5-bin libcloud-0.4.2-bin liboauth-0.9.1-bin libopkele-bin libstrophe-bin libxml2-2.7.7-bin memcached-1.4.7-bin mod-auth-openid-bin modsecurity-apache-2.6.1-bin nspr-4.8.8-bin nuvem/nuvem-parallel page-speed-1.9-bin pgbouncer-1.5-bin postgresql-9.1.2-bin python-2.6.6-bin scribe-2.2-bin thrift-0.2.0-bin tinycdb-0.77-bin tuscany-sca-cpp tuscany-sca-cpp-bin diff --git a/sca-cpp/trunk/ubuntu/ubuntu-install-all b/sca-cpp/trunk/ubuntu/ubuntu-install-all index a3acbd3c6b..4aaa117f2a 100755 --- a/sca-cpp/trunk/ubuntu/ubuntu-install-all +++ b/sca-cpp/trunk/ubuntu/ubuntu-install-all @@ -339,7 +339,7 @@ curl -OL http://archive.apache.org/dist/incubator/thrift/0.2.0-incubating/thrift tar xzf thrift-0.2.0-incubating.tar.gz cd thrift-0.2.0 ./bootstrap.sh -./configure --prefix=$build/thrift-0.2.0-bin --with-java=no --with-erlang=no --with-perl=no --with-ruby=no --with-csharp=no --disable-static +./configure --prefix=$build/thrift-0.2.0-bin --with-java=no --with-erlang=no --with-py=no --with-perl=no --with-ruby=no --with-csharp=no --disable-static make make install if [ "$?" != "0" ]; then @@ -378,6 +378,18 @@ fi cp src/lib/libscribe.so $build/scribe-2.2-bin/lib cd $build +# Build Python +curl -OL http://www.python.org/ftp/python/2.6.6/Python-2.6.6.tgz +tar xzf Python-2.6.6.tgz +cd Python-2.6.6 +./configure --prefix=$build/python-2.6.6-bin --enable-shared +make +make install +if [ "$?" != "0" ]; then + exit $? +fi +cd $build + # Build Apache Libcloud curl -OL http://archive.apache.org/dist/incubator/libcloud/apache-libcloud-incubating-0.4.2.tar.bz2 tar xjf apache-libcloud-incubating-0.4.2.tar.bz2 @@ -410,7 +422,7 @@ cd $build git clone git://git.apache.org/tuscany-sca-cpp.git cd tuscany-sca-cpp ./bootstrap -./configure --prefix=$build/tuscany-sca-cpp-bin --with-curl=$build/curl-7.24.0-bin --with-apr=$build/apr-1.4.x-bin --with-httpd=$build/httpd-2.3.15-bin --with-memcached=$build/memcached-1.4.7-bin --with-tinycdb=$build/tinycdb-0.77-bin --with-js-include=$build/js-1.8.5-bin/include/js --with-js-lib=$build/js-1.8.5-bin/lib --enable-pagespeed --with-pagespeed=$build/page-speed-1.9-bin --enable-libcloud --with-libcloud=$build/libcloud-0.4.2-bin --enable-threads --enable-python --enable-gae --with-gae=$build/google_appengine --enable-java --with-java=/usr/lib/jvm/java-6-openjdk --enable-webservice --with-libxml2=$build/libxml2-2.7.7-bin --with-axis2c=$build/axis2c-1.6.0-bin --enable-queue --with-qpidc=$build/qpidc-0.6-bin --enable-chat --with-libstrophe=$build/libstrophe-bin --with-vysper=$build/vysper-0.6 --enable-sqldb --with-pgsql=$build/postgresql-9.1.2-bin --with-pgbouncer=$build/pgbouncer-1.5-bin --enable-log --with-thrift=$build/thrift-0.2.0-bin --with-scribe=$build/scribe-2.2-bin --enable-openid --with-mod-auth-openid=$build/mod-auth-openid-bin --enable-oauth --with-liboauth=$build/liboauth-0.9.1-bin --enable-mod-security --with-mod-security=$build/modsecurity-apache-2.6.1-bin +./configure --prefix=$build/tuscany-sca-cpp-bin --with-curl=$build/curl-7.24.0-bin --with-apr=$build/apr-1.4.x-bin --with-httpd=$build/httpd-2.3.15-bin --with-memcached=$build/memcached-1.4.7-bin --with-tinycdb=$build/tinycdb-0.77-bin --with-js-include=$build/js-1.8.5-bin/include/js --with-js-lib=$build/js-1.8.5-bin/lib --enable-pagespeed --with-pagespeed=$build/page-speed-1.9-bin --enable-libcloud --with-libcloud=$build/libcloud-0.4.2-bin --enable-threads --enable-python --with-python=$build/python-2.6.6-bin --enable-gae --with-gae=$build/google_appengine --enable-java --with-java=/usr/lib/jvm/java-6-openjdk --enable-webservice --with-libxml2=$build/libxml2-2.7.7-bin --with-axis2c=$build/axis2c-1.6.0-bin --enable-queue --with-qpidc=$build/qpidc-0.6-bin --enable-chat --with-libstrophe=$build/libstrophe-bin --with-vysper=$build/vysper-0.6 --enable-sqldb --with-pgsql=$build/postgresql-9.1.2-bin --with-pgbouncer=$build/pgbouncer-1.5-bin --enable-log --with-thrift=$build/thrift-0.2.0-bin --with-scribe=$build/scribe-2.2-bin --enable-openid --with-mod-auth-openid=$build/mod-auth-openid-bin --enable-oauth --with-liboauth=$build/liboauth-0.9.1-bin --enable-mod-security --with-mod-security=$build/modsecurity-apache-2.6.1-bin make make install if [ "$?" != "0" ]; then @@ -419,8 +431,8 @@ fi cd $build # Create src archive -tar czf tuscany-sca-cpp-all-1.0-src.tar.gz apache-libcloud-incubating-0.4.2 apache-libcloud-incubating-0.4.2.tar.bz2 apr-1.4.x apr-1.4.x-bin axis2c-1.6.0-bin axis2c-src-1.6.0 axis2c-src-1.6.0.tar.gz curl-7.24.0 curl-7.24.0-bin curl-7.24.0.tar.gz expat-2.0.1 expat-2.0.1-bin expat-2.0.1.tar.gz google_appengine google_appengine_1.4.0.zip htmltidy-bin httpd-2.3.15-beta httpd-2.3.15-beta.tar.gz httpd-2.3.15-bin js-1.8.5-bin js-1.8.5 js185-1.0.0.tar.gz libcloud-0.4.2-bin liboauth-0.9.1 liboauth-0.9.1-bin liboauth-0.9.1.tar.gz libopkele libopkele-bin libstrophe libstrophe-bin libxml2-2.7.7 libxml2-2.7.7-bin libxml2-sources-2.7.7.tar.gz memcached-1.4.7 memcached-1.4.7-bin memcached-1.4.7.tar.gz mod_auth_openid mod-auth-openid-bin modsecurity-apache_2.6.1 modsecurity-apache-2.6.1-bin modsecurity-apache_2.6.1.tar.gz modsecurity-crs_2.2.2 modsecurity-crs_2.2.2.tar.gz nspr-4.8.8-bin nspr-4.8.8 nspr-4.8.8.tar.gz nuvem page-speed-1.9 page-speed-1.9-bin page-speed-sdk.zip pgbouncer-1.5 pgbouncer-1.5-bin pgbouncer-1.5.tar.gz postgresql-9.1.2 postgresql-9.1.2-bin postgresql-9.1.2.tar.gz qpidc-0.6 qpidc-0.6-bin qpid-cpp-0.6.tar.gz scribe scribe-2.2-bin scribe-2.2.tar.gz thrift-0.2.0 thrift-0.2.0-bin thrift-0.2.0-incubating.tar.gz tidy tinycdb-0.77 tinycdb-0.77-bin tinycdb_0.77.tar.gz tuscany-sca-cpp tuscany-sca-cpp-bin vysper-0.6 vysper-0.6-bin.tar.gz +tar czf tuscany-sca-cpp-all-1.0-src.tar.gz apache-libcloud-incubating-0.4.2 apache-libcloud-incubating-0.4.2.tar.bz2 apr-1.4.x apr-1.4.x-bin axis2c-1.6.0-bin axis2c-src-1.6.0 axis2c-src-1.6.0.tar.gz curl-7.24.0 curl-7.24.0-bin curl-7.24.0.tar.gz expat-2.0.1 expat-2.0.1-bin expat-2.0.1.tar.gz google_appengine google_appengine_1.4.0.zip htmltidy-bin httpd-2.3.15-beta httpd-2.3.15-beta.tar.gz httpd-2.3.15-bin js-1.8.5-bin js-1.8.5 js185-1.0.0.tar.gz libcloud-0.4.2-bin liboauth-0.9.1 liboauth-0.9.1-bin liboauth-0.9.1.tar.gz libopkele libopkele-bin libstrophe libstrophe-bin libxml2-2.7.7 libxml2-2.7.7-bin libxml2-sources-2.7.7.tar.gz memcached-1.4.7 memcached-1.4.7-bin memcached-1.4.7.tar.gz mod_auth_openid mod-auth-openid-bin modsecurity-apache_2.6.1 modsecurity-apache-2.6.1-bin modsecurity-apache_2.6.1.tar.gz modsecurity-crs_2.2.2 modsecurity-crs_2.2.2.tar.gz nspr-4.8.8-bin nspr-4.8.8 nspr-4.8.8.tar.gz nuvem page-speed-1.9 page-speed-1.9-bin page-speed-sdk.zip pgbouncer-1.5 pgbouncer-1.5-bin pgbouncer-1.5.tar.gz postgresql-9.1.2 postgresql-9.1.2-bin postgresql-9.1.2.tar.gz qpidc-0.6 qpidc-0.6-bin qpid-cpp-0.6.tar.gz Python-2.6.6 python-2.6.6-bin Python-2.6.6.tgz scribe scribe-2.2-bin scribe-2.2.tar.gz thrift-0.2.0 thrift-0.2.0-bin thrift-0.2.0-incubating.tar.gz tidy tinycdb-0.77 tinycdb-0.77-bin tinycdb_0.77.tar.gz tuscany-sca-cpp tuscany-sca-cpp-bin vysper-0.6 vysper-0.6-bin.tar.gz # Create bin archive -tar czf tuscany-sca-cpp-all-1.0.tar.gz apr-1.4.x-bin axis2c-1.6.0-bin curl-7.24.0-bin expat-2.0.1-bin google_appengine htmltidy-bin httpd-2.3.15-bin js-1.8.5-bin libcloud-0.4.2-bin liboauth-0.9.1-bin libopkele-bin libstrophe-bin libxml2-2.7.7-bin memcached-1.4.7-bin mod-auth-openid-bin modsecurity-apache-2.6.1-bin nspr-4.8.8-bin nuvem/nuvem-parallel page-speed-1.9-bin postgresql-9.1.2-bin qpidc-0.6-bin scribe-2.2-bin thrift-0.2.0-bin tinycdb-0.77-bin tuscany-sca-cpp tuscany-sca-cpp-bin vysper-0.6 +tar czf tuscany-sca-cpp-all-1.0.tar.gz apr-1.4.x-bin axis2c-1.6.0-bin curl-7.24.0-bin expat-2.0.1-bin google_appengine htmltidy-bin httpd-2.3.15-bin js-1.8.5-bin libcloud-0.4.2-bin liboauth-0.9.1-bin libopkele-bin libstrophe-bin libxml2-2.7.7-bin memcached-1.4.7-bin mod-auth-openid-bin modsecurity-apache-2.6.1-bin nspr-4.8.8-bin nuvem/nuvem-parallel page-speed-1.9-bin postgresql-9.1.2-bin python-2.6.6-bin qpidc-0.6-bin scribe-2.2-bin thrift-0.2.0-bin tinycdb-0.77-bin tuscany-sca-cpp tuscany-sca-cpp-bin vysper-0.6 -- cgit v1.2.3