tycho icon indicating copy to clipboard operation
tycho copied to clipboard

Participate in the Maven Build Cache Extension

Open laeubi opened this issue 3 years ago • 2 comments

The Maven Build Cache Extension aims in speedup builds and caching things. We should investigate if Tycho could participate here e.g. also for its need to cache P2 data.

laeubi avatar Jan 30 '22 06:01 laeubi

Since there is an official release of the build cache extension, I've tried it on one of my repos. Unfortunately it already fails quite early, because Tycho has sanity checks that are not fulfilled anymore:

[ERROR] Failed to execute goal org.eclipse.tycho:target-platform-configuration:3.0.4:target-platform (default-target-platform) on project com.etas.lima.disabled: Execution default-target-platform of goal org.eclipse.tycho:target-platform-configuration:3.0.4:target-platform failed: Unexpected build result of MavenProject: com.etas.common:com.etas.lima.connector:5.1.0-SNAPSHOT @ C:\dev\commons\git\common\plugins\com.etas.lima.connector\pom.xml: Artifact with classifier 'p2metadata' expected at location "C:\dev\commons\git\common\plugins\com.etas.lima.connector\target\p2content.xml", but is at "C:\Users\myuserid\.m2\build-cache\v1\com.etas.common\com.etas.lima.connector\c0fc6a83a46700155935cd590c4b267acbfd92b86d00273fded6c546838d3271\local\com.etas.lima.connector-p2metadata.xml"

That comes from https://github.com/eclipse-tycho/tycho/blob/73276c7ea3812d9e2fe6691ecefa11534c2585b9/tycho-core/src/main/java/org/eclipse/tycho/core/resolver/DefaultTargetPlatformService.java#L167. I have no idea how many similar or other problems might exist for using the build cache extension. What do you think about removing that check, or checking that the location contains "build-cache" (if not equal) or...

Bananeweizen avatar Jun 11 '23 19:06 Bananeweizen

The problem is that there are other parts of the code that expect the files to be at certain locations, so even if we fix this it might give problems else-where.

I also looking once in a while at the Build Cache Extension but sadly it is very very tightly coupled to the maven-plugins and do not work well with custom plugins or extensions and has many prerequisites.

So in the end I found no real way to make use of it, my initial idea was more to be able to cache target resolution and classpath-validations but this seems not to be supported here.

laeubi avatar Jun 12 '23 06:06 laeubi