Page 1 of 1

Mach packaging error message

Posted: 2019-12-06, 14:24
by __tch
What does this error message mean and how can i solve it?
Error while running startup cache precompilation
It's Linux/ARMHF, GCC-7 and Python 2.7.

Re: Mach packaging error message

Posted: 2019-12-06, 15:52
by adesh
No idea. It'd be helpful if you tell the exact command you are running and post your mozconfig and some of the relevant build output.

Re: Mach packaging error message

Posted: 2019-12-06, 15:58
by Walter Dnes
You can solve it by including --disable-precompiled-startupcache in your mozconfig. Note; the first startup after install or upgrade will be slower, because it has to pre-populate the startupcache at first launch.

Why it happens... By default, the final compiled code is run on the build host to pre-populate the startupcache at the end of the build process. If the compiled code can't run on the build host (e.g. different architecture), you get the error. E.g. if you build ARM code on an Intel machine, the ARM code is not going to run on the Intel CPU.

Re: Mach packaging error message

Posted: 2019-12-06, 15:59
by New Tobin Paradigm
Some versions of linux and Bullshit System Distributions don't play well with the precompilation of startup cache either.

Re: Mach packaging error message

Posted: 2019-12-06, 18:35
by __tch
@adesh:
The command is just

Code: Select all

./mach build && ./mach package
and the config is

Code: Select all

#mk_add_options AUTOCLOBBER=1
mk_add_options MOZ_MAKE_FLAGS="-j3"
ac_add_options --enable-default-toolkit=cairo-gtk2
ac_add_options --enable-alsa
ac_add_options --disable-pulseaudio
#ac_add_options --enable-optimize=-O2
ac_add_options --enable-strip
ac_add_options --disable-debug
ac_add_options --enable-release
ac_add_options --disable-sync
ac_add_options --disable-verify-mar
ac_add_options --disable-updater
ac_add_options --disable-crashreporter
ac_add_options --disable-maintenance-service
ac_add_options --disable-tests
ac_add_options --disable-ipdl-tests
Edit: The build finished without errors, only the packaging dies, so nothing to include from the build output. Here are the relevant lines from the packaging output:

Code: Select all

 0:07.76 resource://gre/components/PageThumbsProtocol.js
 0:08.77 Traceback (most recent call last):
 0:08.77   File "/mnt/UXP/toolkit/mozapps/installer/packager.py", line 416, in <module>
 0:08.77     main()
 0:08.77   File "/mnt/UXP/toolkit/mozapps/installer/packager.py", line 410, in main
 0:08.78     args.source, gre_path, base)
 0:08.78   File "/mnt/UXP/toolkit/mozapps/installer/packager.py", line 166, in precompile_cache
 0:08.78     errors.fatal('Error while running startup cache precompilation')
 0:08.78   File "/mnt/UXP/python/mozbuild/mozpack/errors.py", line 103, in fatal
 0:08.79     self._handle(self.FATAL, msg)
 0:08.79   File "/mnt/UXP/python/mozbuild/mozpack/errors.py", line 98, in _handle
 0:08.79     raise ErrorMessage(msg)
 0:08.79 mozpack.errors.ErrorMessage: Error: Error while running startup cache precompilation
 0:08.87 /mnt/UXP/toolkit/mozapps/installer/packager.mk:41: recipe for target 'stage-package' failed
@Walter Dnes:
Thank you. The change in config means, that i have to recompile it from the start?
As for the different archs, i compile this on the same machine i want to run it. (Orange Pi PC Plus with Armbian 5.30)

Re: Mach packaging error message

Posted: 2019-12-06, 19:15
by Walter Dnes
__tch wrote:
2019-12-06, 18:35
@Walter Dnes:
Thank you. The change in config means, that i have to recompile it from the start?
As for the different archs, i compile this on the same machine i want to run it. (Orange Pi PC Plus with Armbian 5.30)
If you're compiling on the same architecture, then my guess to the problem source is wrong. Having said that, adding...

ac_add_options --disable-precompiled-startupcache

...to your mozconfig will skip the startupcache precompile stage where it dies. It's a temporary kludge, not a real fix to the root of the problem. Hopefully someone else can diagnose the problem. I don't know the answer to the rebuild-from-scratch question.

Re: Mach packaging error message

Posted: 2019-12-06, 19:42
by Moonchild
I think you might be able to just start the package stage again without rebuilding, but I'm not 100% sure. If it fails again then you'll have to restart.

As for why it fails, that's an elusive problem we've run into on some systems and configurations. Our support for ARM environments is experimental. Since the environment for precompiling the startup cache and actually compiling JS modules in a fully-initialized browser are significantly different, there's no guarantee that it will always work in the former. If it doesn't, then your only recourse for the moment is to simply not precompile the startup cache, which, as explained before, will only have a drawback on the first start after installation or upgrade of the browser. There's no functional drawback otherwise in the browser.

Re: Mach packaging error message

Posted: 2019-12-06, 20:47
by __tch
@Walter Dnes:
I see, thank you. I can live with this.

@Moonchild:
Well, i think i just recompile it anyway, because this was just a fast test-compile without the -O2 flag, that if it can compile. The answer was positive, so it's time to build it properly anyway. I hope with the new option, packaging also will be done now. Thanks for the explanation.

Re: Mach packaging error message

Posted: 2019-12-09, 01:15
by stevenpusser
Hmmm--you may be able to cross-compile a compatible armhf/arm64 version on a much faster x86 machine using sbuild in Debian or a derivative distro. I have it set up, but never had had to use it yet.

I know the openSUSE Build Service also supports armhf and arm64 package builds for Debian 9, 10, testing, and unstable. I've built a few packages with it, such as qmplay2: https://build.opensuse.org/package/show ... mplay2-qt5

Re: Mach packaging error message

Posted: 2019-12-10, 04:50
by stevenpusser
Are you using an Ubuntu or Debian version of Armbian? The docs I can find about the distro seem to indicate that the Debian version is based on Debian 9 Stretch, and is based on the armhf (armv71) architecture.

I tried adding both the armhf and arm64 arch builds to my OBS repo for Stretch, just to see what would happen. If they fail, users will never see them. At the same time, I launched an armhf test build for Debian 10 on my fast gaming laptop on the x86-64 architecture, using the sbuild cross-compiler, also to see what happens. It seems to be most of the way through, since the laptop is several times faster than the OBS. Were your build failures near the beginning of the build?

Re: Mach packaging error message

Posted: 2019-12-10, 21:54
by stevenpusser
It doesn't appear that the ARM support is ready for prime-time, judging on how the builds failed on the OBS.

I also found out that the QEMU-based cross-compile on my own machine, using sbuild, is about twenty times slower than an x86 cross-compile, so it failed after maybe five hours of running the laptop at full speed on all six cores--good thing I picked one with a really good cooling solution, plus I undervolt the CPU to both keep it cooler and reduce thermal throttling.

Re: Mach packaging error message

Posted: 2019-12-11, 00:40
by Admin
You're lucky cross-compiling works at all. It's known to be broken with many combinations of host and target.

Re: Mach packaging error message

Posted: 2019-12-12, 00:25
by stevenpusser
Admin wrote:
2019-12-11, 00:40
You're lucky cross-compiling works at all. It's known to be broken with many combinations of host and target.
Well, it works fine on a Debian 10 host using sbuild (QEMU schroots) for Debian 10, 9, and 8 for amd64 and i386 builds, except it still runs out of virtual memory on Debian 8 i386 builds, so I have to use a virtual machine for those.

Based on no version of Debian ever using gcc-7 as default, the OP's Armbian probably is based on an Ubuntu that did ship that as default.

Re: Mach packaging error message

Posted: 2019-12-12, 01:14
by stevenpusser
Hmmm---well, armhf and arm64 builds of 28.8.0 are now successful on the OBS, at least on the platforms that support those builds. Let me add Rasbian builds now.

The OP should be able to rebuild packages from my OBS source files, using Debian standard packaging tools, on his own device, if none of the ones on the OBS match his version of Armbian.

The Pale Moon source files can be downloaded from here without signing onto the OBS:

https://download.opensuse.org/repositor ... Debian_10/