deu / palemoon-overlay

Unofficial Gentoo overlay for the Pale Moon (http://www.palemoon.org/) web browser.
34 stars 12 forks source link

www-client/palemoon-30.0.0 build failure (ERROR: Cannot find project palemoon) #122

Closed jeandestouches closed 2 years ago

jeandestouches commented 2 years ago

Hi, 30.0.0 build fails early, it seems 30.0.0 introduces several changes..

>>> Source configured.
>>> Compiling source in /var/tmp/portage/www-client/palemoon-30.0.0/work/palemoon-30.0.0 ...
 0:00.43 /usr/bin/gmake -f client.mk MOZ_PARALLEL_BUILD=5 -s configure
 0:01.42 Clobber not needed.
 0:02.40 Generating /var/tmp/portage/www-client/palemoon-30.0.0/work/palemoon-30.0.0/configure
 0:02.42 Generating /var/tmp/portage/www-client/palemoon-30.0.0/work/palemoon-30.0.0/platform/configure
 0:02.43 Generating /var/tmp/portage/www-client/palemoon-30.0.0/work/palemoon-30.0.0/platform/js/src/configure
 0:02.44 cd /var/tmp/portage/www-client/palemoon-30.0.0/work/palemoon-30.0.0/o
 0:02.45 /var/tmp/portage/www-client/palemoon-30.0.0/work/palemoon-30.0.0/configure
 0:02.66 Creating Python environment
 0:04.84 New python executable in /var/tmp/portage/www-client/palemoon-30.0.0/work/palemoon-30.0.0/o/_virtualenv/bin/python2.7
 0:04.84 Also creating executable in /var/tmp/portage/www-client/palemoon-30.0.0/work/palemoon-30.0.0/o/_virtualenv/bin/python
 0:04.84 Installing setuptools, pip, wheel...done.
 0:05.61 running build_ext
 0:05.61 building 'psutil._psutil_linux' extension
 0:05.61 creating build
 0:05.61 creating build/temp.linux-x86_64-2.7
 0:05.61 creating build/temp.linux-x86_64-2.7/psutil
 0:05.61 x86_64-pc-linux-gnu-gcc -pthread -fno-strict-aliasing -march=bdver2 -O2 -pipe -fwrapv -DNDEBUG -fPIC -DPSUTIL_VERSION=311 -I/usr/include/python2.7 -c psutil/_psutil_linux.c -o build/temp.linux-x86_64-2.7/psutil/_psutil_linux.o
 0:05.61 creating build/lib.linux-x86_64-2.7
 0:05.61 creating build/lib.linux-x86_64-2.7/psutil
 0:05.61 x86_64-pc-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,--as-needed build/temp.linux-x86_64-2.7/psutil/_psutil_linux.o -L/usr/lib64 -lpython2.7 -o build/lib.linux-x86_64-2.7/psutil/_psutil_linux.so
 0:05.61 building 'psutil._psutil_posix' extension
 0:05.61 x86_64-pc-linux-gnu-gcc -pthread -fno-strict-aliasing -march=bdver2 -O2 -pipe -fwrapv -DNDEBUG -fPIC -I/usr/include/python2.7 -c psutil/_psutil_posix.c -o build/temp.linux-x86_64-2.7/psutil/_psutil_posix.o
 0:05.61 x86_64-pc-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,--as-needed build/temp.linux-x86_64-2.7/psutil/_psutil_posix.o -L/usr/lib64 -lpython2.7 -o build/lib.linux-x86_64-2.7/psutil/_psutil_posix.so
 0:05.61 copying build/lib.linux-x86_64-2.7/psutil/_psutil_linux.so -> psutil
 0:05.61 copying build/lib.linux-x86_64-2.7/psutil/_psutil_posix.so -> psutil
 0:05.61 
 0:05.61 Reexecuting in the virtualenv
 0:05.93 Adding configure options from /var/tmp/portage/www-client/palemoon-30.0.0/work/palemoon-30.0.0/.mozconfig
 0:05.93   --enable-application=palemoon
 0:05.93   --disable-updater
 0:05.93   --disable-install-strip
 0:05.93   --disable-accessibility
 0:05.93   --enable-official-branding
 0:05.93   --enable-optimize=-O2 -msse2 -mfpmath=sse
 0:05.93   --enable-jemalloc
 0:05.93   --disable-dbus
 0:05.93   --disable-gconf
 0:05.93   --enable-default-toolkit=cairo-gtk3
 0:05.93   --disable-necko-wifi
 0:05.93   --disable-pulseaudio
 0:05.93   --enable-devtools
 0:05.93   --disable-precompiled-startupcache
 0:05.93   BASH_ARGC=([0]="4")
 0:05.93   BASH_ARGV=([0]="/var/tmp/portage/www-client/palemoon-30.0.0/work/palemoon-30.0.0/platform/python/mozbuild/mozbuild/action/dump_env.py" [1]="/var/tmp/portage/www-client/palemoon-30.0.0/work/palemoon-30.0.0/o/_virtualenv/bin/python" [2]="/var/tmp/portage/www-client/palemoon-30.0.0/work/palemoon-30.0.0/.mozconfig" [3]="/var/tmp/portage/www-client/palemoon-30.0.0/work/palemoon-30.0.0/platform")
 0:05.95 ERROR: Cannot find project palemoon
 0:05.98 *** Fix above errors and then restart with\
 0:05.98                "/usr/bin/gmake -f client.mk build"
 0:05.98 gmake: *** [client.mk:371: configure] Error 1
 * ERROR: www-client/palemoon-30.0.0::localrepo failed (compile phase):
 *   (no error message)
 * 
 * Call stack:
 *     ebuild.sh, line 127:  Called src_compile
 *   environment, line 3680:  Called die
 * The specific snippet of code:
 *       python2 "${S}/platform/mach" build || die
 * 
 * If you need support, post the output of `emerge --info '=www-client/palemoon-30.0.0::localrepo'`,
 * the complete build log and the output of `emerge -pqv '=www-client/palemoon-30.0.0::localrepo'`.
 * The complete build log is located at '/var/log/portage/www-client:palemoon-30.0.0:20220318-180143.log'.
 * For convenience, a symlink to the build log is located at '/var/tmp/portage/www-client/palemoon-30.0.0/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/www-client/palemoon-30.0.0/temp/environment'.
 * Working directory: '/var/tmp/portage/www-client/palemoon-30.0.0/work/palemoon-30.0.0'
 * S: '/var/tmp/portage/www-client/palemoon-30.0.0/work/palemoon-30.0.0'
jeandestouches commented 2 years ago

Adding mozconfig_enable "application=browser" to src_configure fixes the issue, I will update this bug report if build fails for another reason (hopefully not ! By the way I'm trying with GCC11 to see if it compiles with it this time | EDIT : Ok it still doesn't like GCC11, trying with 9.4.0 instead)

src_configure() {
  # Basic configuration:
  mozconfig_init

  mozconfig_disable updater install-strip accessibility

  mozconfig_enable "application=browser"

[...]
jeandestouches commented 2 years ago

I just realized this option is handled by the eclass, so the eclass should be updated instead. (with a version check to avoid breaking old ebuild using 'palemoon' instead of 'browser')

jeandestouches commented 2 years ago

So, it builds correctly with GCC9.4 but install fails in src_install() Here :

  einfo "Extracting the package..."
  tar xjpf "${S}/${obj_dir}/dist/${P}.linux-${CTARGET_default%%-*}.tar.bz2"

xz is used now, so :

tar xpf "${S}/${obj_dir}/dist/${P}.linux-${CTARGET_default%%-*}.tar.xz"

Also, the icon_path in install_branding_files function (in palemoon eclass) should read now :

icon_path="${extracted_dir}/browser/branding/unofficial"

I hope i'm not missing anything more this time. I'm trying again.

See also, https://github.com/deu/palemoon-overlay/issues/121

CaseOf commented 2 years ago

thanks for your work, I’ll commit these changes now.

CaseOf commented 2 years ago

but tell me if your build succeed or not though

CaseOf commented 2 years ago

How I did in the eclass for version testing:

mozconfig_init() {
        if [ "$(printf '%s\n' "30.0.0" "${PV}" | sort -V | head -n1)" = "30.0.0" ]; then
                echo "ac_add_options --enable-application=browser" > "${S}/.mozconfig"
        else
                echo "ac_add_options --enable-application=palemoon" > "${S}/.mozconfig"
        fi
}
CaseOf commented 2 years ago

I did expect this: /var/tmp/portage/www-client/palemoon-30.0.0/temp/environment: line 3671: /var/tmp/portage/www-client/palemoon-30.0.0/work/palemoon-30.0.0/o/dist/bin/browser/defaults/preferences/palemoon.js: No such file or directory

jeandestouches commented 2 years ago

My build failed again on install_phase because of a small typo in the icon_path... (in palemoon-5.eclass)

icon_path="${extracted_dir}/browser/branding/unofficial"

instead of

icon_path="${extracted_dir}/branding/unofficial"

I'm starting to feel ridiculous but I think the next one should finally pass haha!

CaseOf commented 2 years ago

I have inspected the directory package and it contains 2 subdirs: branding (that was copied before) and palemoon, and the said line is inside the branding function of the eclass that is called when use branding is used. Then this specific path should not be changed. It should remain just ${extracted_dir}/branding

jeandestouches commented 2 years ago

Oh! Indeed, I was looking at the wrong dir.. This one is called during installation right ? /var/tmp/portage/www-client/palemoon-30.0.0/temp/package/branding ? ls -al

-rw-r--r-- 1 root root   811 18 mars  23:32 default16.png
-rw-r--r-- 1 root root  2273 18 mars  23:32 default32.png
-rw-r--r-- 1 root root  3885 18 mars  23:32 default48.png
-rw-r--r-- 1 root root   879 18 mars  23:32 license.txt
-rw-r--r-- 1 root root 20601 18 mars  23:32 mozicon128.png

So it should work indeed with the default icon_path.. my bad.

CaseOf commented 2 years ago

else, I fixed this:

set_pref() {
        if [ "$(printf '%s\n' "30.0.0" "${PV}" | sort -V | head -n1)" = "30.0.0" ]; then
                echo "pref(\"$1\", $2);" >> "${S}/${obj_dir}/dist/bin/defaults/pref/palemoon.js"
        else
                echo "pref(\"$1\", $2);" >> "${S}/${obj_dir}/dist/bin/browser/defaults/preferences/palemoon.js"
        fi
}
CaseOf commented 2 years ago

Oh! Indeed, I was looking at the wrong dir.. This is one is called during installation right ? /var/tmp/portage/www-client/palemoon-30.0.0/temp/package/branding ?

Yes, if branding use is not set, then the makefile will use the unbranded ones that are, I think, defined by devs.

CaseOf commented 2 years ago

pushed new changes, can you try to build with that?

CaseOf commented 2 years ago

on my side, build succeeded. feel free to reopen this issue if it is not on your side.

jeandestouches commented 2 years ago

Fully working now, thanks CaseOf ! And sorry for the delay to confirm, it took a while on my toaster.. (especially the xz compression..)

CaseOf commented 2 years ago

yeah I noticed that xz compression is taking ages, maybe more than before, but that’s just feelings

CaseOf commented 2 years ago

maybe could we do something on that side to simply disable that step?

jeandestouches commented 2 years ago

Maybe, it seems xz options are set here : platform/system/installer/packager-uxp.mk It is set to use the maximum compression a.k.a -9e so this could be lowered a little bit, 6 is used by default. And especially drop 'extreme' (e), this could probably be modified quickly with sed in src_configure.