Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Package.swift symlink? #34

Closed
honghaoz opened this issue Feb 15, 2019 · 5 comments
Closed

Support Package.swift symlink? #34

honghaoz opened this issue Feb 15, 2019 · 5 comments

Comments

@honghaoz
Copy link

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.

@tanner0101
Copy link

@honghaoz what is the error you are getting?

@honghaoz
Copy link
Author

Hey @tanner0101 here is the error log:

➜  XXX git:(master) git push heroku master  
Counting objects: 131, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (102/102), done.
Writing objects: 100% (131/131), 69.21 KiB | 4.33 MiB/s, done.
Total 131 (delta 33), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> App not compatible with buildpack: https://github.com/vapor-community/heroku-buildpack
remote:        More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure
remote: 
remote:  !     Push failed
remote: Verifying deploy...
remote: 
remote: !	Push rejected to XXX.
remote: 
To https://git.heroku.com/XXX.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/XXX.git'

@tanner0101
Copy link

I don't know much about Heroku buildpacks, but my guess is the problem is here: https://github.com/vapor-community/heroku-buildpack/blob/master/bin/detect#L4

Seems like we need to expand that check to support symlinks. Maybe this will help: https://stackoverflow.com/questions/5767062/how-to-check-if-a-symlink-exists

@honghaoz
Copy link
Author

@tanner0101 Yes, I suspect that check doesn't support symlinks. I will do a fork and test with it. If it works, I could put a PR for it.

@honghaoz
Copy link
Author

I found this error was caused by the symlink's absolute path of the source file.
Specifically,

This was the bad symlink:

Package.swift -> <absolute path>/Environment/production/Package.swift

After I changed the symlink to

Package.swift -> ./Environment/production/Package.swift

The buildpack works well.

Credit to this post: https://www.mokacoding.com/blog/symliks-in-git/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants