Server-side Swift. The Perfect core toolset and framework for Swift Developers. (For mobile back-end development, website and API development, and more…)

Overview

Perfect: Server-Side Swift 简体中文

Get Involed with Perfect!

Swift 5.2 Platforms macOS | Linux License Apache

Perfect: Server-Side Swift

Perfect is a complete and powerful toolbox, framework, and application server for Linux, iOS, and macOS (OS X). It provides everything a Swift engineer needs for developing lightweight, maintainable, and scalable apps and other REST services entirely in the Swift programming language for both client-facing and server-side applications.

Perfect includes a suite of tools that will enhance your productivity as you use only one programming language to build your apps: Swift. The global development community’s most dynamic and popular server-side toolbox and framework available today, Perfect is the backbone for many live web applications and apps available on iTunes.

This guide is designed for developers at all levels of experience to get Perfect up and running quickly.

Working with Perfect

Compatibility with Swift

The master branch of this project currently compiles with Xcode 11 or the Swift 5 toolchain on Ubuntu.

Getting Started

Access a tutorial to help you get started using Perfect quickly. It includes straightforward examples of how Perfect can be used.

Documentation

Get started working with Perfect, deploy your apps, and find more detailed help by consulting our reference library.

We welcome contributions to Perfect’s documentation. If you spot a typo, bug, or other errata, or have additions or suggestions to recommend, please create a pull request or issue in Github.

Community

We all need a little help now and then. If you do too, don’t be shy, ask us or the friendly and supportive Perfect community:

Slack | Twitter

Deployment

Your Perfect project can be deployed to any Swift compatible Linux server. We provide a macOS desktop application, Perfect Assistant, to help with AWS and Google Cloud deployments. Additional deployment options are in the works.

Samples, Examples, and Tutorials

Our library continues to grow as members of the Swift-Perfect development community have shared many samples and examples of their projects in Perfect. Examples include:

There are many more examples you can explore. Please share yours!

Core Perfect Modules

Perfect project is divided into several repositories to make it easy for you to find, download, and install the components you need:

  • Perfect – This repository contains the core PerfectLib and will continue to be the main landing point for the project
  • Perfect Docs – Contains all API reference-related material

Examples

  • Perfect Template - A simple starter project which compiles with the Swift Package Manager into a standalone executable HTTP server. This repository is ideal for starting a Perfect-based project
  • Perfect Examples - All the Perfect example projects

DataSources

Utilities

More about Perfect

Perfect operates using either a standalone HTTP server, HTTPS server, or through FastCGI server. It provides a system for loading your Swift-based modules at startup, for interfacing those modules with its request/response objects, or to the built-in Mustache template processing system.

Perfect is built on a completely asynchronous, high-performance networking engine to provide a scalable option for internet services. It supports Secure Sockets Layer (SSL) encryption, and it features a suite of tools commonly required by internet servers such as WebSockets and iOS push notifications, but you are not limited to those options.

Feel free to use your favourite JSON or templating systems, etc.

Join and Contribute to the Community

The Swift-Perfect developer community is vital to improving Perfect and supporting one another.  

You can help other developers by sharing your expertise and tips, as well as learn from others, by joining the Perfect Slack channel. Contributions of all kinds are welcome: reporting issues, updating documentation, fixing bugs, building examples, sharing projects, and any other tips that may help the Swift-Perfect community.

If you would like to share your example project, tutorial, or video, please share the URL of your work on GitHub and Twitter, and the Perfect team will highlight it to the community.

Code of Conduct

The Perfect team welcomes people of all ethnicities, nationalities, ages, gender, disability, levels of experience, and religious beliefs to use and contribute to the Perfect project. We pledge to foster and enforce a harassment-free environment of openness, respect, and cooperation for everyone in all project and public spaces online or offline.

Please report any behaviour that violates our Code of Conduct to [email protected]. The Perfect team is committed to enforcing this Code of Conduct to ensure everyone who wishes to use, contribute to, and comment on the Perfect project may do so freely and openly and without fear of reprisal.

We will investigate all complaints of unacceptable or abusive behaviour or comments expediently, and we will maintain the confidentiality of the person who reports any perceived infraction or wrongdoing to us. We will not tolerate any form of direct or indirect harassment or discrimination within the Swift-Perfect community, and will take appropriate, fair, and corrective action to any instance of inappropriate behaviour.

The Perfect team maintains the right to remove, edit, or reject any comments, code, edits, or issues that do not align with our Code of Conduct.

Comments
  • Perfect should be more

    Perfect should be more "Swifty"

    We'd heard from a few people that Perfect isn't as "Swifty" as it should be. We'd love to hear what this means to you, and where you think we could improve Perfect to be more so. What is "Swifty" to you that Perfect isn't?

    opened by SeanStephens 30
  • Is this project dead?

    Is this project dead?

    The last commit was 3 months ago and I haven't seen much recent activity. ~~I am unable to join the Slack channel~~. So is this project basically dead?

    EDIT: I've got to join Slack now after some failed attempts (was getting HTTP 502-504)

    I am looking to decide what to use for a backend and thought of server-side Swift (instead of going with some NodeJS thing) and found this but I am quite skeptical.

    opened by xissburg 27
  • Swift compiler error

    Swift compiler error

    Hello Perfect team, I tried following the README Quick Start instructions.

    After I enter the following in Terminal: git clone https://github.com/PerfectlySoft/PerfectTemplate.git cd PerfectTemplate swift build

    I get: /Users/matthewtso/git/PerfectTemplate/Packages/PerfectThread-0.10.0/Sources/ThreadQueue.swift:210:97: error: cannot convert value of type 'UnsafeMutablePointer<Void>' (aka 'UnsafeMutablePointer<()>') to expected argument type 'UnsafeMutablePointer<_>'

    /Users/matthewtso/git/PerfectTemplate/Packages/PerfectThread-0.10.0/Sources/ThreadQueue.swift:233:37: error: value of type 'Unmanaged<IsThisRequired>' has no member 'toOpaque'

    error: exit(1): /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-build-tool -f /Users/matthewtso/git/PerfectTemplate/.build/debug.yaml

    Checking my Swift version returns the following: Apple Swift version 3.0 (swiftlang-800.0.30 clang-800.0.24) Target: x86_64-apple-macosx10.9

    I'm pretty new and not sure how to diagnose this, is there something I can try to fix this? Thanks!

    opened by mtso 27
  • Tutorial Contest Entry - Introduction to Perfect Video Series

    Tutorial Contest Entry - Introduction to Perfect Video Series

    Hi Everyone!

    I have been hard at work learning Perfect and making tutorial videos in my spare time. This is by far not finished yet, but since the introduction section is done, I figured it was time to share it with the community.

    So beginning today I have four videos for you:

    1. How to setup an Xcode Workspace (HelloPerfect Part 1): https://www.youtube.com/watch?v=LNU6L2pnq0k
    2. How to host your first Web Application with a custom route (Hello Perfect Part 2): https://www.youtube.com/watch?v=rYV9M64pPv8
    3. How to host web content (a website) with Perfect: https://www.youtube.com/watch?v=J441eJ40PH4
    4. How to host dynamic content using Mustache Templates and Handlers: https://www.youtube.com/watch?v=SX9aX2aYzpw

    Update: May 5th:

    Video 5 is live!

    1. How to encode JSON: https://youtu.be/EwoXL_ZnA3s

    I have also combined them into one easy playlist here: https://www.youtube.com/playlist?list=PLE2M81Pddau3LrJRGPbc6UXMy3VQuA2lL

    Update: May 6th:

    Video 6 is live!

    1. Start working with POST requests: https://youtu.be/IwkbRxDZaBA

    More to Come

    Again, this is only the beginning for me as I prepare an entire online course in everything Perfect has to offer. Things I have planned:

    • How to hookup a database and work with the database connectors
    • How to use Perfect's built-in JSON
    • How to create a Private API & an iOS app that uses that API
    • How to create a public API
    • How to work with Perfect's built-in curl library
    • How to tie all of it together in one application (an API, web app, mobile app, database, custom routes, and mustache as one project)

    If you like my tutorials, please give hit the like button in the upper right corner (looks like +😀) and select the "thumbs up" to vote for me in the competition, and thank you for watching!

    Edit: Made Voting Instructions More Clear Edit 2: Added Video 5: Encoding JSON Edit 3: Added Video 6: Working with POST

    opened by rymcol 25
  • License Rationale and Clarification

    License Rationale and Clarification

    I see this great project is under the Gnu Affero License, which basically implies that any software built using this server will need to be under the same license (see https://www.gnu.org/licenses/gpl-faq.html#LinkingOverControlledInterface).

    Swift.org has been released under the Apache License. Any chance this project would consider doing the same ?

    opened by sergehuber 23
  • Latest perfect release can't find Foundation

    Latest perfect release can't find Foundation

    I'm attempting to build hash a1a9fe27c9a5fef4434c50ede050dea206807423 and this is what I get on Ubuntu 14.04 when making PerfectLib:

    ~/s/P/PerfectLib ❯❯❯ make
    swift -frontend -c  NetNamedPipe.swift File.swift Threading.swift LibEvent.swift Bytes.swift FastCGI.swift LogManager.swift NetTCPSSL.swift PerfectServer.swift WebConnection.swift Closeable.swift FastCGIServer.swift Net.swift Utilities.swift MimeReader.swift NetTCP.swift SessionManager.swift WebRequest.swift HTTPServer.swift MimeType.swift PageHandler.swift SQLite.swift WebResponse.swift Dir.swift Mustache.swift PerfectError.swift SysProcess.swift DynamicLoader.swift JSON.swift Utilities-Server.swift Routing.swift StaticFileHandler.swift WebSocketHandler.swift JSONConvertible.swift cURL.swift -primary-file ICU.swift \
            -emit-module-path ./tmp/ICU.swiftmodule \
            -emit-module-doc-path ./tmp/ICU.swiftdoc \
            -emit-dependencies-path ./tmp/ICU.d \
            -emit-reference-dependencies-path ./tmp/ICU.swiftdeps \
            -g -Onone -Xcc -DDEBUG=1 -emit-module -I /usr/include/ -I linked/LibEvent -I linked/OpenSSL_Linux -I linked/ICU -I linked/SQLite3 -I linked/cURL_Linux -module-cache-path /tmp/modulecache -module-name PerfectLib -I linked/LinuxBridge -g -Onone -Xcc -DDEBUG=1 -emit-module -I /usr/include/ -I linked/LibEvent -I linked/OpenSSL_Linux -I linked/ICU -I linked/SQLite3 -I linked/cURL_Linux -module-cache-path /tmp/modulecache -module-name PerfectLib -I linked/LinuxBridge \
            -o ICU.o
    SessionManager.swift:26:8: error: no such module 'Foundation'
    import Foundation
           ^
    make: *** [ICU.o] Error 1
    

    Any help is appreciated.

    opened by eimantas 19
  • Missing OpenSSL

    Missing OpenSSL

    Hello,

    I built the latest version of PerfectLib with the correct Swift snapshot. However, when I import the .xcodeproj or a compiled version of the framework into Xcode whenever I try to compile my program the compiler says "Missing required module 'OpenSSL'." Also, I ran 'brew link openssl --force' to force symlink the openssl libs to /usr/local/include/openssl.

    Thanks!

    opened by kurtbitner 15
  • Compile PerfectLib error in Ubuntu 14.04

    Compile PerfectLib error in Ubuntu 14.04

    I use make to compile PerfectLib (sudo make) ,but show this error: swift -frontend -c ICU.swift NetNamedPipe.swift File.swift Threading.swift LibEvent.swift Bytes.swift FastCGI.swift LogManager.swift NetTCPSSL.swift PerfectServer.swift WebConnection.swift Closeable.swift FastCGIServer.swift Net.swift Utilities.swift MimeReader.swift NetTCP.swift SessionManager.swift WebRequest.swift HTTPServer.swift MimeType.swift PageHandler.swift SQLite.swift WebResponse.swift Dir.swift Mustache.swift PerfectError.swift SysProcess.swift DynamicLoader.swift JSON.swift Utilities-Server.swift Routing.swift StaticFileHandler.swift WebSocketHandler.swift JSONConvertible.swift -primary-file cURL.swift
    -emit-module-path ./tmp/cURL.swiftmodule
    -emit-module-doc-path ./tmp/cURL.swiftdoc
    -emit-dependencies-path ./tmp/cURL.d
    -emit-reference-dependencies-path ./tmp/cURL.swiftdeps
    -g -Onone -Xcc -DDEBUG=1 -emit-module -I /usr/include/ -I linked/LibEvent -I linked/OpenSSL_Linux -I linked/ICU -I linked/SQLite3 -I linked/cURL_Linux -module-cache-path /tmp/modulecache -module-name PerfectLib -I linked/LinuxBridge -g -Onone -Xcc -DDEBUG=1 -emit-module -I /usr/include/ -I linked/LibEvent -I linked/OpenSSL_Linux -I linked/ICU -I linked/SQLite3 -I linked/cURL_Linux -module-cache-path /tmp/modulecache -module-name PerfectLib -I linked/LinuxBridge
    -o cURL.o cURL.swift:84:13: error: use of unresolved identifier 'CURLOPT_HEADERDATA' setOption(CURLOPT_HEADERDATA, v: opaqueMe) ^~~~~~~~~~~~~~~~~~ cURL.swift:85:13: error: use of unresolved identifier 'CURLOPT_WRITEDATA' setOption(CURLOPT_WRITEDATA, v: opaqueMe) ^~~~~~~~~~~~~~~~~ cURL.swift:86:13: error: use of unresolved identifier 'CURLOPT_READDATA' setOption(CURLOPT_READDATA, v: opaqueMe) ^~~~~~~~~~~~~~~~ make: *** [cURL.o] Error 1

    opened by lokinfey 15
  • Deploy on AWS?

    Deploy on AWS?

    I'm assuming this can't be deployed to a real production server yet, since it can't run on linux. Is that something that is only reconcilable after Apple open sources the language?

    Nevertheless, not being able to scale the servers made is definitely an issue.

    opened by AndrewSB 10
  • PerfectNet integer type issues

    PerfectNet integer type issues

    • Building Perfect via SPM
    • Debian 8.5 (jessie)
    • Beaglebone Black (armv7 / 32bit )
    • Swift version 3.0-dev (June 9, 2015)(LLVM eb140647a6, Clang 188b5bf5e2, Swift df68c08020) Target: armv7--linux-gnueabihf

    In addition to build errors reported on the Ubuntu (#187), there are two additional ones that pop up on the Beaglebone Black, a 32bit device.

    debian@beaglebone:~/Development/delete/Perfect$ swift build
    Compile Swift Module 'PerfectNet' (5 sources)
    /home/debian/Development/delete/Perfect/Packages/PerfectNet-0.8.0/Sources/NetTCP.swift:26:26: error: integer literal '4294967295' overflows when stored into 'Int'
    let INADDR_NONE = UInt32(0xffffffff)
    

    and

    /home/debian/Development/delete/Perfect/Packages/PerfectNet-0.8.0/Sources/NetTCPSSL.swift:234:42: error: cannot convert value of type 'UInt' to expected argument type 'Int'
                    SSL_CTX_ctrl(sslCtx, SSL_CTRL_OPTIONS, SSL_OP_ALL, nil)
                                                           ^~~~~~~~~~
                                                           Int(      )
    
    opened by iamcam 9
  • Issue when launching the server on Ubuntu 15-10 :

    Issue when launching the server on Ubuntu 15-10 : "the file / was not found"

    Hello,

    I have a problem when i launch the perfectserverhttp from Ubuntu 15-10. capture d ecran 2015-12-14 a 17 59 00

    The server launches properly, but then i can't manage to work with it. The message "The file "/" was not found" is displaying on the navigator.

    Could it be because i use a virtual machine? Or did i do something wrong with the installation? I followed step by step the instructions written in the Readme files.

    Thanks in advance!

    opened by Khalil-Ciret 9
  • Releasing version 4 of PerfectHTTP and PerfectHTTP-Server?

    Releasing version 4 of PerfectHTTP and PerfectHTTP-Server?

    Hi, we recently moved from precompiled Perfect to one resolved via SPM.

    We stumbled upon the crash explained in:

    https://github.com/PerfectlySoft/Perfect/issues/296

    only when running in Release configuration. On the very first request, app crashes in

    return UnsafePointer(bytesArray).withMemoryRebound(to: Int8.self, capacity: bytesArray.count) { return String(validatingUTF8: $0) }

    Now this seems to be fixed in PerfectLib from version 4.0 onwards by following commit:

    https://github.com/PerfectlySoft/Perfect/commit/135fb33471f1dd316eb323f8a94d701bde2efa85#diff-69391fd63fbd9d34d8f320a64858e895ea4ab70dc9e87fafe0cfe701de2db5b0L250

    The problem is that no publicly available version of HTTP and HTTP-Server depends on PerfectLib 4.0, which essentially is letting me with no access to the fix for this crash.

    Long story short, is there an intent from your side to publish HTTP/HTTP-Server version 4.0 that depends on PerfectLib 4.0?

    Thanks in advance. Uros

    opened by uros-gardasevic 0
  • Compiling on M1 Mac

    Compiling on M1 Mac

    PerfectLib doesn't compile on M1 macs. I get an error in Log.swift on line 73. Has anyone been able to get this to work?

    Cannot convert value of type 'CVaListPointer' to expected argument type '__darwin_va_list?' (aka 'Optional<UnsafeMutablePointer<Int8>>')

    opened by omrd 5
  • A emoji parameter bug On Linux

    A emoji parameter bug On Linux

    Platform: Linux(not happen on Mac) What happen: the server shutdown How to happen: remove permeter escapeVS, request body is '👨‍👩‍👧‍👦' Strange: set parameter escapeVS or request not contains '👨‍👩‍👧‍👦', this wouldn't happen. My question: Is the postParams wrong when the request body contains some speical emoji?

    this is my request:

    curl --location --request POST 'http://localhost:8181/emoji/parse?a=b' \
    --header 'Content-Type: text/plain' \
    --data-raw '👨‍👩‍👧‍👦'
    

    this is my code:

    func emojiParse(request: HTTPRequest, response: HTTPResponse) {
        do {
            let escapeVS = request.param(name: "escapeVS", defaultValue: "false")?.elementsEqual("true") ?? false
            if let raw = request.postBodyString {
                response.setHeader(.contentType, value: MimeType.forExtension("json"))
                let result = raw.translateUEmojiCode(escapeVS)
                try response.setBody(json: result)
            }
        } catch {
            response.status = .internalServerError
            response.setBody(string: "Error handling request: \(error)")
        }
        response.completed()
    }
    

    this is my debug on Mac:

    image

    this is the error log:

    content:Fatal error: UnsafeMutablePointer.initialize overlapping range: file /home/buildnode/jenkins/workspace/oss-swift-5.2-package-linux-ubuntu-18_04/swift/stdlib/public/core/UnsafePointer.swift, line 832
    content:Current stack trace:
    content:0    libswiftCore.so                    0x00007fe6d9fc6db0 swift_reportError + 50
    content:1    libswiftCore.so                    0x00007fe6da038f60 _swift_stdlib_reportFatalErrorInFile + 115
    content:2    libswiftCore.so                    0x00007fe6d9d4d5f5 <unavailable> + 1381877
    content:3    libswiftCore.so                    0x00007fe6d9d4d117 <unavailable> + 1380631
    content:4    libswiftCore.so                    0x00007fe6d9d4cde3 <unavailable> + 1379811
    content:5    libswiftCore.so                    0x00007fe6d9d4c750 _assertionFailure(_:_:file:line:flags:) + 525
    content:6    libswiftCore.so                    0x00007fe6d9d4ccb0 _fatalErrorMessage(_:_:file:line:flags:) + 44
    content:7    libswiftCore.so                    0x00007fe6d9f6ae72 <unavailable> + 3599986
    content:8    PerfectTemplate                    0x0000562ce0eea388 <unavailable> + 992136
    content:9    PerfectTemplate                    0x0000562ce0e85404 <unavailable> + 578564
    content:10   PerfectTemplate                    0x0000562ce0e82862 <unavailable> + 567394
    content:11   PerfectTemplate                    0x0000562ce0e819e3 <unavailable> + 563683
    content:12   PerfectTemplate                    0x0000562ce0e5564d <unavailable> + 382541
    content:13   PerfectTemplate                    0x0000562ce0f03097 <unavailable> + 1093783
    content:14   PerfectTemplate                    0x0000562ce0e6f7c5 <unavailable> + 489413
    content:15   PerfectTemplate                    0x0000562ce0e6fda9 <unavailable> + 490921
    content:16   PerfectTemplate                    0x0000562ce0e85eb4 <unavailable> + 581300
    content:17   PerfectTemplate                    0x0000562ce0ec1159 <unavailable> + 823641
    content:18   PerfectTemplate                    0x0000562ce0ebf1bc <unavailable> + 815548
    content:19   PerfectTemplate                    0x0000562ce0ec1d77 <unavailable> + 826743
    content:20   PerfectTemplate                    0x0000562ce0e812d7 <unavailable> + 561879
    content:21   PerfectTemplate                    0x0000562ce0e80e79 <unavailable> + 560761
    content:22   PerfectTemplate                    0x0000562ce0ef7df9 <unavailable> + 1048057
    content:23   PerfectTemplate                    0x0000562ce0ebee50 <unavailable> + 814672
    content:24   PerfectTemplate                    0x0000562ce0ec1bd7 <unavailable> + 826327
    content:25   PerfectTemplate                    0x0000562ce0e85cc9 <unavailable> + 580809
    content:26   libdispatch.so                     0x00007fe6d8df3487 <unavailable> + 140423
    content:27   libdispatch.so                     0x00007fe6d8dfb14a <unavailable> + 172362
    content:28   libdispatch.so                     0x00007fe6d8dfaec8 <unavailable> + 171720
    content:29   libdispatch.so                     0x00007fe6d8e07993 <unavailable> + 223635
    content:30   libpthread.so.0                    0x00007fe6d99e46db <unavailable> + 30427
    content:31   libc.so.6                          0x00007fe6d588f850 clone + 63
    content:Fatal error: UnsafeMutablePointer.initialize overlapping range: file /home/buildnode/jenkins/workspace/oss-swift-5.2-package-linux-ubuntu-18_04/swift/stdlib/public/core/UnsafePointer.swift, line 832
    content:Current stack trace:
    content:0    libswiftCore.so                    0x00007fdc837b5db0 swift_reportError + 50
    content:1    libswiftCore.so                    0x00007fdc83827f60 _swift_stdlib_reportFatalErrorInFile + 115
    content:2    libswiftCore.so                    0x00007fdc8353c5f5 <unavailable> + 1381877
    content:3    libswiftCore.so                    0x00007fdc8353c117 <unavailable> + 1380631
    content:4    libswiftCore.so                    0x00007fdc8353bde3 <unavailable> + 1379811
    content:5    libswiftCore.so                    0x00007fdc8353b750 _assertionFailure(_:_:file:line:flags:) + 525
    content:6    libswiftCore.so                    0x00007fdc8353bcb0 _fatalErrorMessage(_:_:file:line:flags:) + 44
    content:7    libswiftCore.so                    0x00007fdc83759e72 <unavailable> + 3599986
    content:8    PerfectTemplate                    0x000055ebe9e40388 <unavailable> + 992136
    content:9    PerfectTemplate                    0x000055ebe9ddb404 <unavailable> + 578564
    content:10   PerfectTemplate                    0x000055ebe9dd8862 <unavailable> + 567394
    content:11   PerfectTemplate                    0x000055ebe9dd79e3 <unavailable> + 563683
    content:12   PerfectTemplate                    0x000055ebe9dab64d <unavailable> + 382541
    content:13   PerfectTemplate                    0x000055ebe9e59098 <unavailable> + 1093784
    content:14   PerfectTemplate                    0x000055ebe9dc57c5 <unavailable> + 489413
    content:15   PerfectTemplate                    0x000055ebe9dc5da9 <unavailable> + 490921
    content:16   PerfectTemplate                    0x000055ebe9ddbeb4 <unavailable> + 581300
    content:17   PerfectTemplate                    0x000055ebe9e17159 <unavailable> + 823641
    content:18   PerfectTemplate                    0x000055ebe9e151bc <unavailable> + 815548
    content:19   PerfectTemplate                    0x000055ebe9e17d77 <unavailable> + 826743
    content:20   PerfectTemplate                    0x000055ebe9dd72d7 <unavailable> + 561879
    content:21   PerfectTemplate                    0x000055ebe9dd6e79 <unavailable> + 560761
    content:22   PerfectTemplate                    0x000055ebe9e4ddf9 <unavailable> + 1048057
    content:23   PerfectTemplate                    0x000055ebe9e14e50 <unavailable> + 814672
    content:24   PerfectTemplate                    0x000055ebe9e17bd7 <unavailable> + 826327
    content:25   PerfectTemplate                    0x000055ebe9ddbcc9 <unavailable> + 580809
    content:26   libdispatch.so                     0x00007fdc825e2487 <unavailable> + 140423
    content:27   libdispatch.so                     0x00007fdc825ea14a <unavailable> + 172362
    content:28   libdispatch.so                     0x00007fdc825e9ec8 <unavailable> + 171720
    content:29   libdispatch.so                     0x00007fdc825f6993 <unavailable> + 223635
    content:30   libpthread.so.0                    0x00007fdc831d36db <unavailable> + 30427
    content:31   libc.so.6                          0x00007fdc7f07f6e0 clone + 63
    content:Fatal error: UnsafeMutablePointer.initialize overlapping range: file /home/buildnode/jenkins/workspace/oss-swift-5.2-package-linux-ubuntu-18_04/swift/stdlib/public/core/UnsafePointer.swift, line 832
    content:Current stack trace:
    content:0    libswiftCore.so                    0x00007fbb8658edb0 swift_reportError + 50
    content:1    libswiftCore.so                    0x00007fbb86600f60 _swift_stdlib_reportFatalErrorInFile + 115
    content:2    libswiftCore.so                    0x00007fbb863155f5 <unavailable> + 1381877
    content:3    libswiftCore.so                    0x00007fbb86315117 <unavailable> + 1380631
    content:4    libswiftCore.so                    0x00007fbb86314de3 <unavailable> + 1379811
    content:5    libswiftCore.so                    0x00007fbb86314750 _assertionFailure(_:_:file:line:flags:) + 525
    content:6    libswiftCore.so                    0x00007fbb86314cb0 _fatalErrorMessage(_:_:file:line:flags:) + 44
    content:7    libswiftCore.so                    0x00007fbb86532e72 <unavailable> + 3599986
    content:8    PerfectTemplate                    0x00005568021bb388 <unavailable> + 992136
    content:9    PerfectTemplate                    0x0000556802156404 <unavailable> + 578564
    content:10   PerfectTemplate                    0x0000556802153862 <unavailable> + 567394
    content:11   PerfectTemplate                    0x00005568021529e3 <unavailable> + 563683
    content:12   PerfectTemplate                    0x000055680212664d <unavailable> + 382541
    content:13   PerfectTemplate                    0x00005568021d4098 <unavailable> + 1093784
    content:14   PerfectTemplate                    0x00005568021407c5 <unavailable> + 489413
    content:15   PerfectTemplate                    0x0000556802140da9 <unavailable> + 490921
    content:16   PerfectTemplate                    0x0000556802156eb4 <unavailable> + 581300
    content:17   PerfectTemplate                    0x0000556802192159 <unavailable> + 823641
    content:18   PerfectTemplate                    0x00005568021901bc <unavailable> + 815548
    content:19   PerfectTemplate                    0x0000556802192d77 <unavailable> + 826743
    content:20   PerfectTemplate                    0x00005568021522d7 <unavailable> + 561879
    content:21   PerfectTemplate                    0x0000556802151e79 <unavailable> + 560761
    content:22   PerfectTemplate                    0x00005568021c8df9 <unavailable> + 1048057
    content:23   PerfectTemplate                    0x000055680218fe50 <unavailable> + 814672
    content:24   PerfectTemplate                    0x0000556802192bd7 <unavailable> + 826327
    content:25   PerfectTemplate                    0x0000556802156cc9 <unavailable> + 580809
    content:26   libdispatch.so                     0x00007fbb853bb487 <unavailable> + 140423
    content:27   libdispatch.so                     0x00007fbb853c314a <unavailable> + 172362
    content:28   libdispatch.so                     0x00007fbb853c2ec8 <unavailable> + 171720
    content:29   libdispatch.so                     0x00007fbb853cf993 <unavailable> + 223635
    content:25   PerfectTemplate                    0x0000564fcaa38cc9 <unavailable> + 580809
    content:26   libdispatch.so                     0x00007f201bcb2487 <unavailable> + 140423
    content:27   libdispatch.so                     0x00007f201bcba14a <unavailable> + 172362
    content:28   libdispatch.so                     0x00007f201bcb9ec8 <unavailable> + 171720
    content:29   libdispatch.so                     0x00007f201bcc6993 <unavailable> + 223635
    content:30   libpthread.so.0                    0x00007f201c8a36db <unavailable> + 30427
    content:31   libc.so.6                          0x00007f201874f6e0 clone + 63
    

    --------UPDATE----------

    this request also trigger the bug.

    curl --location --request POST 'localhost:8181/emoji/parse?escapeVS=false&👨‍👩‍👧‍👦=b' \
    --header 'Content-Type: text/plain' \
    --data-raw '123xds'
    

    --------UPDATE----------

    Looks like a swift unicode bug on Linux?

    opened by hellomsg 1
  • Fatal Error When Idle

    Fatal Error When Idle "UnsafeMutablePointer.initialize overlapping range"

    I've built a listener server with Perfect HTTP, listening on certain routes for Webhooks called by GitLab on certain repository actions. The project is a work in progress and primarily for my own use, though it is public on https://gitlab.com/apricum/gitlab-listener.

    I'm starting the server through systemd via systemctl start and the likes. I've found it crashes after a seemingly random amount of time, sometimes a few hours, other times not even ten minutes. Reading the log with sudo journalctl -u gitlab-listener (where gitlab-listener is the name of the systemd service file), as follows:

    Apr 28 12:54:04 luxembourg-master systemd[1]: Started GitLab Listener.
    Apr 28 14:12:04 luxembourg-master GitLabListener[7000]: Fatal error: UnsafeMutablePointer.initialize overlapping range: file /home/buildnode/jenkins/workspace/oss-swift-5.2-package-linux-ubuntu-18_04/swift/stdlib/public/core/UnsafePointer.swift, line 832
    Apr 28 14:12:04 luxembourg-master GitLabListener[7000]: Current stack trace:
    Apr 28 14:12:04 luxembourg-master GitLabListener[7000]: 0    libswiftCore.so                    0x00007f2e15f01f90 swift_reportError + 50
    Apr 28 14:12:04 luxembourg-master GitLabListener[7000]: 1    libswiftCore.so                    0x00007f2e15f73a60 _swift_stdlib_reportFatalErrorInFile + 115
    Apr 28 14:12:04 luxembourg-master GitLabListener[7000]: 2    libswiftCore.so                    0x00007f2e15c88735 <unavailable> + 1382197
    Apr 28 14:12:04 luxembourg-master GitLabListener[7000]: 3    libswiftCore.so                    0x00007f2e15c88257 <unavailable> + 1380951
    Apr 28 14:12:04 luxembourg-master GitLabListener[7000]: 4    libswiftCore.so                    0x00007f2e15c87f23 <unavailable> + 1380131
    Apr 28 14:12:04 luxembourg-master GitLabListener[7000]: 5    libswiftCore.so                    0x00007f2e15c87890 _assertionFailure(_:_:file:line:flags:) + 525
    Apr 28 14:12:04 luxembourg-master GitLabListener[7000]: 6    libswiftCore.so                    0x00007f2e15c87df0 _fatalErrorMessage(_:_:file:line:flags:) + 44
    Apr 28 14:12:04 luxembourg-master GitLabListener[7000]: 7    libswiftCore.so                    0x00007f2e15ea5fb2 <unavailable> + 3600306
    Apr 28 14:12:04 luxembourg-master GitLabListener[7000]: 8    GitLabListener                     0x000055a3a662ac98 <unavailable> + 1043608
    Apr 28 14:12:04 luxembourg-master GitLabListener[7000]: 9    GitLabListener                     0x000055a3a65c1098 <unavailable> + 610456
    Apr 28 14:12:04 luxembourg-master GitLabListener[7000]: 10   GitLabListener                     0x000055a3a65c145b <unavailable> + 611419
    Apr 28 14:12:04 luxembourg-master GitLabListener[7000]: 11   GitLabListener                     0x000055a3a65bff02 <unavailable> + 605954
    Apr 28 14:12:04 luxembourg-master GitLabListener[7000]: 12   GitLabListener                     0x000055a3a656e210 <unavailable> + 270864
    Apr 28 14:12:04 luxembourg-master GitLabListener[7000]: 13   GitLabListener                     0x000055a3a65c1b83 <unavailable> + 613251
    Apr 28 14:12:04 luxembourg-master GitLabListener[7000]: 14   GitLabListener                     0x000055a3a65c1789 <unavailable> + 612233
    Apr 28 14:12:04 luxembourg-master GitLabListener[7000]: 15   GitLabListener                     0x000055a3a6638709 <unavailable> + 1099529
    Apr 28 14:12:04 luxembourg-master GitLabListener[7000]: 16   GitLabListener                     0x000055a3a65c1a9c <unavailable> + 613020
    Apr 28 14:12:04 luxembourg-master GitLabListener[7000]: 17   GitLabListener                     0x000055a3a66383b9 <unavailable> + 1098681
    Apr 28 14:12:04 luxembourg-master GitLabListener[7000]: 18   GitLabListener                     0x000055a3a66396e5 <unavailable> + 1103589
    Apr 28 14:12:04 luxembourg-master GitLabListener[7000]: 19   GitLabListener                     0x000055a3a663a5cc <unavailable> + 1107404
    Apr 28 14:12:04 luxembourg-master GitLabListener[7000]: 20   GitLabListener                     0x000055a3a6635dc2 <unavailable> + 1088962
    Apr 28 14:12:04 luxembourg-master GitLabListener[7000]: 21   GitLabListener                     0x000055a3a65c65d9 <unavailable> + 632281
    Apr 28 14:12:04 luxembourg-master GitLabListener[7000]: 22   libdispatch.so                     0x00007f2e14f35487 <unavailable> + 140423
    Apr 28 14:12:04 luxembourg-master GitLabListener[7000]: 23   libdispatch.so                     0x00007f2e14f3d14a <unavailable> + 172362
    Apr 28 14:12:04 luxembourg-master GitLabListener[7000]: 24   libdispatch.so                     0x00007f2e14f3cec8 <unavailable> + 171720
    Apr 28 14:12:04 luxembourg-master GitLabListener[7000]: 25   libdispatch.so                     0x00007f2e14f49993 <unavailable> + 223635
    Apr 28 14:12:04 luxembourg-master GitLabListener[7000]: 26   libpthread.so.0                    0x00007f2e1591f6db <unavailable> + 30427
    Apr 28 14:12:04 luxembourg-master GitLabListener[7000]: 27   libc.so.6                          0x00007f2e140e1850 clone + 63
    Apr 28 14:12:04 luxembourg-master systemd[1]: gitlab-listener.service: Main process exited, code=killed, status=4/ILL
    Apr 28 14:12:04 luxembourg-master systemd[1]: gitlab-listener.service: Failed with result 'signal'.
    
    opened by augustsaintfreytag 1
  • Help

    Help

    Hello everyone, I'm glad to learn how to use Perfect, but I encountered some problems. When I used Perfect Assistant to create an Empty Executable Project, I found that HTTPServer could not be dragged, and I was prompted "The Package.swift file could not be parsed", Is there a problem with my settings?

    image

    System: MacOS 10.15.3 Xcode: 11.3.1

    opened by CainLuo 0
Releases(v1.0.0)
Owner
PerfectlySoft Inc.
Server-side Swift
PerfectlySoft Inc.
Meet Corvus, the first strongly declarative server-side framework.

Corvus Corvus is the first truly declarative server-side framework for Swift. It provides a declarative, composable syntax which makes it easy to get

null 42 Jun 29, 2022
A Swift web framework and HTTP server.

A Swift Web Framework and HTTP Server Summary Kitura is a web framework and web server that is created for web services written in Swift. For more inf

Kitura 7.6k Dec 27, 2022
Lightweight library for web server applications in Swift on macOS and Linux powered by coroutines.

Why Zewo? • Support • Community • Contributing Zewo Zewo is a lightweight library for web applications in Swift. What sets Zewo apart? Zewo is not a w

Zewo 1.9k Dec 22, 2022
Swift HTTP server using the pre-fork worker model

Curassow Curassow is a Swift Nest HTTP Server. It uses the pre-fork worker model and it's similar to Python's Gunicorn and Ruby's Unicorn. It exposes

Kyle Fuller Archive 397 Oct 30, 2022
Super lightweight async HTTP server library in pure Swift runs in iOS / MacOS / Linux

Embassy Super lightweight async HTTP server in pure Swift. Please read: Embedded web server for iOS UI testing. See also: Our lightweight web framewor

Envoy 540 Dec 15, 2022
Tiny http server engine written in Swift programming language.

What is Swifter? Tiny http server engine written in Swift programming language. Branches * stable - lands on CocoaPods and others. Supports the latest

null 3.6k Jan 3, 2023
A Swift Multiplatform Single-threaded Non-blocking Web and Networking Framework

Serverside non-blocking IO in Swift Ask questions in our Slack channel! Lightning (formerly Edge) Node Lightning is an HTTP Server and TCP Client/Serv

SkyLab 316 Oct 6, 2022
Super lightweight web framework in Swift based on SWSGI

Ambassador Super lightweight web framework in Swift based on SWSGI Features Super lightweight Easy to use, designed for UI automatic testing API mocki

Envoy 170 Nov 15, 2022
Evented I/O streams for Swift

Noze.io "Das Haus das Verrückte macht." Noze.io is an attempt to carry over the Node.js ideas into pure Swift. It uses libdispatch for event-driven, n

The Noze Consortium 305 Oct 14, 2022
Server-side Swift. The Perfect core toolset and framework for Swift Developers. (For mobile back-end development, website and API development, and more…)

Perfect: Server-Side Swift 简体中文 Perfect: Server-Side Swift Perfect is a complete and powerful toolbox, framework, and application server for Linux, iO

PerfectlySoft Inc. 13.9k Jan 6, 2023
Server-side Swift. The Perfect core toolset and framework for Swift Developers. (For mobile back-end development, website and API development, and more…)

Perfect: Server-Side Swift 简体中文 Perfect: Server-Side Swift Perfect is a complete and powerful toolbox, framework, and application server for Linux, iO

PerfectlySoft Inc. 13.9k Dec 29, 2022
Virgil Core SDK allows developers to get up and running with Virgil Cards Service API quickly and add end-to-end security to their new or existing digital solutions to become HIPAA and GDPR compliant and more.

Virgil Core SDK Objective-C/Swift Introduction | SDK Features | Installation | Configure SDK | Usage Examples | Docs | Support Introduction Virgil Sec

Virgil Security, Inc. 27 Jul 26, 2022
A Slack API Client for the Perfect Server-Side Swift Framework

PerfectSlackAPIClient is an API Client to access the Slack API from your Perfect Server Side Swift application. It is build on top of PerfectAPIClient

Cap.雪ノ下八幡 2 Dec 1, 2019
surespot is a mobile messaging application that secures all messages using end-to-end encryption.

surespot-ios ios surespot client surespot is a mobile messaging application that secures all messages using end-to-end encryption. Contribute surespot

surespot 70 Jul 21, 2022
CloudKit, Apple’s remote data storage service, provides a possibility to store app data using users’ iCloud accounts as a back-end storage service.

CloudKit, Apple’s remote data storage service, provides a possibility to store app data using users’ iCloud accounts as a back-end storage service. He

Yalantis 252 Nov 4, 2022
JSON to Core Data and back. Swift Core Data Sync.

Notice: Sync was supported from it's creation back in 2014 until March 2021 Moving forward I won't be able to support this project since I'm no longer

Nes 2.5k Dec 31, 2022
Control your iPhone from inside Xcode for end-to-end testing.

Remote - Control your iPhone from Xcode "Remote" is a plugin for Xcode that allows you to control an iPhone from a window on your Mac during developme

John Holdsworth 791 Dec 26, 2022
Switchboard - easy and super light weight A/B testing for your mobile iPhone or android app. This mobile A/B testing framework allows you with minimal servers to run large amounts of mobile users.

Switchboard - easy A/B testing for your mobile app What it does Switchboard is a simple way to remote control your mobile application even after you'v

Keepsafe 287 Nov 19, 2022
From JSON to Core Data and back.

Groot Groot provides a simple way of serializing Core Data object graphs from or into JSON. It uses annotations in the Core Data model to perform the

Guille Gonzalez 533 Nov 3, 2022
Mobile, desktop and website Apps with the same code

Mobile, desktop and website Apps with the same code This project shows how the source code can be architectured to run on multiple devices. As of now,

Benoit VALLON 5.2k Jan 1, 2023