Hi Viktor,
I encounter an issue with the Cache:Pull step, the step seems failed to download or extract the cache archive, it produce this log
2017/09/28 04:19:46 => > Downloading and extracting cache archive …
2017/09/28 04:19:46 [!] Unable to download or uncompress cache: failed to extract tar archive, output: gzip: stdin: not in gzip format
tar: Child died with signal 13
tar: Error is not recoverable: exiting now, error: exit status 2, retrying…
2017/09/28 04:20:33 => [DONE]
2017/09/28 04:20:33 => Took: 47.71805638s
2017/09/28 04:20:33 => Finished
I’ve checked the Cache:Push step from the previous build and it finished successfully.
@taku Without more info it’s really hard to say anything useful.
I’d suggest you to upgrade all the related steps in the workflow, and if that wouldn’t help please create a #issues:build-issues report so that we’ll have enough info to debug it
Indeed, the Cache:Push step is configured to not to push back cache in case of PR builds. In general we’d suggest you to keep that default behaviour, but of course if you have a use case which requires / benefits from pushing back from pull request builds the run_if: true option can be used
The caching gradle system works fine on my Android project! Thanks!
I would like to know where I can find the logic of Bitrise for detecting when it can re-use the pulled cache or not; I assume it is somewhere in the Steps but I still can’t find it… sorry…
What I would like to do is to make sure NOT to re-use the cached data if certain project-specific file in the project(e.g. gradle file) is modified whenever changes are pushed.
I think you should add a script step right after the git-clone step.
This script should decide if the build should use cache or not.
You can use git diff command to determine which files changed. Use envman to export an environment variable which holds if cache is needed or not.
envman add --key USE_CACHE --value "true"
Use this env in the cache step’s run_if property (which controls if the step should run or not), like:
run_if: {{getenv “USE_CACHE” | eq “true”}} `
Let me know if you need any help to implement the script!
I just added the PUSH stuff without any further confirmations and I think I still need to ask for Gradle cache. Is that right?
Does the cache work with a multi-module project?
Our build has around 6mins of Cache:Pull. That is a really long time. I’m not sure if adding 6 more minutes is worth it. I wonder if we are doing something wrong. What is the best way to check that?
Hi @taso.dane
Thank you for reaching out to Bitrise.
Can you please enable Support Access for your project and send us the build URL so that we can take a look at your WF and figure out why it is taking some time?
Hi, I recently changed the caching configuration and deleted the old cache and it was better. Since then, ~1 week has passed and the cache is again became 10GB which is really big. That is the reason why the builds becomes slower.
Hi, thanks for the reply. I remembered this recently and I was going to also ping.
We have the step named _cache-build and it is included into only 1 workflow actually. Here is how it looks like in bitrise.yml. I’m not sure what I can change here. Any feedback will be appreciated.