Dependencies.swift resolution improvements #3421
Replies: 5 comments 10 replies
-
PR implementing the change, using |
Beta Was this translation helpful? Give feedback.
-
Hey @danyf90 it is a very very good idea! My thoughts:
I think we could print to console suggestion that user should call |
Beta Was this translation helpful? Give feedback.
-
I like the idea. Tuist has to be fast, and therefore any proposal to improve the performance is well received. My only concern regarding the approach is that if the process receives a kill signal, the dependencies directory might end up with intermediate artifacts. I think we should detect that scenario somehow and make sure we clean that, maybe the next time we run the command? What about adding a |
Beta Was this translation helpful? Give feedback.
-
I can't think of any side effects in doing so. What about adding a note to the files to make it explicit that we don't expect users to modify those files? Just in case developers see those files there and assume they can make changes there directly? |
Beta Was this translation helpful? Give feedback.
-
Thanks for the RFC! Agree that improving performance on fetch is crucial, since SPM resolution is already pretty slow. In terms of where to copy files Id say sticking to whatever each package manager does by default is probably best. One odd thing i've noticed is the So in this case i'd say we should probably move away from the temp directory and let SPM resolve to the standard .build directory of the current project folder. I don't have too much context on how we're doing dependencies now as the project has evolved a lot, so i trust you all to come up with a great solution |
Beta Was this translation helpful? Give feedback.
-
The current implementation of tuist dependencies fetch command does:
Ignoring step 7, which is not affected by this proposal, after the first tuist dependencies fetch, the subsequent ones take more than 1 minute in our project, and most of the time is spent moving around the SPM resolve output (points 2 and 6), which in our case is about 1.5GB, but I guess can be also bigger in other cases.
I have done a quick test refactoring the logic as:
This way, the command is much faster, and takes about 1 second.
Pros:
Cons:
tuist dependencies fetch
it fails halfway, the contents of dependencies directory will be in a weird non-functioning state -> if you are running a tuist dependencies fetch it probably means that what you have in the directory is no longer what you want. In any case, such a performance improvement would probably be worth anywayOpen points:
Tuist/Dependencies/SwiftPackageManager
folder? They don't harm and might be useful for debugging purposesTuist/Dependencies
folder? Options would be :tuist clean dependencies
, which would clean the local dependencies folder -> it will be slightly different from all othertuist clean
categories as it would be the only one acting on the local foldertuist dependencies clean
subcommand, it would be probably easier to discover for people playing with tuist dependencies for the first timeBeta Was this translation helpful? Give feedback.
All reactions