Bug 1023573 - Custom compile of xulrunner 25 fails with unable to match template error.
Summary: Custom compile of xulrunner 25 fails with unable to match template error.
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: xulrunner
Version: 20
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Martin Stransky
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-10-25 19:29 UTC by stan
Modified: 2015-01-05 15:34 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-01-05 10:51:35 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description stan 2013-10-25 19:29:50 UTC
Description of problem:
When compiling the src rpm of xulrunner 25 from koji, it fails with an error that it is unable to find a match for a template


Version-Release number of selected component (if applicable):
xulrunner 25.0

How reproducible:
Every time


Steps to Reproduce:
1.  Put custom .mozilla in ~/.mozilla
2.  Remove crash reporter and debuginfo from spec file
3.  rpmbuild -bb xulrunner.spec

Actual results:
Compile fails in 
xulrunner-25.0/mozilla-release/content/media/plugins/MediaResourceServer.cpp
because the compiler can't find a template match.

Expected results:
Compile succeeds.


Additional info
I realize that 'I bit it, I bought it' on a custom compile.  However, I was able to do a one line patch and get past this problem.  I thought I would report it so it made it back upstream.

Here's the patch:
--- xulrunner-25.0/mozilla-release/content/media/plugins/MediaResourceServer.cpp  2013-10-25 10:04:21.192693383 -0700
+++ xulrunner-25.0/mozilla-release/content/media/plugins/MediaResourceServer.cpp  2013-10-25 10:06:53.038201961 -0700
@@ -226,11 +226,11 @@ ServeResourceEvent::Run() {
     const char* s = strstr(line.get(), byteRange.get());
     if (s) {
       start = strtoll(s+byteRange.Length(), NULL, 10);

       // Clamp 'start' to be between 0 and the resource length.
-      start = std::max(0ll, std::min(resource->GetLength(), start));
+      start = std::max(0l, std::min(resource->GetLength(), start));
     }
   }

   // HTTP response to use if this is a non byte range request
   const char* response_normal = "HTTP/1.1 200 OK\r\n";

This seemed to be a common warning during the compile, but this was the only place it caused an error.  Like a 32 bit programmer let habit take over while programming 64 bit.

warning: format '%lld' expects argument of type 'long long int', but argument 4 has type 'int64_t {aka long int}' [-Wformat=]


I added the following lines to the spec file, after placing the patch in SOURCES as xulrunner-25.0-mediaresourceserver.patch


# Upstream patches
Patch25:        xulrunner-25.0-mediaresourceserver.patch


%patch25  -p2 -b .mediaresourceserver


Here's the custom .mozconfig I used.  I have to disable crashreporter and debuginfo for the compile to complete.  I let it run with those enabled for 10 hours after the compile completed, and the compiler spent the whole time thrashing while trying to optimize the debuginfo files for size.  At 2 Gb, my system is marginal for this compile, since mozilla suggests 4 Gb.

#  This is the original .mozconfig from the src.rpm package for xulrunner
. $topsrcdir/xulrunner/config/mozconfig
# --with-system-png is disabled because Mozilla requires APNG support in libpng
#ac_add_options --with-system-png

ac_add_options --prefix="$PREFIX"
ac_add_options --libdir="$LIBDIR"
ac_add_options --with-system-jpeg
ac_add_options --with-system-zlib
ac_add_options --with-system-bz2
ac_add_options --with-system-libvpx
ac_add_options --enable-system-hunspell
ac_add_options --with-pthreads
#ac_add_options --disable-strip
ac_add_options --disable-tests
ac_add_options --disable-mochitest
ac_add_options --disable-installer
#ac_add_options --enable-xinerama
ac_add_options --enable-default-toolkit=cairo-gtk2
ac_add_options --enable-pango
ac_add_options --enable-svg
ac_add_options --enable-canvas
ac_add_options --disable-javaxpcom
ac_add_options --enable-safe-browsing
ac_add_options --enable-extensions=default
ac_add_options --enable-libnotify
ac_add_options --disable-necko-wifi
ac_add_options --enable-startup-notification
ac_add_options --disable-cpp-exceptions
ac_add_options --enable-shared-js
ac_add_options --enable-url-classifier
ac_add_options --enable-gio
ac_add_options --disable-gnomevfs
ac_add_options --disable-updater
ac_add_options --enable-chrome-format=omni
#ac_add_options --disable-gstreamer

export BUILD_OFFICIAL=1
export MOZILLA_OFFICIAL=1
export MOZ_UA_BUILDID=20100101

mk_add_options BUILD_OFFICIAL=1
mk_add_options MOZILLA_OFFICIAL=1
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/objdir
ac_add_options --with-system-nspr
ac_add_options --with-system-nss
ac_add_options --enable-system-sqlite
ac_add_options --disable-system-cairo
ac_add_options --enable-system-ffi
ac_add_options --disable-debug
#ac_add_options --enable-optimize

# These are additional options I've added to tune the build.
# Have to disable debuginfo and crashreporter in the spec file to use them.

mk_add_options MOZ_MAKE_FLAGS="-j1"
ac_add_options --enable-gstreamer
ac_add_options --enable-pulseaudio
ac_add_options --enable-media-plugins
ac_add_options --enable-webm
ac_add_options --with-arch=k8
ac_add_options --with-x
ac_add_options --with-ccache
#ac_add_options --with-compiler-wrapper

# These are additional options I've added to tune the build.
# Have to disable debuginfo and crashreporter in the spec file to use them.

mk_add_options MOZ_MAKE_FLAGS="-j1"
ac_add_options --enable-gstreamer
ac_add_options --enable-pulseaudio
ac_add_options --enable-media-plugins
ac_add_options --enable-webm
ac_add_options --with-arch=k8
ac_add_options --with-x
ac_add_options --with-ccache
#ac_add_options --with-compiler-wrapper
ac_add_options --disable-gamepad
ac_add_options --disable-parental-controls
ac_add_options --enable-optimize="-g0 -O3"
ac_add_options --enable-strip
ac_add_options --enable-install-strip


I add these lines to the xulrunner.spec to disable crashreporter and debuginfo.

## crash reporter work only on x86/x86_64
#%ifarch %{ix86} x86_64
#%global enable_mozilla_crashreporter 1
#%else
%global enable_mozilla_crashreporter 0
#%endif
%global debug_package %{nil}

So, why do I bother?  Well, the resulting executable is roughly 1 1/2 times faster.  Enough to be noticeable.

Comment 1 stan 2013-10-25 19:33:38 UTC
There's some duplication in the .mozconfig.  The paste must have gone wrong.  The second
#These are some additional ...
is spurious until 
I add these lines ...

Comment 2 Martin Stransky 2013-11-12 10:20:38 UTC
> So, why do I bother?  Well, the resulting executable is roughly 1 1/2 times 
> faster.  Enough to be noticeable.

Whan do you mean with that? The firefox is 50% faster when it's built without debug info and crashreporter?

Comment 3 stan 2013-11-12 14:52:21 UTC
I don't know that it is the lack of debug and crash reporter that is making the difference.  I also use O3 optimization.  And some other customization, as the .mozconfig shows.  Maybe it's just because it is compiled for only my system.  But there is a noticeable difference in speed for firefox, guesstimating the 50% faster.

If it would compile on my system with debug and crashreporter, I would leave it active, but it won't, so I can't say for sure.

I haven't noticed any crashes in firefox, so I am probably not hindering firefox development through my lack of reporting.

Comment 4 Martin Stransky 2015-01-05 10:51:35 UTC
Unable to reproduce, the build system is completely different now. Let's close it.

Comment 5 stan 2015-01-05 15:34:59 UTC
I agree, there isn't even the mediaresourceserver code in the latest version of firefox.  And xulrunner isn't used by the Fedora package anymore.


Note You need to log in before you can comment on or make changes to this bug.