Originally reported at https://trac.macports.org/ticket/50472 configure finds an appropriate version of python: :info:configure -- Found PythonInterp: /opt/local/bin/python2.7 (found suitable version "2.7.11", minimum required is "2.7.0") but the build still fails when executing the generate-inspector-gresource-manifest.py script when the first python executable in $PATH is version 2.6: :info:build [ 86%] Generating ../../DerivedSources/webkit2gtk/InspectorGResourceBundle.xml :info:build cd /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_www_webkit2-gtk/webkit2-gtk/work/build/Source/WebKit2 && /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_www_webkit2-gtk/webkit2-gtk/work/webkitgtk-2.11.4/Tools/gtk/generate-inspector-gresource-manifest.py --output=/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_www_webkit2-gtk/webkit2-gtk/work/build/DerivedSources/webkit2gtk/InspectorGResourceBundle.xml ... :info:build Traceback (most recent call last): :info:build File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_www_webkit2-gtk/webkit2-gtk/work/webkitgtk-2.11.4/Tools/gtk/generate-inspector-gresource-manifest.py", line 18, in <module> :info:build import argparse :info:build ImportError: No module named argparse :info:build make[2]: *** [DerivedSources/webkit2gtk/InspectorGResourceBundle.xml] Error 1 The issue is that the script is executed directly with a hash-bang of "#!/usr/bin/env python" whereas other python scripts are executed using the configured interpreter, eg: :info:build cd /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_www_webkit2-gtk/webkit2-gtk/work/webkitgtk-2.11.4/Source/WebKit2 && /opt/local/bin/python2.7 /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_www_webkit2-gtk/webkit2-gtk/work/webkitgtk-2.11.4/Source/WebKit2/Scripts/generate-messages-header.py WebProcess/WebPage/WebPage.messages.in > /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_www_webkit2-gtk/webkit2-gtk/work/build/DerivedSources/WebKit2/WebPageMessages.h
I'm testing a patch now.
Created attachment 270310 [details] patch
Created attachment 270311 [details] patch
Created attachment 270312 [details] patch
Sorry for the noise. The first one contained unrelated changes and the second had an incorrect commit log.
Comment on attachment 270312 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=270312&action=review > Source/WebKit2/PlatformGTK.cmake:648 > + COMMAND ${PYTHON_EXECUTABLE} ${TOOLS_DIR}/gtk/generate-inspector-gresource-manifest.py --output=${DERIVED_SOURCES_WEBKIT2GTK_DIR}/InspectorGResourceBundle.xml ${InspectorFiles} ${DERIVED_SOURCES_WEBINSPECTORUI_DIR}/UserInterface/Protocol/InspectorBackendCommands.js Ugh, I do not like working around the shebang in the file itself. I normally prefer to substitute the right python executable into the shebang with a configure replacement, but then the script would go in the build directory rather than Tools/gtk, and that's definitely undesired. r=me only because I'm pretty sure there's no better solution. Normally, files that end in .py are understood to not be executable, and should not have shebangs. The python files under Tools/gtk don't seem to follow this rule.
Comment on attachment 270312 [details] patch Clearing flags on attachment: 270312 Committed r195902: <http://trac.webkit.org/changeset/195902>
All reviewed patches have been landed. Closing bug.