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

Built-in capabilities to cache package manager files #11229

Closed
eric-labelle opened this issue Aug 27, 2019 · 2 comments
Closed

Built-in capabilities to cache package manager files #11229

eric-labelle opened this issue Aug 27, 2019 · 2 comments

Comments

@eric-labelle
Copy link

Question, Bug, or Feature?
Feature

Enter Task Name: CacheBetaV0

Environment

  • Server - Azure Pipelines
  • Agent - Hosted or Private: Hosted (macOS 10.14)

Issue Description

Using the documentation and setting cache to GRADLE_USER_HOME (.gradle)
eventually ends up in error. In an Android pipeline, I wish to cache at least 3 things

  • .gradle/cache/build-cache-1 --> the buildCache would speed up build a lot
  • .gradle/cache/modules-2/files-2.1 --> all dependencies downloaded
  • .gradle/wrapper/ --> the gradle distribution jar

My problems with current setup:

  • When I change a dependency from the Android project, the cache should be updated but isn't
  • When I swap wrapper version the cache should be updated but isn't
  • Caching the whole .gradle/ folder will eventually end up with an aapt2 error Execution failed for task ':app:mergeDebugResources'. > 8 exceptions were raised by workers:   com.android.builder.internal.aapt.v2.Aapt2InternalException: AAPT2 aapt2-3.4.2-5326820-osx Daemon #2: Daemon startup failed .This should not happen under normal circumstances, please file an issue if it does.

I've seen there is lots of lock file in gradle repo and Gradle uses dependency locking so I was wondering.. Is there a lock file we can use for the Cache key in gradle similar to the example for yarn (and/or gem.lock whereas everytime the dependencies changes, the file hash would be different)

Either way, I'm glad you're working on this new task but I currently can't figure a way to make it work efficiently with Android / Gradle project.

A great improvement to this CacheBeta task would be to have it capable to handle common caches built-in (maven, gradle, yarn, gem etc.) perhaps an evolution of this task or some additional configurations but these will be common usecase we want cached in order to speed up pipeline execution.

Thanks for your time.

@fadnavistanmay
Copy link
Contributor

Apologies for the delay here, there were some routing issues related to the Cache task, which Danny have fixed.

@eric-labelle - you should definitely try the gemfile.lock , assuming it has all your dependencies. So, whenever it changes, you will get a new hash/new cache.

You can also try the globbing pattern, for e.g.

key - gradle | **/*.lock

something on similar lines to include all the lock files.
Let us know if this resolves your issue.
Thanks.

@fadnavistanmay
Copy link
Contributor

I am closing this issue. Please feel free to re-open if it still persists.

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

3 participants