-
Notifications
You must be signed in to change notification settings - Fork 484
[JAMES-3978] Improves james build cache #2786
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
| <ignoreEmptyDirectories>true</ignoreEmptyDirectories> | ||
| </normalization> | ||
| </fileSet> | ||
| <fileSet> |
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.
using the classpathElements as items in the cache key solves the invalid cache items so compilation works
locally for executions in rapid succession the local cache works but on the ci with 5h between jobs we get cache misses with out of order items
classpathElements is a set in the scala compiler plugin and caching it was inspired by the kotlin example and the clojure example
the cause is probably that the scala maven plugin creates a new set with
@Override
protected Set<File> getClasspathElements() throws Exception {
Set<File> back = FileUtils.fromStrings(project.getTestClasspathElements());
back.remove(new File(project.getBuild().getTestOutputDirectory()));
addAdditionalDependencies(back);
return back;
}
whereas the clojure plugin uses a stored proeprty
@Parameter(required = true, readonly = true, property = "project.compileClasspathElements")
protected List<String> classpathElements;
the additional dependencies was added as a way to introduce compile-only dependencies to generate better documentation
not sure how to fix that, I'm trying to push a patch upstream
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.
the patch was accepted upstream and released yesterday I have updated the PR to resume my tests
|
with build cache enabled for scala compilation, a rebuild on an unchanged james codebase unsing down to |
ea20a0d to
fd07344
Compare
| <normalization> | ||
| <runtimeClassPath> | ||
| <ignoredFiles> | ||
| <ignoredFile>git.properties</ignoredFile> |
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 haven't been able to retrieve the contents to understand why they were different but build scan comparison showed that this file was preventing caching of the test outputs
fd07344 to
7de3d41
Compare
using runtimeClasspath normalization to ignore git.properties which was pointed out as preventing caching by a build scan comparison git.properties are not expected to change test and coverage output much anyways.
7de3d41 to
9d8cfeb
Compare
|
This build shows test output successfully loaded from the build cache. If build caching proves problematic, disabling scala compilation caching can easily be achived and the build time cost of not caching compilation is not that high (a few minutes) Once merged on master, I expect the develocity performance report for the test stage to show a massive build time gain |
This PR adds build cache support for scala compile and jacoco report-aggregate
According to this build scan (on master) and this build scan (on the initial build cache branch), Scala compilation and jacoco report aggregation are the 2 longest running goals in the build when it is otherwise fully cached.
Note that this PR is WIP : local runs seem to be able to store to the build cache.
-DrerunGoalsensures that all cache output is stored again in case some cache pollution occured.but running again without the rerunGoals
fails to compile on my machine with
I'm not sure why there is a cache miss on the java compilation so this it not yet mergeable
links I found helpful working on this (in case I accidentally close my browser tabs :D)
MAVEN_OPTS=-Dorg.slf4j.simpleLogger.log.develocity.goal.cache=debugshow some useful information on goal caching