SwiftPackageIndex-Server: Server hangs when running with Swift 6.1 image

The server process seems to be hanging when deploying the new swift:6.1.0-jammy based base image.

Compare this launch of the 2.116.27 docker image (swift:6.0.3-jammy) with 2.117.0 (swift:6.1.0-jammy):

Image

In both cases, the process has no configuration and should immediately raise an internal server error. However, the Swift 6.1 based image just hangs.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 1
  • Comments: 20 (17 by maintainers)

Commits related to this issue

Most upvoted comments

If we end up doing it, we should just skip the signing. That way the basic feature is still available and URLs aren’t 404ing even though the produced collection is somewhat flawed.

As to the base image, we used to ship the base image with a different compiler version for analysis but that was a whole different can of worms which I’d rather we didn’t go back to if it can be avoided at all.

Ok, updating to SwiftPM release/6.1 is not sufficient. I thought I got that working on Friday but perhaps it was working only when I removed SwiftPM as a dependency entirely?

I’m now looking into dropping SwiftPM as a dependency. However, there are some issues with that.

There are two modules we need, PackageCollectionsModel and PackageCollectionsSigning.

  • PackageCollectionsModel is easy. It has no upstream dependencies, it’s a straight up copy into a new module.
  • PackageCollectionsSigning depends on PackageCollectionsModel (not a problem) but also on the “Basics” SwiftPM module as well as “Crypto” from swift-crypto.
    • swift-crypto is not a problem, but “Basics” again has upstream dependencies:
      • SPMSQLLite3
      • swift-collections
      • swift-tools-support-core
      • swift-system

This will probably only work if we can avoid depending on “Basics”.

Unfortunately, its dependency on “Basics” also means that there’s no way we’ll get SwiftPM to pull this into its own upstream dependency which we could import.

So the only two choices we have are:

  • keep using SwiftPM as a dependency with all its downsides
  • copy the two module sources and make (probably some nontrivial) changes that allow us to use them standalone, and maintain that going forward

I’ll briefly explore replacing the “Basics” module. Perhaps PackageCollectionsSigning isn’t using too much of it and I can copy some more bits.

This is to unblock us. I don’t think we want to maintain signing code on our end in the long run.

In order to try and debug this further, I had to fork Vapor, which required me to drop SwiftPM as a dependency. Doing this actually fixed the hang. The Vapor fork is the latest release + a couple of print statements, so I’m operating under the assumption that the SwiftPM dependency is the problem.

I’ll try to move us to release/6.0 on the main branch first, addressing the new concurrency issues along the way, and then to release/6.1 subsequently.