#5257: Rubygems rebuild failed due to wrong expansion of %{_libdir} macro

Fedora Release Engineering rel-eng at fedoraproject.org
Mon Jul 30 13:31:40 UTC 2012


#5257: Rubygems rebuild failed due to wrong expansion of %{_libdir} macro
------------------------------+-----------------------
  Reporter:  vondruch         |      Owner:  rel-eng@…
      Type:  defect           |     Status:  new
 Milestone:  Fedora 18 Alpha  |  Component:  koji
Resolution:                   |   Keywords:
Blocked By:                   |   Blocking:
------------------------------+-----------------------

Comment (by spot):

 The problem is that noarch packages need to be valid and correct on _all_
 possible architectures. If %{_libdir} was evaluated from the build env
 (x86_64), and files end up in %{_libdir} (/usr/lib64), that package would
 install files into a directory on i686 that is unused and for which the
 system runtime would have no reason to look in.

 The solution is to not use %{_libdir} (or macros that evaluate from
 %{_libdir}) in a noarch package. Period.

 The isa macro is not defined because we have no idea what the bitsize is
 for a noarch build, nor should we.

 What you need to do is determine a path for these files that ruby will
 _always_ search/find/locate/use, regardless of architecture, then either
 hardcode that into a macro. An initial look through the ruby config
 suggests that perhaps "rubylibdir" is appropriate. So, maybe define a
 systemwide macro called "%{ruby_sitelib}" which evaluates from the result
 of:

 {{{
 ruby -rrbconfig -e 'puts Config::CONFIG["rubylibdir"]'
 }}}

 This seems appropriate because /usr/share/$FOO is a universal target
 (remember, all files in a noarch package must be identical on all possible
 architectures), but I don't know Ruby well enough to be sure that this is
 indeed 100% correct. I looked for any pathing including /usr/lib in the
 x86_64 Config output, but there was none.

 The equivalent for python is %{python_sitelib}, which is hardcoded (by the
 python executable) to:
 /usr/lib/python2.7/site-packages. The reason this works is because A) It
 is not using %{_libdir} to define this macro and B) python _always_ looks
 in /usr/lib/python2.7/site-packages, regardless of architecture.

-- 
Ticket URL: <https://fedorahosted.org/rel-eng/ticket/5257#comment:4>
Fedora Release Engineering <http://fedorahosted.org/rel-eng>
Release Engineering for the Fedora Project


More information about the rel-eng mailing list