swiftlang / swiftly

A Swift toolchain installer and manager, written in Swift.
https://swiftlang.github.io/swiftly/
Apache License 2.0
490 stars 28 forks source link

Should installing 6.0 snapshot be supported? #122

Closed t089 closed 2 months ago

t089 commented 5 months ago

I tried to install a 6.0 snapshot with swiftly, but it seems the installation does not work afterwards. Maybe it is a problem with the snapshot …

tobias@ubuntu:~$ swiftly use 6.0-snapshot
Set the active toolchain to 6.0-snapshot-2024-06-13 (was Swift 5.10.1)
tobias@ubuntu:~$ cd test/
tobias@ubuntu:~/test$ swift build
error: 'test': Invalid manifest (compiled with: ["/home/tobias/.local/bin/swiftc", "-vfsoverlay", "/tmp/TemporaryDirectory.dZtFHJ/vfs.yaml", "-L", "/home/tobias
/.local/bin", "-lPackageDescription", "-Xlinker", "-rpath", "-Xlinker", "/home/tobias/.local/bin", "-swift-version", "6", "-I", "/home/tobias/.local/bin", "-pac
kage-description-version", "6.0.0", "/home/tobias/test/Package.swift", "-o", "/tmp/TemporaryDirectory.7QJOfi/test-manifest"])
/home/tobias/test/Package.swift:4:8: error: no such module 'PackageDescription'
 2 | // The swift-tools-version declares the minimum version of Swift required to build this package.
 3 | 
 4 | import PackageDescription
   |        `- error: no such module 'PackageDescription'
 5 | 
 6 | let package = Package(
error: 'test': Invalid manifest (compiled with: ["/home/tobias/.local/bin/swiftc", "-vfsoverlay", "/tmp/TemporaryDirectory.QvI34V/vfs.yaml", "-L", "/home/tobias
/.local/bin", "-lPackageDescription", "-Xlinker", "-rpath", "-Xlinker", "/home/tobias/.local/bin", "-swift-version", "6", "-I", "/home/tobias/.local/bin", "-pac
kage-description-version", "6.0.0", "/home/tobias/test/Package.swift", "-o", "/tmp/TemporaryDirectory.VcmOIN/test-manifest"])
/home/tobias/test/Package.swift:4:8: error: no such module 'PackageDescription'
 2 | // The swift-tools-version declares the minimum version of Swift required to build this package.
 3 | 
 4 | import PackageDescription
   |        `- error: no such module 'PackageDescription'
 5 | 
 6 | let package = Package(
tobias@ubuntu:~/test$ swiftly list
Installed release toolchains
----------------------------
Swift 5.10.1

Installed snapshot toolchains
-----------------------------
6.0-snapshot-2024-06-13 (in use)
tobias@ubuntu:~/test$ 
adam-fowler commented 5 months ago

Yes it should work. There was an issue with the new swift-driver not working when referenced through a symbolic link. This was fixed. It appears it has broken again.

EDIT: Ah I was wrong the relevant PR has still to be merged into release/6.0 https://github.com/apple/swift-driver/pull/1606. I always end up using VSCode on Linux which follows the symbolic link to find the actual location of the toolchain so doesn't have this issue.

gregcotten commented 4 months ago

Here with the same issue, still. On Ubuntu 22.04 LTS, latest swiftly. Really confusing issue!

kkebo commented 2 months ago

I believe this issue can be closed now.

adam-fowler commented 2 months ago

I have verified this now works with the latest 6.0 snapshot