Bug 153712

Summary: generate-inspector-gresource-manifest.py uses the wrong python interpreter
Product: WebKit Reporter: Jeremy Huddleston Sequoia <jeremyhu>
Component: WebKitGTKAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: bugs-noreply, commit-queue
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
patch
none
patch
none
patch none

Jeremy Huddleston Sequoia
Reported 2016-01-30 10:00:25 PST
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
Attachments
patch (2.57 KB, patch)
2016-01-30 10:50 PST, Jeremy Huddleston Sequoia
no flags
patch (2.08 KB, patch)
2016-01-30 10:51 PST, Jeremy Huddleston Sequoia
no flags
patch (2.06 KB, patch)
2016-01-30 10:55 PST, Jeremy Huddleston Sequoia
no flags
Jeremy Huddleston Sequoia
Comment 1 2016-01-30 10:05:53 PST
I'm testing a patch now.
Jeremy Huddleston Sequoia
Comment 2 2016-01-30 10:50:25 PST
Jeremy Huddleston Sequoia
Comment 3 2016-01-30 10:51:41 PST
Jeremy Huddleston Sequoia
Comment 4 2016-01-30 10:55:59 PST
Jeremy Huddleston Sequoia
Comment 5 2016-01-30 10:56:56 PST
Sorry for the noise. The first one contained unrelated changes and the second had an incorrect commit log.
Michael Catanzaro
Comment 6 2016-01-30 11:15:03 PST
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.
WebKit Commit Bot
Comment 7 2016-01-30 12:01:51 PST
Comment on attachment 270312 [details] patch Clearing flags on attachment: 270312 Committed r195902: <http://trac.webkit.org/changeset/195902>
WebKit Commit Bot
Comment 8 2016-01-30 12:01:55 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.