SwiftPackageIndex / SwiftPackageIndex-Server

The Swift Package Index is the place to find Swift packages!
https://swiftpackageindex.com
Apache License 2.0
547 stars 43 forks source link

Swift 6 linux builds fail with `clang: error: unknown argument: '-index-store-path'` #3154

Closed finestructure closed 3 months ago

finestructure commented 3 months ago

Not sure if it's all linux builds but it certainly seems to be common, for example Vapor and distributed-actors are affected.

It doesn't seem to be a problem with the swift base images themselves. All the following Swift 6 images we used can build Vapor:

✅ swiftlang/swift@sha256:f4ea7ab93663beac44cc5ec1a3ffcc7a7c33b9d2cd2dec4ad98dd1a739717e39 ✅ swiftlang/swift@sha256:0f8bfdf7a1e34448c804aa290c5d02f6652cdef3d628d54dbdaa3e99a95bd22d ✅ swiftlang/swift@sha256:32cd5cc3e82012f138d5e255485a5ce6ec8fb10588e1ecef34c6af7e1291de48 ✅ swiftlang/swift@sha256:30154112a700a5a95fd1760716bd2040e8b735f54f081a4865823abdec67d17e ✅ swiftlang/swift@sha256:c91ee3fa7f0e9b49459750cadfc39023e34732769f45122cb139850d6af4c6e9

That would mean it's one of the OS level dependencies we're installing that's interfering.

git clone https://github.com/vapor/vapor && cd vapor
mkdir .stats
docker run --rm -v "$PWD":/host -w /host swiftlang/swift@sha256:c91ee3fa7f0e9b49459750cadfc39023e34732769f45122cb139850d6af4c6e9 swift build --triple aarch64-unknown-linux-gnu -Xswiftc -Xfrontend -Xswiftc -stats-output-dir -Xswiftc -Xfrontend -Xswiftc .stats -Xswiftc -strict-concurrency=complete

(Use --triple aarch64-unknown-linux-gnu on Apple Silicon, --triple x86_64-unknown-linux-gnu on x86)

finestructure commented 3 months ago

It's the clang os level dependency we install for swift-crossui:

    libgtk-3-dev clang       `# swift-cross-ui` \
finestructure commented 3 months ago

swift-cross-ui is failing builds across the board anyway, so I'll drop its dependencies for now.

CleanShot 2024-06-20 at 09 50 44@2x

https://gitlab.com/finestructure/spi-images/-/merge_requests/30

finestructure commented 3 months ago
finestructure commented 3 months ago

Vapor now passing:

CleanShot 2024-06-20 at 10 42 49@2x

finestructure commented 3 months ago

Latest builder changes deployed.