kylef / heroku-buildpack-swift

Heroku build pack for Swift
BSD 3-Clause "New" or "Revised" License
508 stars 0 forks source link

Cannot invoke executable by its name on Swift 4 #31

Closed PopFlamingo closed 6 years ago

PopFlamingo commented 7 years ago

Using the buildpack with Swift 4, it isn't possible to execute a program by directly calling its name in the procfile.

This may be because of this:

In Swift 4, the Swift Package Manager will build to a different path, containing a platform sub-folder (.build/macosx-x86_64/debug for mac and .build/linux-x86_64/debug for linux), making it more cumbersome to run the executable from the command line. SE-179 Swift run Command

Thank you !

Trevör

EDIT : Both .build/linux-x86_64/release/MyExecutableName and .build/linux-x86_64/debug/MyExecutableName don't let me run the execuable either, does your buildpack remove the .build folder ?

kheinrich188 commented 6 years ago

https://stackoverflow.com/questions/46420691/slackbot-written-in-swift-4-deployed-on-heroku Maybe a problem also with swift 4.0 ? Arg cannot run the app successfully

kylef commented 6 years ago

I am seeing Swift 4.0 setting up the symbolic link from the existing name and thus this still should work.

$ ls -al .build
lrwxr-xr-x   1 kyle  staff     30 27 Sep 10:10 debug -> x86_64-apple-macosx10.10/debug
drwxr-xr-x   3 kyle  staff    102 27 Sep 10:10 x86_64-apple-macosx10.10

@adtrevor The binaries and necessary libraries are moved over to the final Heroku slug and available under the PATH. You should just use the binary name in the Procfile, for example:

web: MyExecutableName --workers 5 --bind 0.0.0.0:$PORT

@kheinrich188 Looks like that tutorial is also incorrect and setting the Procfile incorrectly. Should be something like:

web: robot-or-not-bot
PopFlamingo commented 6 years ago

I will try it again, maybe I did an error last time but it didn't work !

kylef commented 6 years ago

https://github.com/kylef/heroku-buildpack-swift/commit/d7f0218064d3448dedd8e796a4669bf6126a9d57 fixes problems while copying over the binaries and dynamic libraries. However there is another problem with Swift 4 and the heroku-16 stack (you can possibly work around the problem by temporarily using cedar-14. Tracked via: https://github.com/kylef/heroku-buildpack-swift/issues/32

kylef commented 6 years ago

5e91d32db352a0a28f628f856525924caf738adc adds support for heroku-16 stack. Please try everything again.