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

We've been using the Windows Swift 5.3 and 5.4 snapshots for a while now to compile a cross-platform library. We use the snapshots instead of the official releases because we would rather not maintain a cmake configuration parallel to our SwiftPM configuration, instead using SwiftPM to build everywhere, including Windows.

Since at least November last year, we have been getting an error about 30% of the time when compiling our library:

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

This happens most often when building our library using GitHub Actions and their provided Windows 10 environment. However, it also happens when building locally with swift build.

Has anyone else been using the snapshots to gain SwiftPM support on Windows and been having this same stochastic issue?

1 Like

I've seen this a couple of times, I'd estimate it more like 0.25% or something. I've not been able to reproduce this locally, but my suspicion is that there is something wrong with the deserialization of the payload being processed through a pipe to the child process. If you can actually capture the actual output from the subprocess when building the manifest, that might help identify where things are going wrong.

Less than 1%? That would be nice! We see it most often using GitHub Actions to build and test our library with the snapshot. Because the environment doesn't have swift of any version installed, we install as part of the script. At one point we thought it might have been because the install had not yet completed before compilation had begun, but that might be a red herring.

I'll investigate a bit more. I just didn't see this on the forum yet, which surprised me, since it happens very often in our case.

Definitely looking forward to an official Windows release of Swift with SwiftPM!

Can confirm that I’ve seen this happen from time to time.

Only on GH CI servers, but then again, I don't have a Windows machine so I only ever personally see Windows builds via GH CI servers.

I see this every time I open a Swift package in CLion.

Again, only at launch—any manual build won’t trigger such bug. It doesn’t matter so much as the CI’s case.

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

That file parses the Swift target triple passed from the Swift compiler to SPM, sounds like it is flaking on Windows for some reason.

Definitely looking forward to an official Windows release of Swift with SwiftPM!

Have you tried the just released Swift 5.4 for Windows, which is supposed to include SPM?

No, we haven't! I checked the Platform Support page to see if SwiftPM was reported as supported for Windows and assumed it was not, since that page seems to not have been updated yet.

I will try the official release in our CI/CD system and see if we continue getting the error.

Terms of Service

Privacy Policy

Cookie Policy