Coder Social home page Coder Social logo

ibm-swift / swift-buildpack Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cloudfoundry-community/swift-buildpack

32.0 32.0 31.0 23.23 MB

IBM Cloud buildpack for Swift

License: BSD 3-Clause "New" or "Revised" License

Shell 31.65% Ruby 68.35%
bluemix buildpack cloud cloud-foundry deployment swift swift-package-manager

swift-buildpack's People

Contributors

bdhernand avatar briancroom avatar drnic avatar gee4vee avatar kylef avatar opiethehokie avatar pbohrer avatar rolivieri avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

swift-buildpack's Issues

Bug in curl 7.58 (shipped in 18.04) - workaround?

There's a bug in the version of curl (7.58) shipped with Ubuntu 18.04. Upon receiving a chunked response, curl will call back with each chunk of data twice, leading to data corruption (and a failure to parse the response). For more information, see Kitura/Kitura#1465. We're considering coding a workaround for this into Kitura-net, but it's far from straightforward.

We reported this to Ubuntu in June, in https://bugs.launchpad.net/ubuntu/+source/hdf5/+bug/1833198 - but no update is yet available for the 18.04 package.

In the meantime, is it possible to update the version of curl in the buildpack to 7.59 or later? This affects anyone trying to receive a chunked response, including users of Google OAuth or CouchDB / Cloudant, as both send chunked responses.

Explore possibility of using the command attribute in manifest.yml.

Just completed verifying this. This is certainly a viable option for stating how to execute the Swift application once it is provisioned. Details about the test conducted:

  • Used Kitura-Starter-Bluemix
  • Removed Procfile
  • Added command attribute to the manifest.yml file: command: Kitura-Starter-Bluemix

Application was successfully provisioned and started on Bluemix.

In addition to testing with Kitura-Starter-Bluemix, we also tested with the swift-helloworld app (estado branch):

  • command: Server -bind 0.0.0.0:$PORT

Using the above command instead of the Procfile also worked as successfully.

We will update our README accordingly.

Compiler freezes during docker image creation

Hi everyone! I stuck with an interesting problem. My application perfectly compiles and I can deploy it, but as soon as I add methods from one of the key class to my codable routes, the compiler freezes during the docker image creation. As far as I understand, the compiler compiles everything, regardless of the usage in the application logic. That means this class and its functionality is not an issue. Tried all Swift versions starting 5.0.2. Please find the project at [email protected]:chekanov/bridge.git or https://us-south.git.cloud.ibm.com/chekanov/bridge.git. Thank you in advance for your help!

BluePic incompatible with Bluemix Swift Buildpack

The Bluemix swift build pack on supports up to swift-DEVELOPMENT-SNAPSHOT-2016-06-06-a. See https://github.com/IBM-Swift/swift-buildpack.

However this sample requires DEVELOPMENT-SNAPSHOT-2016-06-20-a. See https://github.com/IBM-Swift/BluePic/blob/master/BluePic-Server/.swift-version#L1

Is there a way to run this on Bluemix?

When I follow the instructions here I get these errors
2016-08-09T10:32:17.23-0400 [STG/0] OUT -----> Installing Swift DEVELOPMENT-SNAPSHOT-2016-06-20-a
2016-08-09T10:32:17.32-0400 [STG/0] ERR DEPENDENCY_MISSING_IN_MANIFEST: 'swift-DEVELOPMENT-SNAPSHOT-2016-06-20-a.tar.gz'
2016-08-09T10:32:17.33-0400 [STG/0] OUT Staging failed: Buildpack compilation step failed
2016-08-09T10:32:17.50-0400 [API/1] ERR encountered error: App staging failed in the buildpack compile phase

Push to Bluemix fails

I created a Kitura App following the steps in Kitura. My app is running locally fine and even with Xcode. However, Pushing to Bluemix using this command

cf push <AppName>

I get this error.

-----> Installing Swift DEVELOPMENT-SNAPSHOT-2016-06-20-a
DEPENDENCY_MISSING_IN_MANIFEST: 'swift-DEVELOPMENT-SNAPSHOT-2016-06-20-a.tar.gz'
Staging failed: Buildpack compilation step failed

The full output of the command is:

Using manifest file /Users/omaralshammari/Development/IBM_Bluemix/UsedBooks/manifest.yml

Creating app UsedBooks in org <Email Address> / space Dev as <Email Address>...
OK

Creating route usedbooks-penitent-volution.mybluemix.net...
OK

Binding usedbooks-penitent-volution.mybluemix.net to UsedBooks...
OK

Uploading UsedBooks...
Uploading app files from: /Users/omaralshammari/Development/IBM_Bluemix/UsedBooks
Uploading 3.2K, 12 files
Done uploading               
OK

Starting app UsedBooks in org <Email Address> / space Dev as <Email Address>...
-----> Downloaded app package (4.0K)
-----> Installing system level dependencies...
-----> Installing libblocksruntime0_0.1-1_amd64.deb
-----> Installing libblocksruntime-dev_0.1-1_amd64.deb
-----> Installing libcurl3_7.35.0-1ubuntu2.6_amd64.deb
-----> Installing libkqueue0_1.0.4-2ubuntu1_amd64.deb
-----> Installing libssl-dev_1.0.1f-1ubuntu2.19_amd64.deb
-----> Installing openssl_1.0.1f-1ubuntu2.19_amd64.deb
-----> Writing profile script...
-----> Buildpack version 1.1.4
-----> Installing Swift DEVELOPMENT-SNAPSHOT-2016-06-20-a
DEPENDENCY_MISSING_IN_MANIFEST: 'swift-DEVELOPMENT-SNAPSHOT-2016-06-20-a.tar.gz'
Staging failed: Buildpack compilation step failed

FAILED
Error restarting application: BuildpackCompileFailed

manifest.yml file is:

applications:
- name: UsedBooks
  memory: 256M
  instances: 1
  random-route: true
  disk_quota: 1024M

Things to notice: I do not create CF App in Bluemix before pushing the app. Not sure if should I. However, After pushing the is created.

Parse Package.swift files to obtain apt-get dependencies.

As usual, let's create a separate branch off develop to work on this task.

See this url for more details: https://github.com/apple/swift-evolution/blob/7fcba970b88a5de3d302d291dc7bc9dfba0f9399/proposals/0063-swiftpm-system-module-search-paths.md

This implies writing code that parses all Package.swift files (the main one and the ones provided by each Swift package that the main app is dependent on).

Robert shared with us the following logic which should help with the implementation of this task:

egrep -R "Apt *\(" Packages/*/Package.swift | sed -e 's/^.*\.Apt *( *" *//' -e 's/".*$//' | xargs -n 1 sudo apt-get install -y

Support 16.04 Swift binaries

IBM Cloud has recently upgraded to use Ubuntu 16.04 cells. This buildpack should be updated accordingly to pull the 16.04 binaries for any requested Swift version instead of 14.04, as it currently does.

For next release, ensure that following swift versions are cached (see description).

Please note that some of these versions are already cached. Let's ensure that all versions listed below are included in the cached manifest:

swift-DEVELOPMENT-SNAPSHOT-2016-08-18-a
swift-DEVELOPMENT-SNAPSHOT-2016-08-07-a
swift-DEVELOPMENT-SNAPSHOT-2016-08-04-a
swift-DEVELOPMENT-SNAPSHOT-2016-07-25-a
swift-DEVELOPMENT-SNAPSHOT-2016-06-20-a
swift-DEVELOPMENT-SNAPSHOT-2016-05-09-a

Setup CI using Travis CI.

  • Automate testing of the master branch using Kitura-Starter-Bluemix and Bluemix (dallas region)
  • Time pushing the master branch of Kitura-Starter (https://github.com/IBM-Bluemix/Kitura-Starter) and Bluemix (dallas region). It should be no longer than X and Y respectively (X and Y being parameters to the Travis CI job).
  • Fail the build if the timing check fails.
  • Automate ZIP package creation, renaming ZIP package to meet requirements by UCD, automate creation of Git tag & release, and upload ZIP to GitHub under new release.
  • Create simple bash shell script for uploading/FTPing buildpack to GSA (this script will not live in this repo, we will put it under the DevOps repo) -> this would take a few parameters: github tag, GSA credentials. Script will download corresponding buildpack ZIP and upload it to GSA under the corresponding folder. Let's place this script here: https://github.com/IBM-Swift/DevOps/swift@ibm/master/scripts_assets/shell_assets/
  • Parameterize the loop count for executing cf push to Bluemix.

References:

Deferring for now (since it does seem feasible):

  • Automate installation of ZIP on bosh-lite and execute tests. Once this is implemented, we will re-order the execution of these in the travis file. For instance, we should create the release after the buildpack has been fully tested.

All of my apps are suddenly broken (OpenSSL issue?)

All of my apps on IBM Cloud suddenly stopped working. I am unable to restart them as my code no longer compiles.

Here's my output when I attempt to push the app again:

Staging app and tracing logs...
   Downloading swift_buildpack...
   Downloaded swift_buildpack
   Cell 93b00c5c-012c-4501-aa85-748d9f1b1064 creating container for instance 7520b7c8-e297-4c04-baba-43f5b89d04d2
   Cell 93b00c5c-012c-4501-aa85-748d9f1b1064 successfully created container for instance 7520b7c8-e297-4c04-baba-43f5b89d04d2
   Downloading app package...
   Downloaded app package (20.2M)
   -----> Buildpack version 2.1.0
   -----> Default supported Swift version is 5.0
   -----> Configure for apt-get installs...
   -----> Writing profile script...
   -----> Copying deb files to installation folder...
   -----> No Aptfile found.
   -----> Getting swift-4.2.4
   -----> WARNING: Default supported Swift version: swift-5.0
   -----> WARNING: Requested Swift version for your app: swift-4.2.4
          Cached swift-4.2.4
   -----> Unpacking swift-4.2.4.tar.gz
   -----> Getting clang-8.0.0
          Cached clang-8.0.0
   -----> Unpacking clang-8.0.0.tar.xz
   -----> .ssh directory and config file not found.
   -----> Skipping cache restore (disabled by config)
   -----> Fetching Swift packages and parsing Package.swift files...
          Fetching https://github.com/IBM-Swift/swift-html-entities
          Fetching https://github.com/kylef/Stencil.git
          Fetching https://github.com/IBM-Swift/HeliumLogger.git
          Fetching https://github.com/OpenKitten/CryptoKitten.git
          Fetching https://github.com/IBM-Swift/Kitura-TemplateEngine.git
          Fetching https://github.com/OpenKitten/BSON.git
          Fetching https://github.com/IBM-Swift/Configuration.git
          Fetching https://github.com/IBM-Swift/Kitura.git
          Fetching https://github.com/IBM-Swift/Kitura-Session.git
          Fetching https://github.com/OpenKitten/Schrodinger.git
          Fetching https://github.com/IBM-Swift/Kitura-Credentials.git
          Fetching https://github.com/IBM-Swift/Health.git
          Fetching https://github.com/IBM-Swift/Kitura-StencilTemplateEngine.git
          Fetching https://github.com/IBM-Swift/Kitura-CredentialsFacebook.git
          Fetching https://github.com/IBM-Swift/SwiftyRequest.git
          Fetching https://github.com/IBM-Swift/TypeDecoder.git
          Fetching https://github.com/IBM-Swift/CircuitBreaker.git
          Fetching https://github.com/kylef/PathKit.git
          Fetching https://github.com/IBM-Swift/BlueSSLService.git
          Fetching https://github.com/IBM-Swift/FileKit.git
          Fetching https://github.com/OpenKitten/MongoKitten.git
          Fetching https://github.com/IBM-Swift/BlueSocket.git
          Fetching https://github.com/IBM-Swift/LoggerAPI.git
          Fetching https://github.com/IBM-Swift/KituraContracts.git
          Fetching https://github.com/IBM-Swift/Kitura-net.git
          Fetching https://github.com/IBM-Swift/Swift-cfenv.git
          Fetching https://github.com/IBM-Swift/BlueCryptor.git
          Fetching https://github.com/OpenKitten/Cheetah.git
          Fetching https://github.com/kylef/Spectre.git
          Fetching https://github.com/IBM-Swift/BlueSignals.git
          Fetching https://github.com/IBM-Swift/OpenSSL.git
          Fetching https://github.com/OpenKitten/KittenCTLS.git
   Completed resolution in 16.32s
          Cloning https://github.com/IBM-Swift/Kitura-CredentialsFacebook.git
          Resolving https://github.com/IBM-Swift/Kitura-CredentialsFacebook.git at 2.2.3
          Cloning https://github.com/IBM-Swift/Configuration.git
          Resolving https://github.com/IBM-Swift/Configuration.git at 3.0.2
          Cloning https://github.com/IBM-Swift/HeliumLogger.git
          Resolving https://github.com/IBM-Swift/HeliumLogger.git at 1.8.0
          Cloning https://github.com/IBM-Swift/FileKit.git
          Resolving https://github.com/IBM-Swift/FileKit.git at 0.0.1
          Cloning https://github.com/kylef/Spectre.git
          Resolving https://github.com/kylef/Spectre.git at 0.9.0
          Cloning https://github.com/OpenKitten/Cheetah.git
          Resolving https://github.com/OpenKitten/Cheetah.git at 2.0.2
          Cloning https://github.com/IBM-Swift/BlueCryptor.git
          Resolving https://github.com/IBM-Swift/BlueCryptor.git at 1.0.23
          Cloning https://github.com/OpenKitten/MongoKitten.git
          Resolving https://github.com/OpenKitten/MongoKitten.git at 4.1.3
          Cloning https://github.com/IBM-Swift/Kitura-net.git
          Resolving https://github.com/IBM-Swift/Kitura-net.git at 2.1.6
          Cloning https://github.com/IBM-Swift/CircuitBreaker.git
          Resolving https://github.com/IBM-Swift/CircuitBreaker.git at 5.0.1
          Cloning https://github.com/IBM-Swift/Kitura-TemplateEngine.git
          Resolving https://github.com/IBM-Swift/Kitura-TemplateEngine.git at 2.0.0
          Cloning https://github.com/IBM-Swift/TypeDecoder.git
          Resolving https://github.com/IBM-Swift/TypeDecoder.git at 1.3.0
          Cloning https://github.com/kylef/PathKit.git
          Resolving https://github.com/kylef/PathKit.git at 0.9.2
          Cloning https://github.com/IBM-Swift/OpenSSL.git
          Resolving https://github.com/IBM-Swift/OpenSSL.git at 2.2.2
          Cloning https://github.com/IBM-Swift/swift-html-entities
          Resolving https://github.com/IBM-Swift/swift-html-entities at 3.0.10
          Cloning https://github.com/IBM-Swift/Kitura.git
          Resolving https://github.com/IBM-Swift/Kitura.git at 2.6.0
          Cloning https://github.com/kylef/Stencil.git
          Resolving https://github.com/kylef/Stencil.git at 0.13.1
          Cloning https://github.com/IBM-Swift/Health.git
          Resolving https://github.com/IBM-Swift/Health.git at 1.0.4
          Cloning https://github.com/OpenKitten/BSON.git
          Resolving https://github.com/OpenKitten/BSON.git at 5.2.4
          Cloning https://github.com/OpenKitten/CryptoKitten.git
          Resolving https://github.com/OpenKitten/CryptoKitten.git at 0.2.3
          Cloning https://github.com/IBM-Swift/Swift-cfenv.git
          Resolving https://github.com/IBM-Swift/Swift-cfenv.git at 6.0.2
          Cloning https://github.com/IBM-Swift/BlueSignals.git
          Resolving https://github.com/IBM-Swift/BlueSignals.git at 1.0.20
          Cloning https://github.com/IBM-Swift/Kitura-Credentials.git
          Resolving https://github.com/IBM-Swift/Kitura-Credentials.git at 2.3.1
          Cloning https://github.com/IBM-Swift/BlueSSLService.git
          Resolving https://github.com/IBM-Swift/BlueSSLService.git at 1.0.44
          Cloning https://github.com/OpenKitten/KittenCTLS.git
          Resolving https://github.com/OpenKitten/KittenCTLS.git at 1.0.1
          Cloning https://github.com/IBM-Swift/Kitura-StencilTemplateEngine.git
          Resolving https://github.com/IBM-Swift/Kitura-StencilTemplateEngine.git at 1.11.0
          Cloning https://github.com/IBM-Swift/SwiftyRequest.git
          Resolving https://github.com/IBM-Swift/SwiftyRequest.git at 2.0.3
          Cloning https://github.com/IBM-Swift/BlueSocket.git
          Resolving https://github.com/IBM-Swift/BlueSocket.git at 1.0.44
          Cloning https://github.com/OpenKitten/Schrodinger.git
          Resolving https://github.com/OpenKitten/Schrodinger.git at 1.0.1
          Cloning https://github.com/IBM-Swift/KituraContracts.git
          Resolving https://github.com/IBM-Swift/KituraContracts.git at 1.1.1
          Cloning https://github.com/IBM-Swift/Kitura-Session.git
          Resolving https://github.com/IBM-Swift/Kitura-Session.git at 3.3.0
          Cloning https://github.com/IBM-Swift/LoggerAPI.git
          Resolving https://github.com/IBM-Swift/LoggerAPI.git at 1.8.0
   -----> Additional packages to download: openssl
   -----> openssl is already installed.
   -----> No additional packages to download.
   -----> Skipping installation of App Management (debug)
   -----> Installing system level dependencies...
   -----> Building Package...
   -----> Build config: release
   warning: PackageDescription API v3 is deprecated and will be removed in the future; used by package(s): MongoKitten, KittenCTLS, Schrodinger, CryptoKitten, Cheetah, BSON, HTMLEntities
          Compile CHTTPParser utils.c
          Compile CHTTPParser http_parser.c
          Compile Swift Module 'LoggerAPI' (1 sources)
          Compile Swift Module 'TypeDecoder' (2 sources)
          Compile Swift Module 'Socket' (3 sources)
          Compile Swift Module 'Signals' (1 sources)
          Compile Swift Module 'Schrodinger' (1 sources)
          Compile Swift Module 'PathKit' (1 sources)
          Compile Swift Module 'KituraTemplateEngine' (1 sources)
          Compile Swift Module 'KituraContracts' (9 sources)
          Compile Swift Module 'HeliumLogger' (2 sources)
          Compile Swift Module 'Stencil' (20 sources)
          Compile Swift Module 'SSLService' (2 sources)
          Compile Swift Module 'Health' (3 sources)
          Compile Swift Module 'HTMLEntities' (4 sources)
          Compile Swift Module 'KituraNet' (36 sources)
          Compile Swift Module 'FileKit' (1 sources)
          Compile Swift Module 'Cryptor' (11 sources)
          Compile Swift Module 'KituraStencil' (1 sources)
          Compile Swift Module 'CryptoKitten' (10 sources)
          Compile Swift Module 'Configuration' (5 sources)
          Compile Swift Module 'Kitura' (52 sources)
          Compile Swift Module 'CircuitBreaker' (10 sources)
          Compile Swift Module 'Cheetah' (7 sources)
          /tmp/app/.build/checkouts/CryptoKitten.git--8745850272021827022/Sources/CryptoKitten/Helpers.swift:3:61: warning: 'IndexDistance' is deprecated: all index distances are now of type Int
          extension Swift.Collection where Iterator.Element == UInt8, IndexDistance == Int {
                                                                      ^
          /tmp/app/.build/checkouts/CryptoKitten.git--8745850272021827022/Sources/CryptoKitten/Helpers.swift:3:75: warning: neither type in same-type constraint ('Self.IndexDistance' (aka 'Int') or 'Int') refers to a generic parameter or associated type
          extension Swift.Collection where Iterator.Element == UInt8, IndexDistance == Int {
                                                                      ~~~~~~~~~~~~~ ^  ~~~
          /tmp/app/.build/checkouts/CryptoKitten.git--8745850272021827022/Sources/CryptoKitten/Helpers.swift:3:61: warning: 'IndexDistance' is deprecated: all index distances are now of type Int
          extension Swift.Collection where Iterator.Element == UInt8, IndexDistance == Int {
                                                                      ^
          /tmp/app/.build/checkouts/CryptoKitten.git--8745850272021827022/Sources/CryptoKitten/Helpers.swift:3:61: warning: 'IndexDistance' is deprecated: all index distances are now of type Int
          extension Swift.Collection where Iterator.Element == UInt8, IndexDistance == Int {
                                                                      ^
          Compile Swift Module 'CloudFoundryEnv' (6 sources)
          Compile Swift Module 'BSON' (21 sources)
          Compile Swift Module 'SwiftyRequest' (10 sources)
          /tmp/app/.build/checkouts/Cheetah.git--346028729905725053/Sources/Cheetah/Codable.swift:655:43: warning: 'flatMap' is deprecated: Please use compactMap(_:) for the case where closure returns an optional value
                  return decoder.target.object.keys.flatMap { Key(stringValue: $0) }
                                                    ^
          /tmp/app/.build/checkouts/Cheetah.git--346028729905725053/Sources/Cheetah/Codable.swift:655:43: note: use 'compactMap(_:)' instead
                  return decoder.target.object.keys.flatMap { Key(stringValue: $0) }
                                                    ^~~~~~~
                                                    compactMap
          /tmp/app/.build/checkouts/Cheetah.git--346028729905725053/Sources/Cheetah/Parser.swift:219:47: warning: 'characters' is deprecated: Please use String or Substring directly
                      if negate && autoNegate && prefix.characters.first != "-" {
                                                        ^
          /tmp/app/.build/checkouts/Cheetah.git--346028729905725053/Sources/Cheetah/Parser.swift:231:26: warning: 'characters' is deprecated: Please use String or Substring directly
                      guard number.characters.count > 0 else {
                                   ^
          /tmp/app/.build/checkouts/Cheetah.git--346028729905725053/Sources/Cheetah/Value.swift:103:24: warning: 'characters' is deprecated: Please use String or Substring directly
                          if str.characters.count == 1 {
                                 ^
          /tmp/app/.build/checkouts/Cheetah.git--346028729905725053/Sources/Cheetah/Value.swift:170:26: warning: 'flatMap' is deprecated: Please use compactMap(_:) for the case where closure returns an optional value
                  let array = self.flatMap { value -> CheetahValue? in
                                   ^
          /tmp/app/.build/checkouts/Cheetah.git--346028729905725053/Sources/Cheetah/Value.swift:170:26: note: use 'compactMap(_:)' instead
                  let array = self.flatMap { value -> CheetahValue? in
                                   ^~~~~~~
                                   compactMap
          /tmp/app/.build/checkouts/BSON.git--6126586813750914861/Sources/BSON/DeserializationHelpers.swift:3:104: warning: 'IndexDistance' is deprecated: all index distances are now of type Int
          internal func fromBytes<T, S : Collection>(_ bytes: S) throws -> T where S.Iterator.Element == Byte, S.IndexDistance == Int {
                                                                                                                 ^
          /tmp/app/.build/checkouts/BSON.git--6126586813750914861/Sources/BSON/Document+Subscripts.swift:242:54: warning: 'characters' is deprecated: Please use String or Substring directly
                      position = stringPosition + newValue.key.characters.count + 1
                                                               ^
          /tmp/app/.build/checkouts/BSON.git--6126586813750914861/Sources/BSON/ObjectId.swift:76:25: warning: 'characters' is deprecated: Please use String or Substring directly
                  guard hexString.characters.count == 24 else {
                                  ^
          /tmp/app/.build/checkouts/BSON.git--6126586813750914861/Sources/BSON/ObjectId.swift:82:29: warning: 'characters' is deprecated: Please use String or Substring directly
                  var gen = hexString.characters.makeIterator()
                                      ^
          Compile Swift Module 'MongoSocket' (2 sources)
          Compile Swift Module 'GeoJSON' (11 sources)
          Compile Swift Module 'ExtendedJSON' (2 sources)
          /tmp/app/.build/checkouts/MongoKitten.git-8286272547337349665/Sources/MongoSocket/Socket.swift:32:49: error: use of undeclared type 'SSL'
              private let sslClient: UnsafeMutablePointer<SSL>?
                                                          ^~~
          /tmp/app/.build/checkouts/MongoKitten.git-8286272547337349665/Sources/MongoSocket/Socket.swift:33:42: error: use of undeclared type 'SSL_METHOD'
              private let sslMethod: UnsafePointer<SSL_METHOD>?
                                                   ^~~~~~~~~~
          /tmp/app/.build/checkouts/MongoKitten.git-8286272547337349665/Sources/MongoSocket/Socket.swift:34:50: error: use of undeclared type 'SSL_CTX'
              private let sslContext: UnsafeMutablePointer<SSL_CTX>?
                                                           ^~~~~~~
          /tmp/app/.build/checkouts/MongoKitten.git-8286272547337349665/Sources/MongoSocket/Socket.swift:217:21: error: use of unresolved identifier 'SSL_library_init'
                              SSL_library_init()
                              ^~~~~~~~~~~~~~~~
          /tmp/app/.build/checkouts/MongoKitten.git-8286272547337349665/Sources/MongoSocket/Socket.swift:218:21: error: use of unresolved identifier 'SSL_load_error_strings'; did you mean 'ERR_lib_error_string'?
                              SSL_load_error_strings()
                              ^~~~~~~~~~~~~~~~~~~~~~
                              ERR_lib_error_string
          KittenCTLS.ERR_lib_error_string:1:13: note: 'ERR_lib_error_string' declared here
          public func ERR_lib_error_string(_ e: UInt) -> UnsafePointer<Int8>!
                      ^
          /tmp/app/.build/checkouts/MongoKitten.git-8286272547337349665/Sources/MongoSocket/Socket.swift:219:21: warning: 'OPENSSL_config' is deprecated
                              OPENSSL_config(nil)
                              ^
          /tmp/app/.build/checkouts/MongoKitten.git-8286272547337349665/Sources/MongoSocket/Socket.swift:220:21: error: use of unresolved identifier 'OPENSSL_add_all_algorithms_conf'
                              OPENSSL_add_all_algorithms_conf()
                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          /tmp/app/.build/checkouts/MongoKitten.git-8286272547337349665/Sources/MongoSocket/Socket.swift:224:30: error: use of unresolved identifier 'SSLv23_client_method'
                          let method = SSLv23_client_method()
                                       ^~~~~~~~~~~~~~~~~~~~
          KittenCTLS.DTLS_client_method:1:13: note: did you mean 'DTLS_client_method'?
          public func DTLS_client_method() -> OpaquePointer!
                      ^
          KittenCTLS.DTLSv1_client_method:2:13: note: did you mean 'DTLSv1_client_method'?
          public func DTLSv1_client_method() -> OpaquePointer!
                      ^
          KittenCTLS.TLS_client_method:1:13: note: did you mean 'TLS_client_method'?
          public func TLS_client_method() -> OpaquePointer!
                      ^
          KittenCTLS.TLSv1_client_method:2:13: note: did you mean 'TLSv1_client_method'?
          public func TLSv1_client_method() -> OpaquePointer!
                      ^
          /tmp/app/.build/checkouts/MongoKitten.git-8286272547337349665/Sources/MongoSocket/Socket.swift:234:35: error: use of unresolved identifier 'SSL_CTRL_OPTIONS'
                          SSL_CTX_ctrl(ctx, SSL_CTRL_OPTIONS, SSL_OP_NO_SSLv2 | SSL_OP_NO_SSLv3 | SSL_OP_NO_COMPRESSION, nil)
                                            ^~~~~~~~~~~~~~~~
          KittenCTLS.SSL_CTRL_CHAIN:1:12: note: did you mean 'SSL_CTRL_CHAIN'?
          public var SSL_CTRL_CHAIN: Int32 { get }
                     ^
          KittenCTLS.SSL_CTRL_SET_MTU:1:12: note: did you mean 'SSL_CTRL_SET_MTU'?
          public var SSL_CTRL_SET_MTU: Int32 { get }
                     ^
   error: terminated(1): /tmp/cache/final/swift-4.2.4/swift-4.2.4-RELEASE-ubuntu18.04/usr/bin/swift-build-tool -f /tmp/app/.build/release.yaml main output:
       
   Failed to compile droplet: Failed to compile droplet: exit status 1
   Exit status 223
   Cell 93b00c5c-012c-4501-aa85-748d9f1b1064 stopping instance 7520b7c8-e297-4c04-baba-43f5b89d04d2
   Cell 93b00c5c-012c-4501-aa85-748d9f1b1064 destroying container for instance 7520b7c8-e297-4c04-baba-43f5b89d04d2
Error staging application: App staging failed in the buildpack compile phase
FAILED

This app worked fine until this morning.

Revisit caching logic.

I executed many tests in the last two days to test the changes in the https://github.com/pbohrer/swift-buildpack#develop branch. Here’s the outcome, which is very similar to the findings from the tests we executed several weeks ago (which are documented at #7).

  1. The https://github.com/pbohrer/swift-buildpack#develop branch not only caches the Packages folder but also the swift and clang tar files. I had already tested adding these tar files to the CACHE_DIR but this has a negative impact on the execution time. It takes longer saving these tar files in the CACHE_DIR and restoring them again than re-downloadng them again.

  2. Let’s go over the test results:

Branch: https://github.com/pbohrer/swift-buildpack#develop
New push of swift_helloworld
Avg. execution time: 156 secs
Branch: https://github.com/pbohrer/swift-buildpack#develop
Re-push of swift_helloworld
Avg. execution time: 125 secs
Branch: https://github.com/IBM-Swift/swift-buildpack#develop (no caching at all)
New push of swift_helloworld
Avg. execution time: 135 secs
Branch: https://github.com/IBM-Swift/swift-buildpack#develop (no caching at all)
Re-push of swift_helloworld
Avg. execution time: 135 secs

Given these numbers, I modified the logic in the https://github.com/pbohrer/swift-buildpack#develop and morphed it into this new branch: https://github.com/IBM-Swift/swift-buildpack.git#packages_caching_v3. This branch caches only the Packages folder and removes any tars and unpacked tars from the CACHE_DIR folder (hence, it does re-download the tar files):

Branch: https://github.com/IBM-Swift/swift-buildpack.git#packages_caching_v3
New push of swift_helloworld
Avg execution time: 130 secs
Branch: https://github.com/IBM-Swift/swift-buildpack.git#packages_caching_v3
Re-push of swift_helloworld
Avg execution time: 121 secs

Here we see an improvement when executing a re-push. There is certainly a performance gain when caching the Packages folder. Given these numbers, my plan is to merge packages_caching_v3 into the develop branch. In other words, we plan to only cache the Packages folder (not the tars).

  1. I also re-tested the behavior of SPM in regards to downloading a new version of a Swift Package if it becomes available. For instance, say there is a Swift Package that was tagged as 1.7.0. Say also that we cache this version (1.7.0) of the Package. Then say a few hours later v1.7.1 of that same Package is made available. In this scenario, since we are caching the Packages folder, the application will not get v1.7.1… they are still at 1.7.0 (SPM will not download v1.7.1). For the app to use v1.7.1 of that Package, the developer will need to do the following:
cf set-env swift-helloworld SWIFT_PACKAGES_CACHE false
cf restage swift-helloworld

And then enable caching again:

cf set-env swift-helloworld SWIFT_PACKAGES_CACHE true
cf restage swift-helloworld

The dependency graph could not be satisfied

Hello

I created pre-built sample project via IBM Cloud Tools for swift.
Then I have uploaded project "cf push zixzelz", and In the during uploading I have an error:

MacBook-Pro-Ruslan:zixzelz Ruslan$ cf push zixzelz
Using manifest file /Users/Ruslan/Documents/Projects/ibm-bluemix/zixzelz/manifest.yml

Updating app zixzelz in org [email protected] / space My as [email protected]...
OK

Uploading zixzelz...
Uploading app files from: /Users/Ruslan/Documents/Projects/ibm-bluemix/zixzelz/BluePic-Server
Uploading 102.6K, 50 files
Done uploading               
OK
Binding service BluePic-Cloudant to app zixzelz in org [email protected] / space My as [email protected]...
OK
Binding service BluePic-Object-Storage to app zixzelz in org [email protected] / space My as [email protected]...
OK
Binding service BluePic-Mobile-Client-Access to app zixzelz in org [email protected] / space My as [email protected]...
OK
Binding service BluePic-IBM-Push to app zixzelz in org [email protected] / space My as [email protected]...
OK
Binding service BluePic-Insights-for-Weather to app zixzelz in org [email protected] / space My as [email protected]...
OK
Binding service BluePic-Alchemy to app zixzelz in org [email protected] / space My as [email protected]...
OK

Stopping app zixzelz in org [email protected] / space My as [email protected]...
OK

Starting app zixzelz in org [email protected] / space My as [email protected]...
-----> Downloaded app package (44K)
Cloning into '/tmp/buildpacks/swift-buildpack'...
-----> Installing system level dependencies...
-----> Installing libblocksruntime0_0.1-1_amd64.deb
-----> Installing libblocksruntime-dev_0.1-1_amd64.deb
-----> Installing libcurl3_7.35.0-1ubuntu2.6_amd64.deb
-----> Installing libkqueue0_1.0.4-2ubuntu1_amd64.deb
-----> Installing libssl-dev_1.0.1f-1ubuntu2.19_amd64.deb
-----> Installing openssl_1.0.1f-1ubuntu2.19_amd64.deb
-----> No Aptfile found.
-----> Writing profile script...
-----> Buildpack version 1.1.6
-----> Installing Swift DEVELOPMENT-SNAPSHOT-2016-06-20-a
       Downloaded Swift
-----> Installing Clang 3.7.0
       Downloaded Clang
-----> Building Package...
-----> Adding libdispatch binaries...
       Cloning https://github.com/IBM-Swift/Kitura.git
       HEAD is now at 65ae28c Updated to new version.
       Resolved version: 0.22.0
       Cloning https://github.com/IBM-Swift/Kitura-net.git
       HEAD is now at d87f8fd Tuning and Cleanup of FastCGI Code (#51)
       Resolved version: 0.22.2
       Cloning https://github.com/IBM-Swift/Kitura-sys.git
       HEAD is now at d1f7ffb IBM-Swift/Kitura#617 Add back Kitura-Build
       Resolved version: 0.22.0
       Cloning https://github.com/IBM-Swift/LoggerAPI.git
       HEAD is now at 9b30704 Merge pull request #8 from tkhuran/develop
       Resolved version: 0.8.0
       Cloning https://github.com/IBM-Swift/BlueSocket.git
       HEAD is now at 20e506d Merge branch 'master' of github.com:IBM-Swift/BlueSocket
       Resolved version: 0.6.2
       Cloning https://github.com/IBM-Swift/CCurl.git
       HEAD is now at 3330699 Removed use of pkgConfig and added system declaration
       Resolved version: 0.2.1
       Cloning https://github.com/IBM-Swift/CHTTPParser.git
       HEAD is now at 41daabb IBM-Swift/Kitura#365 Removed references to code installed externally and the pkgConfig file that is no longer needed.
       Resolved version: 0.1.1
       Cloning https://github.com/IBM-Swift/SwiftyJSON.git
       HEAD is now at 1eec775 Added Package info
       Resolved version: 10.0.2
       Cloning https://github.com/IBM-Swift/Kitura-TemplateEngine.git
       HEAD is now at 1fe55ef Merge remote-tracking branch 'origin/develop'
       Resolved version: 0.16.0
       Cloning https://github.com/IBM-Swift/Kitura-CouchDB.git
       HEAD is now at 851d049 Updated to new version.
       Resolved version: 0.22.0
       Cloning https://github.com/IBM-Swift/HeliumLogger.git
       HEAD is now at 967db14 Migration 0620 (#14)
       Resolved version: 0.12.0
       HEAD is now at b0f6595 Updates to README.
       Resolved version: 1.4.0
       Cloning https://github.com/ibm-bluemix-mobile-services/bluemix-objectstorage-swift-sdk.git
       HEAD is now at f020bc8 Merge pull request #7 from ibm-bluemix-mobile-services/development
       Resolved version: 0.5.0
       Cloning https://github.com/ibm-bluemix-mobile-services/bluemix-simple-http-client-swift.git
       HEAD is now at 4bb9175 Merge branch 'development'
       Resolved version: 0.4.2
       Cloning https://github.com/ibm-bluemix-mobile-services/bluemix-simple-logger-swift.git
       HEAD is now at 11a0adc Feature/update to june 20 snapshot (#1)
       Resolved version: 0.3.0
swift-build: error: The dependency graph could not be satisfied (https://github.com/IBM-Swift/Kitura-net.git)
Staging failed: Buildpack compilation step failed

FAILED
Error restarting application: BuildpackCompileFailed

TIP: use 'cf logs zixzelz --recent' for more information

Could you help me resolve that issue?

Multiple private repositories

Hi, I'm trying to build a Kitura project with the Swift-Buildpack on the IBM Cloud Foundry. My server is having multiple private repositories as dependencies (model, db, etc.), and even if I can access all of them individually, I cannot make it work with more than one at the time.
I'm using the .ssh approach with all the repositories on Github. All the dependencies repository have their own deployment key, and I've double checked that I can access them with that key.
The config file syntax is a bit obscure, and it could really be the issue. So far it looks like something like that:

Host private_repository_dependency
    HostName github.com
    User git
    IdentityFile ~/.ssh/dependency_1

Host private_repository_dependency_2
    HostName github.com
    User git
    IdentityFile ~/.ssh/dependency_2

where HostName is always Github as the repositories are hosted there. and Host is the name of the repository itself (the dependency name). I've tried with other names, with the same result.

For reference, the error is always like that:

 error: Failed to clone [email protected]:User/private_repository_dependency.git:
       Cloning into bare repository '/tmp/app/.build/repositories/private_repository_dependency-e222c161'...
       [email protected]: Permission denied (publickey).
   fatal: Could not read from remote repository.
       Please make sure you have the correct access rights
       and the repository exists.
   Failed to compile droplet: Failed to compile droplet: exit status 1

What am I doing wrong here? Thanks for your help.

Disk Quota Exceeded

18.04 runs into Disk Quota Exceeded errors during Copying binaries to 'bin' phase.

Tried raising disk space with no change.

Using:
buildpack: https://github.com/IBM-Swift/swift-buildpack#2.2.0
stack: cflinuxfs3

Dependencies example which can cause this issue:
dependencies: [
.package(url: "https://github.com/IBM-Swift/Kitura.git", .upToNextMinor(from: "2.8.1")),
.package(url: "https://github.com/IBM-Swift/HeliumLogger.git", .upToNextMajor(from: "1.9.0")),
.package(url: "https://github.com/IBM-Swift/CloudEnvironment.git", .upToNextMajor(from: "9.1.0")),
.package(url: "https://github.com/IBM-Swift/Health.git", .upToNextMajor(from: "1.0.5")),
.package(url: "https://github.com/IBM-Swift/SwiftyRequest.git", .upToNextMajor(from: "3.0.0")),
.package(url: "https://github.com/IBM-Swift/Kitura-OpenAPI.git", from: "1.3.0"),
.package(url: "https://github.com/RuntimeTools/SwiftMetrics.git", .upToNextMajor(from: "2.6.4")),
.package(url: "https://github.com/ianpartridge/swift-backtrace", .upToNextMajor(from: "1.1.1"))
]

Swift 4.1 support

Swift 4.1 is nearing public release and the BuildPack will need to be updated to support 4.1 when it becomes available. Xcode 9.3 will ship with the 4.1 binaries, and is available today as a developer beta.

Test using Windows.

Test completed and few minor code changes made to the buildpack code.

See following PR for further details: #46

Update custom swift version message.


WARNING: You are requesting a custom version of Swift (defined in .swift-version)
WARNING: Default supported Swift version : {SUPPORTED_SWIFT_VERSION}
WARNING: Custom Swift version in your app: {CUSTOM_SWIFT_VERISON}
WARNING: The buildpack will attempt to download requested version from Swift.org


Add support to pass in env variables to enable deployment of Kitura NIO apps

We need to add support to pass through environment variables to the swift-buildpack when performing swift package resolve, as currently we can't use Cloud Foundry to deploy a Kitura app to IBM Cloud which uses Kitura-NIO.

This is because to run on top of Kitura-NIO (instead of Kitura-Net) you need to set an environment variable called KITURA_NIO before building your Kitura application, e.g. export KITURA_NIO=1 && swift build

So we need to find a way to end up with export KITURA_NIO && swift package resolve set if the user has a Kitura application which they want to run with Kitura-NIO.

Include a more recent Swift Runtime.

The latest version of swift supported by swift-buildpack is dev-2016-05-03a. This leaves me stuck at fixing my dependencies to e.g. Kitura 0.16.x and SwiftyJSON 7.0.x.

It would be easier to keep up with the development of these projects if I wouldn't be stuck on dev-2016-05-03a.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.