Errors with gradle tasks that write files
I am using nixpacks gradle.
I have been getting errors like:
#10 327.5 > Could not copy zip entry /app/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-compiler-embeddable/1.9.0/2c8c3a7402becca891f12739b3e9fd2dc2adbd7a/kotlin-compiler-embeddable-1.9.0.jar!javaslang/?.class to '/app/.gradle/expanded/zip_190f62ce61c412336560b18963fb3dff/javaslang/?.class'.
They seem to be caused by zip and copy tasks. I can't replace some of the tasks because they are part of other gradle plugins and provide no way to control.
I'm not sure this is the cause, but gradle has issues like this when it is writing into a directory it doesn't have ownership of, even if it has permissions to write to
Any help appreciated. Project id: 30d959ae-e330-4322-971d-a4802080496c
2 Replies
Project ID:
30d959ae-e330-4322-971d-a4802080496c
https://docs.gradle.org/current/userguide/dependency_resolution.html#sub:ephemeral-ci-cache seems it's not recommended to use .gradle as a cached volume, I'm trying a modified version of the nixpack generated Dockerfile now using GRADLE_RO_DEP_CACHE on a separate read-only cache directory
Actually, it seems it is just the kotlin embedded compiler that has this issue with the permissions, no idea why, but I didn't need need it in production anyway
Though now I am getting a lock error because I had 2 builds running simultaneously, so I do think this is a cause for many bugs that should be addressed (e.g. use a proper gradle supported read-only cache) by nixpack devs - not that I believe this to be Railway's responsibility, but thought i'd note