swiftly icon indicating copy to clipboard operation
swiftly copied to clipboard

6.0-snapshot installed with swiftly doesn't work

Open kkebo opened this issue 2 years ago • 7 comments

The current main-snapshot toolchain uses the new swift-driver and it doesn't seem to work with symlinks.

$ swiftly install main-snapshot
...
$ swiftly list
Installed release toolchains                                                                                                                                                             
----------------------------                                                                                                                                                             
                                                                                                                                                                                         
Installed snapshot toolchains                                                                                                                                                            
-----------------------------                                                                                                                                                            
main-snapshot-2024-01-14 (in use)                                                                                                                                                        
$ mkdir example
$ cd example/
$ swift package init --type executable
Creating executable package: example                                                                                                                                                     
Creating Package.swift                                                                                                                                                                   
Creating .gitignore                                                                                                                                                                      
Creating Sources/                                                                                                                                                                        
Creating Sources/main.swift                                                                                                                                                              
$ swift build
error: 'example': Invalid manifest (compiled with: ["/home/kebo/.local/bin/swiftc", "-vfsoverlay", "/tmp/TemporaryDirectory.otDNvO/vfs.yaml", "-L", "/home/kebo/.local/bin", "-lPackageDe
scription", "-Xlinker", "-rpath", "-Xlinker", "/home/kebo/.local/bin", "-swift-version", "5", "-I", "/home/kebo/.local/bin", "-package-description-version", "5.11.0", "/home/kebo/exampl
e/Package.swift", "-Xfrontend", "-disable-implicit-concurrency-module-import", "-Xfrontend", "-disable-implicit-string-processing-module-import", "-o", "/tmp/TemporaryDirectory.xjhMqz/e
xample-manifest"])                                                                                                                                                                       
error: fatalError                                                                                                                                                                        
/home/kebo/example/Package.swift:4:8: error: no such module 'PackageDescription'                                                                                                         
import PackageDescription                                                                                                                                                                
       ^                                                                                                                                                                                 
$ swift build -Xswiftc -disallow-use-new-driver
Building for debugging...
<unknown>:0: warning: legacy driver is now deprecated; consider avoiding specifying '-disallow-use-new-driver'                                                       
<unknown>:0: warning: legacy driver is now deprecated; consider avoiding specifying '-disallow-use-new-driver'                                                     
[7/7] Linking example
Build complete! (1.69s)
$ which swift
/home/kebo/.local/bin/swift
$ ls -l $HOME/.local/bin
lrwxrwxrwx kebo kebo  81 B  Mon Jan 15 21:01:21 2024  clang ⇒ /home/kebo/.local/share/swiftly/toolchains/main-snapshot-2024-01-14/usr/bin/clang
lrwxrwxrwx kebo kebo  83 B  Mon Jan 15 21:01:21 2024  clang++ ⇒ /home/kebo/.local/share/swiftly/toolchains/main-snapshot-2024-01-14/usr/bin/clang++
lrwxrwxrwx kebo kebo  84 B  Mon Jan 15 21:01:21 2024  clang-17 ⇒ /home/kebo/.local/share/swiftly/toolchains/main-snapshot-2024-01-14/usr/bin/clang-17
lrwxrwxrwx kebo kebo  87 B  Mon Jan 15 21:01:21 2024  clang-cache ⇒ /home/kebo/.local/share/swiftly/toolchains/main-snapshot-2024-01-14/usr/bin/clang-cache
lrwxrwxrwx kebo kebo  84 B  Mon Jan 15 21:01:21 2024  clang-cl ⇒ /home/kebo/.local/share/swiftly/toolchains/main-snapshot-2024-01-14/usr/bin/clang-cl
lrwxrwxrwx kebo kebo  85 B  Mon Jan 15 21:01:21 2024  clang-cpp ⇒ /home/kebo/.local/share/swiftly/toolchains/main-snapshot-2024-01-14/usr/bin/clang-cpp
lrwxrwxrwx kebo kebo  82 B  Mon Jan 15 21:01:21 2024  clangd ⇒ /home/kebo/.local/share/swiftly/toolchains/main-snapshot-2024-01-14/usr/bin/clangd
lrwxrwxrwx kebo kebo  80 B  Mon Jan 15 21:01:21 2024  docc ⇒ /home/kebo/.local/share/swiftly/toolchains/main-snapshot-2024-01-14/usr/bin/docc                       
lrwxrwxrwx kebo kebo  82 B  Mon Jan 15 21:01:21 2024  ld.lld ⇒ /home/kebo/.local/share/swiftly/toolchains/main-snapshot-2024-01-14/usr/bin/ld.lld                 
lrwxrwxrwx kebo kebo  84 B  Mon Jan 15 21:01:21 2024  ld64.lld ⇒ /home/kebo/.local/share/swiftly/toolchains/main-snapshot-2024-01-14/usr/bin/ld64.lld
lrwxrwxrwx kebo kebo  79 B  Mon Jan 15 21:01:21 2024  lld ⇒ /home/kebo/.local/share/swiftly/toolchains/main-snapshot-2024-01-14/usr/bin/lld
lrwxrwxrwx kebo kebo  84 B  Mon Jan 15 21:01:21 2024  lld-link ⇒ /home/kebo/.local/share/swiftly/toolchains/main-snapshot-2024-01-14/usr/bin/lld-link
lrwxrwxrwx kebo kebo  80 B  Mon Jan 15 21:01:21 2024  lldb ⇒ /home/kebo/.local/share/swiftly/toolchains/main-snapshot-2024-01-14/usr/bin/lldb                    
lrwxrwxrwx kebo kebo  90 B  Mon Jan 15 21:01:21 2024  lldb-argdumper ⇒ /home/kebo/.local/share/swiftly/toolchains/main-snapshot-2024-01-14/usr/bin/lldb-argdumper
lrwxrwxrwx kebo kebo  87 B  Mon Jan 15 21:01:21 2024  lldb-server ⇒ /home/kebo/.local/share/swiftly/toolchains/main-snapshot-2024-01-14/usr/bin/lldb-server
lrwxrwxrwx kebo kebo  83 B  Mon Jan 15 21:01:21 2024  llvm-ar ⇒ /home/kebo/.local/share/swiftly/toolchains/main-snapshot-2024-01-14/usr/bin/llvm-ar                 
lrwxrwxrwx kebo kebo  84 B  Mon Jan 15 21:01:21 2024  llvm-cov ⇒ /home/kebo/.local/share/swiftly/toolchains/main-snapshot-2024-01-14/usr/bin/llvm-cov
lrwxrwxrwx kebo kebo  89 B  Mon Jan 15 21:01:21 2024  llvm-profdata ⇒ /home/kebo/.local/share/swiftly/toolchains/main-snapshot-2024-01-14/usr/bin/llvm-profdata
lrwxrwxrwx kebo kebo  82 B  Mon Jan 15 21:01:21 2024  plutil ⇒ /home/kebo/.local/share/swiftly/toolchains/main-snapshot-2024-01-14/usr/bin/plutil
lrwxrwxrwx kebo kebo  86 B  Mon Jan 15 21:01:21 2024  repl_swift ⇒ /home/kebo/.local/share/swiftly/toolchains/main-snapshot-2024-01-14/usr/bin/repl_swift
lrwxrwxrwx kebo kebo  92 B  Mon Jan 15 21:01:21 2024  sdk-module-lists ⇒ /home/kebo/.local/share/swiftly/toolchains/main-snapshot-2024-01-14/usr/bin/sdk-module-lists
lrwxrwxrwx kebo kebo  89 B  Mon Jan 15 21:01:21 2024  sourcekit-lsp ⇒ /home/kebo/.local/share/swiftly/toolchains/main-snapshot-2024-01-14/usr/bin/sourcekit-lsp     
lrwxrwxrwx kebo kebo  81 B  Mon Jan 15 21:01:21 2024  swift ⇒ /home/kebo/.local/share/swiftly/toolchains/main-snapshot-2024-01-14/usr/bin/swift
lrwxrwxrwx kebo kebo  96 B  Mon Jan 15 21:01:21 2024  swift-api-checker.py ⇒ /home/kebo/.local/share/swiftly/toolchains/main-snapshot-2024-01-14/usr/bin/swift-api-checker.py
lrwxrwxrwx kebo kebo  94 B  Mon Jan 15 21:01:21 2024  swift-api-digester ⇒ /home/kebo/.local/share/swiftly/toolchains/main-snapshot-2024-01-14/usr/bin/swift-api-digester
lrwxrwxrwx kebo kebo  93 B  Mon Jan 15 21:01:21 2024  swift-api-extract ⇒ /home/kebo/.local/share/swiftly/toolchains/main-snapshot-2024-01-14/usr/bin/swift-api-extract
lrwxrwxrwx kebo kebo  98 B  Mon Jan 15 21:01:21 2024  swift-autolink-extract ⇒ /home/kebo/.local/share/swiftly/toolchains/main-snapshot-2024-01-14/usr/bin/swift-autolink-extract
lrwxrwxrwx kebo kebo  87 B  Mon Jan 15 21:01:21 2024  swift-build ⇒ /home/kebo/.local/share/swiftly/toolchains/main-snapshot-2024-01-14/usr/bin/swift-build       
lrwxrwxrwx kebo kebo 102 B  Mon Jan 15 21:01:21 2024  swift-build-sdk-interfaces ⇒ /home/kebo/.local/share/swiftly/toolchains/main-snapshot-2024-01-14/usr/bin/swift-build-sdk-interfaces
lrwxrwxrwx kebo kebo  92 B  Mon Jan 15 21:01:21 2024  swift-build-tool ⇒ /home/kebo/.local/share/swiftly/toolchains/main-snapshot-2024-01-14/usr/bin/swift-build-tool
lrwxrwxrwx kebo kebo  92 B  Mon Jan 15 21:01:21 2024  swift-cache-tool ⇒ /home/kebo/.local/share/swiftly/toolchains/main-snapshot-2024-01-14/usr/bin/swift-cache-tool
lrwxrwxrwx kebo kebo  90 B  Mon Jan 15 21:01:21 2024  swift-demangle ⇒ /home/kebo/.local/share/swiftly/toolchains/main-snapshot-2024-01-14/usr/bin/swift-demangle
lrwxrwxrwx kebo kebo  88 B  Mon Jan 15 21:01:21 2024  swift-driver ⇒ /home/kebo/.local/share/swiftly/toolchains/main-snapshot-2024-01-14/usr/bin/swift-driver
lrwxrwxrwx kebo kebo  98 B  Mon Jan 15 21:01:21 2024  swift-experimental-sdk ⇒ /home/kebo/.local/share/swiftly/toolchains/main-snapshot-2024-01-14/usr/bin/swift-experimental-sdk
lrwxrwxrwx kebo kebo  90 B  Mon Jan 15 21:01:21 2024  swift-frontend ⇒ /home/kebo/.local/share/swiftly/toolchains/main-snapshot-2024-01-14/usr/bin/swift-frontend
lrwxrwxrwx kebo kebo  86 B  Mon Jan 15 21:01:21 2024  swift-help ⇒ /home/kebo/.local/share/swiftly/toolchains/main-snapshot-2024-01-14/usr/bin/swift-help
lrwxrwxrwx kebo kebo  95 B  Mon Jan 15 21:01:21 2024  swift-legacy-driver ⇒ /home/kebo/.local/share/swiftly/toolchains/main-snapshot-2024-01-14/usr/bin/swift-legacy-driver
lrwxrwxrwx kebo kebo  89 B  Mon Jan 15 21:01:21 2024  swift-package ⇒ /home/kebo/.local/share/swiftly/toolchains/main-snapshot-2024-01-14/usr/bin/swift-package
lrwxrwxrwx kebo kebo 100 B  Mon Jan 15 21:01:21 2024  swift-package-collection ⇒ /home/kebo/.local/share/swiftly/toolchains/main-snapshot-2024-01-14/usr/bin/swift-package-collection
lrwxrwxrwx kebo kebo  98 B  Mon Jan 15 21:01:21 2024  swift-package-registry ⇒ /home/kebo/.local/share/swiftly/toolchains/main-snapshot-2024-01-14/usr/bin/swift-package-registry
lrwxrwxrwx kebo kebo  95 B  Mon Jan 15 21:01:21 2024  swift-plugin-server ⇒ /home/kebo/.local/share/swiftly/toolchains/main-snapshot-2024-01-14/usr/bin/swift-plugin-server
lrwxrwxrwx kebo kebo  85 B  Mon Jan 15 21:01:21 2024  swift-run ⇒ /home/kebo/.local/share/swiftly/toolchains/main-snapshot-2024-01-14/usr/bin/swift-run
lrwxrwxrwx kebo kebo 101 B  Mon Jan 15 21:01:21 2024  swift-symbolgraph-extract ⇒ /home/kebo/.local/share/swiftly/toolchains/main-snapshot-2024-01-14/usr/bin/swift-symbolgraph-extract
lrwxrwxrwx kebo kebo  86 B  Mon Jan 15 21:01:21 2024  swift-test ⇒ /home/kebo/.local/share/swiftly/toolchains/main-snapshot-2024-01-14/usr/bin/swift-test
lrwxrwxrwx kebo kebo  82 B  Mon Jan 15 21:01:21 2024  swiftc ⇒ /home/kebo/.local/share/swiftly/toolchains/main-snapshot-2024-01-14/usr/bin/swiftc
lrwxrwxrwx kebo kebo  96 B  Mon Jan 15 21:01:21 2024  swiftc-legacy-driver ⇒ /home/kebo/.local/share/swiftly/toolchains/main-snapshot-2024-01-14/usr/bin/swiftc-legacy-driver
.rwxr-xr-x kebo kebo  54 MB Sun Jan  7 17:18:40 2024  swiftly
lrwxrwxrwx kebo kebo  83 B  Mon Jan 15 21:01:21 2024  wasm-ld ⇒ /home/kebo/.local/share/swiftly/toolchains/main-snapshot-2024-01-14/usr/bin/wasm-ld
$ export PATH=$HOME/.local/share/swiftly/toolchains/main-snapshot-2024-01-14/usr/bin:$PATH
$ swift package clean
$ swift build
Building for debugging...
[8/8] Linking example
Build complete! (1.65s)

kkebo avatar Jan 15 '24 18:01 kkebo

Have you added an issue to https://github.com/apple/swift?

adam-fowler avatar Jan 15 '24 18:01 adam-fowler

No, I haven't. I didn't know where this issue should be fixed.

kkebo avatar Jan 15 '24 18:01 kkebo

I'm not sure this is something we can fix without restructuring everything.

The new swift driver is meant to be a drop in replacement for the old one. So if we lose functionality like working with symbolic linked versions of Swift then that is a bug.

If you add an issue can you link back to it here. Thanks

adam-fowler avatar Jan 15 '24 20:01 adam-fowler

I have understood why I should create an issue in apple/swift. Thank you. I will create an issue later.

kkebo avatar Jan 15 '24 23:01 kkebo

I created https://github.com/apple/swift/issues/70932.

kkebo avatar Jan 16 '24 16:01 kkebo

The issue has been fixed in the latest main-snapshot, but 6.0-snapshot still have the issue.

kkebo avatar May 03 '24 21:05 kkebo

Cherry-pick to 6.0 is in progress: https://github.com/apple/swift-driver/pull/1606

patrickfreed avatar May 15 '24 13:05 patrickfreed

Cherry-picking has been done, so I'm closing this.

kkebo avatar Aug 20 '24 00:08 kkebo