bitrise-steplib / bitrise-step-save-cache

1 stars 5 forks source link

Add `--format posix` argument to `tar` to support caching DerivedData #32

Closed jflan-dd closed 1 month ago

jflan-dd commented 4 months ago

Troubleshooting

Useful information

Issue description

I've been attempting to replicate the work from this article for our Bitrise builds.

Using the standard Save Cache and Restore Cache I wasn't able to have Xcode reuse any build artifacts, and it actually ended up taking more time than without the cache.

After going through the differences between the steps in the article and the Bitrise Save/Restore Cache steps I found that the important difference was passing --format posix to the tar command in Save Cache.

I was also able to validate this behavior locally without Bitrise in the loop at all by manually archiving a restoring the DerivedData folder and seeing that Xcode only reused artifacts when --format posix was supplied.

Bitrise info

 
  

Steps to reproduce

  1. ...
  2. ...
jflan-dd commented 3 months ago

This is the motivation for using the posix format according to the original article

we will use posix notation for higher-resolution timestamps. This preserves various attributes used by xcodebuild.

treastrain commented 3 months ago

Focusing on the discussion of DerivedData provided by Xcode, I am very interested in the bitrise-steplib/bitrise-step-save-xcodebuild-cache and bitrise-steplib/bitrise-step-restore-xcodebuild-cache are beginning development.

These have not yet been added to bitrise-io/bitrise-steplib, so it does not appear that we can use them from bitrise.io yet.

bitrise-silver commented 1 month ago

custom_tar_args has been added https://github.com/bitrise-steplib/bitrise-step-save-cache?tab=readme-ov-file#%EF%B8%8F-configuration , thanks for your feedback .

jflan-dd commented 1 month ago

Thanks!