Bug 28225 - check-webkit-style uses python from /usr/bin instead of the PATH
Summary: check-webkit-style uses python from /usr/bin instead of the PATH
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Linux
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-08-12 13:07 PDT by Carol Szabo
Modified: 2009-09-02 01:01 PDT (History)
3 users (show)

See Also:


Attachments
Patch: uses python from $PATH (999 bytes, patch)
2009-08-12 13:34 PDT, Carol Szabo
eric: review-
Details | Formatted Diff | Diff
This is the second patch attempt for this problem (2.51 KB, patch)
2009-08-31 13:28 PDT, Carol Szabo
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Carol Szabo 2009-08-12 13:07:38 PDT
check-webkit-style starts with '#!/usr/bin/python'.
This prevents usage of the script on computers where /usr/bin/python is absent or is too old even if an appropriate python version exists in the PATH.
Comment 1 Carol Szabo 2009-08-12 13:34:50 PDT
Created attachment 34686 [details]
Patch: uses python from $PATH

This solution was suggested by kollivier on the #webkit IRC channel. It worked for me and it may be useful to others.
Comment 2 Mark Rowe (bdash) 2009-08-12 13:58:21 PDT
None of our existing scripts in WebKitTools/Scripts use this approach.  If this is a problem I don't see why we would only fix a single script.
Comment 3 Mark Rowe (bdash) 2009-08-12 13:58:52 PDT
Comment on attachment 34686 [details]
Patch: uses python from $PATH

Clearing review flag for reason mentioned.
Comment 4 Carol Szabo 2009-08-12 14:13:48 PDT
(In reply to comment #2)
> None of our existing scripts in WebKitTools/Scripts use this approach.  If this
> is a problem I don't see why we would only fix a single script.

Mark,
You are right that this would fix only one script and if otherwise the fix is acceptable I am willing to change all scripts in the directory to use the same approach.

On the other hand, there is one other script (roll-over-ChangeLogs) which uses the same approach, so it can be argued that since it is ok for that script it should be ok for this script too.

I believe that the /usr/bin/env approach  does not make sense for standard shells (such as /usr/bin/sh), but may be useful for perl, python and ruby scripts where many incompatible versions may exist in the system.
Comment 5 Laszlo Gombos 2009-08-24 14:10:46 PDT
(In reply to comment #4)
> (In reply to comment #2)
> > None of our existing scripts in WebKitTools/Scripts use this approach.  If this
> > is a problem I don't see why we would only fix a single script.
> 
> Mark,
> You are right that this would fix only one script and if otherwise the fix is
> acceptable I am willing to change all scripts in the directory to use the same
> approach.
> 
> On the other hand, there is one other script (roll-over-ChangeLogs) which uses
> the same approach, so it can be argued that since it is ok for that script it
> should be ok for this script too.
> 
> I believe that the /usr/bin/env approach  does not make sense for standard
> shells (such as /usr/bin/sh), but may be useful for perl, python and ruby
> scripts where many incompatible versions may exist in the system.

Perhaps -for now - we should just do this for "top level" python scripts. I did a quick search and I only found 3 scripts:

check-webkit-style, bugzilla-tool, run-webkit-unittests
Comment 6 Eric Seidel (no email) 2009-08-25 10:35:25 PDT
Comment on attachment 34686 [details]
Patch: uses python from $PATH

Marking r- per the discussion above.  Either we should do this for all scripts or none.
Comment 7 Carol Szabo 2009-08-31 13:28:23 PDT
Created attachment 38831 [details]
This is the second patch attempt for this problem

I have applied the fix to all python scripts per lgombos's comments.
I was reluctant to fix all scripts in the directory as I am not familiar with many of them and I think that it is preferable that (as the case of style errors in C/C++ code) they are fixed as they cause problems.
I am not quite an "if its not broken don't fix it" kind of guy, but I am reluctant to take poorly understood (at least by me) risks when the benefit is small.
Comment 8 Eric Seidel (no email) 2009-09-01 11:09:39 PDT
Comment on attachment 38831 [details]
This is the second patch attempt for this problem

Rejecting patch 38831 from commit-queue.  This patch will require manual commit.

Failed to run "/Users/eseidel/Projects/WebKitSVN/WebKitTools/Scripts/update-webkit"  exit_code: 1  cwd: None
Comment 9 Eric Seidel (no email) 2009-09-01 16:38:14 PDT
Comment on attachment 38831 [details]
This is the second patch attempt for this problem

svn: Failed to add file 'WebCore/bindings/v8/custom/V8WebSocketCustom.cpp': object of the same name already exists
This was a victim of bug 28603. :(
Comment 10 Eric Seidel (no email) 2009-09-01 17:42:02 PDT
Comment on attachment 38831 [details]
This is the second patch attempt for this problem

Rejecting patch 38831 from commit-queue.  This patch will require manual commit.

['WebKitTools/Scripts/run-webkit-tests', '--no-launch-safari', '--quiet', '--exit-after-n-failures=1'] failed with exit code 1
Comment 11 Eric Seidel (no email) 2009-09-02 00:45:03 PDT
Comment on attachment 38831 [details]
This is the second patch attempt for this problem

Flakey test. :(
compositing/color-matching/image-color-matching.html -> crashed
Comment 12 Eric Seidel (no email) 2009-09-02 00:49:10 PDT
I believe that's just another instance of bug 28845 biting us. :(
Comment 13 Eric Seidel (no email) 2009-09-02 01:01:30 PDT
Comment on attachment 38831 [details]
This is the second patch attempt for this problem

Clearing flags on attachment: 38831

Committed r47955: <http://trac.webkit.org/changeset/47955>
Comment 14 Eric Seidel (no email) 2009-09-02 01:01:34 PDT
All reviewed patches have been landed.  Closing bug.