Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 343461 - x11-misc/xorg-cf-files-1.0.3 does not support multilib-nosymlink
Summary: x11-misc/xorg-cf-files-1.0.3 does not support multilib-nosymlink
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo X packagers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: portage-multilib
  Show dependency tree
 
Reported: 2010-10-31 05:41 UTC by Nathan Phillip Brink (binki) (RETIRED)
Modified: 2013-05-28 21:25 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
/tmp/emerge--info.txt (emerge--info.txt,7.44 KB, text/plain)
2010-10-31 05:42 UTC, Nathan Phillip Brink (binki) (RETIRED)
Details
/tmp/transfig-3.2.5d-build.log (transfig-3.2.5d-build.log,3.09 KB, text/plain)
2010-10-31 05:43 UTC, Nathan Phillip Brink (binki) (RETIRED)
Details
files/xorg-cf-files-1.0.3-libdir.patch (xorg-cf-files-1.0.3-libdir.patch,561 bytes, text/plain)
2010-10-31 05:43 UTC, Nathan Phillip Brink (binki) (RETIRED)
Details
xorg-cf-files-1.0.3.ebuild-multilib-nosymlink.patch (xorg-cf-files-1.0.3.ebuild-multilib-nosymlink.patch,1.26 KB, text/plain)
2010-10-31 05:47 UTC, Nathan Phillip Brink (binki) (RETIRED)
Details
Respect LIBDIR for multilib (xorg-cf-files-1.0.4-multilib.patch,1.92 KB, patch)
2013-05-28 16:44 UTC, Anthony Basile
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nathan Phillip Brink (binki) (RETIRED) gentoo-dev 2010-10-31 05:41:15 UTC
See attached failed build log for transfig.

The error ``Imakefile.c:34: error: Imake.tmpl: No such file or directory'' is caused because the Makefile generated by xmkmf(1) tells imake to look in /usr/lib/X11/config instead of /usr/lib64/X11/config for files (such as Imake.tmpl).

The following lines testify to this (each line is taken out of context from the "${S}"/Makefile generated by xmkmf(1)):
LIBDIR = /usr/lib/X11
CONFIGDIR = $(LIBDIR)/config
IRULESRC = $(CONFIGDIR)

ICONFIGFILES = $(IRULESRC)/Imake.tmpl $(IRULESRC)/X11.tmpl                         $(IRULESRC)/site.def $(IRULESRC)/$(MACROFILE)                   $(IRULESRC)/xfree86.cf $(IRULESRC)/xf86.rules $(IRULESRC)/xorgsite.def $(IRULESRC)/host.def $(EXTRA_ICONFIGFILES)

The ICONFIGFILES is used by the generate Makefile as arguments for calling imake(1). This causes imake's searchpath to include /usr/lib/X11/config, which doesn't exist on a multilib-nosymlink system:

ohnopublishing ~ # ls -lha /usr/lib/X11/config
ls: cannot access /usr/lib/X11/config: No such file or directory
ohnopublishing ~ # ls -lha /usr/lib64/X11/config/Imake.tmpl
-rw-r--r-- 1 root root 54K Oct 30 23:00 /usr/lib64/X11/config/Imake.tmpl



Where does this LIBDIR variable come from? Well, it's actually stored into /usr/lib64/X11/config/:

ohnopublishing ~ # grep -R -e '\(^\| \)LIBDIR =' /usr/lib64/X11/config
/usr/lib64/X11/config/X11.tmpl:           LIBDIR = LibDir               /* configs for xdm, xinit, etc. */

ohnopublishing ~ # grep -R -e '# *define LibDir ' /usr/lib64/X11/config 
/usr/lib64/X11/config/Amoeba.cf:#define LibDir                  $(DESTDIR)/profile/module/x11/lib
/usr/lib64/X11/config/X11.tmpl:#  define LibDir Concat(ProjectRoot,/lib/X11)
/usr/lib64/X11/config/X11.tmpl:#  define LibDir /usr/lib/X11




Proposed solution: The ``#define LibDir'' statement should take advantage of LibDirName, which is fixed by the xorg-cf-files ebuild and contains the correct lib* -- even for lib32:

ohnopublishing ~ # grep -R -e '# *define LibDirName ' /usr/lib*/X11/config
/usr/lib32/X11/config/Imake.tmpl:# define LibDirName lib32
/usr/lib32/X11/config/sun.cf:# define LibDirName Concat3(lib,/,Solaris64bitSubdir)
/usr/lib64/X11/config/Imake.tmpl:# define LibDirName lib64
/usr/lib64/X11/config/sun.cf:# define LibDirName Concat3(lib,/,Solaris64bitSubdir)

The (to be) attached patches cause the ``#define LibDir'' statement to use LibDirName and fixes the transfig failure attached.
Comment 1 Nathan Phillip Brink (binki) (RETIRED) gentoo-dev 2010-10-31 05:42:29 UTC
Created attachment 252635 [details]
/tmp/emerge--info.txt
Comment 2 Nathan Phillip Brink (binki) (RETIRED) gentoo-dev 2010-10-31 05:43:04 UTC
Created attachment 252637 [details]
/tmp/transfig-3.2.5d-build.log

An example of xorg-cf-files causing imake to fail on a multilib-nosymlink system.
Comment 3 Nathan Phillip Brink (binki) (RETIRED) gentoo-dev 2010-10-31 05:43:48 UTC
Created attachment 252639 [details]
files/xorg-cf-files-1.0.3-libdir.patch

Patches the files distributed with x11-misc/xorg-cf-files to respect multilib systems in general.
Comment 4 Nathan Phillip Brink (binki) (RETIRED) gentoo-dev 2010-10-31 05:47:07 UTC
Created attachment 252641 [details]
xorg-cf-files-1.0.3.ebuild-multilib-nosymlink.patch

Upgrade to EAPI=2, move some stuff into src_prepare(), apply the libdir patch for bug 343461, inherit all used eclasses to ensure that functionality doesn't change.
Comment 5 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2010-11-01 07:50:27 UTC
Is this thing even supported nowadays?
Comment 6 Nathan Phillip Brink (binki) (RETIRED) gentoo-dev 2010-11-01 14:15:42 UTC
(In reply to comment #5)
> Is this thing even supported nowadays?

If bug 289296 is fixed (which requires the ``resolved'' bug 290424 to be fixed first), then this bug may be resolved WONTFIX/INVALID.

If your question about support concerns multilib-nosymlink, then I have to comment that multilib-nosymlink is useful for discovering bad situations where 32-bit code wrongly ends up using /usr/lib (and thus, by way of symlink, /usr/lib64).
Comment 7 Anthony Basile gentoo-dev 2013-05-28 16:11:13 UTC
(In reply to Nathan Phillip Brink (binki) from comment #6)
> (In reply to comment #5)
> > Is this thing even supported nowadays?
> 
> If bug 289296 is fixed (which requires the ``resolved'' bug 290424 to be
> fixed first), then this bug may be resolved WONTFIX/INVALID.
> 
> If your question about support concerns multilib-nosymlink, then I have to
> comment that multilib-nosymlink is useful for discovering bad situations
> where 32-bit code wrongly ends up using /usr/lib (and thus, by way of
> symlink, /usr/lib64).

This bug is still there and it hits more exotic multilib systems like mips64el with three abis, the default in /lib32 while /lib and /lib64 also exist, and it affects amd64 uclibc which is a non-multilib system with everything in /lib.  We have to respect LIBDIR else we get into trouble.

I didn't test binki's solution, I came up with an independent more adhoc one.  I'll test binki's and if it works, then I'd like to see it committed as an -r1 dropped back down to ~arch.
Comment 8 Anthony Basile gentoo-dev 2013-05-28 16:44:30 UTC
Created attachment 349466 [details, diff]
Respect LIBDIR for multilib

Binki's solution is for 1.0.3.  This patch addresses 1.0. and only adds three more sed lines which do the real work.  I also added some quotes to make the quoting of variables consistent.
Comment 9 Anthony Basile gentoo-dev 2013-05-28 16:45:56 UTC
(In reply to Anthony Basile from comment #8)
> Created attachment 349466 [details, diff] [details, diff]
> Respect LIBDIR for multilib
> 
> This patch addresses 1.0. 

My "4" key is sticking!  That's supposed to be 1.0.4.  We should rev bump to -r1 and drop to ~arch.
Comment 10 Anthony Basile gentoo-dev 2013-05-28 21:25:30 UTC
Committed ~arch as xorg-cf-files-1.0.4-r1 with ack form binki and chithead in IRC.  I tested on regular i686, amd64, amd64/x32, mips64el/o32/n32/n64 and amd64-uclibc and it looks good.

Reopen if this is still a problem.  Hopefully imake will go away but there are currently 128 ebuilds / 71 packages depending on it.  A daunting task.