Bug 39097

Summary: webkit-patch barfed on upload with a new image test result
Product: WebKit Reporter: Simon Fraser (smfr) <simon.fraser>
Component: Tools / TestsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, aroben, cjerdonek, commit-queue, dbates, ddkilzer, eric, jparent, tony, webkit.review.bot, wsiegrist
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: OS X 10.5   
Attachments:
Description Flags
webkit-patch output
none
Patch
none
Patch none

Description Simon Fraser (smfr) 2010-05-13 18:07:25 PDT
Created attachment 56040 [details]
webkit-patch output

I ran 'webkit-patch upload NNN' with a new image result added to my git index. In the diff file (attached), I see:

Exception raised during decoding git binary patch:
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/open3.rb:67:in `exec': No such file or directory - /opt/local/bin/git apply --directory=/var/folders/4I/4IFxjUcVHIip-GD1W3OsEE+++TM/-Tmp- (Errno::ENOENT)
	from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/open3.rb:67:in `popen3'
	from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/open3.rb:53:in `fork'
	from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/open3.rb:53:in `popen3'
	from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/open3.rb:51:in `fork'
	from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/open3.rb:51:in `popen3'
	from /Volumes/InternalData/Development/webkit/OpenSource/BugsSite/PrettyPatch/PrettyPatch.rb:452:in `extract_contents_from_git_binary_chunk'
	from /Volumes/InternalData/Development/webkit/OpenSource/BugsSite/PrettyPatch/PrettyPatch.rb:373:in `initialize'
	from /Volumes/InternalData/Development/webkit/OpenSource/BugsSite/PrettyPatch/PrettyPatch.rb:372:in `collect'
	from /Volumes/InternalData/Development/webkit/OpenSource/BugsSite/PrettyPatch/PrettyPatch.rb:372:in `initialize'
	from /Volumes/InternalData/Development/webkit/OpenSource/BugsSite/PrettyPatch/PrettyPatch.rb:424:in `new'
	from /Volumes/InternalData/Development/webkit/OpenSource/BugsSite/PrettyPatch/PrettyPatch.rb:424:in `parse'
	from /Volumes/InternalData/Development/webkit/OpenSource/BugsSite/PrettyPatch/PrettyPatch.rb:424:in `collect'
	from /Volumes/InternalData/Development/webkit/OpenSource/BugsSite/PrettyPatch/PrettyPatch.rb:424:in `parse'
	from /Volumes/InternalData/Development/webkit/OpenSource/BugsSite/PrettyPatch/PrettyPatch.rb:15:in `prettify'
	from /Volumes/InternalData/Development/webkit/OpenSource/BugsSite/PrettyPatch/prettify.rb:26

/Volumes/InternalData/Development/webkit/OpenSource/BugsSite/PrettyPatch/PrettyPatch.rb:458:in `extract_contents_from_git_binary_chunk'
/Volumes/InternalData/Development/webkit/OpenSource/BugsSite/PrettyPatch/PrettyPatch.rb:373:in `initialize'
/Volumes/InternalData/Development/webkit/OpenSource/BugsSite/PrettyPatch/PrettyPatch.rb:372:in `collect'
/Volumes/InternalData/Development/webkit/OpenSource/BugsSite/PrettyPatch/PrettyPatch.rb:372:in `initialize'
/Volumes/InternalData/Development/webkit/OpenSource/BugsSite/PrettyPatch/PrettyPatch.rb:424:in `new'
/Volumes/InternalData/Development/webkit/OpenSource/BugsSite/PrettyPatch/PrettyPatch.rb:424:in `parse'
/Volumes/InternalData/Development/webkit/OpenSource/BugsSite/PrettyPatch/PrettyPatch.rb:424:in `collect'
/Volumes/InternalData/Development/webkit/OpenSource/BugsSite/PrettyPatch/PrettyPatch.rb:424:in `parse'
/Volumes/InternalData/Development/webkit/OpenSource/BugsSite/PrettyPatch/PrettyPatch.rb:15:in `prettify'
/Volumes/InternalData/Development/webkit/OpenSource/BugsSite/PrettyPatch/prettify.rb:26
Comment 1 Simon Fraser (smfr) 2010-05-13 18:07:46 PDT
On SnowLeopard, WebKit r59396
Comment 2 Simon Fraser (smfr) 2010-07-13 21:51:24 PDT
No such file or directory - /opt/local/bin/git apply
My git is in /usr/local/bin/git.
Comment 3 Simon Fraser (smfr) 2010-07-13 21:55:57 PDT
BugsSite/PrettyPatch/PrettyPatch.rb has GIT_PATH = "/opt/local/bin/git" which is bogus.
Comment 4 Eric Seidel (no email) 2010-07-13 22:18:14 PDT
PrettyPatch is thanks to senior Roben, although others (including myself) have hacked on it.

Seems like an easy fix.  We should probably use 'which git' if available.
Comment 5 Eric Seidel (no email) 2010-07-13 22:18:36 PDT
Thank you for the report, btw.
Comment 6 Tony Chang 2010-08-17 11:26:58 PDT
Created attachment 64610 [details]
Patch
Comment 7 Tony Chang 2010-08-17 11:27:47 PDT
Comment on attachment 64610 [details]
Patch

It looks like other scripts also expect git to be in your path (e.g., prepare-ChangeLog, resolve-ChangeLog, VCSUtils.pm).
Comment 8 WebKit Review Bot 2010-08-17 11:30:07 PDT
Attachment 64610 [details] did not pass style-queue:

Failed to run "['WebKitTools/Scripts/check-webkit-style']" exit_code: 1
BugsSite/ChangeLog:1:  One or more unexpected \r (^M) found; better to use only a \n  [whitespace/carriage_return] [1]
Suppressing further [whitespace/carriage_return] reports for this file.
Total errors found: 9 in 2 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 9 Simon Fraser (smfr) 2010-08-17 12:58:27 PDT
prepare-ChangeLog works fine for me on the same machine.
Comment 10 Eric Seidel (no email) 2010-08-17 17:20:11 PDT
Comment on attachment 64610 [details]
Patch

OK.  Makes sense.
Comment 11 WebKit Commit Bot 2010-08-17 18:05:38 PDT
Comment on attachment 64610 [details]
Patch

Rejecting patch 64610 from commit-queue.

Unexpected failure when processing patch!  Please file a bug against webkit-patch.
Failed to run "['./WebKitTools/Scripts/webkit-patch', '--status-host=queues.webkit.org', 'land-attachment', '--force-clean', '--build', '--non-interactive', '--ignore-builders', '--build-style=both', '--quiet', 64610, '--test', '--parent-command=commit-queue', '--no-update']" exit_code: 1
Last 500 characters of output:
webkitpy/tool/commands/stepsequence.py", line 64, in _run
    step(tool, options).run(state)
  File "/Users/eseidel/Projects/CommitQueue/WebKitTools/Scripts/webkitpy/tool/steps/validatereviewer.py", line 66, in run
    if self._has_valid_reviewer(changelog_entry):
  File "/Users/eseidel/Projects/CommitQueue/WebKitTools/Scripts/webkitpy/tool/steps/validatereviewer.py", line 48, in _has_valid_reviewer
    if changelog_entry.reviewer():
AttributeError: 'NoneType' object has no attribute 'reviewer'
Comment 12 Eric Seidel (no email) 2010-08-17 19:36:59 PDT
Comment on attachment 64610 [details]
Patch

I'm confused by that commit-queue error.  Lets try again. :)
Comment 13 WebKit Commit Bot 2010-08-17 20:09:20 PDT
Comment on attachment 64610 [details]
Patch

Rejecting patch 64610 from commit-queue.

Unexpected failure when processing patch!  Please file a bug against webkit-patch.
Failed to run "['./WebKitTools/Scripts/webkit-patch', '--status-host=queues.webkit.org', 'land-attachment', '--force-clean', '--build', '--non-interactive', '--ignore-builders', '--build-style=both', '--quiet', 64610, '--test', '--parent-command=commit-queue', '--no-update']" exit_code: 1
Last 500 characters of output:
webkitpy/tool/commands/stepsequence.py", line 64, in _run
    step(tool, options).run(state)
  File "/Users/eseidel/Projects/CommitQueue/WebKitTools/Scripts/webkitpy/tool/steps/validatereviewer.py", line 66, in run
    if self._has_valid_reviewer(changelog_entry):
  File "/Users/eseidel/Projects/CommitQueue/WebKitTools/Scripts/webkitpy/tool/steps/validatereviewer.py", line 48, in _has_valid_reviewer
    if changelog_entry.reviewer():
AttributeError: 'NoneType' object has no attribute 'reviewer'
Comment 14 Eric Seidel (no email) 2010-08-17 21:47:02 PDT
My guess is its failing to parse the changelog. Just not sure why.
Comment 15 Adam Barth 2010-08-17 21:52:47 PDT
Likely because of the \r complained about in https://bugs.webkit.org/show_bug.cgi?id=39097#c8
Comment 16 Eric Seidel (no email) 2010-08-18 09:16:45 PDT
Comment on attachment 64610 [details]
Patch

Seems like we should update webkit-patch to detect \r in a ChangeLog and barf nicely.

This can't be cq+'d as is.  And ideally the \r would be removed from the ChangeLog anyway.
Comment 17 Tony Chang 2010-08-19 09:50:45 PDT
*** Bug 38101 has been marked as a duplicate of this bug. ***
Comment 18 Tony Chang 2010-08-19 10:08:57 PDT
Created attachment 64867 [details]
Patch
Comment 19 Tony Chang 2010-08-19 10:09:38 PDT
Comment on attachment 64867 [details]
Patch

I removed the \r's in ChangeLog (the whole file had \r's) and set the svn:eol-style to native.
Comment 20 Adam Barth 2010-08-19 11:00:05 PDT
Comment on attachment 64867 [details]
Patch

Okiedokes.  Thanks for fixing the ChangeLog.
Comment 21 WebKit Commit Bot 2010-08-19 11:29:05 PDT
Comment on attachment 64867 [details]
Patch

Clearing flags on attachment: 64867

Committed r65686: <http://trac.webkit.org/changeset/65686>
Comment 22 WebKit Commit Bot 2010-08-19 11:29:11 PDT
All reviewed patches have been landed.  Closing bug.
Comment 23 Tony Chang 2010-08-19 13:03:04 PDT
It turns out that whatever computer runs PrettyPatch.rb when you click "Formatted Diff" on the bots depended on the full git path.  For example, the following patch fails even though it includes the git binary information in the diff.

https://bugs.webkit.org/attachment.cgi?id=64890&action=prettypatch

Where does this run?  Can we fix the path to git on the bots?
Comment 24 Eric Seidel (no email) 2010-08-19 13:08:32 PDT
wms is our man!  if he can't do it, no one can!
Comment 25 William Siegrist 2010-08-19 13:29:51 PDT
Dave, looks like we need to adjust the PATH for the open2() in attachment.cgi?

http://trac.webkit.org/browser/trunk/BugsSite/attachment.cgi#L395
Comment 26 Eric Seidel (no email) 2010-08-19 13:34:45 PDT
jparent is also on rather intimate terms with bugzilla...
Comment 27 Tony Chang 2010-08-19 13:56:51 PDT
(In reply to comment #25)
> Dave, looks like we need to adjust the PATH for the open2() in attachment.cgi?
> 
> http://trac.webkit.org/browser/trunk/BugsSite/attachment.cgi#L395

Alternately, maybe we can just symlink /usr/bin/git to /opt/local/bin/git on bugs.webkit.org?

I could also change PrettyPatch.rb to use /usr/bin/env git.
Comment 28 William Siegrist 2010-08-26 08:57:39 PDT
Bugs' PrettyPatch has been fixed in <http://trac.webkit.org/changeset/66104>.
Comment 29 David Kilzer (:ddkilzer) 2010-08-26 09:53:53 PDT
(In reply to comment #28)
> Bugs' PrettyPatch has been fixed in <http://trac.webkit.org/changeset/66104>.

Inadvertent changes backed out in r66105.
<http://trac.webkit.org/changeset/66105>