Skip to content
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

systemProperties contains absolute paths, creating remote build cache misses #1376

Closed
martinbonnin opened this issue Apr 24, 2023 · 4 comments
Assignees
Milestone

Comments

@martinbonnin
Copy link
Contributor

Hi 👋

Trying to enable remote build cache on apollo-kotlin, :intellij-plugin:test creates a cache misses (build scan).

This is due to the systemProperties input containing absolute paths. For an example, dumping the value of systemProperties:

tasks.named("test") {
  doFirst {
    println(inputs.properties.get("systemProperties"))
  }
}

Dumps this:

{idea.config.path=/Users/mbonnin/git/apollo-kotlin/intellij-plugin/build/idea-sandbox/config-test,
 idea.force.use.core.classloader=true, idea.home.path=/Users/mbonnin/git/apollo-kotlin/intellij-plugin/mockJDK, 
idea.log.path=/Users/mbonnin/git/apollo-kotlin/intellij-plugin/build/idea-sandbox/system-test/log, 
idea.plugins.path=/Users/mbonnin/git/apollo-kotlin/intellij-plugin/build/idea-sandbox/plugins-test, 
idea.system.path=/Users/mbonnin/git/apollo-kotlin/intellij-plugin/build/idea-sandbox/system-test, idea.use.core.classloader.for=,
 idea.use.core.classloader.for.plugin.path=true, java.system.class.loader=com.intellij.util.lang.PathClassLoader, 
jdk.attach.allowAttachSelf=true, jdk.http.auth.tunneling.disabledSchemes="", jdk.module.illegalAccess.silent=true, 
kotlinx.coroutines.debug=off, plugin.path=/Users/mbonnin/git/apollo-kotlin/intellij-plugin/build/idea-sandbox/plugins-
test/toml:,/Users/mbonnin/git/apollo-kotlin/intellij-plugin/build/idea-sandbox/plugins-test/js-graphql-intellij-
plugin:,/Users/mbonnin/git/apollo-kotlin/intellij-plugin/build/idea-sandbox/plugins-test/apollo-intellij-plugin, 
sun.io.useCanonCaches=false, sun.java2d.metal=true}

Would it be possible to make those relative instead?

@runningcode
Copy link
Contributor

Here is how you can change these paths to use relative path sensitivity: https://docs.gradle.org/current/userguide/caching_java_projects.html#dealing_with_file_paths

@hsz hsz added this to the 1.14.2 milestone Jun 15, 2023
@hsz hsz closed this as completed in 9765b12 Jun 15, 2023
@hsz
Copy link
Member

hsz commented Jun 16, 2023

Could you folks please verify the fix with 1.14.2-SNAPSHOT release?

@martinbonnin
Copy link
Contributor Author

It's working 🎉 Build scan comparison: https://ge.apollographql.com/c/tio3mycqe52gw/hutlgsgajznwe/task-inputs

We're down from ~40s to ~3s with build cache.

@hsz
Copy link
Member

hsz commented Jun 19, 2023

@martinbonnin Thank you for the confirmation!
@runningcode This link was super helpful, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants