RJVB / macstrop

RJVB's repository of alternative macports, with ports missing from or overriding those in the standard collection, including a set of KF5 ports.
20 stars 9 forks source link

qt5-kde-qtwebengine fails to build #45

Closed Tatsh closed 5 years ago

Tatsh commented 5 years ago

Attached is the log. qt5-kde-qtwebengine-main.log

Tatsh commented 5 years ago

Perhaps this is a Python 2/3 issue regarding bytes/str.

:info:build rm -f obj/base/third_party/libevent/libbundled_libevent.a && TOOL_VERSION=1538154140 python ../../../../../../../../qt-everywhere-opensource-src-5.9.7/qtwebengine/src/3rdparty/chromium/build/toolchain/mac/filter_libtool.py libtool -static  -o obj/base/third_party/libevent/libbundled_libevent.a obj/base/third_party/libevent/bundled_libevent/buffer.o obj/base/third_party/libevent/bundled_libevent/evbuffer.o obj/base/third_party/libevent/bundled_libevent/evdns.o obj/base/third_party/libevent/bundled_libevent/event.o obj/base/third_party/libevent/bundled_libevent/event_tagging.o obj/base/third_party/libevent/bundled_libevent/evrpc.o obj/base/third_party/libevent/bundled_libevent/evutil.o obj/base/third_party/libevent/bundled_libevent/http.o obj/base/third_party/libevent/bundled_libevent/log.o obj/base/third_party/libevent/bundled_libevent/poll.o obj/base/third_party/libevent/bundled_libevent/select.o obj/base/third_party/libevent/bundled_libevent/signal.o obj/base/third_party/libevent/bundled_libevent/strlcpy.o obj/base/third_party/libevent/bundled_libevent/kqueue.o
:info:build Traceback (most recent call last):
:info:build   File "../../../../../../../../qt-everywhere-opensource-src-5.9.7/qtwebengine/src/3rdparty/chromium/build/toolchain/mac/filter_libtool.py", line 42, in <module>
:info:build     sys.exit(Main(sys.argv[1:]))
:info:build   File "../../../../../../../../qt-everywhere-opensource-src-5.9.7/qtwebengine/src/3rdparty/chromium/build/toolchain/mac/filter_libtool.py", line 29, in Main
:info:build     if not libtool_re.match(line) and not libtool_re5.match(line):
:info:build TypeError: cannot use a string pattern on a bytes-like object
RJVB commented 5 years ago

Perhaps this is a Python 2/3 issue regarding bytes/str.

What python version is being used by the build process; do you by any chance have a $prefix/bin/python that is symlinked to python 3?

The build seems to require Python 2, but apparently also knows how to find it, so I'm surprised it calls python in the failed command:

Checking for Python 2... /opt/local/bin/python2

The documentation confirms this. I don't see an obvious way to define the python executable to be used by the build, but you could try to add the following two lines, just above the one that says # do NOT forget this one!! in the qtwebengine subport block of the Portfile:

configure.env-append PYTHON_EXECUTABLE=/usr/bin/python
build.env-append PYTHON_EXECUTABLE=/usr/bin/python

R.

Tatsh commented 5 years ago

My /opt/local/bin/python2 definitely points to Python 2.7 from MacPorts.

The documentation confirms this. I don't see an obvious way to define the python executable to be used by the build, but you could try to add the following two lines, just above the one that says # do NOT forget this one!! in the qtwebengine subport block of the Portfile:

Which Portfile?

RJVB commented 5 years ago

My /opt/local/bin/python2 definitely points to Python 2.7 from MacPorts.

The question was about the python executable that is on the path for the build system, most likely /opt/local/bin/python .

Which Portfile?

From what I can see from your previous post, port file qt5-kde-qtwebengine.

Tatsh commented 5 years ago

That Python script is strictly Python 2.7 (it uses constructs like print >>). It appears that even if you specify the Python you want to use, that script is invoked using the first python in PATH. I switched to Python 2.7 with port select python and I am currently building.

Tatsh commented 5 years ago

Made it a lot further with Python 2.7 set. A file seems to be missing:

:info:build /opt/local/var/macports/build/_Users_tatsh_dev_macstrop_aqua_qt5-kde/qt5-kde-qtwebengine/work/qt-everywhere-opensource-src-5.9.7/qtwebengine/src/core/content_browser_client_qt.cpp:49:10: fatal error: 'chrome/browser/spellchecker/spellcheck_message_filter_platform.h' file not found
:info:build #include "chrome/browser/spellchecker/spellcheck_message_filter_platform.h"
:info:build          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:info:build 1 error generated
RJVB commented 5 years ago

Made it a lot further with Python 2.7 set. A file seems to be missing:

No, the file is there (at least it's in the 5.9.8 source bundle as installed port:qt5-kde-devel-qtwebengine).

Did you clean the port before attempting to build anew, after correcting the python issue?

If you did I see only 1 explanation: the use_native_spellchecker option somehow doesn't work on your system. In that case you can try the build again after removing the corresponding line from the Portfile.

Sadly I cannot even do a test build on QtWebEngine 5.9 on my OS X 10.9 set-up, and haven't rebuild the 5.8.0 version of the port for a while.

Tatsh commented 5 years ago

Definitely ran port clean qt5-kde-qtwebengine and got the same error. Can I turn off the use_native_spellchecker feature in the Portfile?

RJVB commented 5 years ago

Yes, have a look, there's a line in a configure.args statement that sets the option; just search for the feature name and remove the line (remember to remove the backquote on the line before too).

Tatsh commented 5 years ago

This fixes it for macOS. Probably needs an OS check.

diff --git a/aqua/qt5-kde/Portfile b/aqua/qt5-kde/Portfile
index 50f3bbe4..080cc4ea 100644
--- a/aqua/qt5-kde/Portfile
+++ b/aqua/qt5-kde/Portfile
@@ -1781,8 +1781,7 @@ subport ${name}-qtwebengine {
                         WEBENGINE_CONFIG+=reduce_binary_size \
                         WEBENGINE_CONFIG+=use_system_snappy \
                         WEBENGINE_CONFIG+=use_system_icu \
-                        WEBENGINE_CONFIG+=use_system_ffmpeg \
-                        WEBENGINE_CONFIG+=use_native_spellchecker
+                        WEBENGINE_CONFIG+=use_system_ffmpeg
     if {${os.platform} eq "darwin"} {
         configure.args-append \
                         WEBENGINE_CONFIG+=use_system_vpx
Tatsh commented 5 years ago

There should be a patch to make the build system use Python 2.7, so running port select python python27 is not required prior to building.

RJVB commented 5 years ago

What OS version are you using? You are the first to report this issue.

Feel free to poke around in the build system to come up with a patch. The only thing I can try to do is to raise an error if the python command runs a v3 interpreter.

R

Tatsh commented 5 years ago

I'm on macOS 10.14.5.

RJVB commented 5 years ago

I'm on macOS 10.14.5.

Actually that shouldn't really matter, but who knows, with a build system that's as complex (and messed up, IMVHO) as the QWE one...

RJVB commented 5 years ago

I have raised the question of the python interpreter version on the MP devel list but as you can imagine it will take a while before action will be taken to prevent the situation you ran into with port select.

I'm debating how to prevent that situation in the port. I've identified the command that failed for you so I can patch that one (make it call /usr/bin/python instead of just python), but I don't know how many others there are.

How long does a QWE build take for you? Would you be up for finding out which build commands would need fixing too, i.e. via a trial-and-error process?