New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SR-13591] REPL is not working on swift-5.3-RELEASE (Windows) #56026
Comments
Thanks for the report. I believe that the backport in apple/llvm-project#1832 should address this issue. |
Taking another look at this - (3) ⚙ D77287 Windows: support `DoLoadImage` (llvm.org) and Windows: support `DoLoadImage` by compnerd · Pull Request #3580 · apple/llvm-project (github.com) repair enough of LLDB to fix the module loading. Subsequently, I can hack together enough pieces to get things working: > swift -- -sdk %SDKROOT%
Welcome to Swift version 5.6-dev (LLVM 4fa084761bda946, Swift 2889d5149c7ca32).
Type :help for assistance.
1> :process load S:\Library\icu-69.1\usr\bin\icudt69.dll
Loading "S:\Library\icu-69.1\usr\bin\icudt69.dll"...ok
1> :process load S:\Library\icu-69.1\usr\bin\icuuc69.dll
Loading "S:\Library\icu-69.1\usr\bin\icuuc69.dll"...ok
Image 1 loaded.
1> :process load S:\Library\icu-69.1\usr\bin\icuin69.dll
Loading "S:\Library\icu-69.1\usr\bin\icuin69.dll"...ok
Image 2 loaded.
1> :process load S:\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk\usr\bin\swiftCore.dll
Loading "S:\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk\usr\bin\swiftCore.dll"...ok
Image 3 loaded.
1> :process load S:\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk\usr\bin\swiftCRT.dll
Loading "S:\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk\usr\bin\swiftCRT.dll"...ok
Image 4 loaded.
1> :process load S:\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk\usr\bin\swiftWinSDK.dll
Loading "S:\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk\usr\bin\swiftWinSDK.dll"...ok
Image 5 loaded.
1> :process load S:\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk\usr\bin\dispatch.dll
Loading "S:\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk\usr\bin\dispatch.dll"...ok
Image 6 loaded.
1> :process load S:\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk\usr\bin\swiftDispatch.dll
Loading "S:\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk\usr\bin\swiftDispatch.dll"...ok
Image 7 loaded.
1> :process load S:\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk\usr\bin\Foundation.dll
Loading "S:\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk\usr\bin\Foundation.dll"...ok
Image 8 loaded.
1> :process load S:\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk\usr\bin\swift_Differentiation.dll
Loading "S:\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk\usr\bin\swift_Differentiation.dll"...ok
Image 9 loaded.
1> import Foundation
2> RunLoop.current
$R0: Foundation.RunLoop = {
Foundation.NSObject = {}
_cfRunLoopStorage = 0x000001dd437f4c40 {
Foundation.NSObject = {}
_cfinfo = {
info = 11136
pad = 0
}
}
monitoredPortsWithModesLock = {
Foundation.NSObject = {}
mutex = 0x1dd437dba60 {
pointee = {
Ptr = nil
}
}
timeoutCond = 0x1dd437dba10 {
pointee = {
Ptr = nil
}
}
timeoutMutex = 0x1dd437f37e0 {
pointee = {
Ptr = nil
}
}
name = nil
}
monitoredPortsWithModes = 0 key/value pairs
monitoredPortObservers = 0 key/value pairs
}
3> Once the changes are merged, the next set of issues lie in the library search path setup which is why the DLLs need to be loaded manually. |
This corrects some invalid behaviour. It seems that the behaviour of |
I could use a bit of help testing this, I think that we are in a slightly better position now with the REPL, though it still needs further work. In the meantime, if someone else can test and verify that that this seems to work better with the 2023-04-11-a snapshot it would be useful. In order to get this to actually work the REPL needs to be invoked with some additional parameters, namely S:\>swift repl "-LS:\Program\ Files\swift\runtime-development\usr\bin"
Welcome to Swift version 5.9-dev (LLVM 91080e65df791d6, Swift a35e5ab3295f464).
Type :help for assistance.
1> import Foundation
2> ProcessInfo.processInfo
$R0: Foundation.ProcessInfo = {
Foundation.NSObject = {}
processName = "repl_swift.exe"
$__lazy_storage_$__operatingSystemVersionString = nil
_processorCount = 1
_activeProcessorCount = 20
_physicalMemory = 0
}
3> You will need to ensure that python is in your path of course but that has always been a requirement. Also note the extra slash to quote the space in |
It works with 2023-04-11 snapshot ( |
apple/llvm-project#6927 should be the last bit that I think that is missing. With that in place, I can now launch the REPL without any additional parameters ( |
The changes have been merged and should be part of the next snapshot. |
Should this be working in 5.9? If I try to run I have Python 3.10 installed, as per the instructions on https://www.swift.org/install/windows/#installation-via-windows-package-manager Running files with |
Environment
Windows 10 - swift-5.3-RELEASE
Additional Detail from JIRA
md5: 34aed1a92808f2bdb31c9273d970f787
is blocked by:
is duplicated by:
Issue Description:
When I issue the command swift it should launch the REPL. But instead of that it gives back the prompt immediately.
The text was updated successfully, but these errors were encountered: