[
https://issues.apache.org/jira/browse/YETUS-1107?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17321966#comment-17321966
]
Masatake Iwasaki commented on YETUS-1107:
-----------------------------------------
The cause seems to be parallel mode of make/cmake ({{-j}}).
https://github.com/apache/hadoop/blob/rel/release-3.3.0/hadoop-maven-plugins/src/main/java/org/apache/hadoop/maven/plugin/cmakebuilder/CompileMojo.java#L200-L204
{noformat}
public void runMake() throws MojoExecutionException {
List<String> cmd = new LinkedList<String>();
cmd.add("make");
cmd.add("-j");
cmd.add(String.valueOf(availableProcessors));
{noformat}
If the order of compiler warnings is non-deterministic, we can not extract
warnings newly introduced by just getting diff of (grepped) console output.
{noformat}
$ ./dev-support/bin/test-patch --debug --project=hadoop
--personality=$PWD/dev-support/bin/hadoop.sh --plugins=all --dirty-workspace
--java-home=/usr/lib/jvm/java-1.8.0-openjdk-amd64 --build-native=true
./2886.patch
...(snip)
+---------------------------------------------------------------------------
| | | | Patch Compile Tests
+---------------------------------------------------------------------------
| 0 | mvndep | 0m 14s | Maven dependency ordering for patch
| +1 | mvninstall | 0m 51s | the patch passed
| +1 | compile | 19m 31s | the patch passed
| -1 | cc | 19m 31s | root generated 4 new + 203 unchanged -
| | | | 4 fixed = 207 total (was 207)
...(snip)
$ diff /tmp/yetus-11054.4656/branch-compile-cc-root.txt
/tmp/yetus-11054.4656/patch-compile-cc-root.txt
187,190d186
< [WARNING]
/home/centos/srcs/hadoop/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/main/native/src/util/StringUtil.cc:39:21:
warning: invalid suffix on literal; C++11 requires a space between literal and
string macro [-Wliteral-suffix]
< [WARNING]
/home/centos/srcs/hadoop/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/main/native/src/util/StringUtil.cc:45:21:
warning: invalid suffix on literal; C++11 requires a space between literal and
string macro [-Wliteral-suffix]
< [WARNING]
/home/centos/srcs/hadoop/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/main/native/src/util/StringUtil.cc:45:34:
warning: invalid suffix on literal; C++11 requires a space between literal and
string macro [-Wliteral-suffix]
< [WARNING]
/home/centos/srcs/hadoop/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/main/native/src/util/StringUtil.cc:51:21:
warning: invalid suffix on literal; C++11 requires a space between literal and
string macro [-Wliteral-suffix]
194a191,194
> [WARNING]
> /home/centos/srcs/hadoop/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/main/native/src/util/StringUtil.cc:39:21:
> warning: invalid suffix on literal; C++11 requires a space between literal
> and string macro [-Wliteral-suffix]
> [WARNING]
> /home/centos/srcs/hadoop/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/main/native/src/util/StringUtil.cc:45:21:
> warning: invalid suffix on literal; C++11 requires a space between literal
> and string macro [-Wliteral-suffix]
> [WARNING]
> /home/centos/srcs/hadoop/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/main/native/src/util/StringUtil.cc:45:34:
> warning: invalid suffix on literal; C++11 requires a space between literal
> and string macro [-Wliteral-suffix]
> [WARNING]
> /home/centos/srcs/hadoop/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-nativetask/src/main/native/src/util/StringUtil.cc:51:21:
> warning: invalid suffix on literal; C++11 requires a space between literal
> and string macro [-Wliteral-suffix]
{noformat}
Sorting the grepped warnings could be an option. I'm going to submit a PR
addressing this.
{noformat}
$ cat /tmp/yetus-11054.4656/branch-compile-cc-root.txt | sort > 1.txt
$ cat /tmp/yetus-11054.4656/patch-compile-cc-root.txt | sort > 2.txt
$ diff 1.txt 2.txt
{noformat}
> calcdiffs of cc raise false positive warnings
> ---------------------------------------------
>
> Key: YETUS-1107
> URL: https://issues.apache.org/jira/browse/YETUS-1107
> Project: Yetus
> Issue Type: Bug
> Reporter: Masatake Iwasaki
> Priority: Major
>
> test-patch of Hadoop project always cast -1 on cc due to warnings not related
> to the patch.
> {{23 new}} and {{23 fixed}} are pointing the the same warnings (not related
> to the patch) in the following example.
> {noformat}
> root-jdkPrivateBuild-1.8.0_282-8u282-b08-0ubuntu120.04-b08 with JDK Private
> Build-1.8.0_282-8u282-b08-0ubuntu120.04-b08 generated 23 new + 304 unchanged
> - 23 fixed = 327 total (was 327)
> {noformat}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)