-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Slow builds due to checkstyle #2411
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
.gitignore
Outdated
| @@ -69,6 +69,8 @@ target/ | |||
| .DS_Store | |||
| Thumbs.db | |||
| .ccm/ | |||
| checkstyle_cachefile | |||
| checkstyle_test_cachefile | |||
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.
could we just put these into the build directory instead ? or the user's tmp directory? (i don't know how it works across different clones and repos…?)
(otherwise this will break releases, e.g. deb packaging)
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 moved it into the build dir. If it were on the tmp folder there could be cross-talk between different builds. Also let's see how this devbranch does...
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.
Devbranch job seems to have been able to build ok...
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.
@bereng @michaelsembwever Could we make it a property in build.xml and reference it in checkstyle.xml? That way I can put whatever path I want to build.properties file. Once it is in build dir, it will be there forever no?
What if I do ant realclean jar? Even I have not changed single line of the source code, I will need to do checkstyle again?
People may have a global .gitignore in their $HOME (normal git stuff) so I can point my build to cache it somewhere it will be gitignored anyway.
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.
Even I have not changed single line of the source code, I will need to do checkstyle again?
You compile classes again, even if you haven't touched them. That's the point with clean, and the behaviour i would expect.
I'm weary of having anything at the top level, it causes problems. Having it under build/ (specifically ${build.dir}) in in line with the work happening in 18133.
I would also be in favour of not calling checkstyle when jar building. With 18133, all linters are a separate command (e.g. .build/check-code.sh). To me this makes sense, as we also have owasp which is critical but we are ignoring because it's too slow (and network prone).
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 see a build.properties file so I am not following. You mean you want a specific property in build.xml just for the checkstyle cache? Why would sbdy need to change that? 🤔
You need it cleaned on every 'realclean', if you're checking out branches on the same folder only realclean works and you need to rebuild the checkstyle cache. It's not perfect but it's the best compromise I came up with.
If we put it in the build folder it gets gitignored already. Look at the latest commit.
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.
My understanding is that the ant realclean must clean the checkstyle cache as well, this is something much closer to the way Maven behaves and much more expected than having a dedicated checkstyle cache somewhere else. I'm +1 here.
I did small local tests by running ant build and changing some classes a few times sequentially, so that now it doesn't check the files that were not changed. Only the affected files are checked, which in turn speeds up the local build.
#1
/Users/x/IdeaProjects/cassandra/src/java/org/apache/cassandra/config/CassandraRelevantProperties.java=1686663255220
#2
/Users/x/IdeaProjects/cassandra/src/java/org/apache/cassandra/config/CassandraRelevantProperties.java=1686663333852
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.
@bereng yes, build.properties is not there but build.propeties.default is. That is supposed to be a template you place your properties in and rename it to build.properties which is in our .gitignore.
Anyway, I gave it the second thought and I think you all are right. realclean should just clean it all. We definitely need to have a target which wipes it all out regardless of the properties / settings a developer might set.
5a33803 to
550ed0b
Compare
checkstyle.xml
Outdated
| @@ -23,6 +23,8 @@ | |||
| <property name="severity" value="error"/> | |||
|
|
|||
| <property name="fileExtensions" value="java, properties, xml"/> | |||
|
|
|||
| <property name="cacheFile" value="${build.dir}/checkstyle_cachefile"/> | |||
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 have checked locally and everything is working as expected using the cacheFile property. I'm wondering if it's worth putting the cache file under the checkstyle directory ${checkstyle.log.dir} to keep everything in one place?
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.
oh, I'm sorry :-) I have just seen a lot of comments related to 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.
I think you're right. I missed that folder. They belong in there imo and it will still be under build. So all good. I have committed your suggestion. Thx.
|
i know we're editing existing files here, but it really bugs me that the checkstyle xml files are checked in at the top directory.
|
|
So you want to move all the checkstyle files from |
No, the versioned controlled checkstyle xml files. (Not talking about the generated files.) That is, the files |
3fb57fc to
1ae6efc
Compare
Thanks for sending a pull request! Here are some tips if you're new here:
Commit messages should follow the following format:
The Cassandra Jira