Skip to content

gem v1.1.0 fails to install on openSUSE due to lib64 naming conventions #333

Closed
@mbixby17451

Description

@mbixby17451

Installing the latest v1.1.0 gem on openSUSE (Leap 42.2) fails because although the bundled freetds correctly builds into a "lib64" subdirectory per openSUSE naming conventions, the gem's extconf.rb is hard-coded to look for freetds in a "lib" subdirectory.

Output from gem install:

markb@linux:~> gem install tiny_tds
Fetching: mini_portile2-2.1.0.gem (100%)
Successfully installed mini_portile2-2.1.0
Fetching: tiny_tds-1.1.0.gem (100%)
Building native extensions.  This could take a while...
ERROR:  Error installing tiny_tds:
        ERROR: Failed to build gem native extension.

    current directory: /home/markb/stack/lib64/ruby/gems/2.3.0/gems/tiny_tds-1.1.0/ext/tiny_tds
/home/markb/stack/bin/ruby -r ./siteconf20170109-3991-kqksju.rb extconf.rb
extconf.rb:14: warning: already initialized constant OpenSSL::SSL::VERIFY_PEER
checking for sybfront.h... no
Downloading freetds-1.00.21.tar.bz2 (100%) 
Extracting freetds-1.00.21.tar.bz2 into tmp/x86_64-pc-linux-gnu/ports/freetds/1.00.21... OK
Running git apply with /home/markb/stack/lib64/ruby/gems/2.3.0/gems/tiny_tds-1.1.0/ports/patches/freetds/1.00.21/0001-mingw_missing_inet_pton.diff... OK
Running 'configure' for freetds 1.00.21... OK
Running 'compile' for freetds 1.00.21... OK
Running 'install' for freetds 1.00.21... OK
Activating freetds 1.00.21 (from /home/markb/stack/lib64/ruby/gems/2.3.0/gems/tiny_tds-1.1.0/ports/x86_64-pc-linux-gnu)...
checking for sybfront.h... yes
checking for sybdb.h... yes
checking for tdsdbopen() in -lsybdb... no
-----
freetds is missing.
Do you have FreeTDS 0.95.80 or higher installed?
-----
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
        --with-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib64
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=/home/markb/stack/bin/$(RUBY_BASE_NAME)
        --help
        --enable-lookup
        --disable-lookup
        --with-freetds-dir
        --without-freetds-dir
        --with-freetds-include
        --without-freetds-include=${freetds-dir}/include
        --with-freetds-lib
        --without-freetds-lib=${freetds-dir}/lib64
        --enable-system-freetds
        --disable-system-freetds
        --enable-system-iconv
        --disable-system-iconv
        --enable-system-openssl
        --disable-system-openssl
        --enable-gnutls
        --disable-gnutls
        --enable-openssl
        --disable-openssl
        --with-freetds-dir
        --without-freetds-dir
        --with-freetds-include
        --without-freetds-include=${freetds-dir}/include
        --with-freetds-lib
        --without-freetds-lib=${freetds-dir}/lib64
        --with-sybdblib
        --without-sybdblib

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /home/markb/stack/lib64/ruby/gems/2.3.0/extensions/x86_64-linux/2.3.0-static/tiny_tds-1.1.0/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /home/markb/stack/lib64/ruby/gems/2.3.0/gems/tiny_tds-1.1.0 for inspection.
Results logged to /home/markb/stack/lib64/ruby/gems/2.3.0/extensions/x86_64-linux/2.3.0-static/tiny_tds-1.1.0/gem_make.out

Contents of mkmf.log:

markb@linux:~> cat /home/markb/stack/lib64/ruby/gems/2.3.0/extensions/x86_64-linux/2.3.0-static/tiny_tds-1.1.0/mkmf.log
have_header: checking for sybfront.h... -------------------- no

"gcc -o conftest -I/home/markb/stack/include/ruby-2.3.0/x86_64-linux -I/home/markb/stack/include/ruby-2.3.0/ruby/backward -I/home/markb/stack/include/ruby-2.3.0 -I. -I/usr/local/include -I/usr/include  -I/home/markb/stack/include    -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wno-packed-bitfield-compat  conftest.c  -L. -L/home/markb/stack/lib64 -Wl,-R/home/markb/stack/lib64 -L/usr/local/lib -Wl,-R/usr/local/lib -L/usr/lib -Wl,-R/usr/lib -L/home/markb/stack/lib64 -Wl,-R/home/markb/stack/lib64 -L. -fstack-protector -rdynamic -Wl,-export-dynamic -L/home/markb/stack/lib  -Wl,-R/home/markb/stack/lib      -Wl,-R/home/markb/stack/lib64 -L/home/markb/stack/lib64 -lruby-static  -lpthread -lgmp -ldl -lcrypt -lm   -lc "
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */

"gcc -E -I/home/markb/stack/include/ruby-2.3.0/x86_64-linux -I/home/markb/stack/include/ruby-2.3.0/ruby/backward -I/home/markb/stack/include/ruby-2.3.0 -I. -I/usr/local/include -I/usr/include  -I/home/markb/stack/include    -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wno-packed-bitfield-compat   conftest.c -o conftest.i"
conftest.c:3:22: fatal error: sybfront.h: No such file or directory
 #include <sybfront.h>
                      ^
compilation terminated.
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <sybfront.h>
/* end */

--------------------

have_header: checking for sybfront.h... -------------------- yes

"gcc -E -I/home/markb/stack/include/ruby-2.3.0/x86_64-linux -I/home/markb/stack/include/ruby-2.3.0/ruby/backward -I/home/markb/stack/include/ruby-2.3.0 -I. -I/home/markb/stack/lib64/ruby/gems/2.3.0/gems/tiny_tds-1.1.0/ports/x86_64-pc-linux-gnu/include -I/usr/local/include -I/usr/include  -I/home/markb/stack/include    -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wno-packed-bitfield-compat   conftest.c -o conftest.i"
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <sybfront.h>
/* end */

--------------------

have_header: checking for sybdb.h... -------------------- yes

"gcc -E -I/home/markb/stack/include/ruby-2.3.0/x86_64-linux -I/home/markb/stack/include/ruby-2.3.0/ruby/backward -I/home/markb/stack/include/ruby-2.3.0 -I. -I/home/markb/stack/lib64/ruby/gems/2.3.0/gems/tiny_tds-1.1.0/ports/x86_64-pc-linux-gnu/include -I/usr/local/include -I/usr/include  -I/home/markb/stack/include    -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wno-packed-bitfield-compat   conftest.c -o conftest.i"
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <sybdb.h>
/* end */

--------------------

find_library: checking for tdsdbopen() in -lsybdb... -------------------- no

"gcc -o conftest -I/home/markb/stack/include/ruby-2.3.0/x86_64-linux -I/home/markb/stack/include/ruby-2.3.0/ruby/backward -I/home/markb/stack/include/ruby-2.3.0 -I. -I/home/markb/stack/lib64/ruby/gems/2.3.0/gems/tiny_tds-1.1.0/ports/x86_64-pc-linux-gnu/include -I/usr/local/include -I/usr/include  -I/home/markb/stack/include    -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wno-packed-bitfield-compat  conftest.c  -L. -L/home/markb/stack/lib64 -Wl,-R/home/markb/stack/lib64 -L/home/markb/stack/lib64/ruby/gems/2.3.0/gems/tiny_tds-1.1.0/ports/x86_64-pc-linux-gnu/lib -Wl,-R/home/markb/stack/lib64/ruby/gems/2.3.0/gems/tiny_tds-1.1.0/ports/x86_64-pc-linux-gnu/lib -L/usr/local/lib -Wl,-R/usr/local/lib -L/usr/lib -Wl,-R/usr/lib -L/home/markb/stack/lib64 -Wl,-R/home/markb/stack/lib64 -L. -fstack-protector -rdynamic -Wl,-export-dynamic -L/home/markb/stack/lib  -Wl,-R/home/markb/stack/lib      -Wl,-R/home/markb/stack/lib64 -L/home/markb/stack/lib64 -lruby-static -lsybdb  -lpthread -lgmp -ldl -lcrypt -lm   -lc "
conftest.c: In function ‘t’:
conftest.c:13:57: error: ‘tdsdbopen’ undeclared (first use in this function)
 int t(void) { void ((*volatile p)()); p = (void ((*)()))tdsdbopen; return !p; }
                                                         ^
conftest.c:13:57: note: each undeclared identifier is reported only once for each function it appears in
checked program was:
/* begin */
 1: #include "ruby.h"
 2: 
 3: /*top*/
 4: extern int t(void);
 5: int main(int argc, char **argv)
 6: {
 7:   if (argc > 1000000) {
 8:     printf("%p", &t);
 9:   }
10: 
11:   return 0;
12: }
13: int t(void) { void ((*volatile p)()); p = (void ((*)()))tdsdbopen; return !p; }
/* end */

"gcc -o conftest -I/home/markb/stack/include/ruby-2.3.0/x86_64-linux -I/home/markb/stack/include/ruby-2.3.0/ruby/backward -I/home/markb/stack/include/ruby-2.3.0 -I. -I/home/markb/stack/lib64/ruby/gems/2.3.0/gems/tiny_tds-1.1.0/ports/x86_64-pc-linux-gnu/include -I/usr/local/include -I/usr/include  -I/home/markb/stack/include    -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wno-packed-bitfield-compat  conftest.c  -L. -L/home/markb/stack/lib64 -Wl,-R/home/markb/stack/lib64 -L/home/markb/stack/lib64/ruby/gems/2.3.0/gems/tiny_tds-1.1.0/ports/x86_64-pc-linux-gnu/lib -Wl,-R/home/markb/stack/lib64/ruby/gems/2.3.0/gems/tiny_tds-1.1.0/ports/x86_64-pc-linux-gnu/lib -L/usr/local/lib -Wl,-R/usr/local/lib -L/usr/lib -Wl,-R/usr/lib -L/home/markb/stack/lib64 -Wl,-R/home/markb/stack/lib64 -L. -fstack-protector -rdynamic -Wl,-export-dynamic -L/home/markb/stack/lib  -Wl,-R/home/markb/stack/lib      -Wl,-R/home/markb/stack/lib64 -L/home/markb/stack/lib64 -lruby-static -lsybdb  -lpthread -lgmp -ldl -lcrypt -lm   -lc "
/usr/lib64/gcc/x86_64-suse-linux/4.8/../../../../x86_64-suse-linux/bin/ld: cannot find -lsybdb
collect2: error: ld returned 1 exit status
checked program was:
/* begin */
 1: #include "ruby.h"
 2: 
 3: /*top*/
 4: extern int t(void);
 5: int main(int argc, char **argv)
 6: {
 7:   if (argc > 1000000) {
 8:     printf("%p", &t);
 9:   }
10: 
11:   return 0;
12: }
13: extern void tdsdbopen();
14: int t(void) { tdsdbopen(); return 0; }
/* end */

--------------------

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions