Swift on Exherbo

As I explained on an SSWG update a year ago (April 14th, 2021 - #18 by RemiBardon) I work at Clever Cloud and we'd like to add support for Swift. I was busy with other subjects, but now I'm back on the subject, and I'm hitting the same issue: Download Swift only proposes downloads for macOS, Ubuntu, CentOS, Amazon Linux and Windows.

So my question is very straightforward: what would it mean / require to add support for Exherbo?

@compnerd What do you think?

Interesting links:

1 Like

Largely I think that the complexity is going to be in the exheres; the build system is pretty complicated and not very amenable to the exheres model. Using CMake directly rather than build-script should make it easier, particularly the cmake exlib. At that point, the problem will become the conflict between LLVM/clang/lldb/lld and the Swift forks of them. Once that is sorted out, personally, I would like to see a similar split to Windows and the rest of the exherbo packages (i.e. gcc vs libstdc++, etc) and have the runtime and compiler be split up (with possible changes for so versioning to aid slotting).

With those handled, I think that it might be possible to stand up a version of Swift that works well on exherbo (including docker images). Subsequent work would be needed for musl as the system libc, but we should at least be able to cover {x86_64,armv7,aarch}-unknown-linux-gnu targets just fine.

1 Like

Thank you for your response :slightly_smiling_face:

I'll have a look tomorrow, and keep you in touch

First, I am trying to build the Swift toolchain on Exherbo, to see where it breaks.

I had to remove the --test flag, as some tests were failing.

Now, I get

/bin/sh: line 1: /home/bas/swift-project/build/Ninja-RelWithDebInfoAssert/swift-linux-x86_64/./bin/swift-def-to-yaml-converter: No such file or directory

You can find the log here: Error when building Swift on Exherbo (2022-05-17-a) · GitHub

I'm looking at issues and PRs concerning swift-def-to-yaml-converter (Issues · apple/swift · GitHub), but I can't find a fix :face_with_monocle: I thought this was fixed in Revert "Update LocalizationFormat to use diagnosticIDStringFor" by benlangmuir · Pull Request #37507 · apple/swift · GitHub, but it's not :confused: