compnerd/swift-win32

[SPM] TSCUtility/Triple.swift:152: Fatal error: could not determine host triple: malforme

Guang1234567 opened this issue · 9 comments

Hello dev:

c:\Users\User\Downloads\swift-win32>swift build

TSCUtility/Triple.swift:152: Fatal error: could not determine host triple: malformed

error: unable to invoke subcommand: C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\swift-build.exe ()

But sometimes get works, -_-||

The solution maybe metioned on :
google/swift-jupyter#103 (comment)

Thanks.

What version of the toolchain are you using?

The 12/01 snapshot did not have a working SPM. You should use 11/18 or so which the GH Actions based CI is using. This is not a Swift/Win32 issue.

As of today, the snapshot that the github actions workflow is using is the 12/12 snapshot. I recommend that if you are using snapshots, you follow the version that the GItHub Actions workflow uses (see .github/workflows/windows.yml).

Thanks your reply.

But 12/12 snapshot has the same issue:

The error output of swift build -v is strange.

sometimes

    ~\downloads\Swift_Boost_Context   master ≣                                                        User@WINDEV2011EVAL  22:23:53 

❯ swift build -v
C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\swiftc.exe -print-target-info
C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\swiftc.exe -print-target-info
C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\swiftc.exe -L C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\lib\swift\pm\4_2 -lPackageDescription -sdk C:\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk -libc MD -I C:\Library\Developer\Platforms\Windows.platform\Developer\Library\XCTest-development\usr\lib\swift\windows\x86_64 -L C:\Library\Developer\Platforms\Windows.platform\Developer\Library\XCTest-development\usr\lib\swift\windows -use-ld=lld -swift-version 5 -I C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\lib\swift\pm\4_2 -package-description-version 5.3.0 C:\Users\User\downloads\Swift_Boost_Context\Package.swift -o C:\Users\User\AppData\Local\Temp\TemporaryDirectory.kphLEK\swift_boost_context-manifest.exe
C:\Users\User\downloads\Swift_Boost_Context: error: manifest parse error(s):
Unknown error parsing manifest for swift_boost_context

and sometimes

    ~\downloads\Swift_Boost_Context   master ≣                                                        User@WINDEV2011EVAL  22:24:10 

❯ swift build -v
C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\swiftc.exe -print-target-info
C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\swiftc.exe -print-target-info
C:\Users\User\downloads\Swift_Boost_Context: error: manifest parse error(s):
lld-link: error: <root>: undefined symbol: mainCRTStartup
lld-link: error: undefined symbol: memcpy
>>> referenced by C:\Users\User\AppData\Local\Temp\Package-5d8c98.o:(main)
>>> referenced by C:\Users\User\AppData\Local\Temp\Package-5d8c98.o:(main)
>>> referenced by C:\Users\User\AppData\Local\Temp\Package-5d8c98.o:(main)
>>> referenced 9 more times
clang: error: linker command failed with exit code 1 (use -v to see invocation)
<unknown>:0: error: link command failed with exit code 1 (use -v to see invocation)

image

Is it a known Issues associate with the manifest parse ? Thanks.

You are not running it from the x64 Developer Command Prompt AFAICT. Are you sure that you used the DEVELOPER command prompt? The startup of the shell will execute parts of Visual Studio's setup that are required to get the environment correct.

You are not running it from the x64 Developer Command Prompt AFAICT. Are you sure that you used the DEVELOPER command prompt? The startup of the shell will execute parts of Visual Studio's setup that are required to get the environment correct.

Aslo try "x64 Developer Command Prompt" as below screen snapshot, thanks.

#327 (comment)

I happened to come across this on GitHub actions once. I think that this is a bug in SPM, and is transient. Re-running the command seemed to be fine on GitHub at least. I think that reporting the issue on bugs.swift.org might be reasonable.