BASIC Developer & Support Resources > Compilers

Apple Swift on Ubuntu

<< < (8/9) > >>

John:
I was able to update the package tools version with this command.

swift package tools-version --set-current


Now I'm stuck resolving this.


--- Code: Bash ---pi@RPi4B:~/swift-dev/sqldemo $ swift build /home/pi/swift-dev/sqldemo: error: manifest parse error(s):/home/pi/swift-dev/sqldemo/Package.swift:7:10: error: type 'Package.Dependency' has no member 'Package'        .Package(url: "./Sqlite3", majorVersion: 1)        ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~pi@RPi4B:~/swift-dev/sqldemo $  

AIR:
I don't so Swift, and the original code I wrote is like 5 years old. A lot has changed since then.

Maybe do sqlite with: https://perfect.org/docs/SQLite.html

John:
Thanks AIR!

That link allowed me to build their getting started example package.

If seems that Swift doesn't waste anytime deprecating code.


--- Code: Bash ---pi@RPi4B:~/swift-dev $ mkdir  perfectpi@RPi4B:~/swift-dev $ cd perfectpi@RPi4B:~/swift-dev/perfect $ git clone https://github.com/PerfectlySoft/PerfectTemplate.gitCloning into 'PerfectTemplate'...remote: Enumerating objects: 3, done.remote: Counting objects: 100% (3/3), done.remote: Compressing objects: 100% (3/3), done.remote: Total 285 (delta 0), reused 1 (delta 0), pack-reused 282Receiving objects: 100% (285/285), 62.89 KiB | 2.62 MiB/s, done.Resolving deltas: 100% (141/141), done.pi@RPi4B:~/swift-dev/perfect $ cd PerfectTemplatepi@RPi4B:~/swift-dev/perfect/PerfectTemplate $ swift buildFetching https://github.com/PerfectlySoft/Perfect-HTTPServer.gitFetching https://github.com/PerfectlySoft/Perfect-Net.gitFetching https://github.com/PerfectlySoft/Perfect-HTTP.gitFetching https://github.com/PerfectlySoft/Perfect-CZlib-src.gitFetching https://github.com/PerfectlySoft/Perfect-Crypto.gitFetching https://github.com/PerfectlySoft/Perfect-LinuxBridge.gitFetching https://github.com/PerfectlySoft/Perfect-Thread.gitFetching https://github.com/PerfectlySoft/PerfectLib.gitFetching https://github.com/PerfectlySoft/Perfect-COpenSSL-Linux.gitCompleted resolution in 26.70sCloning https://github.com/PerfectlySoft/Perfect-HTTPServer.gitResolving https://github.com/PerfectlySoft/Perfect-HTTPServer.git at 3.0.23Cloning https://github.com/PerfectlySoft/Perfect-COpenSSL-Linux.gitResolving https://github.com/PerfectlySoft/Perfect-COpenSSL-Linux.git at 4.0.1Cloning https://github.com/PerfectlySoft/Perfect-Net.gitResolving https://github.com/PerfectlySoft/Perfect-Net.git at 3.3.0Cloning https://github.com/PerfectlySoft/Perfect-CZlib-src.gitResolving https://github.com/PerfectlySoft/Perfect-CZlib-src.git at 0.0.4Cloning https://github.com/PerfectlySoft/Perfect-HTTP.gitResolving https://github.com/PerfectlySoft/Perfect-HTTP.git at 3.3.0Cloning https://github.com/PerfectlySoft/Perfect-LinuxBridge.gitResolving https://github.com/PerfectlySoft/Perfect-LinuxBridge.git at 3.1.0Cloning https://github.com/PerfectlySoft/Perfect-Thread.gitResolving https://github.com/PerfectlySoft/Perfect-Thread.git at 3.0.7Cloning https://github.com/PerfectlySoft/PerfectLib.gitResolving https://github.com/PerfectlySoft/PerfectLib.git at 3.1.4Cloning https://github.com/PerfectlySoft/Perfect-Crypto.gitResolving https://github.com/PerfectlySoft/Perfect-Crypto.git at 3.2.0/home/pi/swift-dev/perfect/PerfectTemplate/.build/checkouts/PerfectLib/Sources/PerfectLib/Dir.swift:129:16: warning: 'readdir_r' is deprecated        return readdir_r(d, &dirEnt, endPtr)               ^/home/pi/swift-dev/perfect/PerfectTemplate/.build/checkouts/PerfectLib/Sources/PerfectLib/Dir.swift:129:16: warning: 'readdir_r' is deprecated        return readdir_r(d, &dirEnt, endPtr)               ^/home/pi/swift-dev/perfect/PerfectTemplate/.build/checkouts/PerfectLib/Sources/PerfectLib/Dir.swift:129:16: warning: 'readdir_r' is deprecated        return readdir_r(d, &dirEnt, endPtr)               ^/home/pi/swift-dev/perfect/PerfectTemplate/.build/checkouts/Perfect-Net/Sources/PerfectNet/NetUDP.swift:52:7: warning: variable 'a' was never mutated; consider changing to 'let' constant                var a = [UInt8](repeating: 0, count: count)                ~~~ ^                let/home/pi/swift-dev/perfect/PerfectTemplate/.build/checkouts/Perfect-Net/Sources/PerfectNet/NetTCPSSL.swift:219:42: warning: 'TLSv1_2_method()' is deprecated                case .tlsV1_2: newSslCtx = SSL_CTX_new(TLSv1_2_method())                                                       ^/home/pi/swift-dev/perfect/PerfectTemplate/.build/checkouts/Perfect-Net/Sources/PerfectNet/NetTCPSSL.swift:220:42: warning: 'TLSv1_1_method()' is deprecated                case .tlsV1_1: newSslCtx = SSL_CTX_new(TLSv1_1_method())                                                       ^/home/pi/swift-dev/perfect/PerfectTemplate/.build/checkouts/Perfect-Net/Sources/PerfectNet/NetTCPSSL.swift:221:40: warning: 'TLSv1_method()' is deprecated                case .tlsV1: newSslCtx = SSL_CTX_new(TLSv1_method())                                                     ^/home/pi/swift-dev/perfect/PerfectTemplate/.build/checkouts/Perfect-Net/Sources/PerfectNet/NetTCPSSL.swift:219:42: warning: 'TLSv1_2_method()' is deprecated                case .tlsV1_2: newSslCtx = SSL_CTX_new(TLSv1_2_method())                                                       ^/home/pi/swift-dev/perfect/PerfectTemplate/.build/checkouts/Perfect-Net/Sources/PerfectNet/NetTCPSSL.swift:220:42: warning: 'TLSv1_1_method()' is deprecated                case .tlsV1_1: newSslCtx = SSL_CTX_new(TLSv1_1_method())                                                       ^/home/pi/swift-dev/perfect/PerfectTemplate/.build/checkouts/Perfect-Net/Sources/PerfectNet/NetTCPSSL.swift:221:40: warning: 'TLSv1_method()' is deprecated                case .tlsV1: newSslCtx = SSL_CTX_new(TLSv1_method())                                                     ^/home/pi/swift-dev/perfect/PerfectTemplate/.build/checkouts/Perfect-HTTP/Sources/PerfectHTTP/HTTPHeaders.swift:41:15: warning: 'Hashable.hashValue' is deprecated as a protocol requirement; conform type 'HTTPRequestHeader.Name' to 'Hashable' by implementing 'hash(into:)' instead                        public var hashValue: Int {                                   ^/home/pi/swift-dev/perfect/PerfectTemplate/.build/checkouts/Perfect-HTTP/Sources/PerfectHTTP/HTTPHeaders.swift:242:15: warning: 'Hashable.hashValue' is deprecated as a protocol requirement; conform type 'HTTPResponseHeader.Name' to 'Hashable' by implementing 'hash(into:)' instead                        public var hashValue: Int {                                   ^/home/pi/swift-dev/perfect/PerfectTemplate/.build/checkouts/Perfect-HTTP/Sources/PerfectHTTP/HTTPMethod.swift:67:14: warning: 'Hashable.hashValue' is deprecated as a protocol requirement; conform type 'HTTPMethod' to 'Hashable' by implementing 'hash(into:)' instead                public var hashValue: Int {                           ^/home/pi/swift-dev/perfect/PerfectTemplate/.build/checkouts/Perfect-HTTP/Sources/PerfectHTTP/HTTPHeaders.swift:41:15: warning: 'Hashable.hashValue' is deprecated as a protocol requirement; conform type 'HTTPRequestHeader.Name' to 'Hashable' by implementing 'hash(into:)' instead                        public var hashValue: Int {                                   ^/home/pi/swift-dev/perfect/PerfectTemplate/.build/checkouts/Perfect-HTTP/Sources/PerfectHTTP/HTTPHeaders.swift:242:15: warning: 'Hashable.hashValue' is deprecated as a protocol requirement; conform type 'HTTPResponseHeader.Name' to 'Hashable' by implementing 'hash(into:)' instead                        public var hashValue: Int {                                   ^/home/pi/swift-dev/perfect/PerfectTemplate/.build/checkouts/Perfect-HTTP/Sources/PerfectHTTP/HTTPMethod.swift:67:14: warning: 'Hashable.hashValue' is deprecated as a protocol requirement; conform type 'HTTPMethod' to 'Hashable' by implementing 'hash(into:)' instead                public var hashValue: Int {                           ^/home/pi/swift-dev/perfect/PerfectTemplate/.build/checkouts/Perfect-HTTP/Sources/PerfectHTTP/HTTPHeaders.swift:41:15: warning: 'Hashable.hashValue' is deprecated as a protocol requirement; conform type 'HTTPRequestHeader.Name' to 'Hashable' by implementing 'hash(into:)' instead                        public var hashValue: Int {                                   ^/home/pi/swift-dev/perfect/PerfectTemplate/.build/checkouts/Perfect-HTTP/Sources/PerfectHTTP/HTTPHeaders.swift:242:15: warning: 'Hashable.hashValue' is deprecated as a protocol requirement; conform type 'HTTPResponseHeader.Name' to 'Hashable' by implementing 'hash(into:)' instead                        public var hashValue: Int {                                   ^/home/pi/swift-dev/perfect/PerfectTemplate/.build/checkouts/Perfect-HTTP/Sources/PerfectHTTP/HTTPMethod.swift:67:14: warning: 'Hashable.hashValue' is deprecated as a protocol requirement; conform type 'HTTPMethod' to 'Hashable' by implementing 'hash(into:)' instead                public var hashValue: Int {                           ^/home/pi/swift-dev/perfect/PerfectTemplate/.build/checkouts/Perfect-HTTP/Sources/PerfectHTTP/HTTPMethod.swift:67:14: warning: 'Hashable.hashValue' is deprecated as a protocol requirement; conform type 'HTTPMethod' to 'Hashable' by implementing 'hash(into:)' instead                public var hashValue: Int {                           ^/home/pi/swift-dev/perfect/PerfectTemplate/.build/checkouts/Perfect-HTTP/Sources/PerfectHTTP/HTTPMethod.swift:67:14: warning: 'Hashable.hashValue' is deprecated as a protocol requirement; conform type 'HTTPMethod' to 'Hashable' by implementing 'hash(into:)' instead                public var hashValue: Int {                           ^/home/pi/swift-dev/perfect/PerfectTemplate/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTP2/HTTP2Session.swift:73:7: warning: 'Hashable.hashValue' is deprecated as a protocol requirement; conform type 'HTTP2Session' to 'Hashable' by implementing 'hash(into:)' instead                var hashValue: Int { return Int(net.fd.fd) }                    ^/home/pi/swift-dev/perfect/PerfectTemplate/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTP2/HTTP2Session.swift:73:7: warning: 'Hashable.hashValue' is deprecated as a protocol requirement; conform type 'HTTP2Session' to 'Hashable' by implementing 'hash(into:)' instead                var hashValue: Int { return Int(net.fd.fd) }                    ^/home/pi/swift-dev/perfect/PerfectTemplate/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTP2/HTTP2Session.swift:73:7: warning: 'Hashable.hashValue' is deprecated as a protocol requirement; conform type 'HTTP2Session' to 'Hashable' by implementing 'hash(into:)' instead                var hashValue: Int { return Int(net.fd.fd) }                    ^/home/pi/swift-dev/perfect/PerfectTemplate/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTP2/HTTP2Session.swift:73:7: warning: 'Hashable.hashValue' is deprecated as a protocol requirement; conform type 'HTTP2Session' to 'Hashable' by implementing 'hash(into:)' instead                var hashValue: Int { return Int(net.fd.fd) }                    ^/home/pi/swift-dev/perfect/PerfectTemplate/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTP2/HTTP2Session.swift:73:7: warning: 'Hashable.hashValue' is deprecated as a protocol requirement; conform type 'HTTP2Session' to 'Hashable' by implementing 'hash(into:)' instead                var hashValue: Int { return Int(net.fd.fd) }                    ^/home/pi/swift-dev/perfect/PerfectTemplate/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTP2/HTTP2Session.swift:73:7: warning: 'Hashable.hashValue' is deprecated as a protocol requirement; conform type 'HTTP2Session' to 'Hashable' by implementing 'hash(into:)' instead                var hashValue: Int { return Int(net.fd.fd) }                    ^/home/pi/swift-dev/perfect/PerfectTemplate/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTP2/HTTP2Session.swift:73:7: warning: 'Hashable.hashValue' is deprecated as a protocol requirement; conform type 'HTTP2Session' to 'Hashable' by implementing 'hash(into:)' instead                var hashValue: Int { return Int(net.fd.fd) }                    ^/home/pi/swift-dev/perfect/PerfectTemplate/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTP2/HTTP2Session.swift:73:7: warning: 'Hashable.hashValue' is deprecated as a protocol requirement; conform type 'HTTP2Session' to 'Hashable' by implementing 'hash(into:)' instead                var hashValue: Int { return Int(net.fd.fd) }                    ^/home/pi/swift-dev/perfect/PerfectTemplate/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTP2/HTTP2Session.swift:73:7: warning: 'Hashable.hashValue' is deprecated as a protocol requirement; conform type 'HTTP2Session' to 'Hashable' by implementing 'hash(into:)' instead                var hashValue: Int { return Int(net.fd.fd) }                    ^/home/pi/swift-dev/perfect/PerfectTemplate/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTP2/HTTP2Session.swift:73:7: warning: 'Hashable.hashValue' is deprecated as a protocol requirement; conform type 'HTTP2Session' to 'Hashable' by implementing 'hash(into:)' instead                var hashValue: Int { return Int(net.fd.fd) }                    ^/home/pi/swift-dev/perfect/PerfectTemplate/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTP2/HTTP2Session.swift:73:7: warning: 'Hashable.hashValue' is deprecated as a protocol requirement; conform type 'HTTP2Session' to 'Hashable' by implementing 'hash(into:)' instead                var hashValue: Int { return Int(net.fd.fd) }                    ^/home/pi/swift-dev/perfect/PerfectTemplate/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTP2/HTTP2Session.swift:73:7: warning: 'Hashable.hashValue' is deprecated as a protocol requirement; conform type 'HTTP2Session' to 'Hashable' by implementing 'hash(into:)' instead                var hashValue: Int { return Int(net.fd.fd) }                    ^/home/pi/swift-dev/perfect/PerfectTemplate/.build/checkouts/Perfect-HTTPServer/Sources/PerfectHTTPServer/HTTP2/HTTP2Session.swift:73:7: warning: 'Hashable.hashValue' is deprecated as a protocol requirement; conform type 'HTTP2Session' to 'Hashable' by implementing 'hash(into:)' instead                var hashValue: Int { return Int(net.fd.fd) }                    ^[80/80] Linking PerfectTemplatepi@RPi4B:~/swift-dev/perfect/PerfectTemplate $ .build/debug/PerfectTemplate[INFO] Starting HTTP server localhost on :::8181 
This is the new format of the Package.swift file.


--- Code: Text ---import PackageDescription let package = Package(    name: "PerfectTemplate",    targets: [],    dependencies: [        .Package(url: "https://github.com/PerfectlySoft/Perfect-HTTPServer.git",            majorVersion: 3),        .Package(url: "https://github.com/PerfectlySoft/Perfect-Mustache.git",            majorVersion: 3)    ]) 

John:
AIR,

I don't seem to have a problem building packages from the PerfectSoft site. What isn't obvious is how to install them so when I run the test scripts it finds the package based on the IMPORT statement. I have searched the PerfectSoft site and Google and the topic seems to elude me.  :-\

I know you're not a Swift fan but your Apple roots give you a huge knowledge advantage,

A question I hear over and over on the RPi forum about Swift is can apps be built on the RPi and used on the iPhone?

Any guidance would be appreciated. I think I'm close to using Swift on the RPi.

John:
AIR,

I may have found the answer.


--- Quote ---Now that we’ve built and tested our command line tool, let’s install it to enable it to be run from anywhere on the command line. To do that, build the tool using the release configuration, and then move the compiled binary to /usr/local/bin:

$ swift build -c release
$ cd .build/release
$ cp -f CommandLineTool /usr/local/bin/commandlinetool

--- End quote ---

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version