Apache OpenOffice (AOO) Bugzilla – Full Text Issue Listing |
Summary: | PyUNO broken in OOo 3.0 DEV300 with system python | ||
---|---|---|---|
Product: | App Dev | Reporter: | kendy |
Component: | api | Assignee: | AOO issues mailing list <issues> |
Status: | CONFIRMED --- | QA Contact: | |
Severity: | Trivial | ||
Priority: | P4 | CC: | ahz001, chris, issues, nesshof, pmladek, rene, stephan.bergmann.secondary |
Version: | 3.3.0 or older (OOo) | Keywords: | oooqa, regression |
Target Milestone: | --- | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Latest Confirmation in: | --- |
Developer Difficulty: | --- |
Description
kendy
2008-06-13 15:33:46 UTC
@kendy: You need at least DEV300m19 to get this working at all. @cmc: Figuring from your comment to issue 88211 that you are willing to create a fix for this issue? ;) Thanks. As discussed at <http://udk.openoffice.org/servlets/ReadMsg?list=dev&msgNo=4040>, SYSTEM_PYTHON PyUNO is indeed still broken. For non-SYSTEM_PYTHON, the problem got fixed by pyuno/zipcore/python.sh:1.10 (which is installed as /opt/openoffice.org3/program/python), the two main points probably also relevant for SYSTEM_PYTHON being to (a) "Set LD_LIBRARY_PATH so that 'import pyuno' finds libpyuno.so" and (b) "Set URE_BOOTSTRAP so that 'uno.getComponentContext()' bootstraps a complete OOo UNO environment". Crap, its not like I even know what's going on :-) wrt. a) finding pyuno. We tweak things a bit to make "import uno" work out of the box anyway by echo "import sys" > uno.py echo "sys.path.append('%{basisinstdir}/program')" >> uno.py and sticking uno.py in the system python place. I believe that ooo-build has a (nasty hardcoded to /usr/lib) rpath to make "import pyuno" work. So... cmc->kendy: does running the suse system python with openoffice.org-pyuno installed and typing into it import uno work ? I'm not sure if that's sufficient, but I assume its necessary anyway. So as sb says, If I just do export URE_BOOTSTRAP=vnd.sun.star.path:/usr/lib/openoffice.org3/program/fundamentalrc then it'll work. Hmm, now for *my* packaging, even with broffice.org installed, I always have an openoffice.org3/program/fundamentalrc installed too. So for me anyway, doing... echo "import sys, os" > uno.py echo "sys.path.append('%{basisinstdir}/program')" >> uno.py echo "os.putenv('URE_BOOTSTRAP', 'vnd.sun.star.pathname:%{oooinstdir}/program/fundamentalrc') would work fine So this is new "fixed" for the fedora system python builds. I guess the question is if this sort of a fix is upstreamable in any sane way because we'd need to know in advance where OOo will be installed and we don't know that until we get to instsetoo_native If I had total free reign, I'd take the standard configure --libdir argument as the basis dir that everything gets installed into and tweak the configure --disable-epm to export a suitable PKGFORMATSWITCH with a -simple DIR of that_prefix_dir (as a side effect making all distros use LIBDIR/openoffice.org3 and LIBDIR/openoffice.org as their OOo directories) and make SYSTEM_PYTHON add into uno.py during the build my above lines. cmc: So, apparently in openSUSE we don't have pyuno working out of the box, what I need to do to get it running is PYTHONPATH=/usr/lib64/ooo-2.0/program python blah.py [where blah.py contains just the 'import uno'] According to sb's comment, and with your finding, I hope an additional URE_BOOTSTRAP will do it for me when I get to m19 :-) cmc: Wrt. setting prefixes in the configure, I've filed a bug against is, maybe this could go together with it? It is issue 90430. pmladek: What do you think, please? cmc->kendy: indeed, you either need the debian-esque rpath hack (which would then need to be extended for the multilib /usr/lib64 on 64bit systems like suse/redhat) in ooo-build, or you need the import sys sys.path.append(/path/to/office/program) hack at the top of uno.py like fedora, and the relocation into the "standard" python locations, here's the dump from my own spec to do the relocation and fixup %define instdir %{_libdir} %define baseinstdir %{instdir}/openoffice.org %define basisinstdir %{baseinstdir}/basis3.0 %define python_py_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(0)") # move python bits into site-packages mkdir -p $RPM_BUILD_ROOT/%{python_py_sitearch} pushd $RPM_BUILD_ROOT/%{python_py_sitearch} echo "import sys, os" > uno.py echo "sys.path.append('%{basisinstdir}/program')" >> uno.py echo "os.putenv('URE_BOOTSTRAP', 'vnd.sun.star.pathname:%{oooinstdir}/program/fundamentalrc')" >> uno.py cat $RPM_BUILD_ROOT/%{basisinstdir}/program/uno.py >> uno.py rm -f $RPM_BUILD_ROOT/%{basisinstdir}/program/uno.py* mv -f $RPM_BUILD_ROOT/%{basisinstdir}/program/unohelper.py* . popd Re <#desc2>, see issue 97629 for the additional requirement (c) to set the UNO_PATH environment variable so that officehelper.py can start soffice. FTR, debian in the meanwhile also uses caolans hack because the rpath hack didn't work anymore :) Reset assigne to the default "issues@openoffice.apache.org". |