Install, Build and Test Swift-Nio on an Armv7 SBC running Debian Stretch.

Tested on Asus TinkerBoard running TinkerOS 2.0.8. (Debian/Stretch)

Swift version = 4.2.1 (swift-4.2.1-RELEASE)

Swift-Nio version = 1.14.1

// install packagecloud.io repo keys and update

$ curl -s https://packagecloud.io/install/repositories/swift-arm/release/script.deb.sh | sudo bash

// install swift-4.2.1-RELEASE

// this will also install swift dependencies needed such clang etc.

$ sudo apt-get install swift4

// install extra dependencies for swift-nio

$ sudo apt-get install zlibc zlib1g zlib1g-dev

// install git

$ sudo apt-get install git

// clone swift-nio

$ git clone https://github.com/apple/swift-nio.git

// cd to repo directory

$ cd swift-nio

// checkout version 1.14.1

$ git checkout 1.14.1

// build

$ swift build

Test NIOEchoServer

Open 2 terminal windows.

Terminal 1

$ cd swift-nio

$ swift run NIOEchoServer

Server started and listening on [IPv6]::1:9999

// ctrl+c to when you want to stop server

Terminal 2

$ echo "Hello SwiftNIO" | nc localhost 9999

Hello SwiftNIO

Test NIOHTTP1Server

Open 2 terminal windows.

Terminal 1

$ cd swift-nio

$ swift run NIOHTTP1Server

Server started and listening on [IPv6]::1:8888

// ctrl+c to stop server

Terminal 2



Hello World! $ curl http://localhost:8888 Hello World!

If you want to try out Swift-Nio v2 you will need to install Swift5.

Check out the Swift-Arm repo to see what versions of Swift are available for which OS. - https://packagecloud.io/swift-arm/release

For more info on Swift-Nio go to - https://github.com/apple/swift-nio