swift-index-store icon indicating copy to clipboard operation
swift-index-store copied to clipboard

Update LLVM and Swift files for Swift 6

Open jpsim opened this issue 1 year ago • 2 comments

Updated some files from https://github.com/apple/llvm-project and https://github.com/swiftlang/swift.

I'm not confident that I did this correctly, but the tests do pass and this does fix https://github.com/MobileNativeFoundation/swift-index-store/issues/60.

$ swift --version
swift-driver version: 1.111.2 Apple Swift version 6.0 (swiftlang-6.0.0.5.15 clang-1600.0.22.6)
Target: arm64-apple-macosx14.0
$ swift test
Building for debugging...
ld: warning: duplicate -rpath '/Applications/Xcode-16.0.0-Beta.3.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib' ignored
[67/67] Linking IndexStorePackageTests
Build complete! (7.53s)
Test Suite 'All tests' started at 2024-07-11 13:12:09.222.
Test Suite 'IndexStorePackageTests.xctest' started at 2024-07-11 13:12:09.223.
Test Suite 'IndexStoreTests' started at 2024-07-11 13:12:09.223.
Test Case '-[IndexStoreTests.IndexStoreTests testExerciseIndexStore]' started.
Test Case '-[IndexStoreTests.IndexStoreTests testExerciseIndexStore]' passed (0.506 seconds).
Test Case '-[IndexStoreTests.IndexStoreTests testMissingIndexStore]' started.
Test Case '-[IndexStoreTests.IndexStoreTests testMissingIndexStore]' passed (0.000 seconds).
Test Suite 'IndexStoreTests' passed at 2024-07-11 13:12:09.729.
	 Executed 2 tests, with 0 failures (0 unexpected) in 0.506 (0.506) seconds
Test Suite 'SwiftDemangleTests' started at 2024-07-11 13:12:09.729.
Test Case '-[SwiftDemangleTests.SwiftDemangleTests testBreathFirstSequence]' started.
Test Case '-[SwiftDemangleTests.SwiftDemangleTests testBreathFirstSequence]' passed (0.000 seconds).
Test Case '-[SwiftDemangleTests.SwiftDemangleTests testDemangle]' started.
Test Case '-[SwiftDemangleTests.SwiftDemangleTests testDemangle]' passed (0.000 seconds).
Test Case '-[SwiftDemangleTests.SwiftDemangleTests testObjCUSR]' started.
Test Case '-[SwiftDemangleTests.SwiftDemangleTests testObjCUSR]' passed (0.000 seconds).
Test Case '-[SwiftDemangleTests.SwiftDemangleTests testSwiftExtensionUSR]' started.
Test Case '-[SwiftDemangleTests.SwiftDemangleTests testSwiftExtensionUSR]' passed (0.000 seconds).
Test Suite 'SwiftDemangleTests' passed at 2024-07-11 13:12:09.730.
	 Executed 4 tests, with 0 failures (0 unexpected) in 0.001 (0.001) seconds
Test Suite 'IndexStorePackageTests.xctest' passed at 2024-07-11 13:12:09.730.
	 Executed 6 tests, with 0 failures (0 unexpected) in 0.507 (0.507) seconds
Test Suite 'All tests' passed at 2024-07-11 13:12:09.730.
	 Executed 6 tests, with 0 failures (0 unexpected) in 0.507 (0.508) seconds

This will fail on CI until it is updated to Swift 6.

jpsim avatar Jul 11 '24 17:07 jpsim

I can't think of an easy way to support both Swift 5.x and 6.x at the same time.

There are hard ways to do it, but I don't think it's worth it considering that consumers can pin to previous releases.

Given that GitHub Action runners are notoriously very slow to support new Xcode versions, it may be necessary to skip some tests on CI in order to merge this once Swift 6 + Xcode 16 are officially released in a few weeks.

I'll also do a final check with Xcode 16.0 GM before merging.

Is that an acceptable approach to you @Keith @marcosgriselli and other users of this project that I'm not aware of?

jpsim avatar Aug 09 '24 14:08 jpsim

I think supporting only Swift 6 for this is fine. especially for swift demangle which only ever supported the specific point release you were at too. tbh it's pretty fragile and maybe we should even have a runtime check that you're on the right version or something 😬

keith avatar Aug 09 '24 16:08 keith

Anything preventing this from landing?

pennig avatar Oct 10 '24 21:10 pennig

We're hoping to update to Xcode 16 for some repos that depend on this. Would it be possible to get an updated release with this Xcode 16 support?

tinder-owenthomas avatar Jan 14 '25 01:01 tinder-owenthomas

thanks for doing the real work here, i'm pulling this + the CI update into https://github.com/MobileNativeFoundation/swift-index-store/pull/64

keith avatar Jan 14 '25 04:01 keith

https://github.com/MobileNativeFoundation/swift-index-store/releases/tag/1.8.0

keith avatar Jan 14 '25 04:01 keith