Fix caching of built dependencies