[ 
https://issues.apache.org/jira/browse/HADOOP-10926?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14187146#comment-14187146
 ] 

Colin Patrick McCabe commented on HADOOP-10926:
-----------------------------------------------

Sorry for the inconvenience, [[email protected]].  I tested with a bunch of 
patches, but as you said, it's hard to test every case.  It looks like the 
issue here is related to differences in what "git apply" produces on stdout as 
opposed to what GNU patch produces.

Thinking about this a little bit more, I think maybe the way to go here is to 
have a special case for patches that are clearly git patches generated 
*without* {{\-\-no-prefix}}.  These patches are always generated with reference 
to the project root, not to some other directory.  Even if "git diff" is run 
when inside a subdirectory, we know that the {{a/}} and {{b/}} actually stand 
for the project root.  This would allow us to skip a bunch of the crazy "let's 
figure out where the patch root is" logic-- just for the special case of git 
patches generated with a prefix.

bq. Xiaoyu wrote: We are still seeing the Jenkins error related to 
test-patch.sh.  https://builds.apache.org/job/PreCommit-HDFS-Build/8570//console

The build error you linked to doesn't seem related to this change.  The error 
message is:

{code}
/home/jenkins/jenkins-slave/workspace/PreCommit-HDFS-Build@2/dev-support/test-patch.sh:
 line 270:  3108 Killed                  $MVN clean test -DskipTests 
-D${PROJECT_NAME}PatchProcess -Ptest-patch > $PATCH_DIR/trunkJavacWarnings.txt 
2>&1
Trunk compilation is broken?
{code}

The "Killed" means that test-patch.sh received a SIGKILL, possibly as a result 
of an OOM condition on the executor.

Also, the build you linked to is at commit 
58c0bb9ed9f4a2491395b63c68046562a73526c9, which is after the change has been 
reverted, so there is no code from this change actually being executed at this 
time.

> Improve test-patch.sh to apply binary diffs
> -------------------------------------------
>
>                 Key: HADOOP-10926
>                 URL: https://issues.apache.org/jira/browse/HADOOP-10926
>             Project: Hadoop Common
>          Issue Type: Improvement
>    Affects Versions: 3.0.0
>            Reporter: Andrew Wang
>            Assignee: Colin Patrick McCabe
>             Fix For: 3.0.0
>
>         Attachments: HADOOP-10926.001.patch
>
>
> The Unix {{patch}} command cannot apply binary diffs as generated via {{git 
> diff --binary}}. This means we cannot get effective test-patch.sh runs when 
> the patch requires adding a binary file.
> We should consider using a different patch method.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to