PerfectlySoft / Perfect

Server-side Swift. The Perfect core toolset and framework for Swift Developers. (For mobile back-end development, website and API development, and more…)
https://www.perfect.org
Apache License 2.0
13.84k stars 945 forks source link

Perfect with 3.0-Preview in Heroku #198

Open CharlesHarroch opened 8 years ago

CharlesHarroch commented 8 years ago

Hi,

I try to push my server in Heroku but i have a problem with a bad swift version. I create my project with documentation procedure : git clone https://github.com/PerfectlySoft/PerfectTemplate.git cd PerfectTemplate swift build

The build work fine with swiftenv set on 3.0

After, I've generate an Xcode project with this command line : swift package generate-xcodeproj

For upload to heroku, i have try this build pack : https://github.com/PerfectlySoft/Perfect-Heroku-Buildpack.git and i've this error :

Push rejected, failed to detect set buildpack https://github.com/PerfectlySoft/Perfect-Heroku-Buildpack.git

And with https://github.com/kylef/heroku-buildpack-swift.git :

remote: -----> Fetching set buildpack https://github.com/kylef/heroku-buildpack-swift.git... done remote: -----> Swift app detected remote: Cloning into 'swiftenv'... remote: -----> Installing DEVELOPMENT-SNAPSHOT-2016-04-12-a remote: Downloading https://swift.org/builds/development/ubuntu1404/swift-DEVELOPMENT-SNAPSHOT-2016-04-12-a/swift-DEVELOPMENT-SNAPSHOT-2016-04-12-a-ubuntu14.04.tar.gz remote: DEVELOPMENT-SNAPSHOT-2016-04-12-a has been installed. remote: -----> Installing clang-3.7.0 remote: -----> Building Package remote: Cloning https://github.com/PerfectlySoft/Perfect.git remote: Resolved version: 0.38.0 remote: Cloning https://github.com/PerfectlySoft/Perfect-Net.git remote: Resolved version: 0.11.0 remote: Cloning https://github.com/PerfectlySoft/Perfect-OpenSSL-Linux.git remote: Resolved version: 0.3.0 remote: /tmp/build_dfb396d0680b48eadf23ecc5211085bb/Packages/Perfect-OpenSSL-Linux/Package.swift:35:22: error: incorrect argument labels in call (have 'name:pkgConfig:providers:', expected 'name:targets:dependencies:') remote: let package = Package( remote: ^ remote: swift-build: error: The package at `/tmp/build_dfb396d0680b48eadf23ecc5211085bb/Packages/Perfect-OpenSSL-Linux' has no Package.swift for the specific version: 0.3.0 remote: remote: ! Push rejected, failed to compile Swift app

I've try to configure my .version-swift with 3.0-preview-1 and 3.0 but i've the same problem.

How i can upload my Prefect server with Swift-3.0-Preview-1 version in heroku ?

taplin commented 8 years ago

It looks like that buildpack is loading an old swift snapshot, so, that needs to be updated to specify the 3.0 preview, which is where Perfect master is currently building successfully.

I see that the build pack you are referencing uses swiftenv and allows for a .swiftversion file to specify which snapshot to use. you may want to try including that in your file structure as advised in the readme

You can also customise the version of Swift used with a .swift-version file in your repository:

$ cat .swift-version 2.2-SNAPSHOT-2015-12-01-b The .swift-version file is completely compatible with swiftenv http://github.com/kylef/swiftenv.

Hope that’s useful.

Tim Taplin

On Jun 24, 2016, at 6:28 AM, Charles Harroch notifications@github.com wrote:

Hi,

I try to push my server in Heroku but i have a problem with a bad swift version. I create my project with documentation procedure : git clone https://github.com/PerfectlySoft/PerfectTemplate.git cd PerfectTemplate swift build

The build work fine with swiftenv set on 3.0

After, I've generate an Xcode project with this command line : swift package generate-xcodeproj

For upload to heroku, i have try this build pack : https://github.com/PerfectlySoft/Perfect-Heroku-Buildpack.git x-msg://8/url and i've this error :

Push rejected, failed to detect set buildpack https://github.com/PerfectlySoft/Perfect-Heroku-Buildpack.git https://github.com/PerfectlySoft/Perfect-Heroku-Buildpack.git And with https://github.com/kylef/heroku-buildpack-swift.git x-msg://8/url :

remote: -----> Fetching set buildpack https://github.com/kylef/heroku-buildpack-swift.git https://github.com/kylef/heroku-buildpack-swift.git... done remote: -----> Swift app detected remote: Cloning into 'swiftenv'... remote: -----> Installing DEVELOPMENT-SNAPSHOT-2016-04-12-a remote: Downloading https://swift.org/builds/development/ubuntu1404/swift-DEVELOPMENT-SNAPSHOT-2016-04-12-a/swift-DEVELOPMENT-SNAPSHOT-2016-04-12-a-ubuntu14.04.tar.gz https://swift.org/builds/development/ubuntu1404/swift-DEVELOPMENT-SNAPSHOT-2016-04-12-a/swift-DEVELOPMENT-SNAPSHOT-2016-04-12-a-ubuntu14.04.tar.gz remote: DEVELOPMENT-SNAPSHOT-2016-04-12-a has been installed. remote: -----> Installing clang-3.7.0 remote: -----> Building Package remote: Cloning https://github.com/PerfectlySoft/Perfect.git https://github.com/PerfectlySoft/Perfect.git remote: Resolved version: 0.38.0 remote: Cloning https://github.com/PerfectlySoft/Perfect-Net.git https://github.com/PerfectlySoft/Perfect-Net.git remote: Resolved version: 0.11.0 remote: Cloning https://github.com/PerfectlySoft/Perfect-OpenSSL-Linux.git https://github.com/PerfectlySoft/Perfect-OpenSSL-Linux.git remote: Resolved version: 0.3.0 remote: /tmp/build_dfb396d0680b48eadf23ecc5211085bb/Packages/Perfect-OpenSSL-Linux/Package.swift:35:22: error: incorrect argument labels in call (have 'name:pkgConfig:providers:', expected 'name:targets:dependencies:') remote: let package = Package( remote: ^ remote: swift-build: error: The package at `/tmp/build_dfb396d0680b48eadf23ecc5211085bb/Packages/Perfect-OpenSSL-Linux' has no Package.swift for the specific version: 0.3.0 remote: remote: ! Push rejected, failed to compile Swift app

I've try to configure my .version-swift with 3.0-preview-1 and 3.0 but i've the same problem.

How i can upload my Prefect server with Swift-3.0-Preview-1 version in heroku ?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/PerfectlySoft/Perfect/issues/198, or mute the thread https://github.com/notifications/unsubscribe/AATZRlBEPFE8nTut3sWl2TcJt1uKBishks5qO81SgaJpZM4I9uM5.

iamjono commented 8 years ago

@CharlesHarroch can you let us know if this solves the issue? That way we can take appropriate action :) Thanks!

janhennings commented 8 years ago

Hi,

I have exactly the same problem as described in the first post. Changing the .swif-version resulted in:

-----> Fetching set buildpack https://github.com/kylef/heroku-buildpack-swift.git... Done -----> Swift app detected Cloning into 'swiftenv'... -----> Installing 3.0-PREVIEW-1 We don't have build instructions for 3.0-PREVIEW-1. ! Push rejected, failed to compile Swift app

CharlesHarroch commented 8 years ago

@iamjono No, this solution not resolve my problem. I've already try to update my .swift-version. I think we have a problem with buildpack and swiftenv who are not update for support swift-3.0-preview-1.

taplin commented 8 years ago

I’m working on updating the heroku build pack. It seems that the move to SPM has left all the current swift on Heroku build packs behind, and there’s some substantial issues with getting the dependencies for Perfect installed at the OS level. I hope to have something posted today that will get things moving and then work on a more flexible and useful solution.

Tim Taplin

On Jun 27, 2016, at 1:50 AM, Charles Harroch notifications@github.com wrote:

@iamjono https://github.com/iamjono No, this solution not resolve my problem. I've already try to update my .swift-version. I think we have a problem with buildpack and swiftenv who are not update for support swift-3.0-preview-1.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/PerfectlySoft/Perfect/issues/198#issuecomment-228676179, or mute the thread https://github.com/notifications/unsubscribe/AATZRrGYohky51eWrGVMfk4SOSo40UHEks5qP4C6gaJpZM4I9uM5.

iamjono commented 8 years ago

We're aware there are some issues with Heroku - @Sha0 is tasked to monster this - some of the restrictions Heroku places on package locations are an issue, if I understand the problem communicated to me correctly.

taplin commented 8 years ago

So, I know I posted this in Gitter last week, but I've updated to make sure it runs with the current linux preview, and wanted to make sure to post here as well.

A simple working version of Perfect on Heroku buildpack is available here: https://github.com/taplin/Perfect-Heroku-Buildpack on branch swift3_starting_point If you need additional dependencies, Mongoldb for example, you should be able to fork and add them to the list of apt-get install commands.

I know that Shao is working on a more comprehensive update and have passed along some of the things that I sorted out on this. This can be an interim update until that is available.