caching
  • j

    John

    06/24/2022, 12:43 PM
    No, but caching in general does
  • Sergey Lapin

    Sergey Lapin

    06/27/2022, 8:02 AM
    Hi, I just found out that
    build-tools;33.0.0
    ‘s
    core-lambda-stubs.jar
    somehow is different for linux and macOS — this is a problem if you use remote build cache populated by some linux-powered CI (as do I) and developers’ machines are Macs. It’s related to #android, but since all impact is about caching — decided to post this info here.
  • n

    nisse

    06/30/2022, 7:24 PM
    I'm trying to figure out why cache is missing. As far as I can tell the only difference between the cache-logs are the implementations, and they're both from the same released artifact. I've tried running it on two different linux hosts, with identical JVM and even identical paths, but the cache is still different
  • j

    Jan Rabe

    07/21/2022, 9:00 AM
    Hello, how do I declare a method that I can use within task execution time with gradle configuration caching enabled? e.g.
    def logOut(String message) {
        println("generate_pluginversionslist - $message")
    }
    
    afterEvaluate {
    
        if (project.hasProperty("android")) {
            android {
                if (it.hasProperty("applicationVariants")) {
                    applicationVariants.all { variant ->
    
                        def buildType = variant.buildType.name
                        def variantName = variant.name
                        def variantNameCapitalize = variantName.capitalize()
    
                        logOut("register for ${variantName} variant")
    
                        preBuild.dependsOn tasks.register("writePluginVersionsStrResourceTask${variantNameCapitalize}") {
    
                            outputs.file(project.file("build/generated/res/c24/$buildType/values/$customGeneratedFileName"))
    
                            description = "Generate ${outputs.files.singleFile}"
                            println(description)
    
                            doLast {
                                logOut("Started for variantName=$variantName buildType=$buildType")
    
                                outputs.files.singleFile.withWriter { writer ->
                                    writer.write('<?xml version="1.0" encoding="utf-8"?>\n<resources>\n\n')
                                    writer.write('\n</resources>\n\n')
                                }
    
    
                                logOut("Done for variantName=$variantName buildType=$buildType")
                            }
                        }
    
                        clean {
                            delete project.file("build/generated/res/c24/$buildType/values/$customGeneratedFileName")
                        }
                    }
                }
            }
        }
    }
    it stops working when enabling configuration caching and rebuilding in gradle.properties
    # <https://docs.gradle.org/current/userguide/configuration_cache.html>
    org.gradle.unsafe.configuration-cache=true
    org.gradle.unsafe.configuration-cache-problems=warn
    after rebuilding it shows this error every time where it states it suddenly can’t find the logOut method any more
    What went wrong:
    Execution failed for task ':app:writePluginVersionsStrResourceTaskDebug'.
    > Could not find method logOut() for arguments [Started for variantName=debug buildType=debug] on task ':app:writePluginVersionsStrResourceTaskDebug' of type org.gradle.api.DefaultTask.
  • Nikolay

    Nikolay

    08/01/2022, 5:40 PM
    Hi, I am getting the following error:
    Project accessors enabled, but root project name not explicitly set for 'buildSrc'. Checking out the project in different folders will impact the generated code and implicitly the buildscript classpath, breaking caching.
    Should I edit
    buildSrc/build.gradle.kts
    and set a project name there? Should I set it to
    buildSrc
    ?
  • David Chang

    David Chang

    08/09/2022, 12:32 AM
    hey, I'm seeing numerous tasks in which I'm getting remote cache misses due to path mismatch between local and CI
    /Users/changd
    vs
    /home/changd
    , these are all with "Normalization: Relative path, ignored empty directories, non-normalized line endings" The commonality I can see is these are all classpaths • Task Class:
    org.jetbrains.kotlin.gradle.internal.KaptGenerateStubsTask
    ◦ File properties:
    classpath
    • Task Class:
    com.android.build.gradle.tasks.TransformClassesWithAsmTask
    ◦ File properties:
    inputClassesDir
    • Task Class:
    org.jetbrains.kotlin.gradle.tasks.KotlinCompileWithWorkers
    ◦ File properties:
    classpath
    • Task Class:
    org.gradle.api.tasks.compile.JavaCompile
    ◦ File properties:
    classpath
  • Alphonse Bendt

    Alphonse Bendt

    09/02/2022, 10:15 AM
    @Chase Pollock i am seeing the same behaviour with my gitlab/gradle setup. could you provide some details on how you resolved it?
  • v

    Vibin Reddy

    09/04/2022, 5:45 PM
    I'm seeing negative savings with Build cache enabled on incremental builds due to "packing" taking up to 7% of the total build time (no "unpacking" as those tasks are UP-TO-DATE), but clearly there is a huge improvement in case of clean builds is this expected? any solution for this?
  • v

    Vibin Reddy

    09/06/2022, 1:50 PM
    ^ can anyone help with this?
  • Bilgehan Kalkan

    Bilgehan Kalkan

    09/15/2022, 1:33 PM
    Hi everyone, I’m trying to run build-cache-node on Ubuntu VM via Docker. But it gets
    OutOfMemoryException
    several times after running. It was working fine for 3 weeks but today it started to happening. I have tried updating docker image, reinstalling docker but still same exception happening. Do you have any suggestion? (Ubuntu Server 22.04, Docker 20.10.18 Build cache node version: 13.1)
  • z

    Zak Taccardi

    09/27/2022, 10:55 PM
    If a cacheable task is a successor of a non-cacheable predecessor task, does that prevent the successor cacheable task from being cacheable bc it depends on a non-cacheable predecessor task?
  • Eug

    Eug

    09/28/2022, 2:21 PM
    We have some old hand written task and I’m trying to rewrite it with configuration cache support. I don’t see any errors. However, first run of this task works. The second run says it can not find some groovy methods defined in this file. What could be the issue?
  • d

    Doni

    10/05/2022, 10:10 AM
    Hi, how do we troubleshot cache misses from the same cache key? So i have first build that stored artifact 9399da9f147952c4565552edec56056a to remote cache (first image). Then i have second build from different machine that have the same cache key, but it missed. I already enabling capturing input task, and comparing both build but it is exactly same and no difference. Any suggestion how do we check why it missed ?
  • c

    Chris Lee

    10/13/2022, 1:54 PM
    Gradle supports normalization to handle this.
  • j

    Justin Breitfeller

    10/20/2022, 4:42 PM
    Can anyone tell me if I’m reading this correctly. I’m debugging why a task is not hitting the remote build cache and I’ve come across this discrepancy in the cache debug output. On my local machine
    Appending input file fingerprints for 'inputArtifact' to build cache key: 3447d06a1cf0b5b0770a5a19c48d6c16 - NAME_ONLY{/Users/justinbreitfeller/.gradle/caches/modules-2/files-2.1/com.android.tools.build/aapt2/7.3.1-8691043/318150c1078be0bd4bdff348e6d79b8ab7991653/aapt2-7.3.1-8691043-osx.jar='aapt2-7.3.1-8691043-osx.jar' / 4341034cb2e00bae6db6d9e642ab5c12}
    On my remote machine
    Appending input file fingerprints for 'inputArtifact' to build cache key: 0df6c43612fd0d3d6d0860576053d155 - NAME_ONLY{/home/circleci/.gradle/caches/modules-2/files-2.1/com.android.tools.build/aapt2/7.3.1-8691043/41177c11a257af096624e80d433714aae61ca9f6/aapt2-7.3.1-8691043-linux.jar='aapt2-7.3.1-8691043-linux.jar' / 25f9626e6fddbffaa42760fb2c950d38}
    Am I wrong to assume that this NAME_ONLY inputArtifact won’t help cross platform since the JAR files have the platform in its name?
  • d

    Doni

    10/27/2022, 11:18 AM
    Is this expected if we make abi changes, then all module depend to it will resulting different cache key ? for example when printing task input it saying that classes.jar is different.
  • s

    Sergey Chelombitko

    10/31/2022, 3:57 PM
    Is it possible to configure Gradle to push to both local and remote build cache? If I enable both caches and enable pushing to remote cache, Gradle never seems to push to remote cache.
  • Łukasz Wasylkowski

    Łukasz Wasylkowski

    11/01/2022, 9:08 PM
    👋 How can I debug
    Class path of task '...' has changed from xxx to yyy
    ? I see it happen for modules with very few dependencies when I change a completely unrelated
    build.gradle
    file (one that the offending module doesn’t depend on). Build scan doesn’t seem too helpful here sadly
  • El Zhang

    El Zhang

    11/02/2022, 3:23 AM
    Hi folks, may I know how to deal with the
    inputChanges.getFileChanges(...)
    with
    ListProperty<Directory>
    ? Should I convert it to
    ConfigurableFileCollection
    or is there any other ways can help me keep the
    ListProperty<Directory>
    property type which is more clear to be used? According to the doc:
    …be it of type
    RegularFileProperty
    ,
    DirectoryProperty
    or
    ConfigurableFileCollection
  • a

    Alex Spence

    11/02/2022, 10:39 PM
    Hi all - not sure if this is the right place to ask this - but I'm recently getting an error in IntelliJ while building related to gradle caches. The root cause is my company compliance app is blocking a log4j file due to it being flagged as vulnerable, and this file is sitting in the gradle source here: https://github.com/gradle/gradle/tree/master/subprojects/docs/src/snippets/antMigration/fileDeps/groovy/libs Its odd that I'm only seeing this problem inside intelliJ, and not on the command line, was wondering if anyone had any insight into a workaround for this. I can report this issue in github and hopefully the offending file will be patched but its blocking some of our developers already.
    org.gradle.internal.execution.OutputSnapshotter$OutputFileSnapshottingException: Cannot snapshot output property 'outputDirectory'.
    java.io.UncheckedIOException: Failed to create MD5 hash for file '/Users/spence/.gradle/caches/transforms-3/b857c89a93e3ad26d7a3a2df48b5cb23/transformed/unzipped-distribution/gradle-7.5.1/subprojects/docs/src/snippets/antMigration/fileDeps/kotlin/libs/log4j-1.2.8.jar' as it does not exist.
  • z

    Zak Taccardi

    11/03/2022, 8:24 PM
    I’d like to add some testing around remote and local cache hits. Does Gradle support this in any way?
  • Brian Stewart

    Brian Stewart

    11/10/2022, 2:47 AM
    Hi folks, I have a system property that is changing on every branch, which appears to be breaking the cache for test tasks. I have read through the docs here on property file normalization, but it doesn’t include anything about ignoring system properties. Is there a way to do it?
  • d

    Doni

    11/11/2022, 9:05 AM
    Hi, How do we check why task artefact size increase? I just realize my artefact size increased 20% recently, but not sure which update/changes causing it. any advice ?
  • j

    Jakub Mosakowski

    11/16/2022, 9:14 AM
    Hello! I recently started using Gradle build-cache which significantly improved clean build time (6 times faster). Unfortunately, benchmarking using gradle-profiler pointed out slight regression on incremental builds (~20% slower). Is it intended behavior? I cannot find anything about that on the internet, but from the logical point of view, it makes sense (cache overhead is probably non-zero). I'm also wondering why this flag is not enabled by default, are there any cons to using that?
  • Sebastian Kacprzak

    Sebastian Kacprzak

    11/21/2022, 11:51 AM
    Would using Oracle Java 17 on CI (that populates remote cache) and OpenJDK 17 locally cause cache misses?
  • e

    Eduard-Cristian Boloș

    11/22/2022, 1:57 PM
    Hello! I am setting up a remote build cache for our project, and I was wondering, is it beneficial to disable the local build cache on the CI, or is it better to keep it enabled? I've seen several examples online with it disabled, but no guidance in the documentation. Thanks!
  • e

    Eduard-Cristian Boloș

    11/23/2022, 12:28 PM
    Hi! I have another question related to remove build caches. Now that I have it set up, I was looking into the gains for our Android project, and I noticed that on an M1 MacBook I am always getting 0 remote cache hits, whereas on an Intel MacBook I am getting many hits. The CI that pushes to the remote cache is an x86 one, is the different architecture an issue? Are there any workarounds, other than having another CI build in parallel that uses an ARM execution environment?
  • r

    ritesh singh

    11/28/2022, 10:54 PM
    Why my
    build cache overhead
    shows 2hrs - it took only max 45 minutes after running these commands • rm -rf ~/.gradle/cache/build-cache-* • ./gradlew clean • ./gradlew assembleDebug
  • Francesco Bonnì

    Francesco Bonnì

    11/29/2022, 7:21 PM
    Hi! I have an android project that run on Travis and I found that we’re uploading every time the caches because files on modules-2/files-2.1 like androidx libraries are marked as changed. Could something impact that libraries .pom or .aar and changed them everytime?