-
Notifications
You must be signed in to change notification settings - Fork 24
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
Can't build on 32-bit Fedora 8 #4
Comments
I just checked in a fix to pass the opts after -- through to configure. So, you should now be able to install with: Let me know if it works for you. Thanks, |
Actually, it looks ruby escapes the args strangely, so you may need to do: |
Yes, I noticed the weird escaping in my own testing. Thanks for this. I just tested it and can confirm that the args do get passed through to The other workaround that I had, which also works, is to build libmemcached first separately, and then install using:
For this to actually work in a Bundler context, I had to do it setting
And then when running So it's nice to have both options as workarounds for now, although to be honest, I like the one you've implemented in your patch the best. Cheers, |
libmemcached won't build on 32-bit Fedora 8 unless
--disable-64bit CFLAGS="-march i686"
is passed to./configure
.Due to this I've found that I can't build the gem using
gem install memcache
, nor any incantation ofgem install memcache -- --extra-flags-here
. There is an$EXTRA_CONF
global variable that is referenced in theext/extconf.rb
, but I am ignorant of how to get custom build settings into that global:Unfortunately, this doesn't work:
The first few lines of the failed
gem_make.out
read as follows, so I see the switches getting passed toextconf.rb
, but they evidently don't make it to theconfigure
line:The only way I've been able to get it to build is by hand-editing the
ext/extconf.rb
file to include those flags.I see that the memcached project does have some platform-specific stuff in its
extconf.rb
(see the Solaris-specific stuff):http://github.com/fauna/memcached/blob/master/ext/extconf.rb
I wonder if something similar could be done here?
Output of
ruby -r rbconfig -r pp -e 'pp RbConfig::CONFIG.sort'
on 32-bit Fedora 8 appears here:http://gist.github.com/558863
Perhaps if
target_cpu
isi686
as it is here,-march=i686
could be added to theCFLAGS
. I am not sure what test would need to be applied to check for 32-bit vs 64-bit systems (for the--disable-64bit
flag).As an aside, I did look at using an "external" libmemcached on the machine so that the memcache gem could just pick that up. This requires the
EXTERNAL_LIB
variable to be set in the environment.Seems like it could work with
env EXTERNAL_LIB=1 gem install memcache
, but that won't help with Bundler-based deployment because Bundler only allows you to set up build options that appear after thegem install
(ie.gem install memcache -- EXTERNAL_LIB=1
, which doesn't get picked up inside theextconf.rb
as far as I can tell).I guess the
extconf.rb
could be customized to look atARGV
for patterns of the formx=y
and possibly act on them. No idea if there are precedents for this though.For reference, upstream bug in libmemcached tracker:
https://bugs.launchpad.net/libmemcached/+bug/516774
Anyway, sorry about the monster ticket. Interested to hear your input on any of these points. My workaround in the meantime is to patch and build by hand, and set Bundler to use a shared
BUNDLE_PATH
; that way it doesn't try to rebuild the gem on each deployment (which would fail).Cheers,
Wincent
The text was updated successfully, but these errors were encountered: