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

Change location of iOS build cache directory to ~/Library/Caches/ #22688

Closed
wants to merge 2 commits into from

Conversation

sryze
Copy link
Contributor

@sryze sryze commented Dec 18, 2018

Instead of using ~/.rncache use the special Caches directory designed for caching files. This fixes #21780.

Changelog:

[iOS] [Changed] - Moved iOS build cache directory from ~/.rncache to ~/Library/Caches/com.facebook.ReactNativeBuild

Test Plan:

  1. Execute ./scripts/ios-install-third-party.sh
  2. Check that the directory ~/Library/Caches/com.facebook.ReactNativeBuild is created and that the .tar.gz files of dependencies are present

or better:

  1. Create a new project: react-native init ReactNativeCacheTest
  2. cd ReactNativeCacheTest
    cp /path/to/react-native-code/scripts/ios-install-third-party.sh node_modules/react-native/scripts/
    
  3. In ios-install-third-party.sh change:
    fetch_and_unpack folly-2018.10.22.00.tar.gz https://github.com/facebook/folly/archive/v2018.10.22.00.tar.gz f70a75bfeb394363d2049a846bba118ffb3b368a
    
    to:
    fetch_and_unpack folly-2016.10.31.00.tar.gz https://github.com/facebook/folly/archive/v2016.10.31.00.tar.gz fb8cdf8962d8c9d0c20a150b6ec3b75d1fa50696
    
  4. react-native run-ios
  5. Check that the directory ~/Library/Caches/com.facebook.ReactNativeBuild is created and that the .tar.gz files of dependencies are present

Instead of using ~/.rncache use the special Caches directory designed
for caching files. This fixes facebook#21780.
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Dec 18, 2018
@react-native-bot react-native-bot added the Platform: iOS iOS applications. label Dec 18, 2018
@mcchrish
Copy link

@sryze I think it should check if .rncache is still existing and still use that instead. Only use the new location if not found. This prevents redownloading the cache for existing installs and new installs will use the new location.

@sryze
Copy link
Contributor Author

sryze commented Dec 19, 2018

I agree, it's a good idea. I updated the script to make it reuse the old directory if it exists.

@facebook-github-bot facebook-github-bot added the Import Started This pull request has been imported. This does not imply the PR has been approved. label Jan 25, 2019
Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cpojer is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

Copy link
Contributor

@cpojer cpojer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good!

@react-native-bot
Copy link
Collaborator

@sryze merged commit 1024dc2 into facebook:master.

@facebook facebook locked as resolved and limited conversation to collaborators Jan 25, 2019
@react-native-bot react-native-bot added the Merged This PR has been merged. label Jan 25, 2019
@hramos hramos removed Import Started This pull request has been imported. This does not imply the PR has been approved. labels Feb 6, 2019
matt-oakes pushed a commit to matt-oakes/react-native that referenced this pull request Feb 7, 2019
…cebook#22688)

Summary:
Instead of using ~/.rncache use the special Caches directory designed for caching files. This fixes facebook#21780.

Changelog:
----------

[iOS] [Changed] - Moved iOS build cache directory from ~/.rncache to ~/Library/Caches/com.facebook.ReactNativeBuild
Pull Request resolved: facebook#22688

Differential Revision: D13817171

Pulled By: cpojer

fbshipit-source-id: af03dda66f9d49f4fe88bd050b359ccb7abb889a
@sryze sryze deleted the update-cachedir branch October 12, 2019 18:00
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. Platform: iOS iOS applications.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Temporary files should be stored in ~/LIbrary/Caches or elsewhere, not ~/.rncache
6 participants