#### Pre-Submission Checklist - [x] Commit message has the format required by CONTRIBUTING guide - [ ] Commits are split per component (core, individual modules, libs, utils, ...) - [ ] Each component has a single commit (if not, squash them into one commit) - [x] No commits to README files for modules (changes must be done to docbook files in `doc/` subfolder, the README file is autogenerated)
#### Type Of Change - [ ] Small bug fix (non-breaking change which fixes an issue) - [x] New feature (non-breaking change which adds new functionality) - [ ] Breaking change (fix or feature that would change existing functionality)
#### Checklist: - [x] PR should be backported to stable branches - [x] Tested changes locally - [x] Related to issue #1761
#### Description Ruby module is disabled on CentOS6 and RHEL6 dist You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/1762
-- Commit Summary --
* pkg/kamailio/obs: Added ruby package #1761
-- File Changes --
M pkg/kamailio/obs/kamailio.spec (38) M src/modules/app_ruby/Makefile (2)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/1762.patch https://github.com/kamailio/kamailio/pull/1762.diff
linuxmaniac requested changes on this pull request.
@@ -30,7 +30,7 @@ ifneq (,$(findstring darwin,$(OS)))
LIBS += -L/opt/local/lib -L$(LOCALBASE)/lib -lev else DEFS += -I$(LOCALBASE)/include -I$(SYSBASE)/include - LIBS += -L$(LOCALBASE)/lib -L$(SYSBASE)/lib -lruby -lpthread -ldl -lobjc
@sergey-safarov you are changing the module here!!
sergey-safarov commented on this pull request.
@@ -30,7 +30,7 @@ ifneq (,$(findstring darwin,$(OS)))
LIBS += -L/opt/local/lib -L$(LOCALBASE)/lib -lev else DEFS += -I$(LOCALBASE)/include -I$(SYSBASE)/include - LIBS += -L$(LOCALBASE)/lib -L$(SYSBASE)/lib -lruby -lpthread -ldl -lobjc
Yes Victor @linuxmaniac, I made this because `objc` lib cannot find. I have created PR on Fedora29 environment. Think same error exist on CentOS. I can see Travis-CI also build kamailio properly compiled without this options. Is option really required? What we can do to fix error with this options on RPM based dists?
linuxmaniac commented on this pull request.
@@ -30,7 +30,7 @@ ifneq (,$(findstring darwin,$(OS)))
LIBS += -L/opt/local/lib -L$(LOCALBASE)/lib -lev else DEFS += -I$(LOCALBASE)/include -I$(SYSBASE)/include - LIBS += -L$(LOCALBASE)/lib -L$(SYSBASE)/lib -lruby -lpthread -ldl -lobjc
I don't know if is needed or not, I'm saying the changes need to be split. You are changing the app_ruby, those changes need to be in another commit with the proper commit message prefix
sergey-safarov commented on this pull request.
@@ -30,7 +30,7 @@ ifneq (,$(findstring darwin,$(OS)))
LIBS += -L/opt/local/lib -L$(LOCALBASE)/lib -lev else DEFS += -I$(LOCALBASE)/include -I$(SYSBASE)/include - LIBS += -L$(LOCALBASE)/lib -L$(SYSBASE)/lib -lruby -lpthread -ldl -lobjc
Ok will do.
@sergey-safarov - that list of libs was taken from the output of `pkg-config --libs`. I do not recall for which version of lib ruby devel, but eventually that piece from Makefile is not used because we should rely on pkg-config.
Doesn't Fedora or CentOS have pkg-config for ruby devel lib?
@sergey-safarov can you please add ``[skip ci]`` to any commit message of pkg/kamailio/obs changes? anything related to pkg doesn't need to be build by travis-ci
To @miconda
Doesn't Fedora or CentOS have pkg-config for ruby devel lib?
I have tested pkconfig for ruby: 1) CendOS7 - `-lruby -lpthread -lrt -ldl -lcrypt -lm`; 2) Fedora 27 - `-Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -m64 -lruby -lpthread -ldl -lcrypt -lm`; 3) Fedora 28- `-Wl,-z,relro -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -m64 -lruby -lpthread -ldl -lcrypt -lm` 4) Fedora 29 - `-Wl,-z,relro -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -m64 -lruby` 5) OpenSUSE tumbleweed - `ruby.pc` not exist. Installed ruby-2.5.0 `/usr/include/ruby-2.5.0/ruby.h` 6) OpenSUSE tumbleweed - `ruby.pc` not exist. Installed ruby-2.1.0 `/usr/include/ruby-2.1.0/ruby.h`
@linuxmaniac , i will wait Daniel and your feedback about pckconfig usage for this module.
@sergey-safarov - can you check if pkg-config has the settings for ruby-x.y, like for example: 'pkg-config --libs ruby-2.5`.
Overall, I am fine to do that change, I see that `-lobjc` is returned by pkg-config on MacOS, but this is irrelevant, as I said, that part should be used for the cases without pkg-config settings, which are the exceptions and likely they will need to be changed based on used OS.
So, you can make a separate commit for the Makefile of app_ruby and you can push it to git repo. It can be also backported.
Hello Daniel @miconda I check `pkg-config --libs ruby-2.5` on OpenSUSE. Yes dist have `/usr/lib64/pkgconfig/ruby-2.5.pc` About `Makefile` update using `ruby-2.5.pc`. This too difficult for me. I will remove commit related to Makefile in this PR.
Hello Victor @linuxmaniac PR is update you continue review
@sergey-safarov -- can you give the output of next command:
``` pkg-config --list-all | grep ruby ```
The makefile for app_ruby tries to detect the version, but it seems to fail there...
@miconda output is here ``` bash-4.4# pkg-config --list-all | grep ruby ruby-2.5 Ruby - Object Oriented Script Language ``` And all other ``` bash-4.4# pkg-config --list-all libpcre16 libpcre16 - PCRE - Perl compatible regular expressions C library with 16 bit character support tic tic - ncurses 6.1 add-on library libpq libpq - PostgreSQL libpq library python Python - Python library ncurses ncurses - ncurses 6.1 library libecpg libecpg - PostgreSQL libecpg library json json-c - A JSON implementation in C popt popt - popt library. geoip geoip - A non-DNS IP-to-country resolver library. menu menu - ncurses 6.1 add-on library libpcreposix libpcreposix - PCREPosix - Posix compatible interface to libpcre ruby-2.5 Ruby - Object Oriented Script Language ncursesw ncursesw - ncurses 6.1 library ncurses++ ncurses++ - ncurses 6.1 add-on library odbccr unixODBC - unixODBC is an Open Source ODBC sub-system. rpm RPM - RPM Package Manager jansson Jansson - Library for encoding, decoding and manipulating JSON data ncurses++w ncurses++w - ncurses 6.1 add-on library odbcinst unixODBC - unixODBC is an Open Source ODBC sub-system. panelw panelw - ncurses 6.1 add-on library libcurl libcurl - Library to transfer files with ftp, http, etc. libevent_core libevent_core - libevent_core libmemcached libmemcached - libmemcached C/C++ library. libsasl2 Cyrus SASL - Cyrus SASL implementation hiredis hiredis - Minimalistic C client library for Redis. tinfo tinfo - ncurses 6.1 terminal interface library openssl OpenSSL - Secure Sockets Layer and cryptography libraries and tools lua5.3 Lua 5.3 - An Extensible Extension Language panel panel - ncurses 6.1 add-on library libevent_openssl libevent_openssl - libevent_openssl adds openssl-based TLS support to libevent sqlite3 SQLite - SQL database engine libcrypto OpenSSL-libcrypto - OpenSSL cryptography library libpcrecpp libpcrecpp - PCRECPP - C++ wrapper for PCRE libevent_extra libevent_extra - libevent_extra expat expat - expat XML parser libssl OpenSSL-libssl - Secure Sockets Layer and cryptography libraries libpcre libpcre - PCRE - Perl compatible regular expressions C library with 8 bit character support lua Lua 5.3 - An Extensible Extension Language json-c json-c - A JSON implementation in C libecpg_compat libecpg_compat - PostgreSQL libecpg_compat library libpgtypes libpgtypes - PostgreSQL libpgtypes library udev udev - udev systemd systemd - systemd System and Service Manager odbc unixODBC - unixODBC is an Open Source ODBC sub-system. libevent libevent - libevent is an asynchronous notification event loop library liblzma liblzma - General purpose data compression library zlib zlib - zlib compression library libevent_pthreads libevent_pthreads - libevent_pthreads adds pthreads-based threading support to libevent uuid uuid - Universally unique id library menuw menuw - ncurses 6.1 add-on library form form - ncurses 6.1 add-on library libmnl libmnl - Minimalistic Netlink communication library libxml-2.0 libXML - libXML library version2. python2 Python - Python library formw formw - ncurses 6.1 add-on library python-2.7 Python - Python library ```
Looks ok, the Makefile of the module should detect is ruby-2.5 and do `pkg-config ... ruby-2.5`.
Can you go to src/modules/app_ruby and do:
``` make clean make Q=0 ``` and paste the output here.
Daniel @miconda, requested log here ``` bash-4.4# make clean bash-4.4# make Q=0 config.mak included gcc -fPIC -DPIC -g -funroll-loops -Wcast-align -m64 -minline-all-stringops -falign-loops -ftree-vectorize -fno-strict-overflow -mtune=generic -Wall -DNAME='"kamailio"' -DVERSION='"5.3.0-dev1"' -DARCH='"x86_64"' -DOS='linux_' -DOS_QUOTED='"linux"' -DCOMPILER='"gcc 8.2.1"' -D__CPU_x86_64 -D__OS_linux -DVERSIONVAL=5003000 -DCFG_DIR='"/etc/kamailio/"' -DSHARE_DIR='"/usr/share/kamailio/"' -DRUN_DIR='"/var/run/kamailio/"' -DPKG_MALLOC -DSHM_MEM -DSHM_MMAP -DDNS_IP_HACK -DUSE_MCAST -DUSE_TCP -DDISABLE_NAGLE -DHAVE_RESOLV_RES -DUSE_DNS_CACHE -DUSE_DNS_FAILOVER -DUSE_DST_BLACKLIST -DUSE_NAPTR -DWITH_XAVP -DMEM_JOIN_FREE -DF_MALLOC -DQ_MALLOC -DTLSF_MALLOC -DDBG_SR_MEMORY -DUSE_TLS -DTLS_HOOKS -DUSE_CORE_STATS -DSTATISTICS -DMALLOC_STATS -DWITH_AS_SUPPORT -DUSE_SCTP -DFAST_LOCK -DADAPTIVE_WAIT -DADAPTIVE_WAIT_LOOPS=1024 -DCC_GCC_LIKE_ASM -DHAVE_GETHOSTBYNAME2 -DHAVE_UNION_SEMUN -DHAVE_SCHED_YIELD -DHAVE_MSG_NOSIGNAL -DHAVE_MSGHDR_MSG_CONTROL -DHAVE_ALLOCA_H -DHAVE_TIMEGM -DHAVE_SCHED_SETSCHEDULER -DHAVE_IP_MREQN -DUSE_RAW_SOCKS -DHAVE_EPOLL -DHAVE_SIGIO_RT -DSIGINFO64_WORKARROUND -DUSE_FUTEX -DHAVE_SELECT -I/usr/include/ruby-2.5.0/x86_64-linux-gnu -I/usr/include/ruby-2.5.0 -DMOD_NAME='"app_ruby"' -c app_ruby_mod.c -o app_ruby_mod.o -MMD -MP gcc -fPIC -DPIC -g -funroll-loops -Wcast-align -m64 -minline-all-stringops -falign-loops -ftree-vectorize -fno-strict-overflow -mtune=generic -Wall -DNAME='"kamailio"' -DVERSION='"5.3.0-dev1"' -DARCH='"x86_64"' -DOS='linux_' -DOS_QUOTED='"linux"' -DCOMPILER='"gcc 8.2.1"' -D__CPU_x86_64 -D__OS_linux -DVERSIONVAL=5003000 -DCFG_DIR='"/etc/kamailio/"' -DSHARE_DIR='"/usr/share/kamailio/"' -DRUN_DIR='"/var/run/kamailio/"' -DPKG_MALLOC -DSHM_MEM -DSHM_MMAP -DDNS_IP_HACK -DUSE_MCAST -DUSE_TCP -DDISABLE_NAGLE -DHAVE_RESOLV_RES -DUSE_DNS_CACHE -DUSE_DNS_FAILOVER -DUSE_DST_BLACKLIST -DUSE_NAPTR -DWITH_XAVP -DMEM_JOIN_FREE -DF_MALLOC -DQ_MALLOC -DTLSF_MALLOC -DDBG_SR_MEMORY -DUSE_TLS -DTLS_HOOKS -DUSE_CORE_STATS -DSTATISTICS -DMALLOC_STATS -DWITH_AS_SUPPORT -DUSE_SCTP -DFAST_LOCK -DADAPTIVE_WAIT -DADAPTIVE_WAIT_LOOPS=1024 -DCC_GCC_LIKE_ASM -DHAVE_GETHOSTBYNAME2 -DHAVE_UNION_SEMUN -DHAVE_SCHED_YIELD -DHAVE_MSG_NOSIGNAL -DHAVE_MSGHDR_MSG_CONTROL -DHAVE_ALLOCA_H -DHAVE_TIMEGM -DHAVE_SCHED_SETSCHEDULER -DHAVE_IP_MREQN -DUSE_RAW_SOCKS -DHAVE_EPOLL -DHAVE_SIGIO_RT -DSIGINFO64_WORKARROUND -DUSE_FUTEX -DHAVE_SELECT -I/usr/include/ruby-2.5.0/x86_64-linux-gnu -I/usr/include/ruby-2.5.0 -DMOD_NAME='"app_ruby"' -c app_ruby_kemi_export.c -o app_ruby_kemi_export.o -MMD -MP gcc -fPIC -DPIC -g -funroll-loops -Wcast-align -m64 -minline-all-stringops -falign-loops -ftree-vectorize -fno-strict-overflow -mtune=generic -Wall -DNAME='"kamailio"' -DVERSION='"5.3.0-dev1"' -DARCH='"x86_64"' -DOS='linux_' -DOS_QUOTED='"linux"' -DCOMPILER='"gcc 8.2.1"' -D__CPU_x86_64 -D__OS_linux -DVERSIONVAL=5003000 -DCFG_DIR='"/etc/kamailio/"' -DSHARE_DIR='"/usr/share/kamailio/"' -DRUN_DIR='"/var/run/kamailio/"' -DPKG_MALLOC -DSHM_MEM -DSHM_MMAP -DDNS_IP_HACK -DUSE_MCAST -DUSE_TCP -DDISABLE_NAGLE -DHAVE_RESOLV_RES -DUSE_DNS_CACHE -DUSE_DNS_FAILOVER -DUSE_DST_BLACKLIST -DUSE_NAPTR -DWITH_XAVP -DMEM_JOIN_FREE -DF_MALLOC -DQ_MALLOC -DTLSF_MALLOC -DDBG_SR_MEMORY -DUSE_TLS -DTLS_HOOKS -DUSE_CORE_STATS -DSTATISTICS -DMALLOC_STATS -DWITH_AS_SUPPORT -DUSE_SCTP -DFAST_LOCK -DADAPTIVE_WAIT -DADAPTIVE_WAIT_LOOPS=1024 -DCC_GCC_LIKE_ASM -DHAVE_GETHOSTBYNAME2 -DHAVE_UNION_SEMUN -DHAVE_SCHED_YIELD -DHAVE_MSG_NOSIGNAL -DHAVE_MSGHDR_MSG_CONTROL -DHAVE_ALLOCA_H -DHAVE_TIMEGM -DHAVE_SCHED_SETSCHEDULER -DHAVE_IP_MREQN -DUSE_RAW_SOCKS -DHAVE_EPOLL -DHAVE_SIGIO_RT -DSIGINFO64_WORKARROUND -DUSE_FUTEX -DHAVE_SELECT -I/usr/include/ruby-2.5.0/x86_64-linux-gnu -I/usr/include/ruby-2.5.0 -DMOD_NAME='"app_ruby"' -c app_ruby_api.c -o app_ruby_api.o -MMD -MP gcc -shared -m64 -Wl,-O2 -Wl,-E app_ruby_mod.o app_ruby_kemi_export.o app_ruby_api.o -lruby2.5 -lpthread -lcrypt -lm -o app_ruby.so ```
I am confused -- what issue you faced? Everything seems to be ok when compiling the module. Or actually now everything is ok from your point of view?
@miconda Could you check error in log ``` [root@node0 kamailio]# cd src/modules/app_ruby/ [root@node0 app_ruby]# make clean [root@node0 app_ruby]# make Q=0 config.mak included config.mak included gcc -fPIC -DPIC -g -funroll-loops -Wcast-align -m64 -minline-all-stringops -falign-loops -ftree-vectorize -fno-strict-overflow -mtune=generic -Wall -DNAME='"kamailio"' -DVERSION='"5.3.0-dev1"' -DARCH='"x86_64"' -DOS='linux_' -DOS_QUOTED='"linux"' -DCOMPILER='"gcc 4.8.5"' -D__CPU_x86_64 -D__OS_linux -DVERSIONVAL=5003000 -DCFG_DIR='"/usr/local/etc/kamailio/"' -DSHARE_DIR='"/usr/local/share/kamailio/"' -DRUN_DIR='"/var/run/kamailio/"' -DPKG_MALLOC -DSHM_MEM -DSHM_MMAP -DDNS_IP_HACK -DUSE_MCAST -DUSE_TCP -DDISABLE_NAGLE -DHAVE_RESOLV_RES -DUSE_DNS_CACHE -DUSE_DNS_FAILOVER -DUSE_DST_BLACKLIST -DUSE_NAPTR -DWITH_XAVP -DMEM_JOIN_FREE -DF_MALLOC -DQ_MALLOC -DTLSF_MALLOC -DDBG_SR_MEMORY -DUSE_TLS -DTLS_HOOKS -DUSE_CORE_STATS -DSTATISTICS -DMALLOC_STATS -DWITH_AS_SUPPORT -DUSE_SCTP -DFAST_LOCK -DADAPTIVE_WAIT -DADAPTIVE_WAIT_LOOPS=1024 -DCC_GCC_LIKE_ASM -DHAVE_GETHOSTBYNAME2 -DHAVE_UNION_SEMUN -DHAVE_SCHED_YIELD -DHAVE_MSG_NOSIGNAL -DHAVE_MSGHDR_MSG_CONTROL -DHAVE_ALLOCA_H -DHAVE_TIMEGM -DHAVE_SCHED_SETSCHEDULER -DHAVE_IP_MREQN -DUSE_RAW_SOCKS -DHAVE_EPOLL -DHAVE_SIGIO_RT -DSIGINFO64_WORKARROUND -DUSE_FUTEX -DHAVE_SELECT -I/usr/local/include -I/include -DMOD_NAME='"app_ruby"' -c app_ruby_api.c -o app_ruby_api.o -MMD -MP gcc -fPIC -DPIC -g -funroll-loops -Wcast-align -m64 -minline-all-stringops -falign-loops -ftree-vectorize -fno-strict-overflow -mtune=generic -Wall -DNAME='"kamailio"' -DVERSION='"5.3.0-dev1"' -DARCH='"x86_64"' -DOS='linux_' -DOS_QUOTED='"linux"' -DCOMPILER='"gcc 4.8.5"' -D__CPU_x86_64 -D__OS_linux -DVERSIONVAL=5003000 -DCFG_DIR='"/usr/local/etc/kamailio/"' -DSHARE_DIR='"/usr/local/share/kamailio/"' -DRUN_DIR='"/var/run/kamailio/"' -DPKG_MALLOC -DSHM_MEM -DSHM_MMAP -DDNS_IP_HACK -DUSE_MCAST -DUSE_TCP -DDISABLE_NAGLE -DHAVE_RESOLV_RES -DUSE_DNS_CACHE -DUSE_DNS_FAILOVER -DUSE_DST_BLACKLIST -DUSE_NAPTR -DWITH_XAVP -DMEM_JOIN_FREE -DF_MALLOC -DQ_MALLOC -DTLSF_MALLOC -DDBG_SR_MEMORY -DUSE_TLS -DTLS_HOOKS -DUSE_CORE_STATS -DSTATISTICS -DMALLOC_STATS -DWITH_AS_SUPPORT -DUSE_SCTP -DFAST_LOCK -DADAPTIVE_WAIT -DADAPTIVE_WAIT_LOOPS=1024 -DCC_GCC_LIKE_ASM -DHAVE_GETHOSTBYNAME2 -DHAVE_UNION_SEMUN -DHAVE_SCHED_YIELD -DHAVE_MSG_NOSIGNAL -DHAVE_MSGHDR_MSG_CONTROL -DHAVE_ALLOCA_H -DHAVE_TIMEGM -DHAVE_SCHED_SETSCHEDULER -DHAVE_IP_MREQN -DUSE_RAW_SOCKS -DHAVE_EPOLL -DHAVE_SIGIO_RT -DSIGINFO64_WORKARROUND -DUSE_FUTEX -DHAVE_SELECT -I/usr/local/include -I/include -DMOD_NAME='"app_ruby"' -c app_ruby_kemi_export.c -o app_ruby_kemi_export.o -MMD -MP gcc -fPIC -DPIC -g -funroll-loops -Wcast-align -m64 -minline-all-stringops -falign-loops -ftree-vectorize -fno-strict-overflow -mtune=generic -Wall -DNAME='"kamailio"' -DVERSION='"5.3.0-dev1"' -DARCH='"x86_64"' -DOS='linux_' -DOS_QUOTED='"linux"' -DCOMPILER='"gcc 4.8.5"' -D__CPU_x86_64 -D__OS_linux -DVERSIONVAL=5003000 -DCFG_DIR='"/usr/local/etc/kamailio/"' -DSHARE_DIR='"/usr/local/share/kamailio/"' -DRUN_DIR='"/var/run/kamailio/"' -DPKG_MALLOC -DSHM_MEM -DSHM_MMAP -DDNS_IP_HACK -DUSE_MCAST -DUSE_TCP -DDISABLE_NAGLE -DHAVE_RESOLV_RES -DUSE_DNS_CACHE -DUSE_DNS_FAILOVER -DUSE_DST_BLACKLIST -DUSE_NAPTR -DWITH_XAVP -DMEM_JOIN_FREE -DF_MALLOC -DQ_MALLOC -DTLSF_MALLOC -DDBG_SR_MEMORY -DUSE_TLS -DTLS_HOOKS -DUSE_CORE_STATS -DSTATISTICS -DMALLOC_STATS -DWITH_AS_SUPPORT -DUSE_SCTP -DFAST_LOCK -DADAPTIVE_WAIT -DADAPTIVE_WAIT_LOOPS=1024 -DCC_GCC_LIKE_ASM -DHAVE_GETHOSTBYNAME2 -DHAVE_UNION_SEMUN -DHAVE_SCHED_YIELD -DHAVE_MSG_NOSIGNAL -DHAVE_MSGHDR_MSG_CONTROL -DHAVE_ALLOCA_H -DHAVE_TIMEGM -DHAVE_SCHED_SETSCHEDULER -DHAVE_IP_MREQN -DUSE_RAW_SOCKS -DHAVE_EPOLL -DHAVE_SIGIO_RT -DSIGINFO64_WORKARROUND -DUSE_FUTEX -DHAVE_SELECT -I/usr/local/include -I/include -DMOD_NAME='"app_ruby"' -c app_ruby_mod.c -o app_ruby_mod.o -MMD -MP gcc -shared -m64 -Wl,-O2 -Wl,-E app_ruby_api.o app_ruby_kemi_export.o app_ruby_mod.o -L/usr/local/lib -L/lib -lruby -lpthread -lobjc -o app_ruby.so /usr/bin/ld: cannot find -lobjc collect2: error: ld returned 1 exit status make: *** [app_ruby.so] Error 1 ``` And some additional info ``` [root@node0 app_ruby]# pkg-config --list-all | grep ruby ruby Ruby - Object Oriented Script Language [root@node0 app_ruby]# cat /usr/lib64/pk pkcs11/ pkgconfig/ [root@node0 app_ruby]# cat /usr/lib64/pk pkcs11/ pkgconfig/ [root@node0 app_ruby]# cat /usr/lib64/pkgconfig/ruby.pc arch=x86_64-linux sitearch=${arch} prefix=/usr exec_prefix=${prefix} bindir=${exec_prefix}/bin libdir=${exec_prefix}/lib64 includedir=/usr/include MAJOR=2 MINOR=0 TEENY=0 ruby_version= RUBY_PROGRAM_VERSION=2.0.0 RUBY_BASE_NAME=ruby RUBY_VERSION_NAME=${RUBY_BASE_NAME}-${ruby_version} RUBY_SO_NAME=${RUBY_BASE_NAME} RUBY_INSTALL_NAME=${RUBY_BASE_NAME} DEFFILE= LIBPATH= LIBRUBY_A=lib${RUBY_SO_NAME}-static.a LIBRUBY_SO=lib${RUBY_SO_NAME}.so.${MAJOR}.${MINOR}.${TEENY} LIBRUBY=${LIBRUBY_SO} LIBRUBYARG_SHARED=-l${RUBY_SO_NAME} LIBRUBYARG_STATIC=-l${RUBY_SO_NAME}-static LIBRUBYARG=${LIBRUBYARG_SHARED} LIBS=-lpthread -lrt -ldl -lcrypt -lm DLDFLAGS= archlibdir=${libdir}/${arch} sitearchlibdir=${libdir}/${sitearch} archincludedir=${includedir}/${arch} sitearchincludedir=${includedir}/${sitearch} ruby=${bindir}/${RUBY_INSTALL_NAME} rubylibprefix=${exec_prefix}/share/${RUBY_BASE_NAME} rubyarchprefix=${libdir}/${RUBY_BASE_NAME} rubysitearchprefix=${sitearchlibdir}/${RUBY_BASE_NAME} rubylibdir=${rubylibprefix}/${ruby_version} vendordir=/usr/share/ruby/vendor_ruby sitedir=/usr/local/share/ruby/site_ruby vendorlibdir=${vendordir}/${ruby_version} sitelibdir=${sitedir}/${ruby_version} rubyarchdir=${rubyarchprefix}/${ruby_version} vendorarchdir=/usr/lib64/ruby/vendor_ruby sitearchdir=/usr/local/lib64/ruby/site_ruby rubyhdrdir=/usr/include vendorhdrdir=${rubyhdrdir}/vendor_ruby sitehdrdir=${rubyhdrdir}/site_ruby
Name: Ruby Description: Object Oriented Script Language Version: 2.0.0 URL: http://www.ruby-lang.org Cflags: -I${rubyhdrdir}/${arch} -I${rubyhdrdir} Libs: ${DLDFLAGS} ${LIBRUBYARG_SHARED} ${LIBS} Requires: [root@node0 app_ruby]# cat /etc/redhat-release CentOS Linux release 7.5.1804 (Core) ```
Maybe this is because on CentOS cannot be detected ruby version by command ``` RUBYVER=$(shell pkg-config --list-all | grep ruby-2 | tail -1 | cut -f 1 -d " ") ``` On CentOS is exist ``` [root@node0 app_ruby]# pkg-config --list-all | grep ruby ruby Ruby - Object Oriented Script Language ``` not `ruby-2`
How about this update ```diff diff --git a/src/modules/app_ruby/Makefile b/src/modules/app_ruby/Makefile index 9e54ba2..66c71ff 100644 --- a/src/modules/app_ruby/Makefile +++ b/src/modules/app_ruby/Makefile @@ -7,10 +7,7 @@ include ../../Makefile.defs auto_gen= NAME=app_ruby.so
-RUBYVER=$(shell pkg-config --list-all | grep ruby-2 | tail -1 | cut -f 1 -d " ") -ifeq ($(RUBYVER),) -RUBYVER=ruby-2.3 -endif +RUBYVER=$(shell pkg-config --list-all | grep ruby | tail -1 | cut -f 1 -d " ") ifeq ($(CROSS_COMPILE),) BUILDER = $(shell which pkg-config) ifneq ($(BUILDER),) ```
I think it's ok to do `grep ruby` instead of `grep ruby-2`, although I put `-2` to ensure it is ruby version 2.x, iirc, it might not work with older versions.
By removing:
``` -ifeq ($(RUBYVER),) -RUBYVER=ruby-2.3 -endif ```
Another test has to be done to be sure RUBYVER is not empty. I looked a bit more into the Makefile, and I think that the order of doing the detection should be changed. I will push a commit very soon to fix all.
Pushed that commit, can you test and see if now all ok? Thanks!
@miconda Now tested master. `app_ruby` compiled on CentOS. How about this update ```diff diff --git a/src/modules/app_ruby/Makefile b/src/modules/app_ruby/Makefile index 45a7b11..6a1eb43 100644 --- a/src/modules/app_ruby/Makefile +++ b/src/modules/app_ruby/Makefile @@ -21,6 +21,11 @@ endif
ifneq ($(PKGLIBRUBY),0) BUILDER = +else + RUBYACCEPTABLE = $(shell $(BUILDER) --libs "$(RUBYVER) >= 2" > /dev/null 2>&1 ; echo $$? ) +ifneq ($(RUBYACCEPTABLE),0) + BUILDER = +endif endif
ifneq ($(BUILDER),) ```
Let's leave it as it is for the moment. If someone complains app_ruby doesn't work for ruby 1.x, then we can change it to what you proposed. Most OSes have ruby 2.x anyhow.
Hello Victor @linuxmaniac Could you check again this PR
@sergey-safarov - you can merge it. If @linuxmaniac want to amend, it can push a commit afterward.
Merged #1762 into master.