-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Carthage doesn't cache build across projects (or CI builds) #2400
Comments
This is the expected behavior. |
@blender, thanks for pointing me to Rome, this is an interesting tool to share builds via the CI server (I'll need to think a bit more about what to do with this tool) Usage of submodules have the same behavior :
it is the Build directory which is "key" to cache (deleting this folder or the framework subfolder lead to a "Invalid cache found for SVProgressHUD, rebuilding with all downstream dependencies") |
@kenji21 on our Jenkins I do something similar like Rome, but less sophisticated, when Jenkins workspace is wiped, then I look into predefined cache directory (e.g. |
I like the way Carthage caches (e.g. using Xcode/swift version and dependency version in the path), does a PR adding an option like |
I'm not sure what you're asking. |
What I see in this is that @kenji21 would like to cache build artifacts in |
With the new Xcode / swift version (4.1), we have to "bootstrap or update" our dependencies on different projects having common dependencies (Alamofire, RxSwift...), same could occurs if Alamofire post a security update I want to share carthage builds across projects (or when runing CI builds with Carthage/Build not checked in, which have a simpler way to reproduce the cache usage / non-usage) |
One more use case: if a compilation fails during update (let's say the 7th out of 10), relaunching |
We does not specify https://stackoverflow.com/questions/46211606/xcodebuild-archive-always-performs-a-clean-build So this will not be an our fault I think. |
I think I understand what carthage means by "Valid cache":
It is the $PWD/Carthage/Build/iOS/SVProgressHUD.framework*** files that is called "cache" by carthage, I was thinking of cache to be located at ~/Library/Caches/org.carthage.CarthageKit/DerivedData/9.3_9E145/SVProgressHUD/2.2.5/ |
Yes, since you are deleting |
So the aim of the PR adding option As I assume that |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Am I right when I say:
I still like to have the |
Well, I recently switched to Rome and now I think that such PR would be redundant as it is much more powerful than behavior described above 🤷♂️ |
To sum up:
Carthage/Source/CarthageKit/Project.swift Lines 1016 to 1026 in 0ec71e1
When building, the DerivedData path used is generated: Carthage/Source/CarthageKit/Project.swift Lines 1067 to 1071 in 0ec71e1
As So, you're right @olejnjak, my needs are what Rome provides, but as I only want to keep it "local" (no need for S3, minio or ceph), I was thinking by error that Carthage with
My bad here, because I haven't RTFM enough the README.md#caching-builds (maybe a link to this can be added to the help?) And Rome doesn't know which Xcode (so, swift version) build your framework, so we should always use I still think that a local cache can easily be included within Carthage, maybe copying built frameworks/dSYMs in a directory, with same path generation as DerivedData, but prefixed by SharedCache instead of DerivedData, plus Exemple:
Important command here is : Second "clean" bootstrap (as jenkins would do):
And all files from |
Correct
You can only specify a local cache to keep it local. You don't need to provide S3 or other caches.
Can you fix this link please so that I can read the comment? |
Fixed, I was thinking anchor link on "local page" was working |
From #2400 (comment)
It won't if you use This case is already covered. Your problem is a cold bootstrap. From #2400 (comment)
Carthage doesn't know either, it uses the current I'll follow up with another comment formalizing your problem. |
So, to formalize a little for @mdiep Problem
When running Current Status
Improvement SuggestionAdd a feature to share artefacts across
Implementation
About the bootstrap cache
|
My personal comment:
|
This would be a duplicate of #1588. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Updated the PR to current master : #2608 |
Updated the PR again as Xcode 10.1 is out (and our CI was failing building dependencies with the simulator not found issue, so I have run it with PR #2631):
|
Here is an example of CI clean build times (on an iMac Pro) with a project having 17 "first level" dependencies (RxSwift, AlamofireObjectMapper...):
|
Anybody coming across this issue nowadays, please checkout my comment here. |
As 0.35 is out, updated the PR #2716 for this issue:
Second run:
|
which carthage
: /usr/local/bin/carthagecarthage version
: 0.29.0xcodebuild -version
: Xcode 9.3 Build version 9E145--no-build
? no--no-use-binaries
? yes--use-submodules
? no--cache-builds
? yes--new-resolver
? noCartfile
Carthage Output
Actual outcome
Carthage did not use cached build if I rm the Carthage directory of my working copy (what our CI does before each build)
Expected outcome
Carthage should use the previously compiled framework stored in ~/Library/Caches/org.carthage.CarthageKit/DerivedData when running the second bootstrap command
I used SVProgressHUD here to have a "quickly recompiled" framework, but it is also the other dependencies (and our CI jobs are taking ages to recompile each time all frameworks)
The text was updated successfully, but these errors were encountered: