Bug 1040065

Summary: Unable to compile mysql2 ruby gem with MySQL 5.5 (SCL)
Product: OKD Reporter: Michal Fojtik <mfojtik>
Component: ImageAssignee: Michal Fojtik <mfojtik>
Status: CLOSED NOTABUG QA Contact: libra bugs <libra-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 2.xCC: hhorak
Target Milestone: ---Keywords: UpcomingRelease
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-12-10 16:43:22 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Michal Fojtik 2013-12-10 16:08:03 UTC
Description of problem:

When testing a MySQL 5.5 cartridge, I found that users are not able to
compile the mysql2 gem (required by Rails) due to missing 'libmysqlclient'

The 'libmysqlclient' is not included in SCL, intentionaly, because SCL team
wants users to compile their clients against the system libmysqlclient.

The problem is that mysql_config script that 'mysql2' execute during
the gem build, reports the MySQL directory from SCL...


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. Prepare devenv with mysql55 SCL installed and with this PR synced: https://github.com/openshift/origin-server/pull/4299
2. rhc app create rails01 ruby-1.9
3. rhc add-cartridge mysql-5.5 --app rails01
4. Follow the steps described in rails quickstart
5. git push

Actual results:
 remote: gcc -shared -o mysql2.so client.o mysql2_ext.o result.o -L. -L/opt/rh/ruby193/root/usr/lib64 -L. -rdynamic 
                -Wl,-export-dynamic -Wl,-rpath,/opt/rh/mysql55/root/usr/lib64/mysql  -m64  -lruby -L/opt/rh/mysql55/root/usr/lib64/mysql 
                -lmysqlclient -lpthread -lz -lm -lrt -lssl -lcrypto -ldl  -lpthread -lrt -ldl -lcrypt -lm   -lc
remote: /usr/bin/ld: cannot find -lmysqlclient



Expected results:


Additional info:

Comment 1 Michal Fojtik 2013-12-10 16:17:01 UTC
Note: The

 -L/opt/rh/mysql55/root/usr/lib64/mysql -lmysqlclient -lpthread -lz -lm -lrt -lssl -lcrypto -ldl  -lpthread -lrt -ldl -lcrypt -lm   -lc

is produced by mysql_config... The easiest solution would be to overide this to point into /usr/lib64/mysql

Comment 2 Michal Fojtik 2013-12-10 16:43:22 UTC
The problem was found in the PR, where we set the OPENSHIFT_MYSQL_PATH_ELEMENT to point into SCL directory, which also include the mysql_config script. Removing this solved this problem.

Comment 3 openshift-github-bot 2013-12-11 18:32:02 UTC
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/edb7b7b3902def2375b5db613ed0832876aae466
Bug 1040065 - Disabled OPENSHIFT_MYSQL_PATH_ELEMENT via SCL