Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Spotify broken #195

Closed
aforemny opened this Issue Nov 24, 2012 · 7 comments

Comments

Projects
None yet
4 participants
Contributor

aforemny commented Nov 24, 2012

Currently spotify is broken, because the sources are gone.

I updated the sources, but found myself having to add quite some dependencies to these new versions of the Spotify client. Those changes can be found in my spotify branch aforemny@a1dfb7b.

However, installing spotify from this branch raises the following error when trying to run spotify.

$ spotify
/nix/store/0m5zs2b3my294j9y353m84bjhd9p3hi1-spotify-0.8.4.103/bin/.spotify-wrapped: error while loading shared libraries: libnss3.so.1d: cannot open shared object file: No such file or directory

A strace on spotify reveals that spotify only looks for this file in the following places and then exits with exit code 127.

/run/opengl-driver/lib/libnss3.so.1d
/nix/store/7dvylm5crlc0sfafcc0n46mb5ch67q0j-glibc-2.13/lib/libnss3.so.1d

It is not clear to me why the path /nix/store/0m5zs2b3my294j9y353m84bjhd9p3hi1-spotify-0.8.4.103/lib is skipped where I created the appropiate symlink.

Any suggestions?

Member

7c6f434c commented Nov 24, 2012

However, installing spotify from this branch raises the following error when trying to run spotify.

$ spotify
/nix/store/0m5zs2b3my294j9y353m84bjhd9p3hi1-spotify-0.8.4.103/bin/.spotify-wrapped: error while loading shared libraries: libnss3.so.1d: cannot open shared object file: No such file or directory

A strace on spotify reveals that spotify only looks for this file in the following places and then exits with exit code 127.

/run/opengl-driver/lib/libnss3.so.1d
/nix/store/7dvylm5crlc0sfafcc0n46mb5ch67q0j-glibc-2.13/lib/libnss3.so.1d

It is not clear to me why the path /nix/store/0m5zs2b3my294j9y353m84bjhd9p3hi1-spotify-0.8.4.103/lib is skipped where I created the appropiate symlink.

What ldd says? It looks like patchELF phases sees nss entry in rpath,
sees no linked libraries that use this entry, ignores dlopen calls deep
inside binary and removes the allegedely unneeded RPATH entry.

I guess you have to skip the automatic patchelf phase of the default
builder altogether.

If I remember correctly, it is specified by dontPatchElf=1 environment
variable. It is definitely inside setup.sh.

Contributor

aforemny commented Nov 24, 2012

ldd reports that libnss3.so.1d is not found.

$ ldd .spotify-wrapped | grep libnss3.so.1d
$ libnss3.so.1d => not found

However, the spotify's Nix expression default.nix already sets dontPatchElf = true, but patchelf is called in installPhase directly.

Contributor

aforemny commented Nov 24, 2012

I am assuming that libnss3.so.1d is loaded by the spotify program instead of the dynamic linker, because this doesn't change the error message.

$ LD_PRELOAD=/nix/store/.../lib/libnss3.so.1d spotify

Is this correct? Then it would be necessary to replace dlopen by a wrapper function I guess. Is this what you suggested?

Member

7c6f434c commented Nov 24, 2012

I am assuming that libnss3.so.1d is loaded by the spotify program instead of the dynamic linker, because this doesn't change the error message.

$ LD_PRELOAD=/nix/store/.../lib/libnss3.so.1d spotify

Is this correct? Then it would be necessary to replace dlopen by a wrapper function I guess. Is this what you suggested?

Does setting LD_LIBRARY_PATH to include directory of libnss3.so help?

Wrapping dlopen would be too much, adding the directory to rpath with
separate patchelf call in the end should be enough - and LD_LIBRARY_PATH
should help if this doesn't work.

Contributor

aforemny commented Nov 24, 2012

Setting LD_LIBRARY_PATH does help indeed. Why doesn't it suffice to set rpath with patchelf? nss's lib directory is set by rpath as this is reported by readelf -d.

Contributor

aforemny commented Nov 24, 2012

I updated the Nix expression and I can launch spotify. However, spotify tries to open the file /nix/store/...-spotify-0.8.4.103/bin/chrome.pak. The file is present in /nix/store/...-spotify-0.8.4.103/share/spotify/chrome.pak. I cannot find a reason why spotify is looking for that file in /bin and I assume I broke something. Any suggestions on this one?

Additionally I am not quite sure if the Nix expression [1] is correct. For instance I need to symlink libgconf-2.so.4 to $out/lib and I doubt that it's needed. However, if I don't spotify complains about libgconf-2.so.4 being missing. Note that I added --set LD_LIBRARY_PATH to wrapProgram. I suspected it would suffice to add gnome.GConf to spotify's library path with patchelf --set-rpath, but apparently and in the presence of LD_LIBRARY_PATH set it doesn't.

[1] https://github.com/aforemny/nixpkgs/blob/spotify/pkgs/applications/audio/spotify/default.nix

Member

Phreedom commented May 5, 2013

This issue is most likely outdated. Can we close it??

@ghost ghost assigned Phreedom May 5, 2013

@rbvermaa rbvermaa closed this May 5, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment