Skip to content
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-13609] Windows builds not work #56044

Closed
swift-ci opened this issue Sep 25, 2020 · 3 comments
Closed

[SR-13609] Windows builds not work #56044

swift-ci opened this issue Sep 25, 2020 · 3 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. Windows Platform: Windows

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-13609
Radar None
Original Reporter liudonghua123 (JIRA User)
Type Bug
Status Closed
Resolution Duplicate
Environment

swift-5.3-RELEASE-windows10.exe

Microsoft Windows [Version 10.0.19041.508]

Additional Detail from JIRA
Votes 0
Component/s
Labels Bug, Windows
Assignee None
Priority Medium

md5: d5340df3b8693338eb1abe0888a42740

Issue Description:

I installed the latest windows builds ( https://swift.org/builds/swift-5.3-release/windows10/swift-5.3-RELEASE/swift-5.3-RELEASE-windows10.exe ), and followed the instructions on https://swift.org/getting-started/#on-windows, and all of the steps are correct without errors. After the installation, I tried to execute `swift`/`swiftc`, but it did nothing but exist sliently.

C:\Users\Liu.D.H>which swift
/c/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/swift
C:\Users\Liu.D.H>python -V
Python 3.7.3
C:\Users\Liu.D.H>where python
C:\Users\Liu.D.H\Anaconda3\python.exe
C:\Users\Liu.D.H\.windows-build-tools\python27\python.exe
C:\msys32\mingw32\bin\python.exe
C:\Users\Liu.D.H\AppData\Local\Microsoft\WindowsApps\python.exe
C:\Users\Liu.D.H\Miniconda3\python.exe
C:\Users\Liu.D.H>python -V
Python 3.7.3
C:\Users\Liu.D.H>set SWIFTFLAGS=-sdk %SDKROOT% -I %SDKROOT%/usr/lib/swift -L SDKROOT%/usr/lib/swift/windows
C:\Users\Liu.D.H>echo %SWIFTFLAGS%
-sdk C:\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk -I C:\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk/usr/lib/swift -L SDKROOT%/usr/lib/swift/windows
C:\Users\Liu.D.H>set SWIFTFLAGS=-sdk %SDKROOT% -I %SDKROOT%/usr/lib/swift -L %SDKROOT%/usr/lib/swift/windows
C:\Users\Liu.D.H>echo %SWIFTFLAGS%
-sdk C:\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk -I C:\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk/usr/lib/swift -L C:\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk/usr/lib/swift/windows
C:\Users\Liu.D.H>swift repl -target x86_64-unknown-windows-msvc %SWIFTFLAGS%
C:\Users\Liu.D.H>echo %errorlevel%
-1073741515
C:\Users\Liu.D.H>mkdir Hello
C:\Users\Liu.D.H>cd hello
C:\Users\Liu.D.H\Hello>swift package init
error: unable to invoke subcommand: C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\swift-package ()
C:\Users\Liu.D.H\Hello>dir C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\swift-package
 Volume in drive C is System
 Volume Serial Number is 0CAC-076E
Directory of C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin
File Not Found
C:\Users\Liu.D.H\Hello>dir C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\swift
 Volume in drive C is System
 Volume Serial Number is 0CAC-076E
Directory of C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin
File Not Found
C:\Users\Liu.D.H\Hello>dir C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\swift*
 Volume in drive C is System
 Volume Serial Number is 0CAC-076E
Directory of C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin
2020-09-17 04:24 93,228,544 swift-autolink-extract.exe
2020-09-17 04:22 636,416 swift-demangle.exe
2020-09-17 04:23 91,353,600 swift-refactor.exe
2020-09-17 04:23 93,228,544 swift.exe
2020-09-17 04:24 93,228,544 swiftc.exe
2020-09-17 04:22 169,984 swiftDemangle.dll
 6 File(s) 371,845,632 bytes
 0 Dir(s) 60,605,186,048 bytes free
C:\Users\Liu.D.H\Hello>cat > hello.swift
print("hello")
C:\Users\Liu.D.H\Hello>swiftc hello.swift
clang: error: no such file or directory: 'C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\lib\swift\windows\x86_64\swiftrt.obj'
<unknown>:0: error: link command failed with exit code 1 (use -v to see invocation)
C:\Users\Liu.D.H\Hello>lldb
C:\Users\Liu.D.H\Hello>
@typesanitizer
Copy link

cc @compnerd

@compnerd
Copy link
Collaborator

Windows requires additional flags at the moment. You should be able to build hello.exe as:

set SWIFTFLAGS=-sdk %SDKROOT% -resource-dir %SDKROOT%/usr/lib/swift -I %SDKROOT%/usr/lib/swift -L %SDKROOT%/usr/lib/swift/windows
swiftc %SWIFTFLAGS% -emit-executable -o hello.exe hello.swift

@compnerd
Copy link
Collaborator

The REPL issue is known: SR-13591

swift-package-manager is not part of the 5.3 release: SR-13588

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. Windows Platform: Windows
Projects
None yet
Development

No branches or pull requests

3 participants