Git Product home page Git Product logo

heroku-buildpack's Issues

Bundle.module does not find resources after deployment

I would like to host the documentation I've created using Apple's DocC compiler on heroku. To do this, my server needs access to a doccarchive folder. I declared this folder as a resource in my pacakge.swift file as shown below:

.target(
    name: "VaporDocC",
    dependencies: [
        .product(name: "Vapor", package: "vapor"),
    ],
    resources: [
        .copy("SpotifyWebAPI.doccarchive")
    ]
),

When I run my app from Xcode, I am able to access this folder. However, when I deploy my app to heroku, it crashes because it cannot find this folder.

How do I make resources accessible by my app on vapor Heroku?

No such file or directory

I was able to push to Heroku yesterday. Today it fails. Any idea how to fix this?

remote: -----> Swift app detected
remote: Cloning into 'swiftenv'...
remote: Swift 3 Heroku Installer
remote: πŸ”’  Version: 3.1.1
remote: πŸ–₯  Operating System: ubuntu1404
remote: πŸ“¦ Installing Swiftenv
remote: Cloning into '/app/.swiftenv'...
remote: 🐦 Installing Swift
remote: Downloading https://swift.org/builds/swift-3.1.1-release/ubuntu1604/swift-3.1.1-RELEASE/swift-3.1.1-RELEASE-ubuntu16.04.tar.gz
remote: /tmp/swiftenv-3.1.1- /tmp/build_f43964271d1da30f8d0dc96de4382c71
remote:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
remote:                                  Dload  Upload   Total   Spent    Left  Speed
remote: 100  117M  100  117M    0     0  8571k      0  0:00:13  0:00:13 --:--:-- 8919k
remote: /tmp/build_f43964271d1da30f8d0dc96de4382c71
remote: 3.1.1 has been installed.
remote: βœ…  Done
remote: precompile
remote: -----> Building Package ... this will take a while
remote: Fetching https://github.com/vapor/vapor.git
remote: Fetching https://github.com/vapor/fluent-provider.git
remote: Fetching https://github.com/vapor/auth-provider.git
remote: Fetching https://github.com/vapor/postgresql-provider.git
remote: Fetching https://github.com/vapor/sqlite.git
remote: Fetching https://github.com/vapor/sockets.git
remote: Fetching https://github.com/vapor-community/postgresql.git
remote: Fetching https://github.com/vapor/json.git
remote: Fetching https://github.com/vapor-community/cpostgresql.git
remote: Fetching https://github.com/vapor/multipart.git
remote: Fetching https://github.com/vapor/ctls.git
remote: Fetching https://github.com/vapor/core.git
remote: Fetching https://github.com/vapor/console.git
remote: Fetching https://github.com/vapor/crypto.git
remote: Fetching https://github.com/vapor/tls.git
remote: Fetching https://github.com/vapor/debugging.git
remote: Fetching https://github.com/vapor/engine.git
remote: Fetching https://github.com/vapor/bits.git
remote: Fetching https://github.com/vapor/random.git
remote: Fetching https://github.com/vapor/auth.git
remote: Fetching https://github.com/vapor/bcrypt.git
remote: Fetching https://github.com/vapor/postgresql-driver.git
remote: Fetching https://github.com/vapor/fluent.git
remote: Fetching https://github.com/vapor/node.git
remote: Fetching https://github.com/vapor/routing.git
remote: Cloning https://github.com/vapor/core.git
remote: Resolving https://github.com/vapor/core.git at 2.1.2
remote: Cloning https://github.com/vapor/sqlite.git
remote: Resolving https://github.com/vapor/sqlite.git at 2.1.0
remote: Cloning https://github.com/vapor-community/postgresql.git
remote: Resolving https://github.com/vapor-community/postgresql.git at 2.0.2
remote: Cloning https://github.com/vapor/ctls.git
remote: Resolving https://github.com/vapor/ctls.git at 1.1.2
remote: Cloning https://github.com/vapor/bits.git
remote: Resolving https://github.com/vapor/bits.git at 1.1.0
remote: Cloning https://github.com/vapor/debugging.git
remote: Resolving https://github.com/vapor/debugging.git at 1.1.0
remote: Cloning https://github.com/vapor/multipart.git
remote: Resolving https://github.com/vapor/multipart.git at 2.1.0
remote: Cloning https://github.com/vapor/console.git
remote: Resolving https://github.com/vapor/console.git at 2.2.0
remote: Cloning https://github.com/vapor/routing.git
remote: Resolving https://github.com/vapor/routing.git at 2.1.0
remote: Cloning https://github.com/vapor/auth-provider.git
remote: Resolving https://github.com/vapor/auth-provider.git at 1.1.0
remote: Cloning https://github.com/vapor/auth.git
remote: Resolving https://github.com/vapor/auth.git at 1.1.0
remote: Cloning https://github.com/vapor/bcrypt.git
remote: Resolving https://github.com/vapor/bcrypt.git at 1.1.0
remote: Cloning https://github.com/vapor-community/cpostgresql.git
remote: Resolving https://github.com/vapor-community/cpostgresql.git at 2.0.0
remote: Cloning https://github.com/vapor/sockets.git
remote: Resolving https://github.com/vapor/sockets.git at 2.1.0
remote: Cloning https://github.com/vapor/json.git
remote: Resolving https://github.com/vapor/json.git at 2.2.0
remote: Cloning https://github.com/vapor/node.git
remote: Resolving https://github.com/vapor/node.git at 2.1.1
remote: Cloning https://github.com/vapor/postgresql-driver.git
remote: Resolving https://github.com/vapor/postgresql-driver.git at 2.0.1
remote: Cloning https://github.com/vapor/random.git
remote: Resolving https://github.com/vapor/random.git at 1.2.0
remote: Cloning https://github.com/vapor/crypto.git
remote: Resolving https://github.com/vapor/crypto.git at 2.1.1
remote: Cloning https://github.com/vapor/postgresql-provider.git
remote: Resolving https://github.com/vapor/postgresql-provider.git at 2.0.0
remote: Cloning https://github.com/vapor/engine.git
remote: Resolving https://github.com/vapor/engine.git at 2.2.1
remote: Cloning https://github.com/vapor/vapor.git
remote: Resolving https://github.com/vapor/vapor.git at 2.2.2
remote: Cloning https://github.com/vapor/fluent.git
remote: Resolving https://github.com/vapor/fluent.git at 2.3.0
remote: Cloning https://github.com/vapor/tls.git
remote: Resolving https://github.com/vapor/tls.git at 2.1.1
remote: Cloning https://github.com/vapor/fluent-provider.git
remote: Resolving https://github.com/vapor/fluent-provider.git at 1.1.1
remote: note: you may be able to install ctls using your system-packager:
remote: 
remote:     apt-get install ctls
remote: 
remote: note: you may be able to install ctls using your system-packager:
remote: 
remote:     apt-get install ctls
remote: 
remote: note: you may be able to install ctls using your system-packager:
remote: 
remote:     apt-get install ctls
remote: 
remote: note: you may be able to install ctls using your system-packager:
remote: 
remote:     apt-get install ctls
remote: 
remote: note: you may be able to install ctls using your system-packager:
remote: 
remote:     apt-get install ctls
remote: 
remote: note: you may be able to install ctls using your system-packager:
remote: 
remote:     apt-get install ctls
remote: 
remote: note: you may be able to install ctls using your system-packager:
remote: 
remote:     apt-get install ctls
remote: 
remote: note: you may be able to install ctls using your system-packager:
remote: 
remote:     apt-get install ctls
remote: 
remote: note: you may be able to install ctls using your system-packager:
remote: 
remote:     apt-get install ctls
remote: 
remote: note: you may be able to install ctls using your system-packager:
remote: 
remote:     apt-get install ctls
remote: 
remote: note: you may be able to install ctls using your system-packager:
remote: 
remote:     apt-get install ctls
remote: 
remote: note: you may be able to install ctls using your system-packager:
remote: 
remote:     apt-get install ctls
remote: 
remote: note: you may be able to install ctls using your system-packager:
remote: 
remote:     apt-get install ctls
remote: 
remote: note: you may be able to install ctls using your system-packager:
remote: 
remote:     apt-get install ctls
remote: 
remote: note: you may be able to install ctls using your system-packager:
remote: 
remote:     apt-get install ctls
remote: 
remote: note: you may be able to install ctls using your system-packager:
remote: 
remote:     apt-get install ctls
remote: 
remote: note: you may be able to install ctls using your system-packager:
remote: 
remote:     apt-get install ctls
remote: 
remote: note: you may be able to install ctls using your system-packager:
remote: 
remote:     apt-get install ctls
remote: 
remote: note: you may be able to install ctls using your system-packager:
remote: 
remote:     apt-get install ctls
remote: 
remote: note: you may be able to install ctls using your system-packager:
remote: 
remote:     apt-get install ctls
remote: 
remote: note: you may be able to install ctls using your system-packager:
remote: 
remote:     apt-get install ctls
remote: 
remote: note: you may be able to install ctls using your system-packager:
remote: 
remote:     apt-get install ctls
remote: 
remote: note: you may be able to install ctls using your system-packager:
remote: 
remote:     apt-get install ctls
remote: 
remote: note: you may be able to install ctls using your system-packager:
remote: 
remote:     apt-get install ctls
remote: 
remote: note: you may be able to install ctls using your system-packager:
remote: 
remote:     apt-get install ctls
remote: 
remote: note: you may be able to install ctls using your system-packager:
remote: 
remote:     apt-get install ctls
remote: 
remote: Compile Swift Module 'Debugging' (1 sources)
remote: Compile Swift Module 'Bits' (19 sources)
remote: Compile Swift Module 'libc' (1 sources)
remote: Compile Swift Module 'Core' (23 sources)
remote: Compile Swift Module 'Random' (6 sources)
remote: Compile Swift Module 'Transport' (10 sources)
remote: Compile Swift Module 'Console' (35 sources)
remote: Compile Swift Module 'PathIndexable' (2 sources)
remote: Compile Swift Module 'Node' (38 sources)
remote: Compile Swift Module 'Sockets' (22 sources)
remote: Compile Swift Module 'Crypto' (13 sources)
remote: Compile Swift Module 'BCrypt' (9 sources)
remote: Compile Swift Module 'TLS' (12 sources)
remote: Compile CSQLite sqlite3.c
remote: Compile Swift Module 'JSON' (9 sources)
remote: Compile Swift Module 'PostgreSQL' (12 sources)
remote: Compile CHTTP http_parser.c
remote: Compile Swift Module 'SMTP' (21 sources)
remote: Linking CHTTP
remote: Compile Swift Module 'URI' (6 sources)
remote: Compile Swift Module 'HTTP' (45 sources)
remote: Compile Swift Module 'WebSockets' (14 sources)
remote: Compile Swift Module 'Cookies' (11 sources)
remote: Compile Swift Module 'Branches' (3 sources)
remote: Compile Swift Module 'Multipart' (6 sources)
remote: Compile Swift Module 'Routing' (10 sources)
remote: Compile Swift Module 'FormData' (4 sources)
remote: Linking CSQLite
remote: Compile Swift Module 'SQLite' (3 sources)
remote: Compile Swift Module 'Cache' (2 sources)
remote: Compile Swift Module 'Configs' (13 sources)
remote: Compile Swift Module 'Sessions' (7 sources)
remote: Compile Swift Module 'Fluent' (70 sources)
remote: Compile Swift Module 'Vapor' (97 sources)
remote: Compile Swift Module 'FluentTester' (16 sources)
remote: Compile Swift Module 'PostgreSQLDriver' (4 sources)
remote: Compile Swift Module 'Authentication' (10 sources)
remote: Compile Swift Module 'Authorization' (3 sources)
remote: Compile Swift Module 'Testing' (6 sources)
remote: Compile Swift Module 'FluentProvider' (19 sources)
remote: Compile Swift Module 'AuthProvider' (10 sources)
remote: Compile Swift Module 'PostgreSQLProvider' (5 sources)
remote: Compile Swift Module 'App' (10 sources)
remote: Compile Swift Module 'Run' (1 sources)
remote: Linking ./.build/release/Run
remote: -----> Installing dynamic libraries
remote: find: β€˜/tmp/build_f43964271d1da30f8d0dc96de4382c71/.build/x86_64-unknown-linux/release’: No such file or directory
remote:  !     Push rejected, failed to compile Swift app.
remote: 
remote:  !     Push failed

Error while using swift 5

Was feeling a bit adventures and set my .swift-version-file to 5.0. The build goes through, but on launch I get the following error

heroku[web] notice Starting process with command `Run serve --env production --hostname 0.0.0.0 --port 35944`
heroku[web] notice Process exited with status 127
app[web] error Run: error while loading shared libraries: libicui18nswift.so.61: cannot open shared object file: No such file or directory

Using Vapor3 with Postgres and all dependencies bumped to latest versions

Heroku build fails

Hey!
Do you have any idea, why my build fails? It fails on different libs any time i'd like to deploy it to heroku. The error log does not say anything useful.
Thanks!
Here is the log:

Counting objects: 1241, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (882/882), done.
Writing objects: 100% (1241/1241), 911.43 KiB | 4.34 MiB/s, done.
Total 1241 (delta 572), reused 468 (delta 209)
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> Swift app detected
remote: -----> Installing clang 5.0.0
remote: -----> Installing swiftenv
remote: Cloning into 'swiftenv'...
remote: -----> Installing Swift 4.1.2
remote: Downloading https://swift.org/builds/swift-4.1.2-release/ubuntu1604/swift-4.1.2-RELEASE/swift-4.1.2-RELEASE-ubuntu16.04.tar.gz
remote: /tmp/swiftenv-4.1.2- ~/tmp/buildpacks/2db5e06b2426c8778ade338f27d60743ddf42f45cb2e38e7cf3b2511145bc4400ce84a93ddec59b96a39485d2c2394c4c489c7fc98a2d0faa3515f3c90da67a9
remote:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
remote:                                  Dload  Upload   Total   Spent    Left  Speed
remote: 100  171M  100  171M    0     0  8510k      0  0:00:20  0:00:20 --:--:-- 9161k
remote: ~/tmp/buildpacks/2db5e06b2426c8778ade338f27d60743ddf42f45cb2e38e7cf3b2511145bc4400ce84a93ddec59b96a39485d2c2394c4c489c7fc98a2d0faa3515f3c90da67a9
remote: 4.1.2 has been installed.
remote: -----> Building package (release configuration)
remote: Compile CNIOAtomics src/c-atomics.c
remote: Compile CNIOSHA1 c_nio_sha1.c
remote: Compile CNIOLinux shim.c
remote: Compile CNIOLinux ifaddrs-android.c
remote: Compile CNIODarwin shim.c
remote: Compile CNIOZlib empty.c
remote: Compile CNIOHTTPParser c_nio_http_parser.c
remote: Compile CNIOOpenSSL shims.c
remote: Compile CNIOOpenSSL helpers.c
remote: Compile CCryptoOpenSSL shim.c
remote: Compile CBcrypt blf.c
remote: Compile CBcrypt bcrypt.c
remote: Compile CBase32 base32.c
remote: Compile Swift Module 'NIOPriorityQueue' (2 sources)
remote: Compile Swift Module 'Debugging' (3 sources)
remote: Compile Swift Module 'COperatingSystem' (1 sources)
remote: Compile Swift Module 'NIOConcurrencyHelpers' (2 sources)
remote: Compile Swift Module 'NIO' (55 sources)
remote: Compile Swift Module 'NIOTLS' (3 sources)
remote: Compile Swift Module 'NIOHTTP1' (9 sources)
remote: Compile Swift Module 'NIOFoundationCompat' (1 sources)
remote: Compile Swift Module 'Bits' (12 sources)
remote: Compile Swift Module 'Async' (15 sources)
remote: Compile Swift Module 'NIOOpenSSL' (15 sources)
remote: Compile Swift Module 'Random' (4 sources)
remote: Compile Swift Module 'Core' (25 sources)
remote: /tmp/build_022abe05b7761ccd00d3bd45b0fbccb9/.build/checkouts/swift-nio-ssl.git-574086289262766763/Sources/NIOOpenSSL/OpenSSLHandler.swift:270:35: warning: 'changeCapacity(to:)' is deprecated: changeCapacity has been replaced by reserveCapacity
remote:                     receiveBuffer.changeCapacity(to: receiveBuffer.capacity + 1024)
remote:                                   ^
remote: Compile Swift Module 'NIOWebSocket' (9 sources)
remote: Compile Swift Module 'HTTP' (25 sources)
remote: Compile Swift Module 'Crypto' (19 sources)
remote: Compile Swift Module 'Validation' (18 sources)
remote: Compile Swift Module 'URLEncodedForm' (8 sources)
remote: Compile Swift Module 'Service' (20 sources)
remote: Compile Swift Module 'Multipart' (8 sources)
remote: Compile Swift Module 'Logging' (4 sources)
remote: Compile Swift Module 'WebSocket' (6 sources)
remote: Compile Swift Module 'TemplateKit' (41 sources)
remote: Compile Swift Module 'Routing' (12 sources)
remote: Compile Swift Module 'DatabaseKit' (30 sources)
remote: Compile Swift Module 'Console' (27 sources)
remote: Compile Swift Module 'SQL' (59 sources)
remote: Compile Swift Module 'Command' (16 sources)
remote: Compile Swift Module 'Vapor' (75 sources)
remote: Compile Swift Module 'Fluent' (49 sources)
remote: Compile Swift Module 'PostgreSQL' (72 sources)
remote: Compile Swift Module 'FluentSQL' (9 sources)
remote: Compile Swift Module 'VaporTestTools' (16 sources)
remote: /tmp/build_022abe05b7761ccd00d3bd45b0fbccb9/.build/checkouts/VaporTestTools.git--4928636270379599054/Sources/VaporTestTools/Extensions/Requests/HTTPRequest+Response.swift:10:29: error: module 'NIO' was not compiled for testing
remote: @_exported @testable import NIO
remote:                             ^
remote: /tmp/build_022abe05b7761ccd00d3bd45b0fbccb9/.build/checkouts/VaporTestTools.git--4928636270379599054/Sources/VaporTestTools/Extensions/Response tools/Response+Checks.swift:9:18: error: module 'Vapor' was not compiled for testing
remote: @testable import Vapor
remote:                  ^
remote: /tmp/build_022abe05b7761ccd00d3bd45b0fbccb9/.build/checkouts/VaporTestTools.git--4928636270379599054/Sources/VaporTestTools/Extensions/Response tools/Response+Checks.swift:10:18: error: module 'NIO' was not compiled for testing
remote: @testable import NIO
remote:                  ^
remote: /tmp/build_022abe05b7761ccd00d3bd45b0fbccb9/.build/checkouts/VaporTestTools.git--4928636270379599054/Sources/VaporTestTools/Extensions/Response tools/Response+Debug.swift:9:18: error: module 'Vapor' was not compiled for testing
remote: @testable import Vapor
remote:                  ^
remote: /tmp/build_022abe05b7761ccd00d3bd45b0fbccb9/.build/checkouts/VaporTestTools.git--4928636270379599054/Sources/VaporTestTools/Extensions/Response tools/Response+Getters.swift:9:18: error: module 'Vapor' was not compiled for testing
remote: @testable import Vapor
remote:                  ^
remote: /tmp/build_022abe05b7761ccd00d3bd45b0fbccb9/.build/checkouts/VaporTestTools.git--4928636270379599054/Sources/VaporTestTools/Extensions/Response tools/Response+Getters.swift:10:18: error: module 'NIO' was not compiled for testing
remote: @testable import NIO
remote:                  ^
remote: /tmp/build_022abe05b7761ccd00d3bd45b0fbccb9/.build/checkouts/VaporTestTools.git--4928636270379599054/Sources/VaporTestTools/Extensions/Services/Services+Testing.swift:9:18: error: module 'Service' was not compiled for testing
remote: @testable import Service
remote:                  ^
remote: error: terminated(1): /app/tmp/cache/heroku-16/swiftenv/versions/4.1.2/usr/bin/swift-build-tool -f /tmp/build_022abe05b7761ccd00d3bd45b0fbccb9/.build/release.yaml main output:
remote:     
remote: 
remote: Fetching https://github.com/vapor/multipart.git
remote: Fetching https://github.com/vapor/crypto.git
remote: Fetching https://github.com/vapor/http.git
remote: Fetching https://github.com/vapor/core.git
remote: Fetching https://github.com/vapor/postgresql.git
remote: Fetching https://github.com/apple/swift-nio.git
remote: Fetching https://github.com/vapor/database-kit.git
remote: Fetching https://github.com/vapor/service.git
remote: Fetching https://github.com/vapor/sql.git
remote: Fetching https://github.com/vapor/websocket.git
remote: Fetching https://github.com/vapor/vapor.git
remote: Fetching https://github.com/vapor/fluent-postgresql
remote: Fetching https://github.com/vapor/fluent.git
remote: Fetching https://github.com/vapor/url-encoded-form.git
remote: Fetching https://github.com/vapor/auth.git
remote: Fetching https://github.com/apple/swift-nio-zlib-support.git
remote: Fetching https://github.com/vapor/routing.git
remote: Fetching https://github.com/vapor/console.git
remote: Fetching https://github.com/apple/swift-nio-ssl.git
remote: Fetching https://github.com/vapor/template-kit.git
remote: Fetching https://github.com/twof/VaporMailgunService.git
remote: Fetching https://github.com/apple/swift-nio-ssl-support.git
remote: Fetching https://github.com/vapor/validation.git
remote: Fetching https://github.com/LiveUI/VaporTestTools.git
remote: Cloning https://github.com/apple/swift-nio.git
remote: Resolving https://github.com/apple/swift-nio.git at 1.10.0
remote: Cloning https://github.com/vapor/core.git
remote: Resolving https://github.com/vapor/core.git at 3.4.4
remote: Cloning https://github.com/vapor/sql.git
remote: Resolving https://github.com/vapor/sql.git at 2.2.0
remote: Cloning https://github.com/vapor/websocket.git
remote: Resolving https://github.com/vapor/websocket.git at 1.1.0
remote: Cloning https://github.com/vapor/fluent-postgresql
remote: Resolving https://github.com/vapor/fluent-postgresql at 1.0.0
remote: Cloning https://github.com/vapor/url-encoded-form.git
remote: Resolving https://github.com/vapor/url-encoded-form.git at 1.0.5
remote: Cloning https://github.com/vapor/auth.git
remote: Resolving https://github.com/vapor/auth.git at 2.0.1
remote: Cloning https://github.com/apple/swift-nio-zlib-support.git
remote: Resolving https://github.com/apple/swift-nio-zlib-support.git at 1.0.0
remote: Cloning https://github.com/apple/swift-nio-ssl.git
remote: Resolving https://github.com/apple/swift-nio-ssl.git at 1.3.2
remote: Cloning https://github.com/vapor/template-kit.git
remote: Resolving https://github.com/vapor/template-kit.git at 1.1.0
remote: Cloning https://github.com/LiveUI/VaporTestTools.git
remote: Resolving https://github.com/LiveUI/VaporTestTools.git at master
remote: Cloning https://github.com/apple/swift-nio-ssl-support.git
remote: Resolving https://github.com/apple/swift-nio-ssl-support.git at 1.0.0
remote: Cloning https://github.com/vapor/multipart.git
remote: Resolving https://github.com/vapor/multipart.git at 3.0.2
remote: Cloning https://github.com/vapor/crypto.git
remote: Resolving https://github.com/vapor/crypto.git at 3.3.0
remote: Cloning https://github.com/vapor/http.git
remote: Resolving https://github.com/vapor/http.git at 3.1.6
remote: Cloning https://github.com/vapor/postgresql.git
remote: Resolving https://github.com/vapor/postgresql.git at 1.1.0
remote: Cloning https://github.com/vapor/database-kit.git
remote: Resolving https://github.com/vapor/database-kit.git at 1.3.1
remote: Cloning https://github.com/vapor/service.git
remote: Resolving https://github.com/vapor/service.git at 1.0.0
remote: Cloning https://github.com/vapor/vapor.git
remote: Resolving https://github.com/vapor/vapor.git at 3.1.0
remote: Cloning https://github.com/vapor/fluent.git
remote: Resolving https://github.com/vapor/fluent.git at 3.1.2
remote: Cloning https://github.com/vapor/routing.git
remote: Resolving https://github.com/vapor/routing.git at 3.0.1
remote: Cloning https://github.com/vapor/console.git
remote: Resolving https://github.com/vapor/console.git at 3.0.3
remote: Cloning https://github.com/twof/VaporMailgunService.git
remote: Resolving https://github.com/twof/VaporMailgunService.git at 1.5.0
remote: Cloning https://github.com/vapor/validation.git
remote: Resolving https://github.com/vapor/validation.git at 2.1.1
remote:  !     Push rejected, failed to compile Swift app.
remote: 
remote:  !     Push failed
remote: Verifying deploy...
remote: 
remote: !	Push rejected to .....
remote: 
To https://git.heroku.com/......git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com.....git'

xz:(stdin): File format not recognized

remote: Building source:
remote:
remote: -----> Swift app detected
remote: -----> Installing clang 5.0.0
remote: xz: (stdin): File format not recognized
remote: ! Push rejected, failed to compile Swift app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to swift-listener.
remote:
To https://git.heroku.com/swift-listener.git

Support for Heroku-20 stack

I'm trying to update my Vapor API on Heroku from -16 to -20 but get errors as mentioned below. Heroku-support tells me it might be caused by this buildpack. Can this buildpack be updated to support Heroku-20 ?

Thanks in advance, Frank

remote: Building source: remote: remote: -----> Building on the Heroku-20 stack remote: -----> Swift app detected remote: -----> Using Swift 4.0 (from .swift-version file) remote: -----> Installing clang 7.0.1 remote: xz: (stdin): File format not recognized remote: ! Push rejected, failed to compile Swift app. remote: remote: ! Push failed remote: Verifying deploy... remote: remote: ! Push rejected to VaporAPI

No such module 'CommonCrypto'

Hello!

Would this issue be related to heroku-buildpack?
Notice: it works fine locally.

/tmp/build_426bdbeeb981fa760322c740cebf1265/.build/checkouts/aescryptable/Sources/AESCryptable/AES.swift:10:8: error: no such module 'CommonCrypto'
import CommonCrypto
       ^
 !     Push rejected, failed to compile Swift app.
 !     Push failed

More information:

$ cat .swift-version
5.0
$ heroku buildpacks
=== app-name Buildpack URL
vapor/vapor
$ heroku config
=== app-name Config Vars
SWIFT_BUILD_CONFIGURATION: debug
$ cat Package.resolved
{
  "object": {
    "pins": [
      {
        "package": "AESCryptable",
        "repositoryURL": "https://github.com/backslash-f/aescryptable",
        "state": {
          "branch": null,
          "revision": "fa4a05b8218c9b84fa3a894887b1ef0c33bc9d34",
          "version": "1.0.3"
        }
      },
      {
        "package": "Console",
        "repositoryURL": "https://github.com/vapor/console.git",
        "state": {
          "branch": null,
          "revision": "74cfbea629d4aac34a97cead2447a6870af1950b",
          "version": "3.1.1"
        }
      },
      {
        "package": "Core",
        "repositoryURL": "https://github.com/vapor/core.git",
        "state": {
          "branch": null,
          "revision": "02f1d0d0eabe68f10d1efa0decdfa0e6e737e985",
          "version": "3.8.0"
        }
      },
      {
        "package": "Crypto",
        "repositoryURL": "https://github.com/vapor/crypto.git",
        "state": {
          "branch": null,
          "revision": "45bb12d13cdec80dbd1cc0685ea002e51ab83439",
          "version": "3.3.2"
        }
      },
      {
        "package": "DatabaseKit",
        "repositoryURL": "https://github.com/vapor/database-kit.git",
        "state": {
          "branch": null,
          "revision": "8f352c8e66dab301ab9bfef912a01ce1361ba1e4",
          "version": "1.3.3"
        }
      },
      {
        "package": "Fluent",
        "repositoryURL": "https://github.com/vapor/fluent.git",
        "state": {
          "branch": null,
          "revision": "3776a0f623e08b413e878f282a70e8952651c91f",
          "version": "3.1.3"
        }
      },
      {
        "package": "FluentSQLite",
        "repositoryURL": "https://github.com/vapor/fluent-sqlite.git",
        "state": {
          "branch": null,
          "revision": "c32f5bda84bf4ea691d19afe183d40044f579e11",
          "version": "3.0.0"
        }
      },
      {
        "package": "HTTP",
        "repositoryURL": "https://github.com/vapor/http.git",
        "state": {
          "branch": null,
          "revision": "254a0a0cbf22a02b697a075a0d2ddbb448bb7c87",
          "version": "3.2.0"
        }
      },
      {
        "package": "Leaf",
        "repositoryURL": "https://github.com/vapor/leaf.git",
        "state": {
          "branch": null,
          "revision": "d35f54cbac723e673f9bd5078361eea74049c8d7",
          "version": "3.0.2"
        }
      },
      {
        "package": "Multipart",
        "repositoryURL": "https://github.com/vapor/multipart.git",
        "state": {
          "branch": null,
          "revision": "bd7736c5f28e48ed8b683dcc9df3dcd346064c2b",
          "version": "3.0.3"
        }
      },
      {
        "package": "Routing",
        "repositoryURL": "https://github.com/vapor/routing.git",
        "state": {
          "branch": null,
          "revision": "626190ddd2bd9f967743b60ba6adaf90bbd2651c",
          "version": "3.0.2"
        }
      },
      {
        "package": "Service",
        "repositoryURL": "https://github.com/vapor/service.git",
        "state": {
          "branch": null,
          "revision": "fa5b5de62bd68bcde9a69933f31319e46c7275fb",
          "version": "1.0.2"
        }
      },
      {
        "package": "SQL",
        "repositoryURL": "https://github.com/vapor/sql.git",
        "state": {
          "branch": null,
          "revision": "50eaeb8f52a1ce63f1ff3880e1114dd8757a78a6",
          "version": "2.3.2"
        }
      },
      {
        "package": "SQLite",
        "repositoryURL": "https://github.com/vapor/sqlite.git",
        "state": {
          "branch": null,
          "revision": "314d9cd21165bcf14215e336a23ff8214f40e411",
          "version": "3.2.1"
        }
      },
      {
        "package": "swift-nio",
        "repositoryURL": "https://github.com/apple/swift-nio.git",
        "state": {
          "branch": null,
          "revision": "29a9f2aca71c8afb07e291336f1789337ce235dd",
          "version": "1.13.2"
        }
      },
      {
        "package": "swift-nio-ssl",
        "repositoryURL": "https://github.com/apple/swift-nio-ssl.git",
        "state": {
          "branch": null,
          "revision": "0f3999f3e3c359cc74480c292644c3419e44a12f",
          "version": "1.4.0"
        }
      },
      {
        "package": "swift-nio-ssl-support",
        "repositoryURL": "https://github.com/apple/swift-nio-ssl-support.git",
        "state": {
          "branch": null,
          "revision": "c02eec4e0e6d351cd092938cf44195a8e669f555",
          "version": "1.0.0"
        }
      },
      {
        "package": "swift-nio-zlib-support",
        "repositoryURL": "https://github.com/apple/swift-nio-zlib-support.git",
        "state": {
          "branch": null,
          "revision": "37760e9a52030bb9011972c5213c3350fa9d41fd",
          "version": "1.0.0"
        }
      },
      {
        "package": "TemplateKit",
        "repositoryURL": "https://github.com/vapor/template-kit.git",
        "state": {
          "branch": null,
          "revision": "4b1073d74be9f5c6a5bc63a07a84e83efec26229",
          "version": "1.1.2"
        }
      },
      {
        "package": "URLEncodedForm",
        "repositoryURL": "https://github.com/vapor/url-encoded-form.git",
        "state": {
          "branch": null,
          "revision": "82d8d63bdb76b6dd8febe916c639ab8608dbbaed",
          "version": "1.0.6"
        }
      },
      {
        "package": "Validation",
        "repositoryURL": "https://github.com/vapor/validation.git",
        "state": {
          "branch": null,
          "revision": "4de213cf319b694e4ce19e5339592601d4dd3ff6",
          "version": "2.1.1"
        }
      },
      {
        "package": "Vapor",
        "repositoryURL": "https://github.com/vapor/vapor.git",
        "state": {
          "branch": null,
          "revision": "c86ada59b31c69f08a6abd4f776537cba48d5df6",
          "version": "3.3.0"
        }
      },
      {
        "package": "WebSocket",
        "repositoryURL": "https://github.com/vapor/websocket.git",
        "state": {
          "branch": null,
          "revision": "d85e5b6dce4d04065865f77385fc3324f98178f6",
          "version": "1.1.2"
        }
      }
    ]
  },
  "version": 1
}

Full Heroku log:

-----> Swift app detected
-----> Using cached clang-7.0.1
-----> Installing swiftenv
-----> Installing Swift 5.0
Downloading https://swift.org/builds/swift-5.0-release/ubuntu1804/swift-5.0-RELEASE/swift-5.0-RELEASE-ubuntu18.04.tar.gz
/tmp/swiftenv-5.0- ~/tmp/buildpacks/8bc2564c47019ec2110317b4b610e6b7742649f0c6de547e3ed684120dba03bbdd0601a741c56fd89112828c6e4815748582d14f62a88bc96696ec2a79912b95
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
~/tmp/buildpacks/8bc2564c47019ec2110317b4b610e6b7742649f0c6de547e3ed684120dba03bbdd0601a741c56fd89112828c6e4815748582d14f62a88bc96696ec2a79912b95
5.0 has been installed.
-----> Building package (debug configuration)
Fetching https://github.com/vapor/sql.git
Fetching https://github.com/vapor/template-kit.git
Fetching https://github.com/vapor/console.git
Fetching https://github.com/vapor/vapor.git
Fetching https://github.com/vapor/sqlite.git
Fetching https://github.com/vapor/fluent-sqlite.git
Fetching https://github.com/vapor/multipart.git
Fetching https://github.com/vapor/core.git
Fetching https://github.com/vapor/crypto.git
Fetching https://github.com/vapor/database-kit.git
Fetching https://github.com/vapor/service.git
Fetching https://github.com/apple/swift-nio.git
Fetching https://github.com/apple/swift-nio-zlib-support.git
Fetching https://github.com/vapor/validation.git
Fetching https://github.com/vapor/websocket.git
Fetching https://github.com/vapor/fluent.git
Fetching https://github.com/vapor/routing.git
Fetching https://github.com/vapor/url-encoded-form.git
Fetching https://github.com/vapor/http.git
Fetching https://github.com/vapor/leaf.git
Fetching https://github.com/apple/swift-nio-ssl.git
Fetching https://github.com/apple/swift-nio-ssl-support.git
Fetching https://github.com/backslash-f/aescryptable
Completed resolution in 12.34s
Cloning https://github.com/vapor/template-kit.git
Resolving https://github.com/vapor/template-kit.git at 1.1.2
Cloning https://github.com/vapor/url-encoded-form.git
Resolving https://github.com/vapor/url-encoded-form.git at 1.0.6
Cloning https://github.com/apple/swift-nio-zlib-support.git
Resolving https://github.com/apple/swift-nio-zlib-support.git at 1.0.0
Cloning https://github.com/vapor/leaf.git
Resolving https://github.com/vapor/leaf.git at 3.0.2
Cloning https://github.com/vapor/fluent-sqlite.git
Resolving https://github.com/vapor/fluent-sqlite.git at 3.0.0
Cloning https://github.com/vapor/core.git
Resolving https://github.com/vapor/core.git at 3.8.0
Cloning https://github.com/vapor/service.git
Resolving https://github.com/vapor/service.git at 1.0.2
Cloning https://github.com/vapor/sqlite.git
Resolving https://github.com/vapor/sqlite.git at 3.2.1
Cloning https://github.com/vapor/fluent.git
Resolving https://github.com/vapor/fluent.git at 3.1.3
Cloning https://github.com/vapor/console.git
Resolving https://github.com/vapor/console.git at 3.1.1
Cloning https://github.com/apple/swift-nio-ssl.git
Resolving https://github.com/apple/swift-nio-ssl.git at 1.4.0
Cloning https://github.com/vapor/websocket.git
Resolving https://github.com/vapor/websocket.git at 1.1.2
Cloning https://github.com/vapor/sql.git
Resolving https://github.com/vapor/sql.git at 2.3.2
Cloning https://github.com/apple/swift-nio.git
Resolving https://github.com/apple/swift-nio.git at 1.13.2
Cloning https://github.com/backslash-f/aescryptable
Resolving https://github.com/backslash-f/aescryptable at 1.0.3
Cloning https://github.com/vapor/vapor.git
Resolving https://github.com/vapor/vapor.git at 3.3.0
Cloning https://github.com/vapor/database-kit.git
Resolving https://github.com/vapor/database-kit.git at 1.3.3
Cloning https://github.com/vapor/routing.git
Resolving https://github.com/vapor/routing.git at 3.0.2
Cloning https://github.com/vapor/crypto.git
Resolving https://github.com/vapor/crypto.git at 3.3.2
Cloning https://github.com/vapor/multipart.git
Resolving https://github.com/vapor/multipart.git at 3.0.3
Cloning https://github.com/vapor/validation.git
Resolving https://github.com/vapor/validation.git at 2.1.1
Cloning https://github.com/vapor/http.git
Resolving https://github.com/vapor/http.git at 3.2.0
Cloning https://github.com/apple/swift-nio-ssl-support.git
Resolving https://github.com/apple/swift-nio-ssl-support.git at 1.0.0
[1/52] Compiling CNIOAtomics src/c-atomics.c
[2/52] Compiling CSQLite sqlite3.c
[3/52] Compiling Swift Module 'NIOPriorityQueue' (2 sources)
[4/52] Compiling Swift Module 'Debugging' (3 sources)
[5/52] Compiling Swift Module 'COperatingSystem' (1 sources)
[6/52] Compiling Swift Module 'AESCryptable' (4 sources)
[7/52] Compiling CNIOZlib empty.c
[8/52] Compiling CNIOSHA1 c_nio_sha1.c
[9/52] Compiling CNIOOpenSSL shims.c
[10/52] Compiling CNIOOpenSSL helpers.c
/tmp/build_426bdbeeb981fa760322c740cebf1265/.build/checkouts/aescryptable/Sources/AESCryptable/AES.swift:10:8: error: no such module 'CommonCrypto'
import CommonCrypto
       ^
/tmp/build_426bdbeeb981fa760322c740cebf1265/.build/checkouts/aescryptable/Sources/AESCryptable/AES.swift:10:8: error: no such module 'CommonCrypto'
import CommonCrypto
       ^
 !     Push rejected, failed to compile Swift app.
 !     Push failed

Any clue will be greatly appreciated, thanks!

Migrate away from swiftenv

Installing a single Swift version does not have to be this complex.
Especially when "it doesn't have build instructions" for the latest version 5.1.5.

Support Package.swift symlink?

Currently, I use a "Package.swift" symbolic link at the root directory instead of a real file. The build pack doesn't handle the symlink case.

Could we support it? Thanks.

Request: Support Heroku 18 stack

With Swift 4.2, Ubuntu 18 builds are available - which should allow for support of Heroku 18 stack. I assume it's just a matter of detecting the Heroku stack, ensuring the requested Swift version is > 4.2, and then downloading the correct Swift release. I'll see if I can get a PR in for this unless someone else gets to it first.

Heroku-22 stack

Set your stack to heroku-22 and:

remote: -----> Building on the Heroku-22 stack
remote: -----> Using buildpack: vapor/vapor
remote: -----> Swift app detected
remote: -----> Using Swift 5.6 (default)
remote: -----> Using built-in clang (Swift 5.6)
remote: -----> Installing swiftenv
remote: -----> Installing Swift 5.6
remote: We don't have build instructions for 5.6.
remote:  !     Push rejected, failed to compile Swift app.

The buildpack works correctly on heroku-20.

Heroku build failed to compile Swift app

Hello. I am trying to deploy my first ever Vapor project to Heroku. Everything works fine on my local Mac computer, but when I try to deploy to Heroku I get the following error:

-----> Swift app detected
-----> Using Swift 5.3 (default)
-----> Using built-in clang (Swift 5.3)
-----> Installing swiftenv
-----> Installing Swift 5.3
..........
..........
..........
[868/869] Compiling Vapor Application.swift
[869/870] Compiling App ImageController.swift
/tmp/build_0b01c993/Sources/App/Controllers/ImageController/ImageController.swift:12:41: error: extraneous argument label 'data:' in call
    guard var image = Image<RGBA<UInt8>>(data: Data(buffer: params.file.data)) else {
                                        ^~~~~~~
                                         
/tmp/build_0b01c993/Sources/App/Controllers/ImageController/ImageController.swift:12:48: error: cannot convert value of type 'Data' to expected argument type 'ImageSlice<RGBA<UInt8>>'
    guard var image = Image<RGBA<UInt8>>(data: Data(buffer: params.file.data)) else {
                                               ^
 !     Push rejected, failed to compile Swift app.
 !     Push failed

It says that the project could not be compiled, but the project can compile and run without any issues on my Mac computer. It seems to complain about the package I use. I thought there might be a problem with the SwiftImage version, but changing its version did not solve my problem. I checked on Heroku's activity build logs to view which version of SwiftImage it was trying to use, and it correctly uses the same version in my Package.swift file:

Cloning https://github.com/koher/swift-image.git
Resolving https://github.com/koher/swift-image.git at 0.7.1

My Package.swift is like this:

// swift-tools-version:5.3
import PackageDescription

let package = Package(
    name: "imageEditor",
    platforms: [
       .macOS(.v10_15)
    ],
    dependencies: [
        // πŸ’§ A server-side Swift web framework.
        .package(url: "https://github.com/vapor/vapor.git", from: "4.0.0"),
        .package(name: "SwiftImage", url: "https://github.com/koher/swift-image.git", .exact("0.7.1"))
    ],
    targets: [
        .target(
            name: "App",
            dependencies: [
                .product(name: "Vapor", package: "vapor"),
                .product(name: "SwiftImage", package: "SwiftImage")
            ],
            swiftSettings: [
                // Enable better optimizations when building in Release configuration. Despite the use of
                // the `.unsafeFlags` construct required by SwiftPM, this flag is recommended for Release
                // builds. See <https://github.com/swift-server/guides#building-for-production> for details.
                .unsafeFlags(["-cross-module-optimization"], .when(configuration: .release))
            ]
        ),
        .target(name: "Run", dependencies: [.target(name: "App")]),
        .testTarget(name: "AppTests", dependencies: [
            .target(name: "App"),
            .product(name: "XCTVapor", package: "vapor"),
        ])
    ]
)

Support for resources

When including resources in the package file, I am able to successfully build and run on MacOS and on Linux, but I get a runtime error when deploying to Heroku.

I think the issue is that the bash script is taking care to copy dynamic libraries (for example) but does not copy the resource files. The error message references file extension .resources but I see the resource files in a directory with extension bundle when building locally.

updated to latest buildpack and heroku-20: No available connections on this event loop, creating a new one [database-id: psql]

The only Add-on I have is Heroku Postgres. All I know is it was working before and now it doesn't work. On the deploy, I updated from heroku-18 to heroku-20 and then to this latest buildpack.

[ DEBUG ] No available connections on this event loop, creating a new one [database-id: psql] (AsyncKit/ConnectionPool/EventLoopConnectionPool.swift:202)
[ DEBUG ] Application shutting down (Vapor/Application.swift:124)
Fatal error: Error raised at top level: connection reset (error set): Connection refused (errno: 111): file Swift/ErrorType.swift, line 200
Current stack trace:
0 libswiftCore.so 0x00007fac95152530 swift_reportError + 50
1 libswiftCore.so 0x00007fac951c6050 swift_stdlib_reportFatalErrorInFile + 115
2 libswiftCore.so 0x00007fac94eab915 + 1399061
3 libswiftCore.so 0x00007fac94eab557 + 1398103
4 libswiftCore.so 0x00007fac94eabaf2 + 1399538
5 libswiftCore.so 0x00007fac94ea9f90 assertionFailure(:
:file:line🎏) + 517
6 libswiftCore.so 0x00007fac94f136a6 + 1824422
7 0x000055e3e900e3f1 + 7885809
8 libc.so.6 0x00007fac93f6afc0 __libc_start_main + 243
9 0x000055e3e89ab6ae + 1189550
0x7fac94d2e3bf
0x7fac94eaa1a2
0x7fac94f136a5
0x55e3e900e3f0, main at /tmp/build_ddd998a5/:0
0x7fac93f6b0b2
0x55e3e89ab6ad
0xffffffffffffffff
Illegal instruction

Building failing on release script

From a vapor generated new project I'm getting a build fail on release phase. This is my Procfile

release: Run migrate -y
web: Run serve --env production --hostname 0.0.0.0 --port $PORT

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.