Hi,
I downloaded swift package for Windows 10 and also Visual Studio 2019 community. Then, installed them with the following components for Visual Studio:
+MSVC v142 - VS 2019 C++ x64/x86 build tools
+Windows Universal CRT (C Runtime)
+Windows 10 SDK
With using the x64 Native Tools for VS2019 Command Prompt in Administrator mode, I copied the several files according to the install help.
copy %SDKROOT%\usr\share\ucrt.modulemap "%UniversalCRTSdkDir%\Include%UCRTVersion%\ucrt\module.modulemap"
copy %SDKROOT%\usr\share\visualc.modulemap "%VCToolsInstallDir%\include\module.modulemap"
copy %SDKROOT%\usr\share\visualc.apinotes "%VCToolsInstallDir%\include\visualc.apinotes"
copy %SDKROOT%\usr\share\winsdk.modulemap "%UniversalCRTSdkDir%\Include%UCRTVersion%\um\module.modulemap"
I also installed Python 3.8.6 on C:\Program Files\Python38.
I kicked off the swift interpreter with --version option as follows:
PS C:\Users\minoh> swift --version
compnerd.org Swift version 5.3 (swift-5.3-RELEASE)
Target: x86_64-unknown-windows-msvc
I kicked off the swift interpreter, however, it failed as follows:
PS C:\Users\minoh> swift
Expected must be checked before access or destruction.
Unchecked Expected contained error:
TypeSystem for language swift doesn't existStack dump:
0. Program arguments: C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\lldb.exe --repl=-disable-objc-interop -sdk "C:\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk" -color-diagnostics -autolink-library oldnames -autolink-library msvcrt -Xcc -D_MT -Xcc -D_DLL
Crash reproducer for lldb version 10.0.0 (GitHub - apple/llvm-project: The LLVM Project is a collection of modular and reusable compiler and toolchain technologies. This fork is used to manage Apple’s stable releases of Clang as well as support the Swift project. revision c39a810ec308dd4a8d93c5011fb73a5c987e8680)
compnerd.org Swift version 5.3 (swift-5.3-RELEASE)
Reproducer written to 'C:\Users\minoh\AppData\Local\Temp\reproducer-9eb792'
Before attaching the reproducer to a bug report:
- Look at the directory to ensure you're willing to share its content.
- Make sure the reproducer works by replaying the reproducer.
Replay the reproducer with the following command:
C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\lldb.exe -replay C:\Users\minoh\AppData\Local\Temp\reproducer-9eb792
#0 0x00007ff67d6ccad5 (C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\lldb.exe+0x1cad5)
#1 0x00007ffab6c8cb7d (C:\WINDOWS\System32\ucrtbase.dll+0x6cb7d)
#2 0x00007ffab6c8db81 (C:\WINDOWS\System32\ucrtbase.dll+0x6db81)
#3 0x00007ffa362e68e1 lldb::SBFile::Write(unsigned char const *, unsigned __int64, unsigned __int64 *) (C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\liblldb.dll+0x1368e1)
#4 0x00007ffa36732130 PyInit__lldb (C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\liblldb.dll+0x582130)
#5 0x00007ffa36738242 PyInit__lldb (C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\liblldb.dll+0x588242)
#6 0x00007ffa36739ce5 PyInit__lldb (C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\liblldb.dll+0x589ce5)
#7 0x00007ffa36761ed7 PyInit__lldb (C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\liblldb.dll+0x5b1ed7)
#8 0x00007ffa36763523 PyInit__lldb (C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\liblldb.dll+0x5b3523)
#9 0x00007ffa36788dd3 PyInit__lldb (C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\liblldb.dll+0x5d8dd3)
#10 0x00007ffa368b9a73 PyInit__lldb (C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\liblldb.dll+0x709a73)
#11 0x00007ffa368b8f22 PyInit__lldb (C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\liblldb.dll+0x708f22)
#12 0x00007ffa366a219d PyInit__lldb (C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\liblldb.dll+0x4f219d)
#13 0x00007ffa3661ea5c PyInit__lldb (C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\liblldb.dll+0x46ea5c)
#14 0x00007ffa362c3dac lldb::SBDebugger::RunREPL(enum lldb::LanguageType, char const *) (C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\liblldb.dll+0x113dac)
#15 0x00007ff67d6b532e (C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\lldb.exe+0x532e)
#16 0x00007ff67d6b7e91 (C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\lldb.exe+0x7e91)
#17 0x00007ff67d6e2060 (C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\lldb.exe+0x32060)
#18 0x00007ffab9417bd4 (C:\WINDOWS\System32\KERNEL32.DLL+0x17bd4)
#19 0x00007ffab9acce51 (C:\WINDOWS\SYSTEM32\ntdll.dll+0x6ce51)
I also wrote a swift programming file named "test.swift", and kicked off the compiler as follows:
PS C:\Users\minoh> swiftc test.swift
clang: error: no such file or directory: 'C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\lib\swift\windows\x86_64\swiftrt.obj'
:0: error: link command failed with exit code 1 (use -v to see invocation)
It was true, because there was no file named "swiftrt.obj" on that directory.
I did setup in the x64 Native Tools for VS2019 Command Prompt as follows, according to the get started help:
set SWIFTFLAGS=-sdk %SDKROOT% -I %SDKROOT%/usr/lib/swift -L SDKROOT%/usr/lib/swift/windows
and kicked off repl as follows:
swift repl -target x86_64-unknown-windows-msvc %SWIFTFLAGS%
The similar crashed report was displayed, that was displayed when kicking off the interpreter.
Huh, what I should do in the next step?
Tatsuo