Skip to content
This repository has been archived by the owner on Jan 7, 2025. It is now read-only.

Heroku Deployment fails, gmp needed #9

Closed
beanieboi opened this issue Jun 23, 2016 · 9 comments
Closed

Heroku Deployment fails, gmp needed #9

beanieboi opened this issue Jun 23, 2016 · 9 comments

Comments

@beanieboi
Copy link

$ git push heroku 
Counting objects: 51, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (47/47), done.
Writing objects: 100% (51/51), 7.26 KiB | 0 bytes/s, done.
Total 51 (delta 23), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> Fetching set buildpack https://github.com/crystal-lang/heroku-buildpack-crystal.git... done
remote: -----> Crystal app detected
remote: -----> Installing Crystal (0.18.4 due to .crystal-version file)
remote: -----> Installing Dependencies
remote: Updating https://github.com/sdogruyol/kemal.git
remote: Updating https://github.com/luislavena/radix.git
remote: Updating https://github.com/jeromegn/kilt.git
remote: Updating https://github.com/sdogruyol/spec-kemal.git
remote: Updating https://github.com/mperham/sidekiq.cr.git
remote: Updating https://github.com/mperham/crystal-redis.git
remote: Updating https://github.com/ysbaddaden/pool.git
remote: Updating https://github.com/miketheman/statsd.cr.git
remote: Updating https://github.com/beanieboi/aws-signer.cr.git
remote: Installing kemal (0c46bd65da9092c4e2d1776c13730eb63fbb6bc9)
remote: Installing radix (0.3.0)
remote: Installing kilt (0.3.3)
remote: Installing spec-kemal (8c0d4268b9ae2b8e7aadfe290006c28060bb61c8)
remote: Installing sidekiq (9248c0f0469d1ead010080a3acf2d6fa4e22c7d5)
remote: Installing redis (744bac8ec708e996ab020b79cbebdb17e28f6e23)
remote: Installing pool (0.2.3)
remote: Installing statsd (917c948e182b26150e124fa84a30ec4518635bf0)
remote: Installing aws_signer (bae4215fb96a074f1cc0e5cb07f116d0f93744ab)
remote: -----> Compiling src/lighthouse.cr (auto-detected from shard.yml)
remote: Deprecation: The build command was renamed to compile and will be removed in a future version.
remote: /usr/bin/ld: cannot find -lgmp
remote: collect2: error: ld returned 1 exit status
remote: Error: execution of command failed with code: 1: `cc -o "/tmp/build_48475e7b877277455138ed66882ee136/app" "${@}"  -rdynamic  -lgmp -lz `pkg-config --libs libssl || printf %s '-lssl -lcrypto'` `pkg-config --libs libcrypto || printf %s '-lcrypto'` -lpcre -lm -lgc -lpthread /tmp/crystal/src/ext/libcrystal.a -levent -lrt -ldl -L/usr/lib -L/usr/local/lib`
remote: 
remote:  !     Push rejected, failed to compile Crystal app
remote: 
remote: Verifying deploy...
remote: 
remote: !   Push rejected to codeship-lighthouse-cr.
remote: 
To https://git.heroku.com/codeship-lighthouse-cr.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/codeship-lighthouse-cr.git'

it looks like gmp is a new dependency in Crystal 0.18? i remember that the deployment worked fine with 0.17.

@bcardiff
Copy link
Member

libgmp is there since 0.16 at least.
using "big" of the std requires gmp which is not installed by default.
related crystal-lang/homebrew-crystal#15 (comment)

Are you using big_* explicitly in your code?

We might need to work something similar to https://github.com/begriffs/heroku-buildpack-ghc to get gmp installed by default in heroku just in case :-(

Or finding/building a buildpack to install gmp, but I am not sure that will work.

@beanieboi
Copy link
Author

beanieboi commented Jun 23, 2016

i added sidekiq as a dependency and sidekiq uses big_float (https://github.com/mperham/sidekiq.cr/blob/master/src/sidekiq/core_ext.cr#L1). this means no Sidekiq on Heroku :(

@beanieboi
Copy link
Author

beanieboi commented Jun 23, 2016

@mperham do you think you can remove the patch, it looks like this got fixed in a newer version of crystal.

@mperham
Copy link

mperham commented Jun 23, 2016

Yep, this was needed pre-0.18 but no more, removed from master.

@beanieboi
Copy link
Author

@mperham thanks so much!

@bcardiff
Copy link
Member

Isn't it nice when the "fix" is to delete code? :-)

Let's leave this open until gmp or other runtime dependencies are added in the buildpack.

@beanieboi
Copy link
Author

@bcardiff i worked on a couple of buildpacks before, i will try to add gmp to the buildpack, to remove this restriction.

@bacongobbler
Copy link
Contributor

@beanieboi if you can write a fixture + unit test that covers this problem after #12 is merged, it should be easy to confirm the fix works.

@beanieboi
Copy link
Author

@bacongobbler sure, will look into it.

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

No branches or pull requests

4 participants