All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 01/11] Added the PR service.
  2011-05-27  6:31 [PATCH 00/11] Add PR service and integrate PKGV/PKGR from OE Lianhao Lu
@ 2011-05-27  6:31 ` Lianhao Lu
  2011-05-27  6:31 ` [PATCH 02/11] conf/bitbake.conf: Added variables for " Lianhao Lu
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 38+ messages in thread
From: Lianhao Lu @ 2011-05-27  6:31 UTC (permalink / raw)
  To: openembedded-core

Added the initial implementation of the server side PR service.

Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
---
 bitbake/bin/bitbake-prserv     |   53 +++++++++++
 bitbake/lib/prserv/__init__.py |   11 ++
 bitbake/lib/prserv/db.py       |  100 ++++++++++++++++++++
 bitbake/lib/prserv/serv.py     |  198 ++++++++++++++++++++++++++++++++++++++++
 4 files changed, 362 insertions(+), 0 deletions(-)
 create mode 100755 bitbake/bin/bitbake-prserv
 create mode 100644 bitbake/lib/prserv/__init__.py
 create mode 100644 bitbake/lib/prserv/db.py
 create mode 100644 bitbake/lib/prserv/serv.py

diff --git a/bitbake/bin/bitbake-prserv b/bitbake/bin/bitbake-prserv
new file mode 100755
index 0000000..14073ca
--- /dev/null
+++ b/bitbake/bin/bitbake-prserv
@@ -0,0 +1,53 @@
+#!/usr/bin/env python
+import os
+import sys,logging
+import optparse
+
+sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(__file__)),'lib'))
+
+import prserv
+import prserv.serv
+
+__version__="1.0.0"
+
+PRHOST_DEFAULT=''
+PRPORT_DEFAULT=8585
+
+def main():
+    parser = optparse.OptionParser(
+        version="Bitbake PR Service Core version %s, %%prog version %s" % (prserv.__version__, __version__),
+        usage = "%prog [options]")
+
+    parser.add_option("-f", "--file", help="database filename(default prserv.db)", action="store",
+                      dest="dbfile", type="string", default="prserv.db")
+    parser.add_option("-l", "--log", help="log filename(default prserv.log)", action="store",
+                      dest="logfile", type="string", default="prserv.log")
+    parser.add_option("--loglevel", help="logging level, i.e. CRITICAL, ERROR, WARNING, INFO, DEBUG",
+                      action = "store", type="string", dest="loglevel", default = "WARNING")
+    parser.add_option("--start", help="start daemon",
+                      action="store_true", dest="start", default="True")
+    parser.add_option("--stop", help="stop daemon",
+                      action="store_false", dest="start")
+    parser.add_option("--host", help="ip address to bind", action="store",
+                      dest="host", type="string", default=PRHOST_DEFAULT)
+    parser.add_option("--port", help="port number(default 8585)", action="store",
+                      dest="port", type="int", default=PRPORT_DEFAULT)
+
+    options, args = parser.parse_args(sys.argv)
+
+    prserv.init_logger(os.path.abspath(options.logfile),options.loglevel)
+
+    if options.start:
+        prserv.serv.start_daemon(options)
+    else:
+        prserv.serv.stop_daemon()
+
+if __name__ == "__main__":
+    try:
+        ret = main()
+    except Exception:
+        ret = 1
+        import traceback
+        traceback.print_exc(5)
+    sys.exit(ret)
+
diff --git a/bitbake/lib/prserv/__init__.py b/bitbake/lib/prserv/__init__.py
new file mode 100644
index 0000000..2837e13
--- /dev/null
+++ b/bitbake/lib/prserv/__init__.py
@@ -0,0 +1,11 @@
+__version__ = "1.0.0"
+
+import os, time
+import sys,logging
+
+def init_logger(logfile, loglevel):
+    numeric_level = getattr(logging, loglevel.upper(), None)
+    if not isinstance(numeric_level, int):
+        raise ValueError('Invalid log level: %s' % loglevel)
+    logging.basicConfig(level=numeric_level, filename=logfile)
+
diff --git a/bitbake/lib/prserv/db.py b/bitbake/lib/prserv/db.py
new file mode 100644
index 0000000..bbee931
--- /dev/null
+++ b/bitbake/lib/prserv/db.py
@@ -0,0 +1,100 @@
+import logging
+import os.path
+import errno
+import sys
+import warnings
+import sqlite3
+
+try:
+    import sqlite3
+except ImportError:
+    from pysqlite2 import dbapi2 as sqlite3
+
+sqlversion = sqlite3.sqlite_version_info
+if sqlversion[0] < 3 or (sqlversion[0] == 3 and sqlversion[1] < 3):
+    raise Exception("sqlite3 version 3.3.0 or later is required.")
+
+class NotFoundError(StandardError):
+    pass
+
+class PRTable():
+    def __init__(self,cursor,table):
+        self.cursor = cursor
+        self.table = table
+
+        #create the table
+        self._execute("CREATE TABLE IF NOT EXISTS %s \
+                    (version TEXT NOT NULL, \
+                    checksum TEXT NOT NULL, \
+                    value INTEGER, \
+                    PRIMARY KEY (version,checksum));"
+                      % table)
+
+    def _execute(self, *query):
+        """Execute a query, waiting to acquire a lock if necessary"""
+        count = 0
+        while True:
+            try:
+                return self.cursor.execute(*query)
+            except sqlite3.OperationalError as exc:
+                if 'database is locked' in str(exc) and count < 500:
+                    count = count + 1
+                    continue
+                raise
+            except sqlite3.IntegrityError as exc:
+                print "Integrity error %s" % str(exc)
+                break
+
+    def getValue(self, version, checksum):
+        data=self._execute("SELECT value FROM %s WHERE version=? AND checksum=?;" % self.table,
+                           (version,checksum))
+        row=data.fetchone()
+        if row != None:
+            return row[0]
+        else:
+            #no value found, try to insert
+            self._execute("INSERT INTO %s VALUES (?, ?, (select ifnull(max(value)+1,0) from %s where version=?));" 
+                           % (self.table,self.table),
+                           (version,checksum,version))
+            data=self._execute("SELECT value FROM %s WHERE version=? AND checksum=?;" % self.table,
+                               (version,checksum))
+            row=data.fetchone()
+            if row != None:
+                return row[0]
+            else:
+                raise NotFoundError
+
+class PRData(object):
+    """Object representing the PR database"""
+    def __init__(self, filename):
+        self.filename=os.path.abspath(filename)
+        #build directory hierarchy
+        try:
+            os.makedirs(os.path.dirname(self.filename))
+        except OSError as e:
+            if e.errno != errno.EEXIST:
+                raise e
+        self.connection=sqlite3.connect(self.filename, timeout=5,
+                                          isolation_level=None)
+        self.cursor=self.connection.cursor()
+        self._tables={}
+
+    def __del__(self):
+        print "PRData: closing DB %s" % self.filename
+        self.connection.close()
+
+    def __getitem__(self,tblname):
+        if not isinstance(tblname, basestring):
+            raise TypeError("tblname argument must be a string, not '%s'" %
+                            type(tblname))
+        if tblname in self._tables:
+            return self._tables[tblname]
+        else:
+            tableobj = self._tables[tblname] = PRTable(self.cursor, tblname)
+            return tableobj
+
+    def __delitem__(self, tblname):
+        if tblname in self._tables:
+            del self._tables[tblname]
+        logging.info("drop table %s" % (tblname))
+        self.cursor.execute("DROP TABLE IF EXISTS %s;" % tblname) 
diff --git a/bitbake/lib/prserv/serv.py b/bitbake/lib/prserv/serv.py
new file mode 100644
index 0000000..ecafe4f
--- /dev/null
+++ b/bitbake/lib/prserv/serv.py
@@ -0,0 +1,198 @@
+import os,sys,logging
+import signal,time, atexit
+from SimpleXMLRPCServer import SimpleXMLRPCServer, SimpleXMLRPCRequestHandler
+import xmlrpclib,sqlite3
+
+import bb.server.xmlrpc
+import prserv
+import prserv.db
+
+if sys.hexversion < 0x020600F0:
+    print("Sorry, python 2.6 or later is required.")
+    sys.exit(1)
+
+class Handler(SimpleXMLRPCRequestHandler):
+    def _dispatch(self,method,params):
+        try:
+            value=self.server.funcs[method](*params)
+        except:
+            import traceback
+            traceback.print_exc()
+            raise
+        return value
+
+class PRServer(SimpleXMLRPCServer):
+    pidfile="/tmp/PRServer.pid"
+    def __init__(self, dbfile, logfile, interface, daemon=True):
+        ''' constructor '''
+        SimpleXMLRPCServer.__init__(self, interface,
+                                    requestHandler=SimpleXMLRPCRequestHandler,
+                                    logRequests=False, allow_none=True)
+        self.dbfile=dbfile
+        self.daemon=daemon
+        self.logfile=logfile
+        self.host, self.port = self.socket.getsockname()
+        self.db=prserv.db.PRData(dbfile)
+        self.table=self.db["PRMAIN"]
+
+        self.register_function(self.getPR, "getPR")
+        self.register_function(self.quit, "quit")
+        self.register_function(self.ping, "ping")
+        self.register_introspection_functions()
+
+    def ping(self):
+        return not self.quit
+ 
+    def getPR(self, version, checksum):
+        try:
+            return self.table.getValue(version,checksum)
+        except prserv.NotFoundError:
+            logging.error("can not find value for (%s, %s)",version,checksum)
+            return None
+        except sqlite3.Error as exc:
+            logging.error(str(exc))
+            return None
+
+    def quit(self):
+        self.quit=True
+        return
+
+    def _serve_forever(self):
+        self.quit = False
+        self.timeout = 0.5
+        while not self.quit:
+            self.handle_request()
+
+        logging.info("PRServer: stopping...")
+        self.server_close()
+        return
+
+    def start(self):
+        if self.daemon is True:
+            logging.info("PRServer: starting daemon...")
+            self.daemonize()
+        else:
+            logging.info("PRServer: starting...")
+            self._serve_forever()
+
+    def delpid(self):
+        os.remove(PRServer.pidfile)
+
+    def daemonize(self):
+        """
+        See Advanced Programming in the UNIX, Sec 13.3
+        """
+        os.umask(0)
+
+        try:
+            pid = os.fork()
+            if pid > 0: 
+                sys.exit(0)
+        except OSError,e:
+            sys.stderr.write("1st fork failed: %d %s\n" % (e.errno, e.strerror))
+            sys.exit(1)
+
+        os.setsid()
+        """
+        fork again to make sure the daemon is not session leader, 
+        which prevents it from acquiring controlling terminal
+        """
+        try:
+            pid = os.fork()
+            if pid > 0: #parent
+                sys.exit(0)
+        except OSError,e:
+            sys.stderr.write("2nd fork failed: %d %s\n" % (e.errno, e.strerror))
+            sys.exit(1)
+
+        os.chdir("/")
+
+        sys.stdout.flush()
+        sys.stderr.flush()
+        si = file('/dev/null', 'r')
+        so = file(self.logfile, 'a+')
+        se = so
+        os.dup2(si.fileno(),sys.stdin.fileno())
+        os.dup2(so.fileno(),sys.stdout.fileno())
+        os.dup2(se.fileno(),sys.stderr.fileno())
+
+        # write pidfile
+        atexit.register(self.delpid)
+        pid = str(os.getpid()) 
+        pf = file(PRServer.pidfile, 'w+')
+        pf.write("%s\n" % pid)
+        pf.write("%s\n" % self.host)
+        pf.write("%s\n" % self.port)
+        pf.close()
+
+        self._serve_forever()
+
+class PRServerConnection():
+    def __init__(self, host, port):
+        self.connection = bb.server.xmlrpc._create_server(host, port)
+        self.host = host
+        self.port = port
+
+    def terminate(self):
+        # Don't wait for server indefinitely
+        import socket
+        socket.setdefaulttimeout(2)
+        try:
+            self.connection.quit()
+        except:
+            pass
+
+    def getPR(self, version, checksum):
+        return self.connection.getPR(version, checksum)
+
+    def ping(self):
+        return self.connection.ping()
+
+def start_daemon(options):
+    try:
+        pf = file(PRServer.pidfile,'r')
+        pid = int(pf.readline().strip())
+        pf.close()
+    except IOError:
+        pid = None
+
+    if pid:
+        sys.stderr.write("pidfile %s already exist. Daemon already running?\n"
+                            % PRServer.pidfile)
+        sys.exit(1)
+
+    server = PRServer(options.dbfile, interface=(options.host, options.port),
+                      logfile=os.path.abspath(options.logfile))
+    server.start()
+
+def stop_daemon():
+    try:
+        pf = file(PRServer.pidfile,'r')
+        pid = int(pf.readline().strip())
+        host = pf.readline().strip()
+        port = int(pf.readline().strip())
+        pf.close()
+    except IOError:
+        pid = None
+
+    if not pid:
+        sys.stderr.write("pidfile %s does not exist. Daemon not running?\n"
+                        % PRServer.pidfile)
+        sys.exit(1)
+
+    PRServerConnection(host,port).terminate()
+    time.sleep(0.5)
+
+    try:
+        while 1:
+            os.kill(pid,signal.SIGTERM)
+            time.sleep(0.1)
+    except OSError, err:
+        err = str(err)
+        if err.find("No such process") > 0:
+            if os.path.exists(PRServer.pidfile):
+                os.remove(PRServer.pidfile)
+        else:
+            print err
+            sys.exit(1)
+
-- 
1.7.0.4




^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH 02/11] conf/bitbake.conf: Added variables for PR service.
  2011-05-27  6:31 [PATCH 00/11] Add PR service and integrate PKGV/PKGR from OE Lianhao Lu
  2011-05-27  6:31 ` [PATCH 01/11] Added the PR service Lianhao Lu
@ 2011-05-27  6:31 ` Lianhao Lu
  2011-05-27  6:31 ` [PATCH 03/11] meta-yocto/local.conf.sample: Added PRSERV_HOST and PRSERV_PORT Lianhao Lu
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 38+ messages in thread
From: Lianhao Lu @ 2011-05-27  6:31 UTC (permalink / raw)
  To: openembedded-core

1. change BB_SIGNATURE_HANDLER from basic to basichash.

2. Added following variables for PR service:
USE_PR_SERV: flag of whether to use the network PR service
PRAUTOINX: search index for the network PR service
PKGE/PKGV/PKGR: epoch, version and revision used in package feed.
EXTENDPKGV: full package version string used in package relationships.

Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
---
 meta/conf/bitbake.conf |   23 +++++++++++++++++++----
 1 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index d307385..4fcf4f6 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -153,9 +153,18 @@ PR = "${@bb.parse.BBHandler.vars_from_file(bb.data.getVar('FILE',d),d)[2] or 'r0
 PF = "${PN}-${EXTENDPE}${PV}-${PR}"
 EXTENDPE = "${@['','${PE\x7d_'][bb.data.getVar('PE',d,1) > 0]}"
 EXTENDPEVER = "${@['','${PE\x7d:'][bb.data.getVar('PE',d,1) > 0]}"
-EXTENDPV = "${EXTENDPEVER}${PV}-${PR}"
+EXTENDPV = "${EXTENDPEVER}${PV}-${PR}{DISTRO_PR}"
 P = "${PN}-${PV}"
 
+EXTENDPRAUTO = "${@['.${PRAUTO\x7d',''][bb.data.getVar('PRAUTO',d,1) is None]}"
+PRAUTOINX = "${PF}${DISTRO_PR}"
+
+PKGV ?= "${PV}"
+PKGR ?= "${PR}${DISTRO_PR}${EXTENDPRAUTO}"
+PKGE ?= "${@['','${PE\x7d'][bb.data.getVar('PE',d,1) > 0]}"
+EXTENDPKGEVER = "${@['','${PKGE\x7d:'][bb.data.getVar('PKGE',d,1).strip() != '']}"
+EXTENDPKGV ?= "${EXTENDPKGEVER}${PKGV}-${PKGR}"
+
 # Base package name
 # Automatically derives "foo" from "foo-native", "foo-cross" or "foo-initial"
 # otherwise it is the same as PN and P
@@ -163,6 +172,11 @@ SPECIAL_PKGSUFFIX = "-native -cross -initial -intermediate -nativesdk -crosssdk
 BPN = "${@base_prune_suffix(bb.data.getVar('PN', d, True), bb.data.getVar('SPECIAL_PKGSUFFIX', d, True).split(), d)}"
 BP = "${BPN}-${PV}"
 
+#
+# network based PR service
+#
+USE_PR_SERV = "${@[1,0][(bb.data.getVar('PRSERV_HOST',d,1) is None) or (bb.data.getVar('PRSERV_PORT',d,1) is None)]}"
+
 # Package info.
 
 SECTION = "base"
@@ -241,7 +255,7 @@ FILES_${PN}-dev = "${includedir} ${libdir}/lib*${SOLIBSDEV} ${libdir}/*.la \
                 ${base_libdir}/*.a ${base_libdir}/*.o"
 SECTION_${PN}-dev = "devel"
 ALLOW_EMPTY_${PN}-dev = "1"
-RDEPENDS_${PN}-dev = "${PN} (= ${EXTENDPV})"
+RDEPENDS_${PN}-dev = "${PN} (= ${EXTENDPKGV})"
 
 DOTDEBUG-dbg = "${bindir}/.debug ${sbindir}/.debug ${libexecdir}/.debug ${libdir}/.debug \
             ${base_bindir}/.debug ${base_sbindir}/.debug ${base_libdir}/.debug ${libdir}/${PN}/.debug \
@@ -253,7 +267,7 @@ FILES_${PN}-dbg = "${@bb.data.getVar(['DOTDEBUG-dbg', 'DEBUGFILEDIRECTORY-dbg'][
 
 SECTION_${PN}-dbg = "devel"
 ALLOW_EMPTY_${PN}-dbg = "1"
-RRECOMMENDS_${PN}-dbg = "${PN} (= ${EXTENDPV})"
+RRECOMMENDS_${PN}-dbg = "${PN} (= ${EXTENDPKGV})"
 
 FILES_${PN}-locale = "${datadir}/locale"
 
@@ -650,6 +664,7 @@ PCMCIA_MANAGER ?= "pcmcia-cs"
 DEFAULT_TASK_PROVIDER ?= "task-base"
 MACHINE_TASK_PROVIDER ?= "${DEFAULT_TASK_PROVIDER}"
 IMAGE_ROOTFS_SIZE ?= "65536"
+DISTRO_PR ?= ''
 
 # Forcefully set CACHE now so future changes to things like 
 # MACHINE don't change the path to the cache
@@ -708,7 +723,7 @@ DISTRO[unexport] = "1"
 TRANSLATED_TARGET_ARCH ??= ${TARGET_ARCH}
 
 # Setup our default hash policy
-BB_SIGNATURE_HANDLER ?= "basic"
+BB_SIGNATURE_HANDLER ?= "basichash"
 BB_HASHTASK_WHITELIST ?= "(.*-cross$|.*-native$|.*-cross-initial$|.*-cross-intermediate$|^virtual:native:.*|^virtual:nativesdk:.*)"
 BB_HASHBASE_WHITELIST ?= "TMPDIR FILE PATH PWD BB_TASKHASH BBPATH DL_DIR SSTATE_DIR THISDIR FILESEXTRAPATHS FILE_DIRNAME HOME LOGNAME SHELL TERM USER FILESPATH USERNAME STAGING_DIR_HOST STAGING_DIR_TARGET COREBASE"
 
-- 
1.7.0.4




^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH 03/11] meta-yocto/local.conf.sample: Added PRSERV_HOST and PRSERV_PORT.
  2011-05-27  6:31 [PATCH 00/11] Add PR service and integrate PKGV/PKGR from OE Lianhao Lu
  2011-05-27  6:31 ` [PATCH 01/11] Added the PR service Lianhao Lu
  2011-05-27  6:31 ` [PATCH 02/11] conf/bitbake.conf: Added variables for " Lianhao Lu
@ 2011-05-27  6:31 ` Lianhao Lu
  2011-05-27  6:31 ` [PATCH 04/11] classes/package(prserv).bbclass: Get PRAUTO and use PKGV/PKGR Lianhao Lu
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 38+ messages in thread
From: Lianhao Lu @ 2011-05-27  6:31 UTC (permalink / raw)
  To: openembedded-core

Setting PRSERV_HOST and PRSERV_PORT would trigger the poky to use remote
PR network service. Leaving them unset allow the user to build image
without the PR network service

Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
---
 meta-yocto/conf/local.conf.sample |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/meta-yocto/conf/local.conf.sample b/meta-yocto/conf/local.conf.sample
index a9b4998..359e510 100644
--- a/meta-yocto/conf/local.conf.sample
+++ b/meta-yocto/conf/local.conf.sample
@@ -216,3 +216,8 @@ NO32LIBS = "1"
 # GNOME, SCREEN, XTERM and KONSOLE
 #TERMCMD = "${KONSOLE_TERMCMD}"
 #TERMCMDRUN = "${KONSOLE_TERMCMDRUN}"
+
+
+# The network based PR service host and port
+#PRSERV_HOST = "localhost"
+#PRSERV_PORT = "8585"
-- 
1.7.0.4




^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH 00/11] Add PR service and integrate PKGV/PKGR from OE
@ 2011-05-27  6:31 Lianhao Lu
  2011-05-27  6:31 ` [PATCH 01/11] Added the PR service Lianhao Lu
                   ` (11 more replies)
  0 siblings, 12 replies; 38+ messages in thread
From: Lianhao Lu @ 2011-05-27  6:31 UTC (permalink / raw)
  To: openembedded-core

This is a modification of the original patch to enable network based PR service. 

The main difference between this series of patch to the original one is that 
this one uses the PKGR/PKGV during the package feed creation, and use EXTENDPKGV 
instead of EXTENDPV for package dependencies.

It also made the PR service disabled by default(by leaving the PRSERV_HOST and 
PRSERV_PORT commented out) and revised some function names.

The following features from the previous patch comments are not included in this 
series:
1) automatically launch PR service in localhost use case.
2) respect OVERIDE to allow setting PRSERV_HOST/PORT per recipe basis
3) write permission control in the PR service.
4) way to sync up local PR database witht the central server.
5) added proxy support for PR service.

I'll continue to work on some of those features. But I'd like to send this patch 
now to meet the schedule time window, and anyone interested can experiment and 
provide some comments.

Below is the excerpt from my last series of patch.
---------------BEGIN of last patch message------------------------------------
This series of 5 patches implemented the network based PR service and enabled 
the poky to use it during the task do_package and do_package_write_xxx. By 
using the network based PR service and the basichash for BB_SIGNATURE_HANDLER, 
the poky user may not need to bump the PR manually everytime he/she changes 
the recipe. The package will get automatically rebuilt and new revision number 
reflecting the change will be included in the package feed.

The first patch "[PATCH 1/5] Added the PR service." implemented the network 
based PR service on the server side. It is a XMLRPC server with the sqlite3 
as the backend database. The users query an automated value from this service 
by giving  a tuple of (version, checksum). The returned value will 
be used as a part of the package revision value during the package feed 
creation process. The following algorihtm is used so this PR service could give 
multiple build servers new values for the new index tuple and same values for 
the same index tuple:

IF the index tuple(version, checksum) is found,  THEN
    return the value.
ELSE 
    find the max value in the database with the same version. 
    increment it and save it into the database along with the index tuple.
    return the incremented value. 
    (Note: If no matching version is found, save and return the value of 0).
ENDIF
 
To start the network based PR service daemon, run the following command after 
"sourcing" the environment file oe-init-build-env:

  bitbake-prserv --start

See bitbake-prserv --help to see a detailed description of the options.

The remaining 4 patches enable the poky to use the PR service. In order to use 
it, the user needs to set 2 varialbes of PRSERV_HOST and PRSERV_PORT (which 
specify the PR service ip address and port, default is "localhost" and "8585" 
respectively) in the file conf/local.conf under the building directory. 
Leaving these 2 variables commented out would disable the poky to use the PR 
service, so the poky would behave exactly like what is now.
------------------END of last patch message----------------------------------

The following changes since commit 9bccbc5fbc71b331911b558a2ba15e0a6d0046b4:
  Nitin A Kamble (1):
        tcmode-default: workaround for gcc 4.6.0 failure on beagleboard

are available in the git repository at:

  git://git.pokylinux.org/poky-contrib llu/PR-service
  http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=llu/PR-service

Lianhao Lu (11):
  Added the PR service.
  conf/bitbake.conf: Added variables for PR service.
  meta-yocto/local.conf.sample: Added PRSERV_HOST and PRSERV_PORT.
  classes/package(prserv).bbclass: Get PRAUTO and use PKGV/PKGR.
  classes/package_xxx.class: Use PKGE/PKGV/PKGR.
  udev: use EXTENDPKGV instead of EXTENDPV.
  xcb: use EXTENDPKGV instead of EXTENDPV.
  xorg-proto: use EXTENDPKGV instead of EXTENDPV.
  xorg-util/util-macros: use EXTENDPKGV instead of EXTENDPV.
  linux-libc-headers: use EXTENDPKGV instead of EXTENDPV.
  conf/bitbake.conf: Removed EXTENDPV and EXTENDPEVER.

 bitbake/bin/bitbake-prserv                         |   53 ++++++
 bitbake/lib/prserv/__init__.py                     |   11 +
 bitbake/lib/prserv/db.py                           |  100 ++++++++++
 bitbake/lib/prserv/serv.py                         |  198 ++++++++++++++++++++
 meta-yocto/conf/local.conf.sample                  |    5 +
 meta/classes/package.bbclass                       |   51 ++++--
 meta/classes/package_deb.bbclass                   |    8 +-
 meta/classes/package_ipk.bbclass                   |    8 +-
 meta/classes/package_rpm.bbclass                   |   14 +-
 meta/classes/package_tar.bbclass                   |    4 +-
 meta/classes/prserv.bbclass                        |   29 +++
 meta/conf/bitbake.conf                             |   23 ++-
 meta/recipes-core/udev/udev-new.inc                |    2 +-
 meta/recipes-graphics/xcb/libpthread-stubs_0.3.bb  |    2 +-
 meta/recipes-graphics/xcb/xcb-proto.inc            |    2 +-
 .../xorg-proto/xorg-proto-common.inc               |    2 +-
 .../xorg-util/util-macros_1.13.0.bb                |    2 +-
 .../linux-libc-headers/linux-libc-headers.inc      |    2 +-
 18 files changed, 473 insertions(+), 43 deletions(-)
 create mode 100755 bitbake/bin/bitbake-prserv
 create mode 100644 bitbake/lib/prserv/__init__.py
 create mode 100644 bitbake/lib/prserv/db.py
 create mode 100644 bitbake/lib/prserv/serv.py
 create mode 100644 meta/classes/prserv.bbclass




^ permalink raw reply	[flat|nested] 38+ messages in thread

* [PATCH 04/11] classes/package(prserv).bbclass: Get PRAUTO and use PKGV/PKGR.
  2011-05-27  6:31 [PATCH 00/11] Add PR service and integrate PKGV/PKGR from OE Lianhao Lu
                   ` (2 preceding siblings ...)
  2011-05-27  6:31 ` [PATCH 03/11] meta-yocto/local.conf.sample: Added PRSERV_HOST and PRSERV_PORT Lianhao Lu
@ 2011-05-27  6:31 ` Lianhao Lu
  2011-05-27  6:31 ` [PATCH 05/11] classes/package_xxx.class: Use PKGE/PKGV/PKGR Lianhao Lu
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 38+ messages in thread
From: Lianhao Lu @ 2011-05-27  6:31 UTC (permalink / raw)
  To: openembedded-core

1. Added package_get_auto_pr to PACKAGEFUNCS to get the auto
incremented value(PRAUTO) from remote PR service.

2. use PKGV/PKGR for pkgdata which will be used by package_write_xxx.

3. Added supporting functions in prserv.bbclass.

Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
---
 meta/classes/package.bbclass |   51 +++++++++++++++++++++++++++++------------
 meta/classes/prserv.bbclass  |   29 +++++++++++++++++++++++
 2 files changed, 65 insertions(+), 15 deletions(-)
 create mode 100644 meta/classes/prserv.bbclass

diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 2c6d30c..a1b9482 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -7,34 +7,37 @@
 #
 # There are the following default steps but PACKAGEFUNCS can be extended:
 #
-# a) perform_packagecopy - Copy D into PKGD
+# a) package_get_auto_pr - get PRAUTO from remote PR service
 #
-# b) package_do_split_locales - Split out the locale files, updates FILES and PACKAGES
+# b) perform_packagecopy - Copy D into PKGD
 #
-# c) split_and_strip_files - split the files into runtime and debug and strip them.
+# c) package_do_split_locales - Split out the locale files, updates FILES and PACKAGES
+#
+# d) split_and_strip_files - split the files into runtime and debug and strip them.
 #    Debug files include debug info split, and associated sources that end up in -dbg packages
 #
-# d) populate_packages - Split the files in PKGD into separate packages in PKGDEST/<pkgname>
+# e) populate_packages - Split the files in PKGD into separate packages in PKGDEST/<pkgname>
 #    Also triggers the binary stripping code to put files in -dbg packages.
 #
-# e) package_do_filedeps - Collect perfile run-time dependency metadata
+# f) package_do_filedeps - Collect perfile run-time dependency metadata
 #    The data is stores in FILER{PROVIDES,DEPENDS}_file_pkg variables with
 #    a list of affected files in FILER{PROVIDES,DEPENDS}FLIST_pkg
 #
-# f) package_do_shlibs - Look at the shared libraries generated and autotmatically add any 
+# g) package_do_shlibs - Look at the shared libraries generated and autotmatically add any 
 #    depenedencies found. Also stores the package name so anyone else using this library 
 #    knows which package to depend on.
 #
-# g) package_do_pkgconfig - Keep track of which packages need and provide which .pc files
+# h) package_do_pkgconfig - Keep track of which packages need and provide which .pc files
 #
-# h) read_shlibdeps - Reads the stored shlibs information into the metadata
+# i) read_shlibdeps - Reads the stored shlibs information into the metadata
 #
-# i) package_depchains - Adds automatic dependencies to -dbg and -dev packages
+# j) package_depchains - Adds automatic dependencies to -dbg and -dev packages
 #
-# j) emit_pkgdata - saves the packaging data into PKGDATA_DIR for use in later 
+# k) emit_pkgdata - saves the packaging data into PKGDATA_DIR for use in later 
 #    packaging steps
 
 inherit packagedata
+inherit prserv
 
 PKGD    = "${WORKDIR}/package"
 PKGDEST = "${WORKDIR}/packages-split"
@@ -326,6 +329,15 @@ def runtime_mapping_rename (varname, d):
 # Package functions suitable for inclusion in PACKAGEFUNCS
 #
 
+python package_get_auto_pr() {
+	if d.getVar('USE_PR_SERV', True):
+		auto_pr=prserv_get_pr_auto(d)
+		if auto_pr is None:
+			bb.fatal("Can NOT get auto PR revision from remote PR service")
+			return
+		d.setVar('PRAUTO',str(auto_pr))
+}
+
 python package_do_split_locales() {
 	if (bb.data.getVar('PACKAGE_NO_LOCALE', d, True) == '1'):
 		bb.debug(1, "package requested not splitting locales")
@@ -773,6 +785,8 @@ python emit_pkgdata() {
 		write_if_exists(sf, pkg, 'PN')
 		write_if_exists(sf, pkg, 'PV')
 		write_if_exists(sf, pkg, 'PR')
+		write_if_exists(sf, pkg, 'PKGV')
+		write_if_exists(sf, pkg, 'PKGR')
 		write_if_exists(sf, pkg, 'DESCRIPTION')
 		write_if_exists(sf, pkg, 'SUMMARY')
 		write_if_exists(sf, pkg, 'RDEPENDS')
@@ -911,9 +925,9 @@ python package_do_shlibs() {
 
 	workdir = bb.data.getVar('WORKDIR', d, True)
 
-	ver = bb.data.getVar('PV', d, True)
+	ver = bb.data.getVar('PKGV', d, True)
 	if not ver:
-		bb.error("PV not defined")
+		bb.error("PKGV not defined")
 		return
 
 	pkgdest = bb.data.getVar('PKGDEST', d, True)
@@ -1025,6 +1039,12 @@ python package_do_shlibs() {
 		needs_ldconfig = False
 		bb.debug(2, "calculating shlib provides for %s" % pkg)
 
+		pkgver = bb.data.getVar('PKGV_' + pkg, d, True)
+		if not pkgver:
+			pkgver = bb.data.getVar('PV_' + pkg, d, True)
+		if not pkgver:
+			pkgver = ver
+
 		needed[pkg] = []
 		sonames = list()
 		renames = list()
@@ -1048,10 +1068,10 @@ python package_do_shlibs() {
 			fd = open(shlibs_file, 'w')
 			for s in sonames:
 				fd.write(s + '\n')
-				shlib_provider[s] = (pkg, ver)
+				shlib_provider[s] = (pkg, pkgver)
 			fd.close()
 			fd = open(shver_file, 'w')
-			fd.write(ver + '\n')
+			fd.write(pkgver + '\n')
 			fd.close()
 		if needs_ldconfig and use_ldconfig:
 			bb.debug(1, 'adding ldconfig call to postinst for %s' % pkg)
@@ -1348,7 +1368,8 @@ python package_depchains() {
 }
 
 PACKAGE_PREPROCESS_FUNCS ?= ""
-PACKAGEFUNCS ?= "perform_packagecopy \
+PACKAGEFUNCS ?= "package_get_auto_pr \	
+                perform_packagecopy \
                 ${PACKAGE_PREPROCESS_FUNCS} \
 		package_do_split_locales \
 		split_and_strip_files \
diff --git a/meta/classes/prserv.bbclass b/meta/classes/prserv.bbclass
new file mode 100644
index 0000000..de46ff6
--- /dev/null
+++ b/meta/classes/prserv.bbclass
@@ -0,0 +1,29 @@
+def prserv_make_conn(d):
+    import prserv.serv
+    host=d.getVar("PRSERV_HOST",True)
+    port=d.getVar("PRSERV_PORT",True)
+    try:
+        conn=None
+        conn=prserv.serv.PRServerConnection(host,int(port))
+        d.setVar("__PRSERV_CONN",conn)
+    except Exception, exc:
+        bb.fatal("Connecting to PR service %s:%s failed: %s" % (host, port, str(exc)))
+
+    return conn
+
+def prserv_get_pr_auto(d):
+    if not d.getVar('USE_PR_SERV', True):
+        bb.warn("Not using network based PR service")
+        return None
+
+    conn=d.getVar("__PRSERV_CONN", True)
+    if conn is None:
+        conn=prserv_make_conn(d)
+        if conn is None:
+            return None
+
+    version=d.getVar("PF", True)
+    checksum=d.getVar("BB_TASKHASH", True)
+    auto_rev=conn.getPR(version,checksum)
+    bb.debug(1,"prserv_get_pr_auto: version: %s checksum: %s result %d" % (version, checksum, auto_rev))
+    return auto_rev
-- 
1.7.0.4




^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH 05/11] classes/package_xxx.class: Use PKGE/PKGV/PKGR.
  2011-05-27  6:31 [PATCH 00/11] Add PR service and integrate PKGV/PKGR from OE Lianhao Lu
                   ` (3 preceding siblings ...)
  2011-05-27  6:31 ` [PATCH 04/11] classes/package(prserv).bbclass: Get PRAUTO and use PKGV/PKGR Lianhao Lu
@ 2011-05-27  6:31 ` Lianhao Lu
  2011-05-27  6:31 ` [PATCH 06/11] udev: use EXTENDPKGV instead of EXTENDPV Lianhao Lu
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 38+ messages in thread
From: Lianhao Lu @ 2011-05-27  6:31 UTC (permalink / raw)
  To: openembedded-core

Use PKGE/PKGV/PKGR to build various package feed in tasks of pacakge_write_xxx.

Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
---
 meta/classes/package_deb.bbclass |    8 ++++----
 meta/classes/package_ipk.bbclass |    8 ++++----
 meta/classes/package_rpm.bbclass |   14 +++++++-------
 meta/classes/package_tar.bbclass |    4 ++--
 4 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/meta/classes/package_deb.bbclass b/meta/classes/package_deb.bbclass
index 000d9ee..fb502cb 100644
--- a/meta/classes/package_deb.bbclass
+++ b/meta/classes/package_deb.bbclass
@@ -272,7 +272,7 @@ python do_package_deb () {
         except ValueError:
             pass
         if not g and bb.data.getVar('ALLOW_EMPTY', localdata) != "1":
-            bb.note("Not creating empty archive for %s-%s-%s" % (pkg, bb.data.getVar('PV', localdata, True), bb.data.getVar('PR', localdata, True)))
+            bb.note("Not creating empty archive for %s-%s-%s" % (pkg, bb.data.getVar('PKGV', localdata, True), bb.data.getVar('PKGR', localdata, True)))
             bb.utils.unlockfile(lf)
             continue
 
@@ -288,11 +288,11 @@ python do_package_deb () {
             raise bb.build.FuncFailed("unable to open control file for writing.")
 
         fields = []
-        pe = bb.data.getVar('PE', d, True)
+        pe = bb.data.getVar('PKGE', d, True)
         if pe and int(pe) > 0:
-            fields.append(["Version: %s:%s-%s\n", ['PE', 'PV', 'PR']])
+            fields.append(["Version: %s:%s-%s\n", ['PKGE', 'PKGV', 'PKGR']])
         else:
-            fields.append(["Version: %s-%s\n", ['PV', 'PR']])
+            fields.append(["Version: %s-%s\n", ['PKGV', 'PKGR']])
         fields.append(["Description: %s\n", ['DESCRIPTION']])
         fields.append(["Section: %s\n", ['SECTION']])
         fields.append(["Priority: %s\n", ['PRIORITY']])
diff --git a/meta/classes/package_ipk.bbclass b/meta/classes/package_ipk.bbclass
index a3dfc73..4317028 100644
--- a/meta/classes/package_ipk.bbclass
+++ b/meta/classes/package_ipk.bbclass
@@ -241,7 +241,7 @@ python do_package_ipk () {
 		except ValueError:
 			pass
 		if not g and bb.data.getVar('ALLOW_EMPTY', localdata) != "1":
-			bb.note("Not creating empty archive for %s-%s-%s" % (pkg, bb.data.getVar('PV', localdata, 1), bb.data.getVar('PR', localdata, 1)))
+			bb.note("Not creating empty archive for %s-%s-%s" % (pkg, bb.data.getVar('PKGV', localdata, 1), bb.data.getVar('PKGR', localdata, 1)))
 			bb.utils.unlockfile(lf)
 			continue
 
@@ -254,11 +254,11 @@ python do_package_ipk () {
 			raise bb.build.FuncFailed("unable to open control file for writing.")
 
 		fields = []
-		pe = bb.data.getVar('PE', d, 1)
+		pe = bb.data.getVar('PKGE', d, 1)
 		if pe and int(pe) > 0:
-			fields.append(["Version: %s:%s-%s\n", ['PE', 'PV', 'PR']])
+			fields.append(["Version: %s:%s-%s\n", ['PKGE', 'PKGV', 'PKGR']])
 		else:
-			fields.append(["Version: %s-%s\n", ['PV', 'PR']])
+			fields.append(["Version: %s-%s\n", ['PKGV', 'PKGR']])
 		fields.append(["Description: %s\n", ['DESCRIPTION']])
 		fields.append(["Section: %s\n", ['SECTION']])
 		fields.append(["Priority: %s\n", ['PRIORITY']])
diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index 1d8c686..3df66cc 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -330,7 +330,7 @@ python write_specfile () {
 				if dep and ver:
 					if '-' in ver:
 						subd = oe.packagedata.read_subpkgdata_dict(dep, d)
-						pv = subd['PV']
+						pv = subd['PKGV']
 						reppv = pv.replace('-', '+')
 						ver = ver.replace(pv, reppv)
 				newdeps_dict[dep] = ver
@@ -383,9 +383,9 @@ python write_specfile () {
 	# Construct the SPEC file...
 	srcname    = bb.data.getVar('PN', d, True)
 	srcsummary = (bb.data.getVar('SUMMARY', d, True) or bb.data.getVar('DESCRIPTION', d, True) or ".")
-	srcversion = bb.data.getVar('PV', d, True).replace('-', '+')
-	srcrelease = bb.data.getVar('PR', d, True)
-	srcepoch   = (bb.data.getVar('PE', d, True) or "")
+	srcversion = bb.data.getVar('PKGV', d, True).replace('-', '+')
+	srcrelease = bb.data.getVar('PKGR', d, True)
+	srcepoch   = (bb.data.getVar('PKGE', d, True) or "")
 	srclicense = bb.data.getVar('LICENSE', d, True)
 	srcsection = bb.data.getVar('SECTION', d, True)
 	srcmaintainer  = bb.data.getVar('MAINTAINER', d, True)
@@ -438,9 +438,9 @@ python write_specfile () {
 		splitname    = pkgname
 
 		splitsummary = (bb.data.getVar('SUMMARY', localdata, True) or bb.data.getVar('DESCRIPTION', localdata, True) or ".")
-		splitversion = (bb.data.getVar('PV', localdata, True) or "").replace('-', '+')
-		splitrelease = (bb.data.getVar('PR', localdata, True) or "")
-		splitepoch   = (bb.data.getVar('PE', localdata, True) or "")
+		splitversion = (bb.data.getVar('PKGV', localdata, True) or "").replace('-', '+')
+		splitrelease = (bb.data.getVar('PKGR', localdata, True) or "")
+		splitepoch   = (bb.data.getVar('PKGE', localdata, True) or "")
 		splitlicense = (bb.data.getVar('LICENSE', localdata, True) or "")
 		splitsection = (bb.data.getVar('SECTION', localdata, True) or "")
 		splitdescription = (bb.data.getVar('DESCRIPTION', localdata, True) or ".")
diff --git a/meta/classes/package_tar.bbclass b/meta/classes/package_tar.bbclass
index e546eb7..a806e45 100644
--- a/meta/classes/package_tar.bbclass
+++ b/meta/classes/package_tar.bbclass
@@ -3,7 +3,7 @@ inherit package
 IMAGE_PKGTYPE ?= "tar"
 
 python package_tar_fn () {
-	fn = os.path.join(bb.data.getVar('DEPLOY_DIR_TAR', d), "%s-%s-%s.tar.gz" % (bb.data.getVar('PKG', d), bb.data.getVar('PV', d), bb.data.getVar('PR', d)))
+	fn = os.path.join(bb.data.getVar('DEPLOY_DIR_TAR', d), "%s-%s-%s.tar.gz" % (bb.data.getVar('PKG', d), bb.data.getVar('PKGV', d), bb.data.getVar('PKGR', d)))
 	fn = bb.data.expand(fn, d)
 	bb.data.setVar('PKGFN', fn, d)
 }
@@ -83,7 +83,7 @@ python do_package_tar () {
 		os.chdir(root)
 		from glob import glob
 		if not glob('*'):
-			bb.note("Not creating empty archive for %s-%s-%s" % (pkg, bb.data.getVar('PV', localdata, 1), bb.data.getVar('PR', localdata, 1)))
+			bb.note("Not creating empty archive for %s-%s-%s" % (pkg, bb.data.getVar('PKGV', localdata, 1), bb.data.getVar('PKGR', localdata, 1)))
 			continue
 		ret = os.system("tar -czf %s %s" % (tarfn, '.'))
 		if ret != 0:
-- 
1.7.0.4




^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH 06/11] udev: use EXTENDPKGV instead of EXTENDPV.
  2011-05-27  6:31 [PATCH 00/11] Add PR service and integrate PKGV/PKGR from OE Lianhao Lu
                   ` (4 preceding siblings ...)
  2011-05-27  6:31 ` [PATCH 05/11] classes/package_xxx.class: Use PKGE/PKGV/PKGR Lianhao Lu
@ 2011-05-27  6:31 ` Lianhao Lu
  2011-05-27  6:31 ` [PATCH 07/11] xcb: " Lianhao Lu
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 38+ messages in thread
From: Lianhao Lu @ 2011-05-27  6:31 UTC (permalink / raw)
  To: openembedded-core

Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
---
 meta/recipes-core/udev/udev-new.inc |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/meta/recipes-core/udev/udev-new.inc b/meta/recipes-core/udev/udev-new.inc
index d1abf39..1b94f1b 100644
--- a/meta/recipes-core/udev/udev-new.inc
+++ b/meta/recipes-core/udev/udev-new.inc
@@ -13,7 +13,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe \
 DEPENDS = "acl glib-2.0 libusb usbutils pciutils linux-libc-headers gperf-native libxslt-native"
 RPROVIDES_${PN} = "hotplug"
 RRECOMMENDS_${PN} += "udev-extraconf udev-cache usbutils-ids pciutils-ids"
-RDEPENDS_libudev = "${PN} (= ${EXTENDPV})"
+RDEPENDS_libudev = "${PN} (= ${EXTENDPKGV})"
 
 SRC_URI = "${KERNELORG_MIRROR}/linux/utils/kernel/hotplug/udev-${PV}.tar.gz \
            file://run.rules \
-- 
1.7.0.4




^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH 07/11] xcb: use EXTENDPKGV instead of EXTENDPV.
  2011-05-27  6:31 [PATCH 00/11] Add PR service and integrate PKGV/PKGR from OE Lianhao Lu
                   ` (5 preceding siblings ...)
  2011-05-27  6:31 ` [PATCH 06/11] udev: use EXTENDPKGV instead of EXTENDPV Lianhao Lu
@ 2011-05-27  6:31 ` Lianhao Lu
  2011-05-27  6:31 ` [PATCH 08/11] xorg-proto: " Lianhao Lu
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 38+ messages in thread
From: Lianhao Lu @ 2011-05-27  6:31 UTC (permalink / raw)
  To: openembedded-core

Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
---
 meta/recipes-graphics/xcb/libpthread-stubs_0.3.bb |    2 +-
 meta/recipes-graphics/xcb/xcb-proto.inc           |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/meta/recipes-graphics/xcb/libpthread-stubs_0.3.bb b/meta/recipes-graphics/xcb/libpthread-stubs_0.3.bb
index 038c00f..40c47da 100644
--- a/meta/recipes-graphics/xcb/libpthread-stubs_0.3.bb
+++ b/meta/recipes-graphics/xcb/libpthread-stubs_0.3.bb
@@ -20,4 +20,4 @@ SRC_URI[sha256sum] = "35b6d54e3cc6f3ba28061da81af64b9a92b7b757319098172488a660e3
 inherit autotools pkgconfig
 
 RDEPENDS_${PN}-dev = ""
-RRECOMMENDS_${PN}-dbg = "${PN}-dev (= ${EXTENDPV})"
+RRECOMMENDS_${PN}-dbg = "${PN}-dev (= ${EXTENDPKGV})"
diff --git a/meta/recipes-graphics/xcb/xcb-proto.inc b/meta/recipes-graphics/xcb/xcb-proto.inc
index ae40282..d511341 100644
--- a/meta/recipes-graphics/xcb/xcb-proto.inc
+++ b/meta/recipes-graphics/xcb/xcb-proto.inc
@@ -16,7 +16,7 @@ inherit autotools pkgconfig
 FILES_${PN}-dev += "${datadir}/xcb/*.xml"
 
 RDEPENDS_${PN}-dev = ""
-RRECOMMENDS_${PN}-dbg = "${PN}-dev (= ${EXTENDPV})"
+RRECOMMENDS_${PN}-dbg = "${PN}-dev (= ${EXTENDPKGV})"
 
 DEPENDS_append_virtclass-native = " python-native"
 BBCLASSEXTEND = "native"
-- 
1.7.0.4




^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH 08/11] xorg-proto: use EXTENDPKGV instead of EXTENDPV.
  2011-05-27  6:31 [PATCH 00/11] Add PR service and integrate PKGV/PKGR from OE Lianhao Lu
                   ` (6 preceding siblings ...)
  2011-05-27  6:31 ` [PATCH 07/11] xcb: " Lianhao Lu
@ 2011-05-27  6:31 ` Lianhao Lu
  2011-05-27  6:31 ` [PATCH 09/11] xorg-util/util-macros: " Lianhao Lu
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 38+ messages in thread
From: Lianhao Lu @ 2011-05-27  6:31 UTC (permalink / raw)
  To: openembedded-core

Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
---
 .../xorg-proto/xorg-proto-common.inc               |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/meta/recipes-graphics/xorg-proto/xorg-proto-common.inc b/meta/recipes-graphics/xorg-proto/xorg-proto-common.inc
index ab1af28..765e30a 100644
--- a/meta/recipes-graphics/xorg-proto/xorg-proto-common.inc
+++ b/meta/recipes-graphics/xorg-proto/xorg-proto-common.inc
@@ -18,4 +18,4 @@ EXTRA_OECONF = "--with-fop=no"
 
 # ${PN} is empty so we need to tweak -dev and -dbg package dependencies
 RDEPENDS_${PN}-dev = ""
-RRECOMMENDS_${PN}-dbg = "${PN}-dev (= ${EXTENDPV})"
+RRECOMMENDS_${PN}-dbg = "${PN}-dev (= ${EXTENDPKGV})"
-- 
1.7.0.4




^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH 09/11] xorg-util/util-macros: use EXTENDPKGV instead of EXTENDPV.
  2011-05-27  6:31 [PATCH 00/11] Add PR service and integrate PKGV/PKGR from OE Lianhao Lu
                   ` (7 preceding siblings ...)
  2011-05-27  6:31 ` [PATCH 08/11] xorg-proto: " Lianhao Lu
@ 2011-05-27  6:31 ` Lianhao Lu
  2011-05-27  6:31 ` [PATCH 10/11] linux-libc-headers: " Lianhao Lu
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 38+ messages in thread
From: Lianhao Lu @ 2011-05-27  6:31 UTC (permalink / raw)
  To: openembedded-core

Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
---
 .../xorg-util/util-macros_1.13.0.bb                |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/meta/recipes-graphics/xorg-util/util-macros_1.13.0.bb b/meta/recipes-graphics/xorg-util/util-macros_1.13.0.bb
index a708ed0..a6f5402 100644
--- a/meta/recipes-graphics/xorg-util/util-macros_1.13.0.bb
+++ b/meta/recipes-graphics/xorg-util/util-macros_1.13.0.bb
@@ -16,7 +16,7 @@ DEPENDS_virtclass-native = "gettext"
 DEPENDS_virtclass-nativesdk = "gettext"
 
 RDEPENDS_${PN}-dev = ""
-RRECOMMENDS_${PN}-dbg = "${PN}-dev (= ${EXTENDPV})"
+RRECOMMENDS_${PN}-dbg = "${PN}-dev (= ${EXTENDPKGV})"
 
 BBCLASSEXTEND = "native nativesdk"
 
-- 
1.7.0.4




^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH 10/11] linux-libc-headers: use EXTENDPKGV instead of EXTENDPV.
  2011-05-27  6:31 [PATCH 00/11] Add PR service and integrate PKGV/PKGR from OE Lianhao Lu
                   ` (8 preceding siblings ...)
  2011-05-27  6:31 ` [PATCH 09/11] xorg-util/util-macros: " Lianhao Lu
@ 2011-05-27  6:31 ` Lianhao Lu
  2011-05-27  6:31 ` [PATCH 11/11] conf/bitbake.conf: Removed EXTENDPV and EXTENDPEVER Lianhao Lu
  2011-05-27 17:00 ` [PATCH 00/11] Add PR service and integrate PKGV/PKGR from OE Richard Purdie
  11 siblings, 0 replies; 38+ messages in thread
From: Lianhao Lu @ 2011-05-27  6:31 UTC (permalink / raw)
  To: openembedded-core

Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
---
 .../linux-libc-headers/linux-libc-headers.inc      |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/meta/recipes-kernel/linux-libc-headers/linux-libc-headers.inc b/meta/recipes-kernel/linux-libc-headers/linux-libc-headers.inc
index 8c5dc76..014024f 100644
--- a/meta/recipes-kernel/linux-libc-headers/linux-libc-headers.inc
+++ b/meta/recipes-kernel/linux-libc-headers/linux-libc-headers.inc
@@ -7,4 +7,4 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/kernel/v2.6/linux-${PV}.tar.bz2"
 
 #DEPENDS = "cross-linkage"
 RDEPENDS_${PN}-dev = ""
-RRECOMMENDS_${PN}-dbg = "${PN}-dev (= ${EXTENDPV})"
+RRECOMMENDS_${PN}-dbg = "${PN}-dev (= ${EXTENDPKGV})"
-- 
1.7.0.4




^ permalink raw reply related	[flat|nested] 38+ messages in thread

* [PATCH 11/11] conf/bitbake.conf: Removed EXTENDPV and EXTENDPEVER.
  2011-05-27  6:31 [PATCH 00/11] Add PR service and integrate PKGV/PKGR from OE Lianhao Lu
                   ` (9 preceding siblings ...)
  2011-05-27  6:31 ` [PATCH 10/11] linux-libc-headers: " Lianhao Lu
@ 2011-05-27  6:31 ` Lianhao Lu
  2011-05-27 17:00 ` [PATCH 00/11] Add PR service and integrate PKGV/PKGR from OE Richard Purdie
  11 siblings, 0 replies; 38+ messages in thread
From: Lianhao Lu @ 2011-05-27  6:31 UTC (permalink / raw)
  To: openembedded-core

Removed the unused variable EXTENDPV and EXTENDPEVER. User should use
EXTENDPKGV instead for package feed generation.

Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
---
 meta/conf/bitbake.conf |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index 4fcf4f6..dd68adc 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -152,8 +152,6 @@ PV = "${@bb.parse.BBHandler.vars_from_file(bb.data.getVar('FILE',d),d)[1] or '1.
 PR = "${@bb.parse.BBHandler.vars_from_file(bb.data.getVar('FILE',d),d)[2] or 'r0'}"
 PF = "${PN}-${EXTENDPE}${PV}-${PR}"
 EXTENDPE = "${@['','${PE\x7d_'][bb.data.getVar('PE',d,1) > 0]}"
-EXTENDPEVER = "${@['','${PE\x7d:'][bb.data.getVar('PE',d,1) > 0]}"
-EXTENDPV = "${EXTENDPEVER}${PV}-${PR}{DISTRO_PR}"
 P = "${PN}-${PV}"
 
 EXTENDPRAUTO = "${@['.${PRAUTO\x7d',''][bb.data.getVar('PRAUTO',d,1) is None]}"
-- 
1.7.0.4




^ permalink raw reply related	[flat|nested] 38+ messages in thread

* Re: [PATCH 00/11] Add PR service and integrate PKGV/PKGR from OE
  2011-05-27  6:31 [PATCH 00/11] Add PR service and integrate PKGV/PKGR from OE Lianhao Lu
                   ` (10 preceding siblings ...)
  2011-05-27  6:31 ` [PATCH 11/11] conf/bitbake.conf: Removed EXTENDPV and EXTENDPEVER Lianhao Lu
@ 2011-05-27 17:00 ` Richard Purdie
  2011-05-27 18:48   ` Koen Kooi
  11 siblings, 1 reply; 38+ messages in thread
From: Richard Purdie @ 2011-05-27 17:00 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

Hi Lianhao,

On Fri, 2011-05-27 at 14:31 +0800, Lianhao Lu wrote:
>   git://git.pokylinux.org/poky-contrib llu/PR-service
>   http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=llu/PR-service
> 
> Lianhao Lu (11):
>   Added the PR service.
>   conf/bitbake.conf: Added variables for PR service.
>   meta-yocto/local.conf.sample: Added PRSERV_HOST and PRSERV_PORT.
>   classes/package(prserv).bbclass: Get PRAUTO and use PKGV/PKGR.
>   classes/package_xxx.class: Use PKGE/PKGV/PKGR.
>   udev: use EXTENDPKGV instead of EXTENDPV.
>   xcb: use EXTENDPKGV instead of EXTENDPV.
>   xorg-proto: use EXTENDPKGV instead of EXTENDPV.
>   xorg-util/util-macros: use EXTENDPKGV instead of EXTENDPV.
>   linux-libc-headers: use EXTENDPKGV instead of EXTENDPV.
>   conf/bitbake.conf: Removed EXTENDPV and EXTENDPEVER.

I merged this but I did make some tweaks to both the patch series and
one of the patches. The changes I made were:

a) Squash the EXTENDPV and EXTENDPEVER changes into the base patch
making all the associated changes in one go.

b) Not include the DISTRO_PR variable for now

c) Not change the default signature handler to basichash.

For c), I'd suggest a follow up patch changing the default in poky.conf
in meta-yocto and we'll test this there. This should wait until the
PACKAGE_ARCH = "all" sstate issues we've been seeing are addressed
though.

Cheers,

Richard









^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH 00/11] Add PR service and integrate PKGV/PKGR from OE
  2011-05-27 17:00 ` [PATCH 00/11] Add PR service and integrate PKGV/PKGR from OE Richard Purdie
@ 2011-05-27 18:48   ` Koen Kooi
  2011-05-27 19:08     ` Otavio Salvador
  2011-05-27 20:09       ` Joshua Lock
  0 siblings, 2 replies; 38+ messages in thread
From: Koen Kooi @ 2011-05-27 18:48 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer


Op 27 mei 2011, om 19:00 heeft Richard Purdie het volgende geschreven:

> Hi Lianhao,
> 
> On Fri, 2011-05-27 at 14:31 +0800, Lianhao Lu wrote:
>>  git://git.pokylinux.org/poky-contrib llu/PR-service
>>  http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=llu/PR-service
>> 
>> Lianhao Lu (11):
>>  Added the PR service.
>>  conf/bitbake.conf: Added variables for PR service.
>>  meta-yocto/local.conf.sample: Added PRSERV_HOST and PRSERV_PORT.
>>  classes/package(prserv).bbclass: Get PRAUTO and use PKGV/PKGR.
>>  classes/package_xxx.class: Use PKGE/PKGV/PKGR.
>>  udev: use EXTENDPKGV instead of EXTENDPV.
>>  xcb: use EXTENDPKGV instead of EXTENDPV.
>>  xorg-proto: use EXTENDPKGV instead of EXTENDPV.
>>  xorg-util/util-macros: use EXTENDPKGV instead of EXTENDPV.
>>  linux-libc-headers: use EXTENDPKGV instead of EXTENDPV.
>>  conf/bitbake.conf: Removed EXTENDPV and EXTENDPEVER.
> 
> I merged this but I did make some tweaks to both the patch series and
> one of the patches. The changes I made were:
> 
> a) Squash the EXTENDPV and EXTENDPEVER changes into the base patch
> making all the associated changes in one go.
> 
> b) Not include the DISTRO_PR variable for now
> 
> c) Not change the default signature handler to basichash.
> 
> For c), I'd suggest a follow up patch changing the default in poky.conf
> in meta-yocto and we'll test this there. This should wait until the
> PACKAGE_ARCH = "all" sstate issues we've been seeing are addressed
> though.

On Fedora 14 I get this when trying to rebuild console-image:

ERROR: (file: 'package_get_auto_pr', lineno: 4, function: package_get_auto_pr)
ERROR: Function 'package_get_auto_pr' failed
ERROR: Logfile of failure stored in: /home/koen/angstrom-core/build/tmp-angstrom_2010_x-eglibc/work/armv7a-angstrom-linux-gnueabi/dbus-1.4.1-r5/temp/log.do_package.24742
Log data follows:
| ERROR: Error executing a python function in /home/koen/angstrom-core/sources/openembedded-core/meta/recipes-core/dbus/dbus_1.4.1.bb:
| ImportError: No module named xmlrpc
| 
| ERROR: The stack trace of python calls that resulted in this exception/failure was:
| ERROR:   File "package_get_auto_pr", line 11, in <module>
| ERROR:
| ERROR:   File "package_get_auto_pr", line 4, in package_get_auto_pr
| ERROR:
| ERROR:   File "prserv.bbclass", line 8, in prserv_get_pr_auto
| ERROR:
| ERROR:   File "prserv.bbclass", line 2, in prserv_make_conn
| ERROR:
| ERROR:   File "/home/koen/angstrom-core/sources/bitbake/lib/prserv/serv.py", line 6, in <module>
| ERROR:     import bb.server.xmlrpc
| ERROR:
| ERROR: The code that was being executed was:
| ERROR:      0007:                     return
| ERROR:      0008:             d.setVar('PRAUTO',str(auto_pr))
| ERROR:      0009:
| ERROR:      0010:
| ERROR:  *** 0011:package_get_auto_pr(d)
| ERROR:      0012:
| ERROR: (file: 'package_get_auto_pr', lineno: 11, function: <module>)
| ERROR:      0001:
| ERROR:      0002:def package_get_auto_pr(d):
| ERROR:      0003:     if d.getVar('USE_PR_SERV', True):
| ERROR:  *** 0004:             auto_pr=prserv_get_pr_auto(d)
| ERROR:      0005:             if auto_pr is None:
| ERROR:      0006:                     bb.fatal("Can NOT get auto PR revision from remote PR service")
| ERROR:      0007:                     return
| ERROR:      0008:             d.setVar('PRAUTO',str(auto_pr))
| ERROR: (file: 'package_get_auto_pr', lineno: 4, function: package_get_auto_pr)
| ERROR: Function 'package_get_auto_pr' failed

It doesn't seem to trigger on my debian box, though





^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH 00/11] Add PR service and integrate PKGV/PKGR from OE
  2011-05-27 18:48   ` Koen Kooi
@ 2011-05-27 19:08     ` Otavio Salvador
  2011-05-27 19:13       ` Koen Kooi
  2011-05-27 20:09       ` Joshua Lock
  1 sibling, 1 reply; 38+ messages in thread
From: Otavio Salvador @ 2011-05-27 19:08 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

Same here.

On Fri, May 27, 2011 at 18:48, Koen Kooi <koen@dominion.thruhere.net> wrote:
>
> Op 27 mei 2011, om 19:00 heeft Richard Purdie het volgende geschreven:
>
>> Hi Lianhao,
>>
>> On Fri, 2011-05-27 at 14:31 +0800, Lianhao Lu wrote:
>>>  git://git.pokylinux.org/poky-contrib llu/PR-service
>>>  http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=llu/PR-service
>>>
>>> Lianhao Lu (11):
>>>  Added the PR service.
>>>  conf/bitbake.conf: Added variables for PR service.
>>>  meta-yocto/local.conf.sample: Added PRSERV_HOST and PRSERV_PORT.
>>>  classes/package(prserv).bbclass: Get PRAUTO and use PKGV/PKGR.
>>>  classes/package_xxx.class: Use PKGE/PKGV/PKGR.
>>>  udev: use EXTENDPKGV instead of EXTENDPV.
>>>  xcb: use EXTENDPKGV instead of EXTENDPV.
>>>  xorg-proto: use EXTENDPKGV instead of EXTENDPV.
>>>  xorg-util/util-macros: use EXTENDPKGV instead of EXTENDPV.
>>>  linux-libc-headers: use EXTENDPKGV instead of EXTENDPV.
>>>  conf/bitbake.conf: Removed EXTENDPV and EXTENDPEVER.
>>
>> I merged this but I did make some tweaks to both the patch series and
>> one of the patches. The changes I made were:
>>
>> a) Squash the EXTENDPV and EXTENDPEVER changes into the base patch
>> making all the associated changes in one go.
>>
>> b) Not include the DISTRO_PR variable for now
>>
>> c) Not change the default signature handler to basichash.
>>
>> For c), I'd suggest a follow up patch changing the default in poky.conf
>> in meta-yocto and we'll test this there. This should wait until the
>> PACKAGE_ARCH = "all" sstate issues we've been seeing are addressed
>> though.
>
> On Fedora 14 I get this when trying to rebuild console-image:
>
> ERROR: (file: 'package_get_auto_pr', lineno: 4, function: package_get_auto_pr)
> ERROR: Function 'package_get_auto_pr' failed
> ERROR: Logfile of failure stored in: /home/koen/angstrom-core/build/tmp-angstrom_2010_x-eglibc/work/armv7a-angstrom-linux-gnueabi/dbus-1.4.1-r5/temp/log.do_package.24742
> Log data follows:
> | ERROR: Error executing a python function in /home/koen/angstrom-core/sources/openembedded-core/meta/recipes-core/dbus/dbus_1.4.1.bb:
> | ImportError: No module named xmlrpc
> |
> | ERROR: The stack trace of python calls that resulted in this exception/failure was:
> | ERROR:   File "package_get_auto_pr", line 11, in <module>
> | ERROR:
> | ERROR:   File "package_get_auto_pr", line 4, in package_get_auto_pr
> | ERROR:
> | ERROR:   File "prserv.bbclass", line 8, in prserv_get_pr_auto
> | ERROR:
> | ERROR:   File "prserv.bbclass", line 2, in prserv_make_conn
> | ERROR:
> | ERROR:   File "/home/koen/angstrom-core/sources/bitbake/lib/prserv/serv.py", line 6, in <module>
> | ERROR:     import bb.server.xmlrpc
> | ERROR:
> | ERROR: The code that was being executed was:
> | ERROR:      0007:                     return
> | ERROR:      0008:             d.setVar('PRAUTO',str(auto_pr))
> | ERROR:      0009:
> | ERROR:      0010:
> | ERROR:  *** 0011:package_get_auto_pr(d)
> | ERROR:      0012:
> | ERROR: (file: 'package_get_auto_pr', lineno: 11, function: <module>)
> | ERROR:      0001:
> | ERROR:      0002:def package_get_auto_pr(d):
> | ERROR:      0003:     if d.getVar('USE_PR_SERV', True):
> | ERROR:  *** 0004:             auto_pr=prserv_get_pr_auto(d)
> | ERROR:      0005:             if auto_pr is None:
> | ERROR:      0006:                     bb.fatal("Can NOT get auto PR revision from remote PR service")
> | ERROR:      0007:                     return
> | ERROR:      0008:             d.setVar('PRAUTO',str(auto_pr))
> | ERROR: (file: 'package_get_auto_pr', lineno: 4, function: package_get_auto_pr)
> | ERROR: Function 'package_get_auto_pr' failed
>
> It doesn't seem to trigger on my debian box, though
>
>
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>



-- 
Otavio Salvador                             O.S. Systems
E-mail: otavio@ossystems.com.br  http://www.ossystems.com.br
Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br



^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH 00/11] Add PR service and integrate PKGV/PKGR from OE
  2011-05-27 19:08     ` Otavio Salvador
@ 2011-05-27 19:13       ` Koen Kooi
  0 siblings, 0 replies; 38+ messages in thread
From: Koen Kooi @ 2011-05-27 19:13 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer

FWIW, F14 has python 2.7


Op 27 mei 2011, om 21:08 heeft Otavio Salvador het volgende geschreven:

> Same here.
> 
> On Fri, May 27, 2011 at 18:48, Koen Kooi <koen@dominion.thruhere.net> wrote:
>> 
>> Op 27 mei 2011, om 19:00 heeft Richard Purdie het volgende geschreven:
>> 
>>> Hi Lianhao,
>>> 
>>> On Fri, 2011-05-27 at 14:31 +0800, Lianhao Lu wrote:
>>>>  git://git.pokylinux.org/poky-contrib llu/PR-service
>>>>  http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=llu/PR-service
>>>> 
>>>> Lianhao Lu (11):
>>>>  Added the PR service.
>>>>  conf/bitbake.conf: Added variables for PR service.
>>>>  meta-yocto/local.conf.sample: Added PRSERV_HOST and PRSERV_PORT.
>>>>  classes/package(prserv).bbclass: Get PRAUTO and use PKGV/PKGR.
>>>>  classes/package_xxx.class: Use PKGE/PKGV/PKGR.
>>>>  udev: use EXTENDPKGV instead of EXTENDPV.
>>>>  xcb: use EXTENDPKGV instead of EXTENDPV.
>>>>  xorg-proto: use EXTENDPKGV instead of EXTENDPV.
>>>>  xorg-util/util-macros: use EXTENDPKGV instead of EXTENDPV.
>>>>  linux-libc-headers: use EXTENDPKGV instead of EXTENDPV.
>>>>  conf/bitbake.conf: Removed EXTENDPV and EXTENDPEVER.
>>> 
>>> I merged this but I did make some tweaks to both the patch series and
>>> one of the patches. The changes I made were:
>>> 
>>> a) Squash the EXTENDPV and EXTENDPEVER changes into the base patch
>>> making all the associated changes in one go.
>>> 
>>> b) Not include the DISTRO_PR variable for now
>>> 
>>> c) Not change the default signature handler to basichash.
>>> 
>>> For c), I'd suggest a follow up patch changing the default in poky.conf
>>> in meta-yocto and we'll test this there. This should wait until the
>>> PACKAGE_ARCH = "all" sstate issues we've been seeing are addressed
>>> though.
>> 
>> On Fedora 14 I get this when trying to rebuild console-image:
>> 
>> ERROR: (file: 'package_get_auto_pr', lineno: 4, function: package_get_auto_pr)
>> ERROR: Function 'package_get_auto_pr' failed
>> ERROR: Logfile of failure stored in: /home/koen/angstrom-core/build/tmp-angstrom_2010_x-eglibc/work/armv7a-angstrom-linux-gnueabi/dbus-1.4.1-r5/temp/log.do_package.24742
>> Log data follows:
>> | ERROR: Error executing a python function in /home/koen/angstrom-core/sources/openembedded-core/meta/recipes-core/dbus/dbus_1.4.1.bb:
>> | ImportError: No module named xmlrpc
>> |
>> | ERROR: The stack trace of python calls that resulted in this exception/failure was:
>> | ERROR:   File "package_get_auto_pr", line 11, in <module>
>> | ERROR:
>> | ERROR:   File "package_get_auto_pr", line 4, in package_get_auto_pr
>> | ERROR:
>> | ERROR:   File "prserv.bbclass", line 8, in prserv_get_pr_auto
>> | ERROR:
>> | ERROR:   File "prserv.bbclass", line 2, in prserv_make_conn
>> | ERROR:
>> | ERROR:   File "/home/koen/angstrom-core/sources/bitbake/lib/prserv/serv.py", line 6, in <module>
>> | ERROR:     import bb.server.xmlrpc
>> | ERROR:
>> | ERROR: The code that was being executed was:
>> | ERROR:      0007:                     return
>> | ERROR:      0008:             d.setVar('PRAUTO',str(auto_pr))
>> | ERROR:      0009:
>> | ERROR:      0010:
>> | ERROR:  *** 0011:package_get_auto_pr(d)
>> | ERROR:      0012:
>> | ERROR: (file: 'package_get_auto_pr', lineno: 11, function: <module>)
>> | ERROR:      0001:
>> | ERROR:      0002:def package_get_auto_pr(d):
>> | ERROR:      0003:     if d.getVar('USE_PR_SERV', True):
>> | ERROR:  *** 0004:             auto_pr=prserv_get_pr_auto(d)
>> | ERROR:      0005:             if auto_pr is None:
>> | ERROR:      0006:                     bb.fatal("Can NOT get auto PR revision from remote PR service")
>> | ERROR:      0007:                     return
>> | ERROR:      0008:             d.setVar('PRAUTO',str(auto_pr))
>> | ERROR: (file: 'package_get_auto_pr', lineno: 4, function: package_get_auto_pr)
>> | ERROR: Function 'package_get_auto_pr' failed
>> 
>> It doesn't seem to trigger on my debian box, though
>> 
>> 
>> 
>> _______________________________________________
>> Openembedded-core mailing list
>> Openembedded-core@lists.openembedded.org
>> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>> 
> 
> 
> 
> -- 
> Otavio Salvador                             O.S. Systems
> E-mail: otavio@ossystems.com.br  http://www.ossystems.com.br
> Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br
> 
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core




^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [OE-core] [PATCH 00/11] Add PR service and integrate PKGV/PKGR from OE
  2011-05-27 18:48   ` Koen Kooi
@ 2011-05-27 20:09       ` Joshua Lock
  2011-05-27 20:09       ` Joshua Lock
  1 sibling, 0 replies; 38+ messages in thread
From: Joshua Lock @ 2011-05-27 20:09 UTC (permalink / raw)
  To: openembedded-core; +Cc: bitbake-devel

[-- Attachment #1: Type: text/plain, Size: 4204 bytes --]

On Fri, 2011-05-27 at 20:48 +0200, Koen Kooi wrote:
> Op 27 mei 2011, om 19:00 heeft Richard Purdie het volgende geschreven:
> 
> > Hi Lianhao,
> > 
> > On Fri, 2011-05-27 at 14:31 +0800, Lianhao Lu wrote:
> >>  git://git.pokylinux.org/poky-contrib llu/PR-service
> >>  http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=llu/PR-service
> >> 
> >> Lianhao Lu (11):
> >>  Added the PR service.
> >>  conf/bitbake.conf: Added variables for PR service.
> >>  meta-yocto/local.conf.sample: Added PRSERV_HOST and PRSERV_PORT.
> >>  classes/package(prserv).bbclass: Get PRAUTO and use PKGV/PKGR.
> >>  classes/package_xxx.class: Use PKGE/PKGV/PKGR.
> >>  udev: use EXTENDPKGV instead of EXTENDPV.
> >>  xcb: use EXTENDPKGV instead of EXTENDPV.
> >>  xorg-proto: use EXTENDPKGV instead of EXTENDPV.
> >>  xorg-util/util-macros: use EXTENDPKGV instead of EXTENDPV.
> >>  linux-libc-headers: use EXTENDPKGV instead of EXTENDPV.
> >>  conf/bitbake.conf: Removed EXTENDPV and EXTENDPEVER.
> > 
> > I merged this but I did make some tweaks to both the patch series and
> > one of the patches. The changes I made were:
> > 
> > a) Squash the EXTENDPV and EXTENDPEVER changes into the base patch
> > making all the associated changes in one go.
> > 
> > b) Not include the DISTRO_PR variable for now
> > 
> > c) Not change the default signature handler to basichash.
> > 
> > For c), I'd suggest a follow up patch changing the default in poky.conf
> > in meta-yocto and we'll test this there. This should wait until the
> > PACKAGE_ARCH = "all" sstate issues we've been seeing are addressed
> > though.
> 
> On Fedora 14 I get this when trying to rebuild console-image:
> 
> ERROR: (file: 'package_get_auto_pr', lineno: 4, function: package_get_auto_pr)
> ERROR: Function 'package_get_auto_pr' failed
> ERROR: Logfile of failure stored in: /home/koen/angstrom-core/build/tmp-angstrom_2010_x-eglibc/work/armv7a-angstrom-linux-gnueabi/dbus-1.4.1-r5/temp/log.do_package.24742
> Log data follows:
> | ERROR: Error executing a python function in /home/koen/angstrom-core/sources/openembedded-core/meta/recipes-core/dbus/dbus_1.4.1.bb:
> | ImportError: No module named xmlrpc
> | 
> | ERROR: The stack trace of python calls that resulted in this exception/failure was:
> | ERROR:   File "package_get_auto_pr", line 11, in <module>
> | ERROR:
> | ERROR:   File "package_get_auto_pr", line 4, in package_get_auto_pr
> | ERROR:
> | ERROR:   File "prserv.bbclass", line 8, in prserv_get_pr_auto
> | ERROR:
> | ERROR:   File "prserv.bbclass", line 2, in prserv_make_conn
> | ERROR:
> | ERROR:   File "/home/koen/angstrom-core/sources/bitbake/lib/prserv/serv.py", line 6, in <module>
> | ERROR:     import bb.server.xmlrpc

Upstream BitBake still has the xmlrpc server removed. The version in
Poky's BitBake is functional (I use it daily).

Attached are two patches against BitBake master to add back the xmlrpc
server (copied from Poky's tree) and fix the uievent.

> | ERROR:
> | ERROR: The code that was being executed was:
> | ERROR:      0007:                     return
> | ERROR:      0008:             d.setVar('PRAUTO',str(auto_pr))
> | ERROR:      0009:
> | ERROR:      0010:
> | ERROR:  *** 0011:package_get_auto_pr(d)
> | ERROR:      0012:
> | ERROR: (file: 'package_get_auto_pr', lineno: 11, function: <module>)
> | ERROR:      0001:
> | ERROR:      0002:def package_get_auto_pr(d):
> | ERROR:      0003:     if d.getVar('USE_PR_SERV', True):
> | ERROR:  *** 0004:             auto_pr=prserv_get_pr_auto(d)
> | ERROR:      0005:             if auto_pr is None:
> | ERROR:      0006:                     bb.fatal("Can NOT get auto PR revision from remote PR service")
> | ERROR:      0007:                     return
> | ERROR:      0008:             d.setVar('PRAUTO',str(auto_pr))
> | ERROR: (file: 'package_get_auto_pr', lineno: 4, function: package_get_auto_pr)
> | ERROR: Function 'package_get_auto_pr' failed
> 
> It doesn't seem to trigger on my debian box, though

Are you using Poky on the Debian box?

Cheers,
Joshua
-- 
Joshua Lock
        Yocto Project Build Monkey
        Intel Open Source Technology Centre

[-- Attachment #2: 0001-server-add-updated-fixed-xmlrpc-server-from-Poky.patch --]
[-- Type: text/x-patch, Size: 10084 bytes --]

From 4c0915842cd578e67fc9cc85d24538e419a47af8 Mon Sep 17 00:00:00 2001
From: Joshua Lock <josh@linux.intel.com>
Date: Fri, 27 May 2011 13:03:55 -0700
Subject: [PATCH 1/2] server: add updated/fixed xmlrpc server from Poky

Signed-off-by: Joshua Lock <josh@linux.intel.com>
---
 lib/bb/server/xmlrpc.py |  273 +++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 273 insertions(+), 0 deletions(-)
 create mode 100644 lib/bb/server/xmlrpc.py

diff --git a/lib/bb/server/xmlrpc.py b/lib/bb/server/xmlrpc.py
new file mode 100644
index 0000000..c43c6cd
--- /dev/null
+++ b/lib/bb/server/xmlrpc.py
@@ -0,0 +1,273 @@
+#
+# BitBake XMLRPC Server
+#
+# Copyright (C) 2006 - 2007  Michael 'Mickey' Lauer
+# Copyright (C) 2006 - 2008  Richard Purdie
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+"""
+    This module implements an xmlrpc server for BitBake.
+
+    Use this by deriving a class from BitBakeXMLRPCServer and then adding
+    methods which you want to "export" via XMLRPC. If the methods have the
+    prefix xmlrpc_, then registering those function will happen automatically,
+    if not, you need to call register_function.
+
+    Use register_idle_function() to add a function which the xmlrpc server
+    calls from within server_forever when no requests are pending. Make sure
+    that those functions are non-blocking or else you will introduce latency
+    in the server's main loop.
+"""
+
+import bb
+import xmlrpclib, sys
+from bb import daemonize
+from bb.ui import uievent
+
+DEBUG = False
+
+from SimpleXMLRPCServer import SimpleXMLRPCServer, SimpleXMLRPCRequestHandler
+import inspect, select
+
+if sys.hexversion < 0x020600F0:
+    print("Sorry, python 2.6 or later is required for bitbake's XMLRPC mode")
+    sys.exit(1)
+
+##
+# The xmlrpclib.Transport class has undergone various changes in Python 2.7
+# which break BitBake's XMLRPC implementation.
+# To work around this we subclass Transport and have a copy/paste of method
+# implementations from Python 2.6.6's xmlrpclib.
+#
+# Upstream Python bug is #8194 (http://bugs.python.org/issue8194)
+# This bug is relevant for Python 2.7.0 and 2.7.1 but was fixed for
+# Python > 2.7.2
+##
+
+class BBTransport(xmlrpclib.Transport):
+    def request(self, host, handler, request_body, verbose=0):
+        h = self.make_connection(host)
+        if verbose:
+            h.set_debuglevel(1)
+
+        self.send_request(h, handler, request_body)
+        self.send_host(h, host)
+        self.send_user_agent(h)
+        self.send_content(h, request_body)
+
+        errcode, errmsg, headers = h.getreply()
+
+        if errcode != 200:
+            raise ProtocolError(
+                host + handler,
+                errcode, errmsg,
+                headers
+                )
+
+        self.verbose = verbose
+
+        try:
+            sock = h._conn.sock
+        except AttributeError:
+            sock = None
+
+        return self._parse_response(h.getfile(), sock)
+
+    def make_connection(self, host):
+        import httplib
+        host, extra_headers, x509 = self.get_host_info(host)
+        return httplib.HTTP(host)
+
+    def _parse_response(self, file, sock):
+        p, u = self.getparser()
+
+        while 1:
+            if sock:
+                response = sock.recv(1024)
+            else:
+                response = file.read(1024)
+            if not response:
+                break
+            if self.verbose:
+                print "body:", repr(response)
+            p.feed(response)
+
+        file.close()
+        p.close()
+
+        return u.close()
+
+def _create_server(host, port):
+    # Python 2.7.0 and 2.7.1 have a buggy Transport implementation
+    # For those versions of Python, and only those versions, use our
+    # own copy/paste BBTransport class.
+    if (2, 7, 0) <= sys.version_info < (2, 7, 2):
+        t = BBTransport()
+        s = xmlrpclib.Server("http://%s:%d/" % (host, port), transport=t, allow_none=True)
+    else:
+        s = xmlrpclib.Server("http://%s:%d/" % (host, port), allow_none=True)
+
+    return s
+
+class BitBakeServerCommands():
+    def __init__(self, server, cooker):
+        self.cooker = cooker
+        self.server = server
+
+    def registerEventHandler(self, host, port):
+        """
+        Register a remote UI Event Handler
+        """
+        s = _create_server(host, port)
+
+        return bb.event.register_UIHhandler(s)
+
+    def unregisterEventHandler(self, handlerNum):
+        """
+        Unregister a remote UI Event Handler
+        """
+        return bb.event.unregister_UIHhandler(handlerNum)
+
+    def runCommand(self, command):
+        """
+        Run a cooker command on the server
+        """
+        return self.cooker.command.runCommand(command)
+
+    def terminateServer(self):
+        """
+        Trigger the server to quit
+        """
+        self.server.quit = True
+        print("Server (cooker) exiting")
+        return
+
+    def ping(self):
+        """
+        Dummy method which can be used to check the server is still alive
+        """
+        return True
+
+class BitBakeServer(SimpleXMLRPCServer):
+    # remove this when you're done with debugging
+    # allow_reuse_address = True
+
+    def __init__(self, cooker, interface = ("localhost", 0)):
+        """
+        Constructor
+        """
+        SimpleXMLRPCServer.__init__(self, interface,
+                                    requestHandler=SimpleXMLRPCRequestHandler,
+                                    logRequests=False, allow_none=True)
+        self._idlefuns = {}
+        self.host, self.port = self.socket.getsockname()
+        #self.register_introspection_functions()
+        commands = BitBakeServerCommands(self, cooker)
+        self.autoregister_all_functions(commands, "")
+        self.cooker = cooker
+
+    def autoregister_all_functions(self, context, prefix):
+        """
+        Convenience method for registering all functions in the scope
+        of this class that start with a common prefix
+        """
+        methodlist = inspect.getmembers(context, inspect.ismethod)
+        for name, method in methodlist:
+            if name.startswith(prefix):
+                self.register_function(method, name[len(prefix):])
+
+    def register_idle_function(self, function, data):
+        """Register a function to be called while the server is idle"""
+        assert hasattr(function, '__call__')
+        self._idlefuns[function] = data
+
+    def serve_forever(self):
+        bb.cooker.server_main(self.cooker, self._serve_forever)
+
+    def _serve_forever(self):
+        """
+        Serve Requests. Overloaded to honor a quit command
+        """
+        self.quit = False
+        self.timeout = 0 # Run Idle calls for our first callback
+        while not self.quit:
+            #print "Idle queue length %s" % len(self._idlefuns)
+            self.handle_request()
+            #print "Idle timeout, running idle functions"
+            nextsleep = None
+            for function, data in self._idlefuns.items():
+                try:
+                    retval = function(self, data, False)
+                    if retval is False:
+                        del self._idlefuns[function]
+                    elif retval is True:
+                        nextsleep = 0
+                    elif nextsleep is 0:
+                        continue
+                    elif nextsleep is None:
+                        nextsleep = retval
+                    elif retval < nextsleep:
+                        nextsleep = retval
+                except SystemExit:
+                    raise
+                except:
+                    import traceback
+                    traceback.print_exc()
+                    pass
+            if nextsleep is None and len(self._idlefuns) > 0:
+                nextsleep = 0
+            self.timeout = nextsleep
+        # Tell idle functions we're exiting
+        for function, data in self._idlefuns.items():
+            try:
+                retval = function(self, data, True)
+            except:
+                pass
+
+        self.server_close()
+        return
+
+class BitbakeServerInfo():
+    def __init__(self, server):
+        self.host = server.host
+        self.port = server.port
+
+class BitBakeServerFork():
+    def __init__(self, cooker, server, serverinfo, logfile):
+        daemonize.createDaemon(server.serve_forever, logfile)
+
+class BitbakeUILauch():
+    def launch(self, serverinfo, uifunc, *args):
+        return uifunc(*args)
+
+class BitBakeServerConnection():
+    def __init__(self, serverinfo):
+        self.connection = _create_server(serverinfo.host, serverinfo.port)
+        self.events = uievent.BBUIEventQueue(self.connection)
+        for event in bb.event.ui_queue:
+            self.events.queue_event(event)
+
+    def terminate(self):
+        # Don't wait for server indefinitely
+        import socket
+        socket.setdefaulttimeout(2)
+        try:
+            self.events.system_quit()
+        except:
+            pass
+        try:
+            self.connection.terminateServer()
+        except:
+            pass
-- 
1.7.5.1


[-- Attachment #3: 0002-uievent-fix-queueing-of-events-for-xmlrpc-before-UI-.patch --]
[-- Type: text/x-patch, Size: 1894 bytes --]

From 1618318f0a30847b08c158e7ac82f9043126144e Mon Sep 17 00:00:00 2001
From: Joshua Lock <josh@linux.intel.com>
Date: Fri, 27 May 2011 13:04:44 -0700
Subject: [PATCH 2/2] uievent: fix queueing of events for xmlrpc before UI has
 loaded

The change to Queue up events before the UI is spawned broke the xmlrpc
server because the uievent implementation of BBUIEventQueue expects pickled
strings for its queue_event() method.
This is because the RPC exposed event.send() method must accept pickled
strings, but for xmlrpc event.send() is just mapped to queue_event(). Work
around this by adding a send_event method which unpickles strings and hands
them off to queue_event() which can then be used for the remapping.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
---
 lib/bb/ui/uievent.py |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/lib/bb/ui/uievent.py b/lib/bb/ui/uievent.py
index b404805..2fef4e4 100644
--- a/lib/bb/ui/uievent.py
+++ b/lib/bb/ui/uievent.py
@@ -63,17 +63,20 @@ class BBUIEventQueue:
 
     def queue_event(self, event):
         self.eventQueueLock.acquire()
-        self.eventQueue.append(pickle.loads(event))
+        self.eventQueue.append(event)
         self.eventQueueNotify.set()
         self.eventQueueLock.release()
 
+    def send_event(self, event):
+        self.queue_event(pickle.loads(event))
+
     def startCallbackHandler(self):
 
         server = UIXMLRPCServer()
         self.host, self.port = server.socket.getsockname()
 
         server.register_function( self.system_quit, "event.quit" )
-        server.register_function( self.queue_event, "event.send" )
+        server.register_function( self.send_event, "event.send" )
         server.socket.settimeout(1)
 
         self.EventHandle = self.BBServer.registerEventHandler(self.host, self.port)
-- 
1.7.5.1


^ permalink raw reply related	[flat|nested] 38+ messages in thread

* Re: [PATCH 00/11] Add PR service and integrate PKGV/PKGR from OE
@ 2011-05-27 20:09       ` Joshua Lock
  0 siblings, 0 replies; 38+ messages in thread
From: Joshua Lock @ 2011-05-27 20:09 UTC (permalink / raw)
  To: openembedded-core; +Cc: bitbake-devel

[-- Attachment #1: Type: text/plain, Size: 4204 bytes --]

On Fri, 2011-05-27 at 20:48 +0200, Koen Kooi wrote:
> Op 27 mei 2011, om 19:00 heeft Richard Purdie het volgende geschreven:
> 
> > Hi Lianhao,
> > 
> > On Fri, 2011-05-27 at 14:31 +0800, Lianhao Lu wrote:
> >>  git://git.pokylinux.org/poky-contrib llu/PR-service
> >>  http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=llu/PR-service
> >> 
> >> Lianhao Lu (11):
> >>  Added the PR service.
> >>  conf/bitbake.conf: Added variables for PR service.
> >>  meta-yocto/local.conf.sample: Added PRSERV_HOST and PRSERV_PORT.
> >>  classes/package(prserv).bbclass: Get PRAUTO and use PKGV/PKGR.
> >>  classes/package_xxx.class: Use PKGE/PKGV/PKGR.
> >>  udev: use EXTENDPKGV instead of EXTENDPV.
> >>  xcb: use EXTENDPKGV instead of EXTENDPV.
> >>  xorg-proto: use EXTENDPKGV instead of EXTENDPV.
> >>  xorg-util/util-macros: use EXTENDPKGV instead of EXTENDPV.
> >>  linux-libc-headers: use EXTENDPKGV instead of EXTENDPV.
> >>  conf/bitbake.conf: Removed EXTENDPV and EXTENDPEVER.
> > 
> > I merged this but I did make some tweaks to both the patch series and
> > one of the patches. The changes I made were:
> > 
> > a) Squash the EXTENDPV and EXTENDPEVER changes into the base patch
> > making all the associated changes in one go.
> > 
> > b) Not include the DISTRO_PR variable for now
> > 
> > c) Not change the default signature handler to basichash.
> > 
> > For c), I'd suggest a follow up patch changing the default in poky.conf
> > in meta-yocto and we'll test this there. This should wait until the
> > PACKAGE_ARCH = "all" sstate issues we've been seeing are addressed
> > though.
> 
> On Fedora 14 I get this when trying to rebuild console-image:
> 
> ERROR: (file: 'package_get_auto_pr', lineno: 4, function: package_get_auto_pr)
> ERROR: Function 'package_get_auto_pr' failed
> ERROR: Logfile of failure stored in: /home/koen/angstrom-core/build/tmp-angstrom_2010_x-eglibc/work/armv7a-angstrom-linux-gnueabi/dbus-1.4.1-r5/temp/log.do_package.24742
> Log data follows:
> | ERROR: Error executing a python function in /home/koen/angstrom-core/sources/openembedded-core/meta/recipes-core/dbus/dbus_1.4.1.bb:
> | ImportError: No module named xmlrpc
> | 
> | ERROR: The stack trace of python calls that resulted in this exception/failure was:
> | ERROR:   File "package_get_auto_pr", line 11, in <module>
> | ERROR:
> | ERROR:   File "package_get_auto_pr", line 4, in package_get_auto_pr
> | ERROR:
> | ERROR:   File "prserv.bbclass", line 8, in prserv_get_pr_auto
> | ERROR:
> | ERROR:   File "prserv.bbclass", line 2, in prserv_make_conn
> | ERROR:
> | ERROR:   File "/home/koen/angstrom-core/sources/bitbake/lib/prserv/serv.py", line 6, in <module>
> | ERROR:     import bb.server.xmlrpc

Upstream BitBake still has the xmlrpc server removed. The version in
Poky's BitBake is functional (I use it daily).

Attached are two patches against BitBake master to add back the xmlrpc
server (copied from Poky's tree) and fix the uievent.

> | ERROR:
> | ERROR: The code that was being executed was:
> | ERROR:      0007:                     return
> | ERROR:      0008:             d.setVar('PRAUTO',str(auto_pr))
> | ERROR:      0009:
> | ERROR:      0010:
> | ERROR:  *** 0011:package_get_auto_pr(d)
> | ERROR:      0012:
> | ERROR: (file: 'package_get_auto_pr', lineno: 11, function: <module>)
> | ERROR:      0001:
> | ERROR:      0002:def package_get_auto_pr(d):
> | ERROR:      0003:     if d.getVar('USE_PR_SERV', True):
> | ERROR:  *** 0004:             auto_pr=prserv_get_pr_auto(d)
> | ERROR:      0005:             if auto_pr is None:
> | ERROR:      0006:                     bb.fatal("Can NOT get auto PR revision from remote PR service")
> | ERROR:      0007:                     return
> | ERROR:      0008:             d.setVar('PRAUTO',str(auto_pr))
> | ERROR: (file: 'package_get_auto_pr', lineno: 4, function: package_get_auto_pr)
> | ERROR: Function 'package_get_auto_pr' failed
> 
> It doesn't seem to trigger on my debian box, though

Are you using Poky on the Debian box?

Cheers,
Joshua
-- 
Joshua Lock
        Yocto Project Build Monkey
        Intel Open Source Technology Centre

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [OE-core] [PATCH 00/11] Add PR service and integrate PKGV/PKGR from OE
  2011-05-27 20:09       ` Joshua Lock
@ 2011-05-27 20:24         ` Khem Raj
  -1 siblings, 0 replies; 38+ messages in thread
From: Khem Raj @ 2011-05-27 20:24 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer; +Cc: bitbake-devel

On Fri, May 27, 2011 at 1:09 PM, Joshua Lock <josh@linux.intel.com> wrote:
> On Fri, 2011-05-27 at 20:48 +0200, Koen Kooi wrote:
>> Op 27 mei 2011, om 19:00 heeft Richard Purdie het volgende geschreven:
>>
>> > Hi Lianhao,
>> >
>> > On Fri, 2011-05-27 at 14:31 +0800, Lianhao Lu wrote:
>> >>  git://git.pokylinux.org/poky-contrib llu/PR-service
>> >>  http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=llu/PR-service
>> >>
>> >> Lianhao Lu (11):
>> >>  Added the PR service.
>> >>  conf/bitbake.conf: Added variables for PR service.
>> >>  meta-yocto/local.conf.sample: Added PRSERV_HOST and PRSERV_PORT.
>> >>  classes/package(prserv).bbclass: Get PRAUTO and use PKGV/PKGR.
>> >>  classes/package_xxx.class: Use PKGE/PKGV/PKGR.
>> >>  udev: use EXTENDPKGV instead of EXTENDPV.
>> >>  xcb: use EXTENDPKGV instead of EXTENDPV.
>> >>  xorg-proto: use EXTENDPKGV instead of EXTENDPV.
>> >>  xorg-util/util-macros: use EXTENDPKGV instead of EXTENDPV.
>> >>  linux-libc-headers: use EXTENDPKGV instead of EXTENDPV.
>> >>  conf/bitbake.conf: Removed EXTENDPV and EXTENDPEVER.
>> >
>> > I merged this but I did make some tweaks to both the patch series and
>> > one of the patches. The changes I made were:
>> >
>> > a) Squash the EXTENDPV and EXTENDPEVER changes into the base patch
>> > making all the associated changes in one go.
>> >
>> > b) Not include the DISTRO_PR variable for now
>> >
>> > c) Not change the default signature handler to basichash.
>> >
>> > For c), I'd suggest a follow up patch changing the default in poky.conf
>> > in meta-yocto and we'll test this there. This should wait until the
>> > PACKAGE_ARCH = "all" sstate issues we've been seeing are addressed
>> > though.
>>
>> On Fedora 14 I get this when trying to rebuild console-image:
>>
>> ERROR: (file: 'package_get_auto_pr', lineno: 4, function: package_get_auto_pr)
>> ERROR: Function 'package_get_auto_pr' failed
>> ERROR: Logfile of failure stored in: /home/koen/angstrom-core/build/tmp-angstrom_2010_x-eglibc/work/armv7a-angstrom-linux-gnueabi/dbus-1.4.1-r5/temp/log.do_package.24742
>> Log data follows:
>> | ERROR: Error executing a python function in /home/koen/angstrom-core/sources/openembedded-core/meta/recipes-core/dbus/dbus_1.4.1.bb:
>> | ImportError: No module named xmlrpc
>> |
>> | ERROR: The stack trace of python calls that resulted in this exception/failure was:
>> | ERROR:   File "package_get_auto_pr", line 11, in <module>
>> | ERROR:
>> | ERROR:   File "package_get_auto_pr", line 4, in package_get_auto_pr
>> | ERROR:
>> | ERROR:   File "prserv.bbclass", line 8, in prserv_get_pr_auto
>> | ERROR:
>> | ERROR:   File "prserv.bbclass", line 2, in prserv_make_conn
>> | ERROR:
>> | ERROR:   File "/home/koen/angstrom-core/sources/bitbake/lib/prserv/serv.py", line 6, in <module>
>> | ERROR:     import bb.server.xmlrpc
>
> Upstream BitBake still has the xmlrpc server removed. The version in
> Poky's BitBake is functional (I use it daily).
>

I use bb master and oe-core

> Attached are two patches against BitBake master to add back the xmlrpc
> server (copied from Poky's tree) and fix the uievent.
>
>> | ERROR:
>> | ERROR: The code that was being executed was:
>> | ERROR:      0007:                     return
>> | ERROR:      0008:             d.setVar('PRAUTO',str(auto_pr))
>> | ERROR:      0009:
>> | ERROR:      0010:
>> | ERROR:  *** 0011:package_get_auto_pr(d)
>> | ERROR:      0012:
>> | ERROR: (file: 'package_get_auto_pr', lineno: 11, function: <module>)
>> | ERROR:      0001:
>> | ERROR:      0002:def package_get_auto_pr(d):
>> | ERROR:      0003:     if d.getVar('USE_PR_SERV', True):
>> | ERROR:  *** 0004:             auto_pr=prserv_get_pr_auto(d)
>> | ERROR:      0005:             if auto_pr is None:
>> | ERROR:      0006:                     bb.fatal("Can NOT get auto PR revision from remote PR service")
>> | ERROR:      0007:                     return
>> | ERROR:      0008:             d.setVar('PRAUTO',str(auto_pr))
>> | ERROR: (file: 'package_get_auto_pr', lineno: 4, function: package_get_auto_pr)
>> | ERROR: Function 'package_get_auto_pr' failed
>>
>> It doesn't seem to trigger on my debian box, though
>
> Are you using Poky on the Debian box?

ubuntu 64bit oe-core no poky

>
> Cheers,
> Joshua
> --
> Joshua Lock
>        Yocto Project Build Monkey
>        Intel Open Source Technology Centre
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>
>



^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH 00/11] Add PR service and integrate PKGV/PKGR from OE
@ 2011-05-27 20:24         ` Khem Raj
  0 siblings, 0 replies; 38+ messages in thread
From: Khem Raj @ 2011-05-27 20:24 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer; +Cc: bitbake-devel

On Fri, May 27, 2011 at 1:09 PM, Joshua Lock <josh@linux.intel.com> wrote:
> On Fri, 2011-05-27 at 20:48 +0200, Koen Kooi wrote:
>> Op 27 mei 2011, om 19:00 heeft Richard Purdie het volgende geschreven:
>>
>> > Hi Lianhao,
>> >
>> > On Fri, 2011-05-27 at 14:31 +0800, Lianhao Lu wrote:
>> >>  git://git.pokylinux.org/poky-contrib llu/PR-service
>> >>  http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=llu/PR-service
>> >>
>> >> Lianhao Lu (11):
>> >>  Added the PR service.
>> >>  conf/bitbake.conf: Added variables for PR service.
>> >>  meta-yocto/local.conf.sample: Added PRSERV_HOST and PRSERV_PORT.
>> >>  classes/package(prserv).bbclass: Get PRAUTO and use PKGV/PKGR.
>> >>  classes/package_xxx.class: Use PKGE/PKGV/PKGR.
>> >>  udev: use EXTENDPKGV instead of EXTENDPV.
>> >>  xcb: use EXTENDPKGV instead of EXTENDPV.
>> >>  xorg-proto: use EXTENDPKGV instead of EXTENDPV.
>> >>  xorg-util/util-macros: use EXTENDPKGV instead of EXTENDPV.
>> >>  linux-libc-headers: use EXTENDPKGV instead of EXTENDPV.
>> >>  conf/bitbake.conf: Removed EXTENDPV and EXTENDPEVER.
>> >
>> > I merged this but I did make some tweaks to both the patch series and
>> > one of the patches. The changes I made were:
>> >
>> > a) Squash the EXTENDPV and EXTENDPEVER changes into the base patch
>> > making all the associated changes in one go.
>> >
>> > b) Not include the DISTRO_PR variable for now
>> >
>> > c) Not change the default signature handler to basichash.
>> >
>> > For c), I'd suggest a follow up patch changing the default in poky.conf
>> > in meta-yocto and we'll test this there. This should wait until the
>> > PACKAGE_ARCH = "all" sstate issues we've been seeing are addressed
>> > though.
>>
>> On Fedora 14 I get this when trying to rebuild console-image:
>>
>> ERROR: (file: 'package_get_auto_pr', lineno: 4, function: package_get_auto_pr)
>> ERROR: Function 'package_get_auto_pr' failed
>> ERROR: Logfile of failure stored in: /home/koen/angstrom-core/build/tmp-angstrom_2010_x-eglibc/work/armv7a-angstrom-linux-gnueabi/dbus-1.4.1-r5/temp/log.do_package.24742
>> Log data follows:
>> | ERROR: Error executing a python function in /home/koen/angstrom-core/sources/openembedded-core/meta/recipes-core/dbus/dbus_1.4.1.bb:
>> | ImportError: No module named xmlrpc
>> |
>> | ERROR: The stack trace of python calls that resulted in this exception/failure was:
>> | ERROR:   File "package_get_auto_pr", line 11, in <module>
>> | ERROR:
>> | ERROR:   File "package_get_auto_pr", line 4, in package_get_auto_pr
>> | ERROR:
>> | ERROR:   File "prserv.bbclass", line 8, in prserv_get_pr_auto
>> | ERROR:
>> | ERROR:   File "prserv.bbclass", line 2, in prserv_make_conn
>> | ERROR:
>> | ERROR:   File "/home/koen/angstrom-core/sources/bitbake/lib/prserv/serv.py", line 6, in <module>
>> | ERROR:     import bb.server.xmlrpc
>
> Upstream BitBake still has the xmlrpc server removed. The version in
> Poky's BitBake is functional (I use it daily).
>

I use bb master and oe-core

> Attached are two patches against BitBake master to add back the xmlrpc
> server (copied from Poky's tree) and fix the uievent.
>
>> | ERROR:
>> | ERROR: The code that was being executed was:
>> | ERROR:      0007:                     return
>> | ERROR:      0008:             d.setVar('PRAUTO',str(auto_pr))
>> | ERROR:      0009:
>> | ERROR:      0010:
>> | ERROR:  *** 0011:package_get_auto_pr(d)
>> | ERROR:      0012:
>> | ERROR: (file: 'package_get_auto_pr', lineno: 11, function: <module>)
>> | ERROR:      0001:
>> | ERROR:      0002:def package_get_auto_pr(d):
>> | ERROR:      0003:     if d.getVar('USE_PR_SERV', True):
>> | ERROR:  *** 0004:             auto_pr=prserv_get_pr_auto(d)
>> | ERROR:      0005:             if auto_pr is None:
>> | ERROR:      0006:                     bb.fatal("Can NOT get auto PR revision from remote PR service")
>> | ERROR:      0007:                     return
>> | ERROR:      0008:             d.setVar('PRAUTO',str(auto_pr))
>> | ERROR: (file: 'package_get_auto_pr', lineno: 4, function: package_get_auto_pr)
>> | ERROR: Function 'package_get_auto_pr' failed
>>
>> It doesn't seem to trigger on my debian box, though
>
> Are you using Poky on the Debian box?

ubuntu 64bit oe-core no poky

>
> Cheers,
> Joshua
> --
> Joshua Lock
>        Yocto Project Build Monkey
>        Intel Open Source Technology Centre
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>
>



^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [PATCH 00/11] Add PR service and integrate PKGV/PKGR from OE
  2011-05-27 20:09       ` Joshua Lock
  (?)
  (?)
@ 2011-05-27 20:54       ` Joshua Lock
  -1 siblings, 0 replies; 38+ messages in thread
From: Joshua Lock @ 2011-05-27 20:54 UTC (permalink / raw)
  To: openembedded-core

[-- Attachment #1: Type: text/plain, Size: 367 bytes --]

On Fri, 2011-05-27 at 13:09 -0700, Joshua Lock wrote:
> Attached are two patches against BitBake master to add back the xmlrpc
> server (copied from Poky's tree) and fix the uievent.

Seems like my patches didn't make it through? *tries again*

Cheers,
Joshua
-- 
Joshua Lock
        Yocto Project Build Monkey
        Intel Open Source Technology Centre

^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [OE-core] [PATCH 00/11] Add PR service and integrate PKGV/PKGR from OE
  2011-05-27 20:09       ` Joshua Lock
@ 2011-05-27 21:00         ` Joshua Lock
  -1 siblings, 0 replies; 38+ messages in thread
From: Joshua Lock @ 2011-05-27 21:00 UTC (permalink / raw)
  To: openembedded-core; +Cc: bitbake-devel

On Fri, 2011-05-27 at 13:09 -0700, Joshua Lock wrote:
> Upstream BitBake still has the xmlrpc server removed. The version in
> Poky's BitBake is functional (I use it daily).
> 
> Attached are two patches against BitBake master to add back the xmlrpc
> server (copied from Poky's tree) and fix the uievent.

Something in the pipeline is eating patches.

I'll send them as replies to this message.

Joshua
-- 
Joshua Lock
        Yocto Project Build Monkey
        Intel Open Source Technology Centre




^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [bitbake-devel] [PATCH 00/11] Add PR service and integrate PKGV/PKGR from OE
@ 2011-05-27 21:00         ` Joshua Lock
  0 siblings, 0 replies; 38+ messages in thread
From: Joshua Lock @ 2011-05-27 21:00 UTC (permalink / raw)
  To: openembedded-core; +Cc: bitbake-devel

On Fri, 2011-05-27 at 13:09 -0700, Joshua Lock wrote:
> Upstream BitBake still has the xmlrpc server removed. The version in
> Poky's BitBake is functional (I use it daily).
> 
> Attached are two patches against BitBake master to add back the xmlrpc
> server (copied from Poky's tree) and fix the uievent.

Something in the pipeline is eating patches.

I'll send them as replies to this message.

Joshua
-- 
Joshua Lock
        Yocto Project Build Monkey
        Intel Open Source Technology Centre




^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [OE-core] [PATCH 00/11] Add PR service and integrate PKGV/PKGR from OE
  2011-05-27 20:09       ` Joshua Lock
@ 2011-05-27 21:01         ` Joshua Lock
  -1 siblings, 0 replies; 38+ messages in thread
From: Joshua Lock @ 2011-05-27 21:01 UTC (permalink / raw)
  To: openembedded-core; +Cc: bitbake-devel

From 4c0915842cd578e67fc9cc85d24538e419a47af8 Mon Sep 17 00:00:00 2001
From: Joshua Lock <josh@linux.intel.com>
Date: Fri, 27 May 2011 13:03:55 -0700
Subject: [PATCH 1/2] server: add updated/fixed xmlrpc server from Poky

Signed-off-by: Joshua Lock <josh@linux.intel.com>
---
 lib/bb/server/xmlrpc.py |  273
+++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 273 insertions(+), 0 deletions(-)
 create mode 100644 lib/bb/server/xmlrpc.py

diff --git a/lib/bb/server/xmlrpc.py b/lib/bb/server/xmlrpc.py
new file mode 100644
index 0000000..c43c6cd
--- /dev/null
+++ b/lib/bb/server/xmlrpc.py
@@ -0,0 +1,273 @@
+#
+# BitBake XMLRPC Server
+#
+# Copyright (C) 2006 - 2007  Michael 'Mickey' Lauer
+# Copyright (C) 2006 - 2008  Richard Purdie
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
along
+# with this program; if not, write to the Free Software Foundation,
Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+"""
+    This module implements an xmlrpc server for BitBake.
+
+    Use this by deriving a class from BitBakeXMLRPCServer and then
adding
+    methods which you want to "export" via XMLRPC. If the methods have
the
+    prefix xmlrpc_, then registering those function will happen
automatically,
+    if not, you need to call register_function.
+
+    Use register_idle_function() to add a function which the xmlrpc
server
+    calls from within server_forever when no requests are pending. Make
sure
+    that those functions are non-blocking or else you will introduce
latency
+    in the server's main loop.
+"""
+
+import bb
+import xmlrpclib, sys
+from bb import daemonize
+from bb.ui import uievent
+
+DEBUG = False
+
+from SimpleXMLRPCServer import SimpleXMLRPCServer,
SimpleXMLRPCRequestHandler
+import inspect, select
+
+if sys.hexversion < 0x020600F0:
+    print("Sorry, python 2.6 or later is required for bitbake's XMLRPC
mode")
+    sys.exit(1)
+
+##
+# The xmlrpclib.Transport class has undergone various changes in Python
2.7
+# which break BitBake's XMLRPC implementation.
+# To work around this we subclass Transport and have a copy/paste of
method
+# implementations from Python 2.6.6's xmlrpclib.
+#
+# Upstream Python bug is #8194 (http://bugs.python.org/issue8194)
+# This bug is relevant for Python 2.7.0 and 2.7.1 but was fixed for
+# Python > 2.7.2
+##
+
+class BBTransport(xmlrpclib.Transport):
+    def request(self, host, handler, request_body, verbose=0):
+        h = self.make_connection(host)
+        if verbose:
+            h.set_debuglevel(1)
+
+        self.send_request(h, handler, request_body)
+        self.send_host(h, host)
+        self.send_user_agent(h)
+        self.send_content(h, request_body)
+
+        errcode, errmsg, headers = h.getreply()
+
+        if errcode != 200:
+            raise ProtocolError(
+                host + handler,
+                errcode, errmsg,
+                headers
+                )
+
+        self.verbose = verbose
+
+        try:
+            sock = h._conn.sock
+        except AttributeError:
+            sock = None
+
+        return self._parse_response(h.getfile(), sock)
+
+    def make_connection(self, host):
+        import httplib
+        host, extra_headers, x509 = self.get_host_info(host)
+        return httplib.HTTP(host)
+
+    def _parse_response(self, file, sock):
+        p, u = self.getparser()
+
+        while 1:
+            if sock:
+                response = sock.recv(1024)
+            else:
+                response = file.read(1024)
+            if not response:
+                break
+            if self.verbose:
+                print "body:", repr(response)
+            p.feed(response)
+
+        file.close()
+        p.close()
+
+        return u.close()
+
+def _create_server(host, port):
+    # Python 2.7.0 and 2.7.1 have a buggy Transport implementation
+    # For those versions of Python, and only those versions, use our
+    # own copy/paste BBTransport class.
+    if (2, 7, 0) <= sys.version_info < (2, 7, 2):
+        t = BBTransport()
+        s = xmlrpclib.Server("http://%s:%d/" % (host, port),
transport=t, allow_none=True)
+    else:
+        s = xmlrpclib.Server("http://%s:%d/" % (host, port),
allow_none=True)
+
+    return s
+
+class BitBakeServerCommands():
+    def __init__(self, server, cooker):
+        self.cooker = cooker
+        self.server = server
+
+    def registerEventHandler(self, host, port):
+        """
+        Register a remote UI Event Handler
+        """
+        s = _create_server(host, port)
+
+        return bb.event.register_UIHhandler(s)
+
+    def unregisterEventHandler(self, handlerNum):
+        """
+        Unregister a remote UI Event Handler
+        """
+        return bb.event.unregister_UIHhandler(handlerNum)
+
+    def runCommand(self, command):
+        """
+        Run a cooker command on the server
+        """
+        return self.cooker.command.runCommand(command)
+
+    def terminateServer(self):
+        """
+        Trigger the server to quit
+        """
+        self.server.quit = True
+        print("Server (cooker) exiting")
+        return
+
+    def ping(self):
+        """
+        Dummy method which can be used to check the server is still
alive
+        """
+        return True
+
+class BitBakeServer(SimpleXMLRPCServer):
+    # remove this when you're done with debugging
+    # allow_reuse_address = True
+
+    def __init__(self, cooker, interface = ("localhost", 0)):
+        """
+        Constructor
+        """
+        SimpleXMLRPCServer.__init__(self, interface,
+
requestHandler=SimpleXMLRPCRequestHandler,
+                                    logRequests=False, allow_none=True)
+        self._idlefuns = {}
+        self.host, self.port = self.socket.getsockname()
+        #self.register_introspection_functions()
+        commands = BitBakeServerCommands(self, cooker)
+        self.autoregister_all_functions(commands, "")
+        self.cooker = cooker
+
+    def autoregister_all_functions(self, context, prefix):
+        """
+        Convenience method for registering all functions in the scope
+        of this class that start with a common prefix
+        """
+        methodlist = inspect.getmembers(context, inspect.ismethod)
+        for name, method in methodlist:
+            if name.startswith(prefix):
+                self.register_function(method, name[len(prefix):])
+
+    def register_idle_function(self, function, data):
+        """Register a function to be called while the server is idle"""
+        assert hasattr(function, '__call__')
+        self._idlefuns[function] = data
+
+    def serve_forever(self):
+        bb.cooker.server_main(self.cooker, self._serve_forever)
+
+    def _serve_forever(self):
+        """
+        Serve Requests. Overloaded to honor a quit command
+        """
+        self.quit = False
+        self.timeout = 0 # Run Idle calls for our first callback
+        while not self.quit:
+            #print "Idle queue length %s" % len(self._idlefuns)
+            self.handle_request()
+            #print "Idle timeout, running idle functions"
+            nextsleep = None
+            for function, data in self._idlefuns.items():
+                try:
+                    retval = function(self, data, False)
+                    if retval is False:
+                        del self._idlefuns[function]
+                    elif retval is True:
+                        nextsleep = 0
+                    elif nextsleep is 0:
+                        continue
+                    elif nextsleep is None:
+                        nextsleep = retval
+                    elif retval < nextsleep:
+                        nextsleep = retval
+                except SystemExit:
+                    raise
+                except:
+                    import traceback
+                    traceback.print_exc()
+                    pass
+            if nextsleep is None and len(self._idlefuns) > 0:
+                nextsleep = 0
+            self.timeout = nextsleep
+        # Tell idle functions we're exiting
+        for function, data in self._idlefuns.items():
+            try:
+                retval = function(self, data, True)
+            except:
+                pass
+
+        self.server_close()
+        return
+
+class BitbakeServerInfo():
+    def __init__(self, server):
+        self.host = server.host
+        self.port = server.port
+
+class BitBakeServerFork():
+    def __init__(self, cooker, server, serverinfo, logfile):
+        daemonize.createDaemon(server.serve_forever, logfile)
+
+class BitbakeUILauch():
+    def launch(self, serverinfo, uifunc, *args):
+        return uifunc(*args)
+
+class BitBakeServerConnection():
+    def __init__(self, serverinfo):
+        self.connection = _create_server(serverinfo.host,
serverinfo.port)
+        self.events = uievent.BBUIEventQueue(self.connection)
+        for event in bb.event.ui_queue:
+            self.events.queue_event(event)
+
+    def terminate(self):
+        # Don't wait for server indefinitely
+        import socket
+        socket.setdefaulttimeout(2)
+        try:
+            self.events.system_quit()
+        except:
+            pass
+        try:
+            self.connection.terminateServer()
+        except:
+            pass
-- 
1.7.5.1





^ permalink raw reply related	[flat|nested] 38+ messages in thread

* Re: [bitbake-devel] [PATCH 00/11] Add PR service and integrate PKGV/PKGR from OE
@ 2011-05-27 21:01         ` Joshua Lock
  0 siblings, 0 replies; 38+ messages in thread
From: Joshua Lock @ 2011-05-27 21:01 UTC (permalink / raw)
  To: openembedded-core; +Cc: bitbake-devel

From 4c0915842cd578e67fc9cc85d24538e419a47af8 Mon Sep 17 00:00:00 2001
From: Joshua Lock <josh@linux.intel.com>
Date: Fri, 27 May 2011 13:03:55 -0700
Subject: [PATCH 1/2] server: add updated/fixed xmlrpc server from Poky

Signed-off-by: Joshua Lock <josh@linux.intel.com>
---
 lib/bb/server/xmlrpc.py |  273
+++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 273 insertions(+), 0 deletions(-)
 create mode 100644 lib/bb/server/xmlrpc.py

diff --git a/lib/bb/server/xmlrpc.py b/lib/bb/server/xmlrpc.py
new file mode 100644
index 0000000..c43c6cd
--- /dev/null
+++ b/lib/bb/server/xmlrpc.py
@@ -0,0 +1,273 @@
+#
+# BitBake XMLRPC Server
+#
+# Copyright (C) 2006 - 2007  Michael 'Mickey' Lauer
+# Copyright (C) 2006 - 2008  Richard Purdie
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
along
+# with this program; if not, write to the Free Software Foundation,
Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+"""
+    This module implements an xmlrpc server for BitBake.
+
+    Use this by deriving a class from BitBakeXMLRPCServer and then
adding
+    methods which you want to "export" via XMLRPC. If the methods have
the
+    prefix xmlrpc_, then registering those function will happen
automatically,
+    if not, you need to call register_function.
+
+    Use register_idle_function() to add a function which the xmlrpc
server
+    calls from within server_forever when no requests are pending. Make
sure
+    that those functions are non-blocking or else you will introduce
latency
+    in the server's main loop.
+"""
+
+import bb
+import xmlrpclib, sys
+from bb import daemonize
+from bb.ui import uievent
+
+DEBUG = False
+
+from SimpleXMLRPCServer import SimpleXMLRPCServer,
SimpleXMLRPCRequestHandler
+import inspect, select
+
+if sys.hexversion < 0x020600F0:
+    print("Sorry, python 2.6 or later is required for bitbake's XMLRPC
mode")
+    sys.exit(1)
+
+##
+# The xmlrpclib.Transport class has undergone various changes in Python
2.7
+# which break BitBake's XMLRPC implementation.
+# To work around this we subclass Transport and have a copy/paste of
method
+# implementations from Python 2.6.6's xmlrpclib.
+#
+# Upstream Python bug is #8194 (http://bugs.python.org/issue8194)
+# This bug is relevant for Python 2.7.0 and 2.7.1 but was fixed for
+# Python > 2.7.2
+##
+
+class BBTransport(xmlrpclib.Transport):
+    def request(self, host, handler, request_body, verbose=0):
+        h = self.make_connection(host)
+        if verbose:
+            h.set_debuglevel(1)
+
+        self.send_request(h, handler, request_body)
+        self.send_host(h, host)
+        self.send_user_agent(h)
+        self.send_content(h, request_body)
+
+        errcode, errmsg, headers = h.getreply()
+
+        if errcode != 200:
+            raise ProtocolError(
+                host + handler,
+                errcode, errmsg,
+                headers
+                )
+
+        self.verbose = verbose
+
+        try:
+            sock = h._conn.sock
+        except AttributeError:
+            sock = None
+
+        return self._parse_response(h.getfile(), sock)
+
+    def make_connection(self, host):
+        import httplib
+        host, extra_headers, x509 = self.get_host_info(host)
+        return httplib.HTTP(host)
+
+    def _parse_response(self, file, sock):
+        p, u = self.getparser()
+
+        while 1:
+            if sock:
+                response = sock.recv(1024)
+            else:
+                response = file.read(1024)
+            if not response:
+                break
+            if self.verbose:
+                print "body:", repr(response)
+            p.feed(response)
+
+        file.close()
+        p.close()
+
+        return u.close()
+
+def _create_server(host, port):
+    # Python 2.7.0 and 2.7.1 have a buggy Transport implementation
+    # For those versions of Python, and only those versions, use our
+    # own copy/paste BBTransport class.
+    if (2, 7, 0) <= sys.version_info < (2, 7, 2):
+        t = BBTransport()
+        s = xmlrpclib.Server("http://%s:%d/" % (host, port),
transport=t, allow_none=True)
+    else:
+        s = xmlrpclib.Server("http://%s:%d/" % (host, port),
allow_none=True)
+
+    return s
+
+class BitBakeServerCommands():
+    def __init__(self, server, cooker):
+        self.cooker = cooker
+        self.server = server
+
+    def registerEventHandler(self, host, port):
+        """
+        Register a remote UI Event Handler
+        """
+        s = _create_server(host, port)
+
+        return bb.event.register_UIHhandler(s)
+
+    def unregisterEventHandler(self, handlerNum):
+        """
+        Unregister a remote UI Event Handler
+        """
+        return bb.event.unregister_UIHhandler(handlerNum)
+
+    def runCommand(self, command):
+        """
+        Run a cooker command on the server
+        """
+        return self.cooker.command.runCommand(command)
+
+    def terminateServer(self):
+        """
+        Trigger the server to quit
+        """
+        self.server.quit = True
+        print("Server (cooker) exiting")
+        return
+
+    def ping(self):
+        """
+        Dummy method which can be used to check the server is still
alive
+        """
+        return True
+
+class BitBakeServer(SimpleXMLRPCServer):
+    # remove this when you're done with debugging
+    # allow_reuse_address = True
+
+    def __init__(self, cooker, interface = ("localhost", 0)):
+        """
+        Constructor
+        """
+        SimpleXMLRPCServer.__init__(self, interface,
+
requestHandler=SimpleXMLRPCRequestHandler,
+                                    logRequests=False, allow_none=True)
+        self._idlefuns = {}
+        self.host, self.port = self.socket.getsockname()
+        #self.register_introspection_functions()
+        commands = BitBakeServerCommands(self, cooker)
+        self.autoregister_all_functions(commands, "")
+        self.cooker = cooker
+
+    def autoregister_all_functions(self, context, prefix):
+        """
+        Convenience method for registering all functions in the scope
+        of this class that start with a common prefix
+        """
+        methodlist = inspect.getmembers(context, inspect.ismethod)
+        for name, method in methodlist:
+            if name.startswith(prefix):
+                self.register_function(method, name[len(prefix):])
+
+    def register_idle_function(self, function, data):
+        """Register a function to be called while the server is idle"""
+        assert hasattr(function, '__call__')
+        self._idlefuns[function] = data
+
+    def serve_forever(self):
+        bb.cooker.server_main(self.cooker, self._serve_forever)
+
+    def _serve_forever(self):
+        """
+        Serve Requests. Overloaded to honor a quit command
+        """
+        self.quit = False
+        self.timeout = 0 # Run Idle calls for our first callback
+        while not self.quit:
+            #print "Idle queue length %s" % len(self._idlefuns)
+            self.handle_request()
+            #print "Idle timeout, running idle functions"
+            nextsleep = None
+            for function, data in self._idlefuns.items():
+                try:
+                    retval = function(self, data, False)
+                    if retval is False:
+                        del self._idlefuns[function]
+                    elif retval is True:
+                        nextsleep = 0
+                    elif nextsleep is 0:
+                        continue
+                    elif nextsleep is None:
+                        nextsleep = retval
+                    elif retval < nextsleep:
+                        nextsleep = retval
+                except SystemExit:
+                    raise
+                except:
+                    import traceback
+                    traceback.print_exc()
+                    pass
+            if nextsleep is None and len(self._idlefuns) > 0:
+                nextsleep = 0
+            self.timeout = nextsleep
+        # Tell idle functions we're exiting
+        for function, data in self._idlefuns.items():
+            try:
+                retval = function(self, data, True)
+            except:
+                pass
+
+        self.server_close()
+        return
+
+class BitbakeServerInfo():
+    def __init__(self, server):
+        self.host = server.host
+        self.port = server.port
+
+class BitBakeServerFork():
+    def __init__(self, cooker, server, serverinfo, logfile):
+        daemonize.createDaemon(server.serve_forever, logfile)
+
+class BitbakeUILauch():
+    def launch(self, serverinfo, uifunc, *args):
+        return uifunc(*args)
+
+class BitBakeServerConnection():
+    def __init__(self, serverinfo):
+        self.connection = _create_server(serverinfo.host,
serverinfo.port)
+        self.events = uievent.BBUIEventQueue(self.connection)
+        for event in bb.event.ui_queue:
+            self.events.queue_event(event)
+
+    def terminate(self):
+        # Don't wait for server indefinitely
+        import socket
+        socket.setdefaulttimeout(2)
+        try:
+            self.events.system_quit()
+        except:
+            pass
+        try:
+            self.connection.terminateServer()
+        except:
+            pass
-- 
1.7.5.1





^ permalink raw reply related	[flat|nested] 38+ messages in thread

* Re: [OE-core] [PATCH 00/11] Add PR service and integrate PKGV/PKGR from OE
  2011-05-27 20:09       ` Joshua Lock
@ 2011-05-27 21:01         ` Joshua Lock
  -1 siblings, 0 replies; 38+ messages in thread
From: Joshua Lock @ 2011-05-27 21:01 UTC (permalink / raw)
  To: openembedded-core; +Cc: bitbake-devel

From 1618318f0a30847b08c158e7ac82f9043126144e Mon Sep 17 00:00:00 2001
From: Joshua Lock <josh@linux.intel.com>
Date: Fri, 27 May 2011 13:04:44 -0700
Subject: [PATCH 2/2] uievent: fix queueing of events for xmlrpc before
UI has
 loaded

The change to Queue up events before the UI is spawned broke the xmlrpc
server because the uievent implementation of BBUIEventQueue expects
pickled
strings for its queue_event() method.
This is because the RPC exposed event.send() method must accept pickled
strings, but for xmlrpc event.send() is just mapped to queue_event().
Work
around this by adding a send_event method which unpickles strings and
hands
them off to queue_event() which can then be used for the remapping.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
---
 lib/bb/ui/uievent.py |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/lib/bb/ui/uievent.py b/lib/bb/ui/uievent.py
index b404805..2fef4e4 100644
--- a/lib/bb/ui/uievent.py
+++ b/lib/bb/ui/uievent.py
@@ -63,17 +63,20 @@ class BBUIEventQueue:
 
     def queue_event(self, event):
         self.eventQueueLock.acquire()
-        self.eventQueue.append(pickle.loads(event))
+        self.eventQueue.append(event)
         self.eventQueueNotify.set()
         self.eventQueueLock.release()
 
+    def send_event(self, event):
+        self.queue_event(pickle.loads(event))
+
     def startCallbackHandler(self):
 
         server = UIXMLRPCServer()
         self.host, self.port = server.socket.getsockname()
 
         server.register_function( self.system_quit, "event.quit" )
-        server.register_function( self.queue_event, "event.send" )
+        server.register_function( self.send_event, "event.send" )
         server.socket.settimeout(1)
 
         self.EventHandle =
self.BBServer.registerEventHandler(self.host, self.port)
-- 
1.7.5.1





^ permalink raw reply related	[flat|nested] 38+ messages in thread

* Re: [bitbake-devel] [PATCH 00/11] Add PR service and integrate PKGV/PKGR from OE
@ 2011-05-27 21:01         ` Joshua Lock
  0 siblings, 0 replies; 38+ messages in thread
From: Joshua Lock @ 2011-05-27 21:01 UTC (permalink / raw)
  To: openembedded-core; +Cc: bitbake-devel

From 1618318f0a30847b08c158e7ac82f9043126144e Mon Sep 17 00:00:00 2001
From: Joshua Lock <josh@linux.intel.com>
Date: Fri, 27 May 2011 13:04:44 -0700
Subject: [PATCH 2/2] uievent: fix queueing of events for xmlrpc before
UI has
 loaded

The change to Queue up events before the UI is spawned broke the xmlrpc
server because the uievent implementation of BBUIEventQueue expects
pickled
strings for its queue_event() method.
This is because the RPC exposed event.send() method must accept pickled
strings, but for xmlrpc event.send() is just mapped to queue_event().
Work
around this by adding a send_event method which unpickles strings and
hands
them off to queue_event() which can then be used for the remapping.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
---
 lib/bb/ui/uievent.py |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/lib/bb/ui/uievent.py b/lib/bb/ui/uievent.py
index b404805..2fef4e4 100644
--- a/lib/bb/ui/uievent.py
+++ b/lib/bb/ui/uievent.py
@@ -63,17 +63,20 @@ class BBUIEventQueue:
 
     def queue_event(self, event):
         self.eventQueueLock.acquire()
-        self.eventQueue.append(pickle.loads(event))
+        self.eventQueue.append(event)
         self.eventQueueNotify.set()
         self.eventQueueLock.release()
 
+    def send_event(self, event):
+        self.queue_event(pickle.loads(event))
+
     def startCallbackHandler(self):
 
         server = UIXMLRPCServer()
         self.host, self.port = server.socket.getsockname()
 
         server.register_function( self.system_quit, "event.quit" )
-        server.register_function( self.queue_event, "event.send" )
+        server.register_function( self.send_event, "event.send" )
         server.socket.settimeout(1)
 
         self.EventHandle =
self.BBServer.registerEventHandler(self.host, self.port)
-- 
1.7.5.1





^ permalink raw reply related	[flat|nested] 38+ messages in thread

* Re: [OE-core] [PATCH 00/11] Add PR service and integrate PKGV/PKGR from OE
  2011-05-27 21:00         ` [bitbake-devel] " Joshua Lock
@ 2011-05-27 21:01           ` Khem Raj
  -1 siblings, 0 replies; 38+ messages in thread
From: Khem Raj @ 2011-05-27 21:01 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer
  Cc: bitbake-devel, openembedded-core



On May 27, 2011, at 2:00 PM, Joshua Lock <josh@linux.intel.com> wrote:

> On Fri, 2011-05-27 at 13:09 -0700, Joshua Lock wrote:
>> Upstream BitBake still has the xmlrpc server removed. The version in
>> Poky's BitBake is functional (I use it daily).
>> 
>> Attached are two patches against BitBake master to add back the xmlrpc
>> server (copied from Poky's tree) and fix the uievent.
> 
> Something in the pipeline is eating patches.
> 
> I'll send them as replies to this message.

I think it's the mailing list setup. When I attach a patch it never goes through
Inlining the patch does go through
> 
> Joshua
> -- 
> Joshua Lock
>        Yocto Project Build Monkey
>        Intel Open Source Technology Centre
> 
> 
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core



^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [bitbake-devel] [PATCH 00/11] Add PR service and integrate PKGV/PKGR from OE
@ 2011-05-27 21:01           ` Khem Raj
  0 siblings, 0 replies; 38+ messages in thread
From: Khem Raj @ 2011-05-27 21:01 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer
  Cc: bitbake-devel, openembedded-core



On May 27, 2011, at 2:00 PM, Joshua Lock <josh@linux.intel.com> wrote:

> On Fri, 2011-05-27 at 13:09 -0700, Joshua Lock wrote:
>> Upstream BitBake still has the xmlrpc server removed. The version in
>> Poky's BitBake is functional (I use it daily).
>> 
>> Attached are two patches against BitBake master to add back the xmlrpc
>> server (copied from Poky's tree) and fix the uievent.
> 
> Something in the pipeline is eating patches.
> 
> I'll send them as replies to this message.

I think it's the mailing list setup. When I attach a patch it never goes through
Inlining the patch does go through
> 
> Joshua
> -- 
> Joshua Lock
>        Yocto Project Build Monkey
>        Intel Open Source Technology Centre
> 
> 
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core



^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [bitbake-devel] [PATCH 00/11] Add PR service and integrate PKGV/PKGR from OE
  2011-05-27 21:01           ` [bitbake-devel] " Khem Raj
  (?)
@ 2011-05-27 21:09           ` Joshua Lock
  -1 siblings, 0 replies; 38+ messages in thread
From: Joshua Lock @ 2011-05-27 21:09 UTC (permalink / raw)
  To: openembedded-core

On Fri, 2011-05-27 at 14:01 -0700, Khem Raj wrote:
> 
> On May 27, 2011, at 2:00 PM, Joshua Lock <josh@linux.intel.com> wrote:
> 
> > On Fri, 2011-05-27 at 13:09 -0700, Joshua Lock wrote:
> >> Upstream BitBake still has the xmlrpc server removed. The version in
> >> Poky's BitBake is functional (I use it daily).
> >> 
> >> Attached are two patches against BitBake master to add back the xmlrpc
> >> server (copied from Poky's tree) and fix the uievent.
> > 
> > Something in the pipeline is eating patches.
> > 
> > I'll send them as replies to this message.
> 
> I think it's the mailing list setup. When I attach a patch it never goes through
> Inlining the patch does go through
> > 

Yeah. It seems to be the oe-core list mangling patches. The attachments
made it to bitbake-devel fine.

Cheers,
Joshua
-- 
Joshua Lock
        Yocto Project Build Monkey
        Intel Open Source Technology Centre




^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [OE-core] [PATCH 00/11] Add PR service and integrate PKGV/PKGR from OE
  2011-05-27 20:09       ` Joshua Lock
@ 2011-05-27 22:09         ` Richard Purdie
  -1 siblings, 0 replies; 38+ messages in thread
From: Richard Purdie @ 2011-05-27 22:09 UTC (permalink / raw)
  To: Joshua Lock; +Cc: bitbake-devel, openembedded-core

On Fri, 2011-05-27 at 13:09 -0700, Joshua Lock wrote:
> Upstream BitBake still has the xmlrpc server removed. The version in
> Poky's BitBake is functional (I use it daily).
> 
> Attached are two patches against BitBake master to add back the xmlrpc
> server (copied from Poky's tree) and fix the uievent.

There have been API changes in upstream which mean this code will fail
to work with bitbake itself although it will work with the pr server.

I've merged the patches as a bandaid to allow things to work but we've
now got two different server backends using different server APIs. I
really just want to highlight I'm aware of this and it will get
addressed next week. Its been on my todo list and is way overdue. The
main priority is to get people's builds with OE-Core working again.

Cheers,

Richard





^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [bitbake-devel] [PATCH 00/11] Add PR service and integrate PKGV/PKGR from OE
@ 2011-05-27 22:09         ` Richard Purdie
  0 siblings, 0 replies; 38+ messages in thread
From: Richard Purdie @ 2011-05-27 22:09 UTC (permalink / raw)
  To: Joshua Lock; +Cc: bitbake-devel, openembedded-core

On Fri, 2011-05-27 at 13:09 -0700, Joshua Lock wrote:
> Upstream BitBake still has the xmlrpc server removed. The version in
> Poky's BitBake is functional (I use it daily).
> 
> Attached are two patches against BitBake master to add back the xmlrpc
> server (copied from Poky's tree) and fix the uievent.

There have been API changes in upstream which mean this code will fail
to work with bitbake itself although it will work with the pr server.

I've merged the patches as a bandaid to allow things to work but we've
now got two different server backends using different server APIs. I
really just want to highlight I'm aware of this and it will get
addressed next week. Its been on my todo list and is way overdue. The
main priority is to get people's builds with OE-Core working again.

Cheers,

Richard





^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [OE-core] [PATCH 00/11] Add PR service and integrate PKGV/PKGR from OE
  2011-05-27 22:09         ` [bitbake-devel] " Richard Purdie
@ 2011-05-28  1:02           ` Khem Raj
  -1 siblings, 0 replies; 38+ messages in thread
From: Khem Raj @ 2011-05-28  1:02 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer; +Cc: bitbake-devel

On Fri, May 27, 2011 at 3:09 PM, Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
> On Fri, 2011-05-27 at 13:09 -0700, Joshua Lock wrote:
>> Upstream BitBake still has the xmlrpc server removed. The version in
>> Poky's BitBake is functional (I use it daily).
>>
>> Attached are two patches against BitBake master to add back the xmlrpc
>> server (copied from Poky's tree) and fix the uievent.
>
> There have been API changes in upstream which mean this code will fail
> to work with bitbake itself although it will work with the pr server.
>
> I've merged the patches as a bandaid to allow things to work but we've
> now got two different server backends using different server APIs. I
> really just want to highlight I'm aware of this and it will get
> addressed next week. Its been on my todo list and is way overdue. The
> main priority is to get people's builds with OE-Core working again.
>

btw. I am at 6c412f009e33e77cbcb5d4881c110e6bdda05282 of bitbake
I still see the problem

> Cheers,
>
> Richard
>
>
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>



^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [bitbake-devel] [PATCH 00/11] Add PR service and integrate PKGV/PKGR from OE
@ 2011-05-28  1:02           ` Khem Raj
  0 siblings, 0 replies; 38+ messages in thread
From: Khem Raj @ 2011-05-28  1:02 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer; +Cc: bitbake-devel

On Fri, May 27, 2011 at 3:09 PM, Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
> On Fri, 2011-05-27 at 13:09 -0700, Joshua Lock wrote:
>> Upstream BitBake still has the xmlrpc server removed. The version in
>> Poky's BitBake is functional (I use it daily).
>>
>> Attached are two patches against BitBake master to add back the xmlrpc
>> server (copied from Poky's tree) and fix the uievent.
>
> There have been API changes in upstream which mean this code will fail
> to work with bitbake itself although it will work with the pr server.
>
> I've merged the patches as a bandaid to allow things to work but we've
> now got two different server backends using different server APIs. I
> really just want to highlight I'm aware of this and it will get
> addressed next week. Its been on my todo list and is way overdue. The
> main priority is to get people's builds with OE-Core working again.
>

btw. I am at 6c412f009e33e77cbcb5d4881c110e6bdda05282 of bitbake
I still see the problem

> Cheers,
>
> Richard
>
>
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>



^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [OE-core] [PATCH 00/11] Add PR service and integrate PKGV/PKGR from OE
  2011-05-28  1:02           ` [bitbake-devel] " Khem Raj
@ 2011-05-28  1:05             ` Khem Raj
  -1 siblings, 0 replies; 38+ messages in thread
From: Khem Raj @ 2011-05-28  1:05 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer; +Cc: bitbake-devel

On Fri, May 27, 2011 at 6:02 PM, Khem Raj <raj.khem@gmail.com> wrote:
> On Fri, May 27, 2011 at 3:09 PM, Richard Purdie
> <richard.purdie@linuxfoundation.org> wrote:
>> On Fri, 2011-05-27 at 13:09 -0700, Joshua Lock wrote:
>>> Upstream BitBake still has the xmlrpc server removed. The version in
>>> Poky's BitBake is functional (I use it daily).
>>>
>>> Attached are two patches against BitBake master to add back the xmlrpc
>>> server (copied from Poky's tree) and fix the uievent.
>>
>> There have been API changes in upstream which mean this code will fail
>> to work with bitbake itself although it will work with the pr server.
>>
>> I've merged the patches as a bandaid to allow things to work but we've
>> now got two different server backends using different server APIs. I
>> really just want to highlight I'm aware of this and it will get
>> addressed next week. Its been on my todo list and is way overdue. The
>> main priority is to get people's builds with OE-Core working again.
>>
>
> btw. I am at 6c412f009e33e77cbcb5d4881c110e6bdda05282 of bitbake
> I still see the problem
>


here is the error

NOTE: Running task 919 of 925 (ID: 9,
/home/kraj/work/angstrom/sources/openembedded-core/meta/recipes-core/uclibc/uclibc_git.bb,
do_package)
NOTE: package uclibc-0.9.31+0.9.32rc3-r2.2: task do_package: Started
ERROR: Connecting to PR service None:None failed: int() argument must
be a string or a number, not 'NoneType'
ERROR: Function 'package_get_auto_pr' failed
ERROR: Logfile of failure stored in:
/home/kraj/work/angstrom/build/tmp-angstrom_2010_x-uclibc/work/efikamx-angstrom-linux-uclibceabi/uclibc-0.9.31+0.9.32rc3-r2.2/temp/log.do_package.5207
Log data follows:
| ERROR: Connecting to PR service None:None failed: int() argument
must be a string or a number, not 'NoneType'
| ERROR: Function 'package_get_auto_pr' failed
NOTE: package uclibc-0.9.31+0.9.32rc3-r2.2: task do_package: Failed
ERROR: Task 9 (/home/kraj/work/angstrom/sources/openembedded-core/meta/recipes-core/uclibc/uclibc_git.bb,
do_package) failed with exit code '1'
ERROR: '/home/kraj/work/angstrom/sources/openembedded-core/meta/recipes-core/uclibc/uclibc_git.bb'
failed


>> Cheers,
>>
>> Richard
>>
>>
>>
>> _______________________________________________
>> Openembedded-core mailing list
>> Openembedded-core@lists.openembedded.org
>> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>>
>



^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [bitbake-devel] [PATCH 00/11] Add PR service and integrate PKGV/PKGR from OE
@ 2011-05-28  1:05             ` Khem Raj
  0 siblings, 0 replies; 38+ messages in thread
From: Khem Raj @ 2011-05-28  1:05 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer; +Cc: bitbake-devel

On Fri, May 27, 2011 at 6:02 PM, Khem Raj <raj.khem@gmail.com> wrote:
> On Fri, May 27, 2011 at 3:09 PM, Richard Purdie
> <richard.purdie@linuxfoundation.org> wrote:
>> On Fri, 2011-05-27 at 13:09 -0700, Joshua Lock wrote:
>>> Upstream BitBake still has the xmlrpc server removed. The version in
>>> Poky's BitBake is functional (I use it daily).
>>>
>>> Attached are two patches against BitBake master to add back the xmlrpc
>>> server (copied from Poky's tree) and fix the uievent.
>>
>> There have been API changes in upstream which mean this code will fail
>> to work with bitbake itself although it will work with the pr server.
>>
>> I've merged the patches as a bandaid to allow things to work but we've
>> now got two different server backends using different server APIs. I
>> really just want to highlight I'm aware of this and it will get
>> addressed next week. Its been on my todo list and is way overdue. The
>> main priority is to get people's builds with OE-Core working again.
>>
>
> btw. I am at 6c412f009e33e77cbcb5d4881c110e6bdda05282 of bitbake
> I still see the problem
>


here is the error

NOTE: Running task 919 of 925 (ID: 9,
/home/kraj/work/angstrom/sources/openembedded-core/meta/recipes-core/uclibc/uclibc_git.bb,
do_package)
NOTE: package uclibc-0.9.31+0.9.32rc3-r2.2: task do_package: Started
ERROR: Connecting to PR service None:None failed: int() argument must
be a string or a number, not 'NoneType'
ERROR: Function 'package_get_auto_pr' failed
ERROR: Logfile of failure stored in:
/home/kraj/work/angstrom/build/tmp-angstrom_2010_x-uclibc/work/efikamx-angstrom-linux-uclibceabi/uclibc-0.9.31+0.9.32rc3-r2.2/temp/log.do_package.5207
Log data follows:
| ERROR: Connecting to PR service None:None failed: int() argument
must be a string or a number, not 'NoneType'
| ERROR: Function 'package_get_auto_pr' failed
NOTE: package uclibc-0.9.31+0.9.32rc3-r2.2: task do_package: Failed
ERROR: Task 9 (/home/kraj/work/angstrom/sources/openembedded-core/meta/recipes-core/uclibc/uclibc_git.bb,
do_package) failed with exit code '1'
ERROR: '/home/kraj/work/angstrom/sources/openembedded-core/meta/recipes-core/uclibc/uclibc_git.bb'
failed


>> Cheers,
>>
>> Richard
>>
>>
>>
>> _______________________________________________
>> Openembedded-core mailing list
>> Openembedded-core@lists.openembedded.org
>> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>>
>



^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [OE-core] [PATCH 00/11] Add PR service and integrate PKGV/PKGR from OE
  2011-05-28  1:05             ` [bitbake-devel] " Khem Raj
@ 2011-05-28  1:34               ` Khem Raj
  -1 siblings, 0 replies; 38+ messages in thread
From: Khem Raj @ 2011-05-28  1:34 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer; +Cc: bitbake-devel

On Fri, May 27, 2011 at 6:05 PM, Khem Raj <raj.khem@gmail.com> wrote:
> On Fri, May 27, 2011 at 6:02 PM, Khem Raj <raj.khem@gmail.com> wrote:
>> On Fri, May 27, 2011 at 3:09 PM, Richard Purdie
>> <richard.purdie@linuxfoundation.org> wrote:
>>> On Fri, 2011-05-27 at 13:09 -0700, Joshua Lock wrote:
>>>> Upstream BitBake still has the xmlrpc server removed. The version in
>>>> Poky's BitBake is functional (I use it daily).
>>>>
>>>> Attached are two patches against BitBake master to add back the xmlrpc
>>>> server (copied from Poky's tree) and fix the uievent.
>>>
>>> There have been API changes in upstream which mean this code will fail
>>> to work with bitbake itself although it will work with the pr server.
>>>
>>> I've merged the patches as a bandaid to allow things to work but we've
>>> now got two different server backends using different server APIs. I
>>> really just want to highlight I'm aware of this and it will get
>>> addressed next week. Its been on my todo list and is way overdue. The
>>> main priority is to get people's builds with OE-Core working again.
>>>
>>
>> btw. I am at 6c412f009e33e77cbcb5d4881c110e6bdda05282 of bitbake
>> I still see the problem
>>
>
>
> here is the error
>
> NOTE: Running task 919 of 925 (ID: 9,
> /home/kraj/work/angstrom/sources/openembedded-core/meta/recipes-core/uclibc/uclibc_git.bb,
> do_package)
> NOTE: package uclibc-0.9.31+0.9.32rc3-r2.2: task do_package: Started
> ERROR: Connecting to PR service None:None failed: int() argument must
> be a string or a number, not 'NoneType'
> ERROR: Function 'package_get_auto_pr' failed
> ERROR: Logfile of failure stored in:
> /home/kraj/work/angstrom/build/tmp-angstrom_2010_x-uclibc/work/efikamx-angstrom-linux-uclibceabi/uclibc-0.9.31+0.9.32rc3-r2.2/temp/log.do_package.5207
> Log data follows:
> | ERROR: Connecting to PR service None:None failed: int() argument
> must be a string or a number, not 'NoneType'
> | ERROR: Function 'package_get_auto_pr' failed
> NOTE: package uclibc-0.9.31+0.9.32rc3-r2.2: task do_package: Failed
> ERROR: Task 9 (/home/kraj/work/angstrom/sources/openembedded-core/meta/recipes-core/uclibc/uclibc_git.bb,
> do_package) failed with exit code '1'
> ERROR: '/home/kraj/work/angstrom/sources/openembedded-core/meta/recipes-core/uclibc/uclibc_git.bb'
> failed
>
>

this patch seems to fix it.

http://patches.openembedded.org/patch/4941/

>>> Cheers,
>>>
>>> Richard
>>>
>>>
>>>
>>> _______________________________________________
>>> Openembedded-core mailing list
>>> Openembedded-core@lists.openembedded.org
>>> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>>>
>>
>



^ permalink raw reply	[flat|nested] 38+ messages in thread

* Re: [bitbake-devel] [PATCH 00/11] Add PR service and integrate PKGV/PKGR from OE
@ 2011-05-28  1:34               ` Khem Raj
  0 siblings, 0 replies; 38+ messages in thread
From: Khem Raj @ 2011-05-28  1:34 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer; +Cc: bitbake-devel

On Fri, May 27, 2011 at 6:05 PM, Khem Raj <raj.khem@gmail.com> wrote:
> On Fri, May 27, 2011 at 6:02 PM, Khem Raj <raj.khem@gmail.com> wrote:
>> On Fri, May 27, 2011 at 3:09 PM, Richard Purdie
>> <richard.purdie@linuxfoundation.org> wrote:
>>> On Fri, 2011-05-27 at 13:09 -0700, Joshua Lock wrote:
>>>> Upstream BitBake still has the xmlrpc server removed. The version in
>>>> Poky's BitBake is functional (I use it daily).
>>>>
>>>> Attached are two patches against BitBake master to add back the xmlrpc
>>>> server (copied from Poky's tree) and fix the uievent.
>>>
>>> There have been API changes in upstream which mean this code will fail
>>> to work with bitbake itself although it will work with the pr server.
>>>
>>> I've merged the patches as a bandaid to allow things to work but we've
>>> now got two different server backends using different server APIs. I
>>> really just want to highlight I'm aware of this and it will get
>>> addressed next week. Its been on my todo list and is way overdue. The
>>> main priority is to get people's builds with OE-Core working again.
>>>
>>
>> btw. I am at 6c412f009e33e77cbcb5d4881c110e6bdda05282 of bitbake
>> I still see the problem
>>
>
>
> here is the error
>
> NOTE: Running task 919 of 925 (ID: 9,
> /home/kraj/work/angstrom/sources/openembedded-core/meta/recipes-core/uclibc/uclibc_git.bb,
> do_package)
> NOTE: package uclibc-0.9.31+0.9.32rc3-r2.2: task do_package: Started
> ERROR: Connecting to PR service None:None failed: int() argument must
> be a string or a number, not 'NoneType'
> ERROR: Function 'package_get_auto_pr' failed
> ERROR: Logfile of failure stored in:
> /home/kraj/work/angstrom/build/tmp-angstrom_2010_x-uclibc/work/efikamx-angstrom-linux-uclibceabi/uclibc-0.9.31+0.9.32rc3-r2.2/temp/log.do_package.5207
> Log data follows:
> | ERROR: Connecting to PR service None:None failed: int() argument
> must be a string or a number, not 'NoneType'
> | ERROR: Function 'package_get_auto_pr' failed
> NOTE: package uclibc-0.9.31+0.9.32rc3-r2.2: task do_package: Failed
> ERROR: Task 9 (/home/kraj/work/angstrom/sources/openembedded-core/meta/recipes-core/uclibc/uclibc_git.bb,
> do_package) failed with exit code '1'
> ERROR: '/home/kraj/work/angstrom/sources/openembedded-core/meta/recipes-core/uclibc/uclibc_git.bb'
> failed
>
>

this patch seems to fix it.

http://patches.openembedded.org/patch/4941/

>>> Cheers,
>>>
>>> Richard
>>>
>>>
>>>
>>> _______________________________________________
>>> Openembedded-core mailing list
>>> Openembedded-core@lists.openembedded.org
>>> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>>>
>>
>



^ permalink raw reply	[flat|nested] 38+ messages in thread

end of thread, other threads:[~2011-05-28  1:38 UTC | newest]

Thread overview: 38+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-27  6:31 [PATCH 00/11] Add PR service and integrate PKGV/PKGR from OE Lianhao Lu
2011-05-27  6:31 ` [PATCH 01/11] Added the PR service Lianhao Lu
2011-05-27  6:31 ` [PATCH 02/11] conf/bitbake.conf: Added variables for " Lianhao Lu
2011-05-27  6:31 ` [PATCH 03/11] meta-yocto/local.conf.sample: Added PRSERV_HOST and PRSERV_PORT Lianhao Lu
2011-05-27  6:31 ` [PATCH 04/11] classes/package(prserv).bbclass: Get PRAUTO and use PKGV/PKGR Lianhao Lu
2011-05-27  6:31 ` [PATCH 05/11] classes/package_xxx.class: Use PKGE/PKGV/PKGR Lianhao Lu
2011-05-27  6:31 ` [PATCH 06/11] udev: use EXTENDPKGV instead of EXTENDPV Lianhao Lu
2011-05-27  6:31 ` [PATCH 07/11] xcb: " Lianhao Lu
2011-05-27  6:31 ` [PATCH 08/11] xorg-proto: " Lianhao Lu
2011-05-27  6:31 ` [PATCH 09/11] xorg-util/util-macros: " Lianhao Lu
2011-05-27  6:31 ` [PATCH 10/11] linux-libc-headers: " Lianhao Lu
2011-05-27  6:31 ` [PATCH 11/11] conf/bitbake.conf: Removed EXTENDPV and EXTENDPEVER Lianhao Lu
2011-05-27 17:00 ` [PATCH 00/11] Add PR service and integrate PKGV/PKGR from OE Richard Purdie
2011-05-27 18:48   ` Koen Kooi
2011-05-27 19:08     ` Otavio Salvador
2011-05-27 19:13       ` Koen Kooi
2011-05-27 20:09     ` [OE-core] " Joshua Lock
2011-05-27 20:09       ` Joshua Lock
2011-05-27 20:24       ` [OE-core] " Khem Raj
2011-05-27 20:24         ` Khem Raj
2011-05-27 20:54       ` Joshua Lock
2011-05-27 21:00       ` [OE-core] " Joshua Lock
2011-05-27 21:00         ` [bitbake-devel] " Joshua Lock
2011-05-27 21:01         ` [OE-core] " Khem Raj
2011-05-27 21:01           ` [bitbake-devel] " Khem Raj
2011-05-27 21:09           ` Joshua Lock
2011-05-27 21:01       ` [OE-core] " Joshua Lock
2011-05-27 21:01         ` [bitbake-devel] " Joshua Lock
2011-05-27 21:01       ` [OE-core] " Joshua Lock
2011-05-27 21:01         ` [bitbake-devel] " Joshua Lock
2011-05-27 22:09       ` [OE-core] " Richard Purdie
2011-05-27 22:09         ` [bitbake-devel] " Richard Purdie
2011-05-28  1:02         ` [OE-core] " Khem Raj
2011-05-28  1:02           ` [bitbake-devel] " Khem Raj
2011-05-28  1:05           ` [OE-core] " Khem Raj
2011-05-28  1:05             ` [bitbake-devel] " Khem Raj
2011-05-28  1:34             ` [OE-core] " Khem Raj
2011-05-28  1:34               ` [bitbake-devel] " Khem Raj

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.