-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-24529][Build][test-maven] Add spotbugs into maven build process #21542
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Test build #91720 has finished for PR 21542 at commit
|
|
Test build #91923 has finished for PR 21542 at commit
|
|
After merging #21481, I confirmed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it a real problem?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not a real problem. However, I cannot find to disable only this check in findPuzzles.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what does it mean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It means x % 2 == does not work correctly if x is negative.
In this case, we know value.length is always non-negative . The current SpotBugs cannot detect this pre-condition. I cannot find to disable only this check in findPuzzles, too.
Therefore, this is a workaround to avoid the false positive violation.
|
Sounds a good idea if what we all need is few changes like this. cc @srowen and @JoshRosen too who I believe might be interested in this too |
srowen
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have the code in front of me; is there a findbugs config in Spark? We can remove it if so after this.
I am OK with adding static analysis like this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we sure this Comparator never returns Int.MinValue? If it can, then this is still a legitimate possible bug.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. We cannot ensure it. ordering.compare(o2, o1) looks better.
|
Test build #92112 has finished for PR 21542 at commit
|
|
retest this please |
|
Test build #92116 has finished for PR 21542 at commit
|
|
retest this please |
|
Test build #92125 has finished for PR 21542 at commit
|
|
Hmm .. retest this please |
|
Test build #92131 has finished for PR 21542 at commit
|
|
retest this please |
|
Test build #92139 has finished for PR 21542 at commit
|
|
retest this please |
|
Test build #92150 has finished for PR 21542 at commit
|
|
Hmm .. seems roughly the error looks consistent. |
|
Unfortunately, looks consistent... |
|
Test build #92180 has finished for PR 21542 at commit
|
|
Even when we stop forking SpotBugs, the same error occurred. |
|
Test build #92601 has finished for PR 21542 at commit
|
revert type
|
Test build #92609 has finished for PR 21542 at commit
|
| <scope>test</scope> | ||
| </dependency> | ||
|
|
||
| <dependency> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is derived from the previous PR
pom.xml
Outdated
| <artifactId>spotbugs-maven-plugin</artifactId> | ||
| <version>3.1.3</version> | ||
| <configuration> | ||
| <classFilesDirectory>${basedir}/target/scala-2.11/classes</classFilesDirectory> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may also want to apply it to 2.12 later?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, me too. Good catch.
|
Seems fine to me otherwise. |
| <configuration> | ||
| <classFilesDirectory>${basedir}/target/scala-2.11/classes</classFilesDirectory> | ||
| <testClassFilesDirectory>${basedir}/target/scala-2.11/test-classes</testClassFilesDirectory> | ||
| <effort>Max</effort> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kiszk, btw do you roughly know how much time this PR increases in the build?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not see large difference of maven's user time with and w/o Max
with Max
user 17m18.628s
without Max
user 17m3.724s
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eh, how much does it increase the Maven build time by this whole PR then roughly?
|
Test build #92746 has finished for PR 21542 at commit
|
|
retest this please |
|
LGTM, let's run test one more time to make sure it's not flaky |
HyukjinKwon
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM too
But still it would be nicer if we know how much this PR one increases the total build time as well roughly since we actually take care about the build time.
|
Test build #92757 has finished for PR 21542 at commit
|
|
retest this please |
|
Test build #92767 has finished for PR 21542 at commit
|
|
LGTM too. |
|
Thank you so much @kiszk. |
|
sorry missed this thread... Let me trigger test again to make sure new code merged during these 2 days do not violate the check. jenkins retest this please |
|
retest this please |
|
Test build #92865 has finished for PR 21542 at commit
|
|
Merged to master. |
|
@HyukjinKwon @kiszk I see errors when I build locally on my machine: |
|
have you cleaned your environment? How exactly did you build Spark locally? |
|
"permission" stuff might be Java 9 related? |
|
Hmmmm this happened to me too and I just pushed fc2e189. Mine was Java 8. There's reproducer in the PR description. |
|
This was reverted in favour of #21865 and SPARK-24895 for now. |
What changes were proposed in this pull request?
This PR enables a Java bytecode check tool spotbugs to avoid possible integer overflow at multiplication. When an violation is detected, the build process is stopped.
Due to the tool limitation, some other checks will be enabled. In this PR, these patterns in
FindPuzzlerscan be detected.This check is enabled at
compilephase. Thus,mvn compileormvn packagelaunches this check.How was this patch tested?
Existing UTs