Build of xulrunner fails with python/nsdom enabled



Other Applications
10 years ago
9 years ago


(Reporter: lkcl, Unassigned)


1.9.0 Branch

Firefox Tracking Flags

(Not tracked)



(1 attachment)



10 years ago
User-Agent:       Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv: Gecko/20080404 Iceweasel/ (Debian-
Build Identifier:

make[5]: Entering directory `/mnt/video/src/xulrunner-'
make[6]: Entering directory `/mnt/video/src/xulrunner-'
rm -f
c++  -fno-rtti -fno-exceptions -Wall -Wconversion -Wpointer-arith -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Wcast-align -Wno-long-long -g -fno-strict-aliasing -pthread -pipe  -DNDEBUG -DTRIMMED -Os -freorder-blocks -fno-reorder-functions  -DPYTHON_SO=\"\" -fPIC -shared -Wl,-z,defs -Wl,-h, -o  nsPyArgArray.o nsPyContext.o nsPyRuntime.o nsPyDOMModule.o nsPyDOMISupports.o nsPyTimeout.o     -lpthread   -Wl,-rpath-link,../../../../dist/bin  ../../../../dist/lib/libxpcomglue_s.a -L../../../../dist/bin -lxpcom -L../../../../dist/bin -lxpcom -lxul  -L../../../../dist/bin -L/usr/lib -lplds4 -lplc4 -lnspr4 -lpthread -ldl  -Wl,--version-script -Wl,../../../../build/unix/gnu-ld-scripts/components-version-script -Wl,-Bsymbolic -ldl -lm  -L/usr/lib -lpython2.5 -lutil -L../../../../dist/lib -lpyxpcom  -L../../../../dist/bin -lmozjs  
nsPyContext.o: In function `nsPythonContext::Deserialize(nsIObjectInputStream*, nsScriptObjectHolder&)':
/mnt/video/src/xulrunner- undefined reference to `PyMarshal_ReadObjectFromString'
/usr/bin/ld: nsPyContext.o: relocation R_X86_64_PC32 against `PyMarshal_ReadObjectFromString' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value

Reproducible: Always

Steps to Reproduce:
1. apt-get source xulrunner-1.9
2. apt-get build-dep xulrunner-1.9
3. edit debian/mozconfig and change "python/xpcom" to "python".
4. dpkg-buildconfig -rfakeroot -nc
Actual Results:  
failed build.

Expected Results:  
successful build states that this should be fixed:

"Fixed in xulrunner"

it's not.


10 years ago
Version: unspecified → 1.9.0 Branch

Comment 1

10 years ago
Not an XPCOM bug, and we don't seem to have a PyXPCOM component. AFAIK this code is not maintained.
Component: XPCOM → General
QA Contact: xpcom → general

Comment 2

10 years ago
don't know where this bug is supposed to go (so i submitted it for xpcom).

it's a rather obscure but really quite... important feature (nsdom) that opens up *massive* possibilities.  two very big projects - komodo and miro - are using nsdom.  komodo include nsdom but they only produce x86 builds.

if this error is fixed, xulrunner can be used as the back-end for a widget set API that competes with - and is a lot better than - python-qt4 and pygtk2.  see for details.  a successful port to webkit has been made.

i'm looking to get ports to python-kde (using python bindings to khtmlpart) and to xulrunner (using python-nsdom).

Comment 3

10 years ago
research into the various links - esp the fedora one - shows that if you change #include "marshal.h" to #include <marshal.h> and also add a marshal.h into dist/include/system_wrappers.h that this problem happily goes away.

i.e. you get a link.

whether it _works_ or not is another matter, yet to be determined by my beautifully-slow laptop...

Comment 4

10 years ago
make[7]: Entering directory `/mnt/video/src/xulrunner-'
if test ! -d ../../../../../dist/xpi-stage/pyxultest/defaults/preferences; then /mnt/video/src/xulrunner- -D ../../../../../dist/xpi-stage/pyxultest/defaults/preferences; fi
set -e;   \
        for i in ./pyxultest-prefs.js; do \
          dest=../../../../../dist/xpi-stage/pyxultest/defaults/preferences/`basename $i`; \
          rm -f -f $dest; \
+++ making chrome /mnt/video/src/xulrunner-  => ../../../../../dist/xpi-stage/pyxultest/chrome/pyxultest.jar
+++ updating chrome ../../../../../dist/xpi-stage/pyxultest/chrome/pyxultest.manifest
Traceback (most recent call last):
  File "../../../../../config/", line 471, in <module>
  File "../../../../../config/", line 456, in main
    pp.handleCommandLine(None, True)
  File "../../../../../config/", line 202, in handleCommandLine
  File "../../../../../config/", line 441, in do_include
  File "../../../../../config/", line 223, in handleLine
  File "../../../../../config/", line 149, in write
    aLine = f[1](aLine)
  File "../../../../../config/", line 403, in filter_substitution
    return self.varsubst.sub(repl, aLine)
  File "../../../../../config/", line 401, in repl
    raise Preprocessor.Error(self, 'UNDEFINED_VAR', varname)
__main__.Error: ('/mnt/video/src/xulrunner-', 18, 'UNDEFINED_VAR', 'BUILD_ID')
make[7]: *** [libs] Error 1

wtf?? _come_ on, guys.  is _anyone_ building this really strategically important code??

Comment 5

10 years ago
add these to pyxultest


BUILD_ID = $(shell $(PYTHON) $(topsrcdir)/config/ $(LIBXUL_DIST)/bin/platform.ini Build BuildID)


include $(topsrcdir)/config/

Comment 6

10 years ago

as suspected by michael stone, marshal.h is the key.  i've "avoided" the compile error by specifying #include <marshal.h> rather than #include "marshal.h".  exactly how you go about including /usr/include/{correctpythonversion}/marshal.h inside the system_wrappers/marshal.h i REALLY do not know.

perhaps you would need a ?


9 years ago
Component: General → PyXPCOM
Product: Core → Other Applications
QA Contact: general → pyxpcom

Comment 7

9 years ago
Do I have to add -I/usr/include/pythonx.y to compiler option?

Comment 8

9 years ago
Comment #7 is properly set by MOZ_PYTHON_INCLUDES in config/
And MOZ_PYTHON_INCLUDES is added to LOCAL_INCLUDES in dom/src/Makefile.

But it is not reflected.

Comment 9

9 years ago

Note that Pyxpcom on linux requires a shared Python build (i.e. a Python configured with --enable-shared), and this shared Python will need to be the first Python found on your PATH.

Another tip is to disable gcc visibility, you do this by adding the visibility flag to the configure line:
  ac_cv_visibility_pragma=no ./configure ...
Created attachment 414251 [details] [diff] [review]
added marshal.h fto system headers

The built fails because system_wrappers are missing marshal.h file.
I can confirm that bug on Fedora 12 / Python 2.6.
Ever confirmed: true

Comment 12

9 years ago
I run into the same problem when compiling against the system Python (Ubuntu 9.10).

Added this patch to pyxpcom hg repository (1.9.2):


9 years ago
Last Resolved: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.