Swift on Clear Linux

I’ve been kicking the tires on Clear Linux and thinking about using it for my Linux laptop for development. I am doing server side Swift. At this time, the Swift project only really supports Ubuntu.

Has anyone either got the Ubuntu binaries to work on Clear Linux or been able to get it to build from source? I’ve been unsuccessful so far but haven’t put a lot of effort in yet. I can get it to work fine in an Ubuntu based container but would ideally like to run it without docker or potentially in a Clear Linux container.

Related - are there any guides for how to package software for Clear Linux? I’d be interested in potentially contributing a configuration to build Swift from source for Clear Linux.

1 Like

See for instance

https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=swift-language

This isn’t very easy to compile. We can probably package it, but, it would be a lot of work.

There are a lot of parts. I’ll take a look at the manual build cycle and see what it looks like there. I’m still wrapping my head around how Clear Linux packages things version stuff I’m more familiar with like apt packages.

Can a deb or rpm be used instead? Not sure if that is a viable solution or not (not for swupd but for me personally until if/when swift might be added to swupd)

Using other packaging formats is problematic, since they often contain hooks and dependencies that are nonfunctional on clearlinux systems. You can technical extract them, but even that may cause issues - .deb archives for instance - if extracted - often have permissions on folders that are problematic and leave your system semi broken (steam deb used to do this, for instance). rpm2cpio is useful, but software shouldn’t be installed into /usr/bin because it will conflict with swupd and so is not a good solution. Chrome is one of the exceptions since it installs in /opt and stays out of the way of the OS properly. I’ve seen people do rpm install --nodeps but I’m not a fan since that does the same amount of damage if you’re careless and surely swupd will protest.

@ascarter this is our Contribution Guidelines.

Never too late to say: Welcome! :slight_smile:

Thanks @biapalmeiro. I’m hoping to carve out a little time in the next few weeks and dive in on this one.

1 Like

Did you try this eventually? Swift now runs on multiple Linux platforms and even windows, would be nice to have support for clearlinux too. Swift.org - Platform Support