I have a project with 11 direct dependencies and 16 total ones. When I run carthage update SomeDependency, it fetches all 16 total dependencies instead of only fetching the 2 dependencies required to handle the update for SomeDependency.
This is with Carthage 0.12.0.
Yup, I can confirm this as well. It only builds the dependency you requested, but only after fetching all of them.
I could be missing something, but in 0.13 it builds _all_ dependencies—even when a single dependency is specified.
This was fixed in #1108 and will ship in the next release.
When is the next release?
When is the next release?
There's no specific plan, but I can do one in the next week if this is causing pain for people.
Please do one as soon as possible. This, and the bug where it builds everything instead of just the dependency, has already caused _hours_ of wasted time for me over the past few days.
Sooner the better IMO. This would dramatically improve our workflow.
I've added it to my todo list and release it when I can.
In the future, feel free to open an issue requesting a new release if you're itching to get something from master.
I've released 0.14 and submitted a PR to homebrew.
Fantastic. Thank you
@mdiep 0.14.0 did not fix this. carthage update SomeDep now only updates/checks out/builds the tree starting from SomeDep (i.e. it fixes #1107), which is good, but it still _fetches_ everything, so this bug needs to be reopened.
This may be a separate issue, but I have also noticed that carthage update foo will also update Cartfile.resolved for other dependencies. 
@danroberts In my experience, it updates any dependencies of foo as well, which seems like reasonable behavior.
@mdiep I want to know what happened about this issue but it is still happening. You want to update a particular dependency and its dependencies, but even if carthage updates only these ones, it clone and fetches all the dependencies, which is something that clearly can be avoided.
I am also seeing this behavior, if we do carthage update SomeDependency all the dependencies listed on Cartfile.resolved are fetched.
Maybe this is expected behavior or requires a separate issue but could it be possible that if we add the --no-use-binaries the list of dependencies passed to update is ignored an all dependencies are fetched, checked-out and built?
Maybe this is expected behavior or requires a separate issue but could it be possible that if we add the --no-use-binaries the list of dependencies passed to update is ignored an all dependencies are fetched, checked-out and built?
That should not be true. Definitely open issue for that if it's what you're seeing.
I'll look up on the --no-use-binaries issue tomorrow and let you know. 
@mdiep After doing some digging I realized there is NO bug with the --no-use-binaries flag. It was actually a problem in one of our scripts that wraps Carthage. Sorry for the false alarm.
@mdiep Regarding this particular issue. I think that the problem of fetching all dependencies even when you pass the list of dependencies to updates is related to this method https://github.com/Carthage/Carthage/blob/master/Source/CarthageKit/Project.swift#L655
Could it be possible that checkoutOrCloneDependency should only be called for the dependencies passed to carthage command line tool (maybe also for its transitive dependencies, not sure)?
What I am saying is that instead of using the dependencies variables passed to the flatMap closure, dependenciesToCheckout should be used.
I don't think it's that simple. I think it also needs to include the dependencies of those dependencies.
Yeah I imagine that could be the case. Any hints on how to solve this issue? Is there any way to reconstruct the dependency graph from a Cartfile.resolved file without doing requests to GitHub?
@mdiep What about using this function to get the list of dependencies and their transitive dependencies to be fetched? https://github.com/Carthage/Carthage/blob/master/Source/CarthageKit/Resolver.swift#L38
Then collect the result from that method into an array of Dependency<PinnedVersion> and pass those to https://github.com/Carthage/Carthage/blob/master/Source/CarthageKit/Project.swift#L660. Would that work?
I'm not sure. You'd need to try it out. ☺️
Hello,
i have
carthage version
0.20.1
and I can confirm that running update is always updating all the dependencies.
I am experiencing troubles because of this issue as it is described in the first post of this thread. Any news on if this might be fixed or if there is a workaround?
It seems that version 0.33.0 still always updates all dependencies.
Until the moment when I had to pick up the necessary library for several days, periodically adding new dependencies to my project (in which there are already more than ten major dependencies), I thought that Cocoapods are slow.
Now I really know what waiting is. 🧘♂️
UPD: After reviewing the results of
carthage update DepName --verbose
I found out that only the library I specified is really building. However, the fetch and clone of all other dependencies is still here, including downloading the binaries. What for? I pointed out that I want to update exactly!
@petrovi4 and how would you know if the new version is compatible with the current dependency graph, if you don't have the graph itself?
@blender
carthage shouldn't think for me while I'm working. I took responsibility for the dependencies saying that I want to update ONE library. I do this in a meaningful way because I don't want to wait half an hour many times a day when I need to add ONE library. And if something happens that breaks the dependency tree, there's another command for that. What you're talking about reminds me of wanting to sell blunt knives because of care about those who might cut themselves. This is wrong.
there's another command for that
What would that command be?
Um ... maybe carthage update?
This command is already there, and it works as it should.
Unlike cartage update depName
@petrovi4 can confirm this issue still exists for me, ideally you should be able to specify only the dependency you want to fetch/clone/build and only that dependency. If we need to add a new command to handle this I don't mind but is it possible to fix this @mdiep ?
3 years later, the issue is still around.
@quentinfasquel can you help fix it?
PRs welcome. 🙂
Commenting here is not productive and takes time away from maintainers.
Most helpful comment
Hello,
i have
carthage version
0.20.1
and I can confirm that running update is always updating all the dependencies.