tl;dr: swift.org has no 26.04 Swift build yet, so you run the 24.04 toolchain (what xtool expects anyway) and backfill the two libraries 26.04 bumped (libxml2, libicu).
Why
swift.org doesn’t publish a 26.04 build yet— swiftly doesn’t even recognize the platform (swiftlang/swiftly#532). 26.04 is an LTS, so it’s coming? I feel pretty on the edge with my LTS. Next step: rolling distros :)
What
First run dies looking for the old shared obj :/
swift-sdk: error while loading shared libraries: libxml2.so.2: cannot open shared object file
26.04 ships libxml2 .so.16 and a newer ICU; the 24.04 toolchain wants libxml2.so.2 and libicuuc.so.74. Luckily, you can grab both from the 24.04 (noble) packages and drop them in /usr/local/lib, where they sit besides the newer versions (and more importantly in your ldconfig path). If infecting you /usr/local/lib isn’t your jam you can probably do something similar with LD env vars assuming xtool obeys them?
How
cd /tmp
# let's 'backport' the older version which will align with what
# xtool was probably compiled against.
## note: these were the urls at publish look in the index if these 404 later
curl -LO http://archive.ubuntu.com/ubuntu/pool/main/libx/libxml2/libxml2_2.9.14+dfsg-1.3ubuntu3.8_amd64.deb
curl -LO http://archive.ubuntu.com/ubuntu/pool/main/i/icu/libicu74_74.2-1ubuntu3.1_amd64.deb
# let's unpack that vintage binary
for deb in libxml2_*.deb libicu74_*.deb; do ar x "$deb" && tar xf data.tar.*; done
# include the old libraries in your linker path
sudo cp -P usr/lib/x86_64-linux-gnu/libxml2.so.2* usr/lib/x86_64-linux-gnu/libicu*.so.74* /usr/local/lib/
sudo ldconfig
Now swift --version runs. That’s the toolchain— time to write some code?
Note: prose and code were created by a human brain