Add caching system to install_deps.sh for faster repeated installs #2520
+74
−17
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR introduces a lightweight and backward-compatible caching mechanism to the install_deps.sh script.
The goal is to significantly reduce repeated dependency installation time in local and CI/CD environments.
Motivation
Currently, every execution of install_deps.sh re-runs the full dependency installation process, even when all required packages are already present.
This causes unnecessary waiting time and redundant network calls, especially in continuous integration environments where the script may run multiple times per workflow.
This patch solves that inefficiency by caching previously installed packages.
Changes Introduced :
Dependency caching system via a persistent file at ~/.folly_deps_cache
Already-installed packages are skipped automatically
Cache updates dynamically after each successful installation
Added --clear-cache flag to reset the cache manually
Added --yes / -y flag for non-interactive runs (CI-friendly)
Clear [CACHE] and [INSTALL] logs for better visibility
Idempotent behavior — script can be safely re-run multiple times
Benefits
Environment : Developer local run | Before : it Installs all packages each time | After : it Skips cached ones instantly