[MacPorts] #39096: ruby portgroup: fix universal builds
#39096: ruby portgroup: fix universal builds --------------------------+-------------------------------- Reporter: ryandesign@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.1.3 Keywords: | Port: --------------------------+-------------------------------- Building rb-rmagick @2.13.2_1 non-universal works fine, but with the universal variant it fails: {{{ checking for stdint.h... no checking for sys/types.h... no checking for wand/MagickWand.h... no Can't install RMagick 2.13.2. Can't find MagickWand.h. }}} These headers all exist; the problem is how Ruby checks for them. In ext/RMagick/mkmf.log we see the real problem: {{{ have_header: checking for stdint.h... -------------------- no "/usr/bin/clang -E -I. -I/opt/local/lib/ruby/1.8/x86_64-darwin12 -I/opt/local/var/macports/build/_Users_rschmidt_macports_dports_ruby_rb- rmagick/rb-rmagick/work/RMagick-2.13.2/ext/RMagick -I/opt/local/include -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -I/opt/local/include/ImageMagick-6 -pipe -Os -arch x86_64 -arch i386 -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -I/opt/local/include/ImageMagick-6 conftest.c -o conftest.i" clang: error: cannot use 'cpp-output' output with multiple -arch options checked program was: /* begin */ 1: #include <stdint.h> /* end */ }}} The compiler is being called with `-E`, meaning pre-processor mode, but for some reason the `-arch` flags, which are not appropriate for use with a pre-processor, are still being supplied, causing the error. RMagick isn't doing anything special; it's using the standard ruby `have_header()` check. According to the Ruby source code, `have_header()` calls `try_cpp()`, which in turn calls `cpp_command()`. And `cpp_command()` runs `Config::expand("$(CPP) #$INCFLAGS #$CPPFLAGS #$CFLAGS #{opt} #{CONFTEST_C} #{outfile}", conf)`—deliberately including `$CFLAGS`, which in MacPorts by default contains `-arch` flags. The developers of Ruby seem to be aware that `-arch` flags should not be passed to the C pre-processor; I found an old discussion about that. But they've taken the unorthodox approach of defining a new environment variable `ARCH_FLAG` which they expect packagers to set, instead of including `-arch` flags in `CFLAGS`, `CXXFLAGS`, `LDFLAGS` etc. I don't know why it's called `ARCH_FLAG` and not `ARCH_FLAGS` or what happens if multiple `-arch` flags are included. In MacPorts we seem to be aware of the `ARCH_FLAG` variable; the ruby port already uses it to build itself, and it ensures only one `-arch` flag is in it by using the muniversal portgroup. But we still need a solution for other Ruby software that uses the ruby-1.0 portgroup. -- Ticket URL: <https://trac.macports.org/ticket/39096> MacPorts <http://www.macports.org/> Ports system for OS X
#39096: ruby portgroup: fix universal builds ---------------------------+----------------------- Reporter: ryandesign@… | Owner: kimuraw@… Type: defect | Status: assigned Priority: Normal | Milestone: Component: ports | Version: 2.1.3 Resolution: | Keywords: Port: | ---------------------------+----------------------- Changes (by kimuraw@…): * owner: macports-tickets@… => kimuraw@… * status: new => assigned -- Ticket URL: <https://trac.macports.org/ticket/39096#comment:2> MacPorts <http://www.macports.org/> Ports system for OS X
#39096: ruby portgroup: fix universal builds ---------------------------+----------------------- Reporter: ryandesign@… | Owner: kimuraw@… Type: defect | Status: assigned Priority: Normal | Milestone: Component: ports | Version: 2.1.3 Resolution: | Keywords: Port: | ---------------------------+----------------------- Comment (by egall@…): r111453 worked towards solving this -- Ticket URL: <https://trac.macports.org/ticket/39096#comment:3> MacPorts <http://www.macports.org/> Ports system for OS X
#39096: ruby portgroup: fix universal builds ---------------------------+----------------------- Reporter: ryandesign@… | Owner: kimuraw@… Type: defect | Status: assigned Priority: Normal | Milestone: Component: ports | Version: 2.1.3 Resolution: | Keywords: Port: | ---------------------------+----------------------- Comment (by kimuraw@…): I added ruby-1.8 universal support to portgroup ruby at r111453 and r111463. requirement: - use "ruby.setup extconf.rb" or "ruby.setup setup.rb" - add the following line to the Porfile. {{{ PortGroup muniversal 1.0 }}} -- Ticket URL: <https://trac.macports.org/ticket/39096#comment:4> MacPorts <http://www.macports.org/> Ports system for OS X
#39096: ruby portgroup: fix universal builds ---------------------------+----------------------- Reporter: ryandesign@… | Owner: kimuraw@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: 2.1.3 Resolution: fixed | Keywords: Port: | ---------------------------+----------------------- Changes (by kimuraw@…): * status: assigned => closed * resolution: => fixed Comment: I confirmed building rb-rmagick +universal after change of r111544. but destroot fails with the following error. {{{ Error: org.macports.destroot for port rb-rmagick returned: /opt/local/share/ doc/rb-rmagick/userguide/ex/add_noise_GaussianNoise.jpg differs in /.../rb-r magick/work/destroot-i386 and /.../rb-rmagick/work/destroot-x86_64 and canno t be merged }}} I think this error will be solve in rb-rmagick Portfile. I close this ticket as fixed. -- Ticket URL: <https://trac.macports.org/ticket/39096#comment:5> MacPorts <http://www.macports.org/> Ports system for OS X
participants (1)
-
MacPorts