#5257: Rubygems rebuild failed due to wrong expansion of %{_libdir} macro
Fedora Release Engineering
rel-eng at fedoraproject.org
Mon Jul 30 13:50:16 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 vondruch):
Replying to [comment:4 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.
That make sense although it is not obvious. Would be nice if it could be
mentioned somewhere (I hope I did not missed some part of guidelines :))
> The isa macro is not defined because we have no idea what the bitsize is
for a noarch build, nor should we.
Neither I do care about bit size, I just want to find my library.
> 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.
Ok, you proposed solution for Ruby and for Python, but what about other
noarch packages? I'd like to have some generic solution. Let say
%{runtime_libdir}, alternatively %{runtime_arch} or whatever you call it
which could be used universally across all languages etc.
--
Ticket URL: <https://fedorahosted.org/rel-eng/ticket/5257#comment:5>
Fedora Release Engineering <http://fedorahosted.org/rel-eng>
Release Engineering for the Fedora Project
More information about the rel-eng
mailing list