Closed Bug 503472 Opened 15 years ago Closed 14 years ago

xulrunner build fails with '--enable-extensions=python,default'

Categories

(Other Applications Graveyard :: PyXPCOM, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: gour, Unassigned)

Details

User-Agent:       Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1) Gecko/20090701 Shiretoko/3.5
Build Identifier: xulrunner-1.9.1

Hello!

I'd like to test pyjamas-desktop (http://pyjd.org/) and it requires python-xpcom.

Following instructions at https://developer.mozilla.org/en/Building_PyXPCOM I modified default mozconfig in Arch Linux by adding:

--enable-extensions=python,default

line. The build fails and I've found the same log in

https://bugzilla.redhat.com/show_bug.cgi?id=436581


Reproducible: Always

Steps to Reproduce:
1. Try to build with --enable-extensions=python,default
2. build fails at linker phase
3.
Actual Results:  
[...]
rm -f libpydom.so
c++  -fno-rtti -fno-exceptions -Wall -Wpointer-arith -Woverloaded-virtual
-Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Wcast-align
-Wno-invalid-offsetof -Wno-long-long -pedantic -fno-strict-aliasing
-fshort-wchar -pthread -pipe  -DNDEBUG -DTRIMMED -Os -freorder-blocks
-fno-reorder-functions  -DPYTHON_SO=\"libpython2.6.so\" -fPIC -shared
-Wl,-z,defs -Wl,-h,libpydom.so -o libpydom.so  nsPyArgArray.o nsPyContext.o
nsPyRuntime.o nsPyDOMModule.o nsPyDOMISupports.o nsPyTimeout.o     -lpthread
-Wl,-rpath,/usr/lib/xulrunner-1.9.1 
-Wl,-rpath-link,/var/abs/local/x11/xulrunner/src/mozilla-1.9.1/dist/bin
-Wl,-rpath-link,/usr/lib 
/var/abs/local/x11/xulrunner/src/mozilla-1.9.1/dist/lib/libxpcomglue_s.a
-L/var/abs/local/x11/xulrunner/src/mozilla-1.9.1/dist/bin -lxpcom
-L/var/abs/local/x11/xulrunner/src/mozilla-1.9.1/dist/bin -lxpcom -lxul 
-L/var/abs/local/x11/xulrunner/src/mozilla-1.9.1/dist/bin -L/usr/lib -lplds4
-lplc4 -lnspr4 -lpthread -ldl  -Wl,--version-script
-Wl,../../../../build/unix/gnu-ld-scripts/components-version-script
-Wl,-Bsymbolic -lasound -ldl -lm  -L/usr/lib -lpython2.6 -lutil
-L../../../../dist/lib -lpyxpcom 
-L/var/abs/local/x11/xulrunner/src/mozilla-1.9.1/dist/bin -lmozjs  
nsPyContext.o: In function `nsPythonContext::Deserialize(nsIObjectInputStream*,
nsScriptObjectHolder&)':
nsPyContext.cpp:(.text+0xb5d): undefined reference to
`PyMarshal_ReadObjectFromString'
nsPyContext.o: In function `nsPythonContext::Serialize(nsIObjectOutputStream*,
void*)':
nsPyContext.cpp:(.text+0xc1d): undefined reference to
`PyMarshal_WriteObjectToString'
/usr/bin/ld: libpydom.so: hidden symbol `PyMarshal_WriteObjectToString' isn't
defined
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: ld returned 1 exit status
make[7]: *** [libpydom.so] Error 1
make[7]: Leaving directory
`/var/abs/local/x11/xulrunner/src/mozilla-1.9.1/extensions/python/dom/src'
make[6]: *** [libs] Error 2
make[6]: Leaving directory
`/var/abs/local/x11/xulrunner/src/mozilla-1.9.1/extensions/python/dom'
make[5]: *** [libs] Error 2
make[5]: Leaving directory
`/var/abs/local/x11/xulrunner/src/mozilla-1.9.1/extensions/python'
make[4]: *** [libs] Error 2
make[4]: Leaving directory
`/var/abs/local/x11/xulrunner/src/mozilla-1.9.1/extensions'
make[3]: *** [libs_tier_app] Error 2
make[3]: Leaving directory `/var/abs/local/x11/xulrunner/src/mozilla-1.9.1'
make[2]: *** [tier_app] Error 2
make[2]: Leaving directory `/var/abs/local/x11/xulrunner/src/mozilla-1.9.1'
make[1]: *** [default] Error 2
make[1]: Leaving directory `/var/abs/local/x11/xulrunner/src/mozilla-1.9.1'
make: *** [build] Error 2



Expected Results:  
Successful build of xulrunner with python-xpcom extensions.


[gour@nitai gour] uname -a
Linux nitai 2.6.30-ARCH #1 SMP PREEMPT Fri Jun 19 20:44:03 UTC 2009 x86_64 AMD Turion(tm) 64 Mobile ML-34 AuthenticAMD GNU/Linux

[gour@nitai gour] gcc -v
Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with: ../configure --prefix=/usr --enable-shared --enable-languages=c,c++,fortran,objc,obj-c++ --enable-threads=posix --mandir=/usr/share/man --infodir=/usr/share/info --enable-__cxa_atexit --disable-multilib --libdir=/usr/lib --libexecdir=/usr/lib --enable-clocale=gnu --disable-libstdcxx-pch --with-tune=generic
Thread model: posix
gcc version 4.4.0 20090526 (prerelease) (GCC)
Forgot to mark branch as 1.9.1
Version: unspecified → 1.9.1 Branch
Hi!

After trying ome more time - this time with script-ing the build to get the whole log, I've noticed few interesting lines which might be connected with the build failure:

[...]
creating extensions/python/Makefile
creating extensions/gnomevfs/Makefile
creating extensions/python/xpcom/Makefile
Unknown variable:extensions/python/xpcom/Makefile:55:pyexecdir  = @libdir@/python$(MOZ_PYTHON_VER_DOTTED)/site-packages
creating extensions/python/xpcom/components/Makefile
creating extensions/python/xpcom/src/Makefile
creating extensions/python/xpcom/src/loader/Makefile
creating extensions/python/xpcom/src/module/Makefile
Unknown variable:extensions/python/xpcom/src/module/Makefile:44:pyexecdir       = @libdir@/python$(MOZ_PYTHON_VER_DOTTED)/site-packages
creating extensions/python/xpcom/test/Makefile
creating extensions/python/xpcom/test/test_component/Makefile
creating extensions/python/dom/Makefile
creating extensions/python/dom/test/Makefile
creating extensions/python/dom/test/pyxultest/Makefile
creating extensions/python/dom/src/Makefile
creating extensions/python/dom/nsdom/Makefile
creating extensions/python/dom/nsdom/test/Makefile


Does it help?


Sincerely,
Gour
Component: Build Config → General
QA Contact: build-config → general
Version: 1.9.1 Branch → Trunk
Hi!

I managed to build 1.9.1 with --enable-extensions=default,python/xpcom which means that the docs at https://developer.mozilla.org/en/Building_PyXPCOM#Testing_PyXPCOM is misleading saying: 
<quote>
For example, 1.8 branch users could add a line:

ac_add_options --enable-extensions=python/xpcom,default 

Or later versions can add:

ac_add_options --enable-extensions=python,default 

to your .mozconfig file.
</quote>

However, after copying extension to ../python-2.6/site-packages, attempt to import it by: 

from xpcom import components

in python shell, produced:

[gour@nitai xulrunner] python
Python 2.6.2 (r262:71600, Jun 18 2009, 20:33:24) 
[GCC 4.4.0 20090526 (prerelease)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from xpcom import components
/usr/lib/python2.6/site-packages/xpcom/__init__.py:54: DeprecationWarning: BaseException.message has been deprecated as of Python 2.6
  self.message = message
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.6/site-packages/xpcom/components.py", line 231, in <module>
    import shutdown
  File "/usr/lib/python2.6/site-packages/xpcom/shutdown.py", line 51, in <module>
    class _ShutdownObserver:
  File "/usr/lib/python2.6/site-packages/xpcom/shutdown.py", line 52, in _ShutdownObserver
    _com_interfaces_ = interfaces.nsIObserver
  File "/usr/lib/python2.6/site-packages/xpcom/components.py", line 103, in __getattr__
    return self._get_one(attr)
  File "/usr/lib/python2.6/site-packages/xpcom/components.py", line 153, in _get_one
    raise xpcom.COMException(nsError.NS_ERROR_NO_INTERFACE, "The interface '%s' does not exist" % (name,))
xpcom.Exception/usr/lib/python2.6/site-packages/xpcom/__init__.py:62: DeprecationWarning: BaseException.message has been deprecated as of Python 2.6
  message = self.message
: -2147467262 (-2147467262)


All in all, thanks to pyjamas & pyjamas-project, python devs now have ability to write-once & run-everywhere their apps, so it would be nice if python-xpcom would receive some more love. ;)


Siincerely,
Gour
Hi!

I managed to proceed and learnt that the build which I did actually works.


However, it would be nice to have up-to-date docs how to build 1.9.x branch.


Sincerely,
Gour
(Not familiar with technical details of the python bridge, just triaging core:general bugs. That said...)

1) Is this different from bug 472649?
2) Please feel free to improve documentation on developer.mozilla.org!
Component: General → PyXPCOM
Product: Core → Other Applications
QA Contact: general → pyxpcom
Yeah, it could be.

In any case, I do not have this issue any longer when running xulrunner-1.9.2.

Moreover, no need to build it manually 'cause my distro is packaging xulrunner with extensions enabled.

This can be closed.


Sincerely,
Gour
Status: UNCONFIRMED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Product: Other Applications → Other Applications Graveyard
You need to log in before you can comment on or make changes to this bug.