Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add informations about community packages/repositories for Linux #323

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions download/_linux.md
Expand Up @@ -17,6 +17,12 @@ Note that nothing prevents Swift from being ported to other Linux distributions
* CentOS 7
* Amazon Linux 2

### Other distributions that work using community packages and repositories

* Fedora 38
* Arch Linux
* Ubuntu/Debian based distros (Using community package from community repository)

* * *

### Installation
Expand Down
60 changes: 60 additions & 0 deletions download/index.md
Expand Up @@ -478,13 +478,73 @@ $ yum install epel-release
$ yum install swiftlang
```

##### Fedora RPM repository

```bash
sudo dnf install swift-lang
```

Checkout [the corresponding Fedora Repository page](https://src.fedoraproject.org/rpms/swift-lang) for more information.


{% include_relative _older-releases.md %}


#### Arch Linux

On Arch Linux you can install Swift using AUR. You can either use a repackaged version of the Fedora RPM or get a native build for Arch Linux.

You can find more information available at [Arch Linux Wiki](https://wiki.archlinux.org/title/Swift).

##### Install using AUR helper tools

Since Swift has AUR packages you can install it using AUR helper tools like `yay`:

```bash
yay -S swift-language
```
or
```bash
yay -S swift-bin
```


##### Native Arch Linux build using AUR

[Source](https://aur.archlinux.org/packages/swift-language)

To install it you will need git and base-devel packages installed.

```bash
git clone https://aur.archlinux.org/swift-language.git
cd swift-language
makepkg -si
```
After that you will be asked if you want to instal requiered dependencies. Answer yes and wait for the build to finish. By the way since its building the whole thing it will take a while.

##### Repackaged Fedora RPM

Can be installed the same way as the previous one, and this package is faster to get up and running. Just change the repository like this:

```bash
git clone https://aur.archlinux.org/swift-bin.git
cd swift-language
makepkg -si
```

#### Ubuntu/Debian community build

There's also a community-made package for Ubuntu/Debian based distros that is easy to install.
Just copy the commands below to add the repository and install Swift.

More information about the community repository is available at [swiftlang.xyz](https://www.swiftlang.xyz/).

```bash
sudo apt install -y curl
curl -s https://archive.swiftlang.xyz/install.sh | sudo bash
sudo apt install swiftlang
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@parpok Would you be able to share the repo/sources for how this package is being built and distributed?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shahmishal
Here's a Swift forum post about the apt repo
There's also more information on the repository project website with included link to scripts code for adding the repository

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't provide sources for the build and packaging scripts unfortunately, which makes it impossible to verify that these packages were built correctly or to understand what modifications were done to the original source.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used pkgdiff on both the official tar.gz file from swift.org and deb file from swiftlang.xyz repository (downloaded using apt download swiftlang) and the result came that files were different. If anyone interested in auditing the difference I'm leaving the report pkgdiff provided.

Also if the community repo doesn't suit needs I can delete any mentions of it.

Overview of the pkgdiff report provided in the gist

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shahmishal @MaxDesiatov As the creator and maintainer of the https://swiftlang.xyz repository I can verify that all packages have been built without any modifications to the original source.
Where possible the packages are created from the original .tar.gz files from swift.org.
OS versions that swift.org does not supply are created from https://github.com/futurejones/swift-arm64/releases.
As I also build and maintain these packages I can also verify that they are built from the original source.
Build logs from https://ci.swiftlang.xyz/ show that no patches currently are needed for builds on ubuntu/debian on amd64 or arm64.
I use https://github.com/jordansissel/fpm to create the .deb packages from the .tar.gz files. fpm does not change or modify any files contained in the .tar.gz files, it simply repackages them into .deb files.

@parpok pkgdiff can not be used to check for diffs between two different file types like .tar and .deb.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shahmishal do we list non-swift.org produced installers / artifacts on this page, or is it limited to the ones the swift.org produces?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shahmishal do we list non-swift.org produced installers / artifacts on this page, or is it limited to the ones the swift.org produces?

We currently don't post installer or artifacts urls from outside of swift.org.

```

## Snapshots

### Trunk Development (main)
Expand Down