Carthage/Carthage

Opting out of Carthage's shared cache?

开放

#1,187 创建于 2016年3月10日

 (13 条评论) (10 个反应) (0 位负责人)Swift (1,544 个派生)batch import
enhancementhelp wanted

仓库指标

星标
 (15,179 个星标)
PR 合并指标
 (30 天内没有已合并 PR)

描述

I run a Jenkins server that executes its work on a slave machine that is set to build 4 concurrent jobs at once. At times, I get irritating race conditions that cause build failures and block PRs unnecessarily. Carthage stops with messages like the following:

fatal: Unable to create '/Users/chris/Library/Caches/org.carthage.CarthageKit/dependencies/Argo/index.lock': File exists.

Generally I invoke Carthage using carthage bootstrap --no-use-binaries --platform ios,mac for my cross-platform products, because using binaries simply doesn't work with Swift code and fast-moving Xcode releases. I generally don't use submodules in my projects, either, which likely exacerbates this issue.

I think it would be beneficial to supply either a command-line switch, or something in the Cartfile that would specify a local folder to use for Carthage's cache. For instance, you could default to a non-shared cache location of Carthage/Cache (alongside Carthage/Checkouts and Carthage/Build), or the user could choose to specify their own folder.

That way I could keep on doing what I'm doing without worrying about automated build checks failing randomly, etc.

To some extent this is related to #458, #459 (in that we can maintain per-project "carthage droppings"), and surely a few others.

Alternatively, Carthage could maintain a more sensible locking mechanism to avoid running concurrent git processes that target the same folder, however that seems quite delicate.

贡献者指南