Opened 13 years ago

Closed 13 years ago

#31756 closed defect (fixed)

ruby19 @1.9.2-p290

Reported by: joshuajmoody@… Owned by: kimuraw (kimura wataru)
Priority: Normal Milestone:
Component: ports Version: 2.0.3
Keywords: lion Cc:
Port: ruby19

Description

System Information: Lion 10.7.2 and Xcode 4.2

I ran into trouble installing ruby19.

:info:configure checking whether the C compiler works... no
:info:configure configure: error: in `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_lang_ruby19/ruby19/work/ruby-1.9.2-p290'                                                                                                                                                                                      
:info:configure configure: error: C compiler cannot create executables

Looking at the Portfile, I found this:

# ruby-1.9.x built with clang or llvm-gcc does not work                                                                                                                                
# see list "MacPorts on Lion (common issues, fixes, and workarounds)"                                                                                                                  
# http://lists.macosforge.org/pipermail/macports-dev/2011-July/015263.html                                                                                                             
if {${configure.compiler} == "clang" ||                                                                                                                                              
      ${configure.compiler} == "llvm-gcc-4.2"} {                                                                                                                                     
      configure.compiler gcc-4.2                                                                                                                                                     
      if {![file executable ${configure.cc}]} {                                                                                                                                      
              depends_build-append port:apple-gcc42                                                                                                                                  
              configure.compiler apple-gcc-4.2                                                                                                                                       
      }   
}                                                                                                                                                                            }  

I read the information in the link provided in the comment and decided to try to compile with clang.

I was able to successful build ruby19 and subsequently rb19-rails by commenting out the compiler if conditional.

# ruby-1.9.x built with clang or llvm-gcc does not work                                                                                                                                
# see list "MacPorts on Lion (common issues, fixes, and workarounds)"                                                                                                                  
# http://lists.macosforge.org/pipermail/macports-dev/2011-July/015263.html                                                                                                             
# if {${configure.compiler} == "clang" ||                                                                                                                                              
#       ${configure.compiler} == "llvm-gcc-4.2"} {                                                                                                                                     
#       configure.compiler gcc-4.2                                                                                                                                                     
#       if {![file executable ${configure.cc}]} {                                                                                                                                      
#               depends_build-append port:apple-gcc42                                                                                                                                  
#               configure.compiler apple-gcc-4.2                                                                                                                                       
#       }                                                                                                                                                                              
# } 

Can the maintainer please investigate and update the Portfile as necessary?

Thanks!

Joshua

Attachments (6)

main.log (19.8 KB) - added by joshuajmoody@… 13 years ago.
log file of failed ruby19 build
port-ruby19-failed-config.log (7.6 KB) - added by joshuajmoody@… 13 years ago.
config log for failed ruby19 build
port-ruby19-failed-main.log (19.7 KB) - added by joshuajmoody@… 13 years ago.
main log for failed ruby19 build (replaces previously uploaded main.log)
port-ruby19-success-main.log (288.0 KB) - added by joshuajmoody@… 13 years ago.
main log for successful ruby19 build (captured during port staging operation)
ruby-192p290-lion-xcode42-clang-make_test.log (14.0 KB) - added by kimuraw (kimura wataru) 13 years ago.
`make test' ruby built with Xcode-4.2 clang
ruby-192p290-lion-xcode42-llvm-gcc-4.2-make_test.log (9.1 KB) - added by kimuraw (kimura wataru) 13 years ago.
`make test' ruby built with Xcode-4.2 llvm-gcc

Download all attachments as: .zip

Change History (11)

Changed 13 years ago by joshuajmoody@…

Attachment: main.log added

log file of failed ruby19 build

comment:1 Changed 13 years ago by ryandesign (Ryan Carsten Schmidt)

Owner: changed from macports-tickets@… to kimuraw@…
Priority: HighNormal

The comment says "ruby-1.9.x built with clang or llvm-gcc does not work", and you only said you were able to build it. Were you actually able to run it also?

comment:2 Changed 13 years ago by ryandesign (Ryan Carsten Schmidt)

Also, it might help to diagnose your earlier build failure if you attach the config.log. It looks like MacPorts selected the "Mac OS X gcc 4.2", which I would not have expected, given that you have Xcode 4.2, which does not include any version of gcc.

Changed 13 years ago by joshuajmoody@…

config log for failed ruby19 build

Changed 13 years ago by joshuajmoody@…

Attachment: port-ruby19-failed-main.log added

main log for failed ruby19 build (replaces previously uploaded main.log)

Changed 13 years ago by joshuajmoody@…

main log for successful ruby19 build (captured during port staging operation)

comment:3 Changed 13 years ago by joshuajmoody@…

The comment says "ruby-1.9.x built with clang or llvm-gcc does not work", and you only said you were able to build it. Were you actually able to run it also?

I am able to run ruby19. I installed rb19-rails and was able to stand up a demo rails site on my machine.

Also, it might help to diagnose your earlier build failure if you attach the config.log.

I did a clean install of MacPorts 2.0.3 in an alternative location. I have attached a config.log and a main.log for a failed ruby19 build. I have also attached the main.log for the successful ruby19 build (halted during the port staging phasing)

It looks like MacPorts selected the "Mac OS X gcc 4.2", which I would not have expected, given that you have Xcode 4.2, which does not include any version of gcc.

This machine has previously had Xcode 3.*, Xcode 4.0, and Xcode 4.1 installed on it. For a time it had both Xcode 4.1 and 4.2 installed.

Here is some information about gcc-4.2 on my machine:

moody% ls -al `which gcc-4.2`
-rwxr-xr-x  1 root  wheel  113024 May 16 05:37 /usr/bin/gcc-4.2
moody% gcc-4.2
gcc-4.2: error trying to exec '/usr/bin/i686-apple-darwin11-gcc-4.2.1': execvp: No such file or directory

Do you require other information?

Thanks for looking into this.

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

Status: newassigned

build success does not mean the built ruby works fine. some features, such as thread/fiber, does not work on clang/llvm-gcc ruby.

see https://github.com/wayneeseguin/rvm/issues/399

we can test ruby by the following commands.

% sudo port -k install ruby19   # install and keep work directory
% cd `port work ruby19`/ruby-1.9.2-p290
% sudo chown -R ${USER} .       # let work directory writable
% make test                     # basic tests. should pass all tests
% make test-all                 # deeper tests. may fail with some errors, but no segmentaion fault.

results on my Mac.

  • Snow Leopard + gcc (Xcode 4.0):
    • make test => pass all
    • make test-all => pass all
  • Lion + gcc (Xcode 4.1):
    • make test => pass all
    • make test-all => 2F
  • Lion + llvm-gcc:
    • make test => Bus Error (segmentaion fault)
  • Lion + clang:
    • make test => Bus Error (segmentaion fault)

Changed 13 years ago by kimuraw (kimura wataru)

`make test' ruby built with Xcode-4.2 clang

Changed 13 years ago by kimuraw (kimura wataru)

`make test' ruby built with Xcode-4.2 llvm-gcc

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

Resolution: fixed
Status: assignedclosed

ruby-1.9.3 supports Xcode-4.2 clang. I updated port:ruby19 to 1.9.3-p0 and solved this problem.

thanks all!

Note: See TracTickets for help on using tickets.