WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
153712
generate-inspector-gresource-manifest.py uses the wrong python interpreter
https://bugs.webkit.org/show_bug.cgi?id=153712
Summary
generate-inspector-gresource-manifest.py uses the wrong python interpreter
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
Details
Formatted Diff
Diff
patch
(2.08 KB, patch)
2016-01-30 10:51 PST
,
Jeremy Huddleston Sequoia
no flags
Details
Formatted Diff
Diff
patch
(2.06 KB, patch)
2016-01-30 10:55 PST
,
Jeremy Huddleston Sequoia
no flags
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
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
Created
attachment 270310
[details]
patch
Jeremy Huddleston Sequoia
Comment 3
2016-01-30 10:51:41 PST
Created
attachment 270311
[details]
patch
Jeremy Huddleston Sequoia
Comment 4
2016-01-30 10:55:59 PST
Created
attachment 270312
[details]
patch
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.
Top of Page
Format For Printing
XML
Clone This Bug