/srv/irclogs.ubuntu.com/2014/08/13/#ubuntu-x.txt

ScottKWould some X smart person (i.e. not me) have a look at Bug 941826 and tell me what package gets the blame?04:03
ubottubug 941826 in python-qt4 (Ubuntu) "PyQt cannot compile shaders with Ubuntu's Nvidia drivers" [Undecided,Confirmed] https://launchpad.net/bugs/94182604:03
RAOFThat bug title promises much!04:25
ScottKI'm pretty convinced it's not PyQt's fault, but ICBW.04:27
RAOFYeah, it's not PyQt's fault.04:28
ScottKGreat. I can relax then.04:29
* ScottK was not looking forward to convincing a somewhat grumpy upstream to care. 04:29
ScottKWould you please comment in the bug (if you didn't).04:31
RAOFJust wrangling the bug stati now.04:31
ScottKThanks. 04:31
RAOFMy, nvidia-331's postinst is pretty big!04:32
RAOFHm. On first inspection, I don't see how that happens.04:35
RAOFAnyway; retitled, and invalidated the Qt* tasks. It'll be one of nvidia-331 or libgl1-mesa-dev's fault.04:44
pwuertzRAOF: I'd say the mesa package is to blame. The symlink /usr/lib/x86_64-linux-gnu/libGL.so shouldn't exist. It makes libGL.so always default to mesa instead of the choice made in /etc/ld.so.conf.d/x86_64-linux-gnu_GL.conf.07:34
tjaaltonpwuertz: eh, of course it defaults to mesa since the package installs it07:35
pwuertzSince /usr/lib/x86_64-linux-gnu has precedence over anything else07:35
tjaaltonif some other pkg wants something else, then it needs to provide the solution07:35
pwuertztjaalton: the idea of the setup as i understand it is to have multiple libGL versions living peacefully next to each other, and you select the one you want to have as the default by linking the right /etc/ld.so.conf.d/x86_64-linux-gnu_GL.conf07:36
tjaaltonwell nvidia et al used to divert the files instead of relying on ldconfig priorities, and back then this wasn't a problem I guess07:37
pwuertztjaalton: by just owning a symlink in the global lib directory you always claim to be the default libGL.so.. and there is nothing another package can do to prevent that07:37
tjaaltonsure there is, divert the link07:37
pwuertzbut it is owned by the package.. you cannot override it, can you?07:38
tjaaltonbut diversions come with other problems, which is why they got replaced by this07:38
tjaaltongoogle dpkg diversion07:38
tjaaltonman dpkg-divert07:38
pwuertzif 2 packages claim ownership over the same file the package management reports a conflict, doesnt it?07:38
tjaaltonno07:38
tjaaltonnot if the other one diverts it07:38
pwuertzok... lets put it in a different way.. there is already a mechanism in ubuntu to select the correct libGL instead of using the global lib directory.. why not just use that?07:40
pwuertzits a mistake07:40
tjaaltonso what is it?07:40
pwuertzyou don't see libGL.so.1 in the global lib directory, do you?07:40
RAOFWe really should have a /usr/lib/libGL.so, too.07:41
tjaaltonpwuertz: no, because that was moved under mesa exactly to cater the blobs07:41
pwuertzi don't know what "cater the blobs" means07:42
tjaaltonhmm ok now I see, so .so should be moved too?07:42
tjaaltonpwuertz: it's a diff to debian07:42
tjaaltonwe ship the libs under mesa/07:42
RAOFWell, I don't think we *can* move the .so07:42
tjaaltonso that the ldconf dance works07:42
tjaaltonRAOF: ah right07:43
RAOFBecause you need the linker to be able to resolve it, and that doesn't care about ld.so07:43
tjaaltonso there you go, diversions then?07:43
RAOFI guess so :/07:43
RAOFActually...07:43
RAOFAlternatives!07:43
RAOFThere's no reason /usr/lib/libGL.so can't be an alternative.07:44
tjaaltonthen there's multiarch :)07:44
RAOFYeah, we'd obviously have /usr/lib/$arch_triple/libGL.so being an alternative.07:45
RAOFAnd I guess we can ignore the /usr/lib/libGL.so requirement of the Linux OpenGL ABI :)07:45
pwuertzWouldn't the linker just pick anything ldconfig is configured for? Or are you saying that there are some occasions where the linker just looks for /usr/lib/libXY.so without asking anyone else?07:45
RAOFThe linker doesn't use ldconfig07:46
RAOFThe dynamic loader (ld.so) does, but the linker is totally separate.07:47
RAOFThe linker just looks for lib$foo.so in a bunch of hardcoded paths.07:47
pwuertzRAOF: Oh, so the linker dynamically links against mesa/libGL.so, then when you call ldd on the binary or run it it switches to the one suggested by ldconfig08:03
pwuertzRAOF: I had no idea :)08:03
RAOFThe linker just encodes "this DSO needs symbols from libGL.so.1" in the binary; it's ld.so's job to take “libGL.so.1” and load it.08:04
RAOF(As in: the binary literally contains the string “libGL.so.1”, and the dynamic loader takes that string and goes “is there a library called libGL.so.1 in my search paths”)08:05
RAOFldd does the same sort of lookup as ld.so08:05
pwuertzRAOF: yea, but the linker also checks if these symbols exist, so if I'd (hypothetically) expect it to successfully link to some functions only present in an alternative libGL.so it wouldn't succeed08:07
RAOFNo, that's the point of the OpenGL ABI; the set of symbols exported from Mesa's libGL.so is exactly the same as the set of symbols exported from NVIDIA's libGL.so.08:08
pwuertzthats why i said hypothetically ^^08:08
RAOFWell, and the linker actually only resolves symbols on first use, too.08:09
RAOFSo if the program never uses a symbol from libbar.so.1 then it's never resolved, even if your particular libbar.so.1 doesn't actually have that symbol.08:09
pwuertzI see08:09
pwuertzThanks for explaining! I really didn't know how exactly the linker did its job ;)08:10
pwuertzI.e. not involving ldconf08:11
pwuertzRAOF: Ok, i got another idea.. do you know who is responsible for creating /etc/ld.so.conf.d/x86_64-linux-gnu_GL.conf ?08:14
pwuertzRAOF: Because the problem is also solved by prioritizing that file with a "0" prefix in the filename, thus dynamically loading the nvidia/libGL08:16
pwuertzNo other actions required08:16

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!