-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Revert "Retrieve resolved package versions in parallel" #8217
Conversation
This reverts commit 0340bb1.
@swift-ci please test |
@dschaefer2 what do you think about parallelizing only downloads of registry packages? That is, instead of parallelizing both The parallelization makes a really big difference in performance, so still would love to make it work. |
This is what I had in mind: #8218 |
I think the right solution is to make I was actually excited about this change for the non-registry case since that's a common complaint I've seen as well. But looking at the registry case, it is also changing the list of dependencies in the Workspace so would have the same problem anyway. |
Is this something the SwiftPM team plans to work on? Any way we can push it forward? The sequential download of registry is quite a drag on its performance – and so is for source control checkouts. I would love to push this initiative further, but there's also so much time I can dedicate to this and it sounds like making
Got it. Let's go with the revert. I do wonder in the interim, if we could at least split the download operation and updating the state into two steps. However, it's definitely preferred to make |
We're all the SwiftPM team, it's open source :). But the people I work with are allocated to other things for the next few months so nothing would be imminent from us. If you can think of a compromise that makes sure this parallelization serializes access to the Workspace state I would be OK with that for a short term solution. Though looking at the code, it might be sufficient to make |
I'll try having a look at this. Thanks for the pointers and sorry for breaking things! |
All good. It helped highlight we really need to make SwiftPM more thread safe. As a central piece of the Swift toolchain, we really should be able to hold it up as a good example of modern Swift. :). |
@dschaefer2 here's a PR that makes Were you able to consistently reproduce the crash? I ran the test suite multiple times and things look a-ok, but would love to double check. |
@swift-ci please test windows |
@fortmarek personally, the WorkspaceTests failed for me 7 out of 30. I can try the same with #8220 tomorrow! |
Reverts #8203
This is causing crashes in SwiftPM during the parallelized checkout. The checkouts update the workspace state and then save it. The workspace save data is not protected against multi-thread access while the save is walking the data which is causing the crash.