Opened 14 years ago

Closed 14 years ago

Last modified 2 years ago

#24240 closed defect (fixed)

ruby +universal does not contain universal binary *.bundle modules

Reported by: cdavis@… Owned by: kimuraw (kimura wataru)
Priority: Normal Milestone:
Component: ports Version: 1.8.2
Keywords: universal Cc: mr_bond@…, mascguy (Christopher Nielsen)
Port: ruby rb-rubygems

Description

There's no zlib module included with ruby 1.8.7, and yet rubygems expects it to be there. Without the zlib ruby module, rubygems will not work.

For example, running:

 gem list

produces this:

/opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- zlib (LoadError)
	from /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:31:in `require'
	from /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/spec_fetcher.rb:1
	from /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
	from /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:31:in `require'
		from /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/commands/query_command.rb:3
	from /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
	from /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:31:in `require'
	from /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/commands/list_command.rb:2
	from /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
	from /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:31:in `require'
	from /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/command_manager.rb:167:in `load_and_instantiate'
	from /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/command_manager.rb:88:in `[]'
	from /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/command_manager.rb:144:in `find_command'
	from /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/command_manager.rb:131:in `process_args'
	from /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/command_manager.rb:102:in `run'
	from /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/gem_runner.rb:58:in `run'
	from /usr/local/bin/gem:21

on my system. Is there something I'm missing, or should there be an 'rb-zlib' port?

I run Mac OS X 10.6.2.

Attachments (1)

patch-lib-mkmf.rb.diff (460 bytes) - added by cdavis@… 14 years ago.
Patch file for ruby that fixes problems with CPP

Download all attachments as: .zip

Change History (9)

comment:1 Changed 14 years ago by mf2k (Frank Schima)

Cc: mr_bond@… added; kimuraw@… removed
Owner: changed from macports-tickets@… to kimuraw@…

comment:2 Changed 14 years ago by cdavis@…

I did some research, and I figured out what's happening.

Ruby actually comes with a zlib extension module, but for some reason, it isn't getting built. Looking at the 'mkmf.log' file, I find (lines broken up to enhance readability):

have_header: checking for zlib.h... -------------------- no

"/usr/bin/gcc-4.2 -E -I../.. -I../../. -I../.././ext/zlib -I/opt/local/include -D_XOPEN_SOURCE 
-D_DARWIN_C_SOURCE  -I/opt/local/include -O2 -arch x86_64 -arch i386  -fno-common -pipe -fno-common    
conftest.c -o conftest.i"
gcc-4.2: -E, -S, -save-temps and -M options are not allowed with multiple -arch flags
checked program was:
/* begin */
1: #include <zlib.h>
/* end */

The problem is that, once again, somebody stupidly passed -arch flags at the same time as the -E flag, and instead of ignoring the -arch flags, GCC stupidly insists that we run -E without them.

Changed 14 years ago by cdavis@…

Attachment: patch-lib-mkmf.rb.diff added

Patch file for ruby that fixes problems with CPP

comment:3 Changed 14 years ago by cdavis@…

The patchfile I attached fixes the problem--and any other problems with finding headers when ruby is built +universal. It changes the mkmf module not to pass CFLAGS to invocations of the CPP.

Oh, did I mention I built ruby +universal? That's really the root cause of all this.

comment:4 Changed 14 years ago by kimuraw (kimura wataru)

Status: newassigned

the variant +universal introduced from r43591 does not work completely. it makes universal binaries only libruby.dylib and ruby, not extension modules such as zlib.bundle. the extension modules are built as single architecture.

I'm starting to correct this problem.

comment:5 Changed 14 years ago by kimuraw (kimura wataru)

Keywords: universal added
Summary: rb-rubygems needs a zlib ruby moduleruby +universal does not contain universal binary *.bundle modules

change summary

comment:6 Changed 14 years ago by kimuraw (kimura wataru)

Resolution: fixed
Status: assignedclosed

I've fixed this problem as r65766 (ruby-1.8.7-p249_2).

please try the latest port:ruby.

  % sudo port sync
  % sudo port -n upgrade ruby

comment:7 Changed 14 years ago by cdavis@…

Yup, that fixed it. Thanks!

comment:8 Changed 2 years ago by mascguy (Christopher Nielsen)

Cc: mascguy added
Note: See TracTickets for help on using tickets.