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

Cannot build sqlite3 gem with apt buildpack #834

Open
schneems opened this issue Dec 10, 2018 · 5 comments
Open

Cannot build sqlite3 gem with apt buildpack #834

schneems opened this issue Dec 10, 2018 · 5 comments

Comments

@schneems
Copy link
Contributor

While technically the apt buildpack is not supported it works for most common cases. However, I was not able to get the sqlite3 gem to install against the libsqlite3-dev package.

This is the error output:

remote:        checking for sqlite3.h... yes
remote:        checking for pthread_create() in -lpthread... yes
remote:        checking for sqlite3_libversion_number() in -lsqlite3... yes
remote:        checking for rb_proc_arity()... yes
remote:        checking for rb_integer_pack()... yes
remote:        checking for sqlite3_initialize()... yes
remote:        checking for sqlite3_backup_init()... yes
remote:        checking for sqlite3_column_database_name()... yes
remote:        checking for sqlite3_enable_load_extension()... yes
remote:        checking for sqlite3_load_extension()... yes
remote:        checking for sqlite3_open_v2()... yes
remote:        checking for sqlite3_prepare_v2()... yes
remote:        checking for sqlite3_int64 in sqlite3.h... yes
remote:        checking for sqlite3_uint64 in sqlite3.h... yes
remote:        creating Makefile
remote:
remote:        current directory:
remote:        /tmp/build_72dc3e768bb2b036042d74e451f38cb0/vendor/bundle/ruby/2.4.0/gems/sqlite3-1.3.13/ext/sqlite3
remote:        make "DESTDIR=" clean
remote:
remote:        current directory:
remote:        /tmp/build_72dc3e768bb2b036042d74e451f38cb0/vendor/bundle/ruby/2.4.0/gems/sqlite3-1.3.13/ext/sqlite3
remote:        make "DESTDIR="
remote:        compiling backup.c
remote:        compiling database.c
remote:        compiling exception.c
remote:        compiling sqlite3.c
remote:        compiling statement.c
remote:        linking shared-object sqlite3/sqlite3_native.so
remote:        /usr/bin/ld:
remote:        /tmp/build_72dc3e768bb2b036042d74e451f38cb0/.apt/usr/lib/x86_64-linux-gnu/libsqlite3.a(sqlite3.o):
remote:        relocation R_X86_64_PC32 against symbol `sqlite3_version' can not be used when
remote:        making a shared object; recompile with -fPIC
remote:        /usr/bin/ld: final link failed: Bad value
remote:        collect2: error: ld returned 1 exit status
remote:        Makefile:257: recipe for target 'sqlite3_native.so' failed
remote:        make: *** [sqlite3_native.so] Error 1

This came up in an internal ticket: number 657004

@gbenedict
Copy link

@schneems Any luck getting this working? I have it working on an existing app that installed it last summer, but it's now failing trying to upgrade a different app . Both are Heroku-16.

My error is slightly different:

remote:        checking for sqlite3.h... yes
remote:        checking for sqlite3_libversion_number() in -lsqlite3... yes
remote:        checking for rb_proc_arity()... yes
remote:        checking for rb_integer_pack()... yes
remote:        checking for sqlite3_initialize()... yes
remote:        checking for sqlite3_backup_init()... yes
remote:        checking for sqlite3_column_database_name()... yes
remote:        checking for sqlite3_enable_load_extension()... yes
remote:        checking for sqlite3_load_extension()... yes
remote:        checking for sqlite3_open_v2()... yes
remote:        checking for sqlite3_prepare_v2()... yes
remote:        checking for sqlite3_int64 in sqlite3.h... yes
remote:        checking for sqlite3_uint64 in sqlite3.h... yes
remote:        creating Makefile
remote:        
remote:        make "DESTDIR=" clean
remote:        
remote:        make "DESTDIR="
remote:        compiling statement.c
remote:        compiling sqlite3.c
remote:        compiling database.c
remote:        compiling backup.c
remote:        compiling exception.c
remote:        linking shared-object sqlite3/sqlite3_native.so
remote:        /usr/bin/ld:
remote:        /tmp/build_96491d9867609e438400188b815890f1/.apt/usr/lib/x86_64-linux-gnu/libsqlite3.a(sqlite3.o):
remote:        relocation R_X86_64_PC32 against symbol `sqlite3_stricmp' can not be used when
remote:        making a shared object; recompile with -fPIC
remote:        /usr/bin/ld: final link failed: Bad value
remote:        collect2: error: ld returned 1 exit status
remote:        Makefile:253: recipe for target 'sqlite3_native.so' failed
remote:        make: *** [sqlite3_native.so] Error 1

@gbenedict
Copy link

I found a way to get this to build on both Heroku-16 and Heroku-18. You need an extra package in your Aptfile:

libsqlite3-dev
libsqlite3-0

@4ndv
Copy link

4ndv commented Apr 22, 2019

@gbenedict had same problem on dokku with heroku-buildpack-ruby and heroku-buildpack-apt, worked for me, thanks!

@schneems
Copy link
Contributor Author

schneems commented Dec 4, 2019

@iamswain25 you downvoted this comment did it not work for you ? #834 (comment)

@donnykurnia
Copy link

#834 (comment) works for me.

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

No branches or pull requests

4 participants