nixpkgs-mozilla icon indicating copy to clipboard operation
nixpkgs-mozilla copied to clipboard

missing library when building only rls-preview

Open hyperfekt opened this issue 6 years ago • 4 comments

Trying to execute rls after building it with latest.rustChannels.[stable|nightly].rls-preview fails with rls: error while loading shared libraries: librustc_driver-a7268cc1add3f195.so: cannot open shared object file: No such file or directory.

hyperfekt avatar Nov 13 '18 14:11 hyperfekt

I also have this issue:

error while loading shared libraries: librustc_driver-025268cc2660894c.so: cannot open shared object file: No such file or directory

Slabity avatar Dec 04 '18 18:12 Slabity

A quick hotfix that I found that should work is adding ${rustc}/lib to LD_LIBRARY_PATH. That said, I now have a can't find crate for 'std' problem which isn't much better.

boomshroom avatar Jan 18 '19 07:01 boomshroom

looks like we would need to wrap rls-preview package with LD_LIBRARY_PATH with few new paths.

Running ldd ./result/bin/rls i get:

	linux-vdso.so.1 (0x00007ffe06f3e000)
	/nix/store/x6inizi5ahlyhqxxwv1rvn05a25icarq-gcc-7.3.0-lib/lib/libstdc++.so.6 (0x00007fb61e32b000)
	librustc_driver-03b4ba3a5f2320e4.so => not found
	librustc_save_analysis-71a87b0cb2271e5b.so => not found
	librustc_typeck-ea61aac178675ced.so => not found
	librustc_plugin-38664a488dc3b116.so => not found
	librustc-6b0eb8aed9d49cbc.so => not found
	libsyntax-874a6c0669523b59.so => not found
	librustc_errors-fa877b23cc59181b.so => not found
	libsyntax_pos-161c814b3fdca50d.so => not found
	librustc_target-fe1aee76944b2bc8.so => not found
	libfmt_macros-03ce20034f19b981.so => not found
	librustc_data_structures-b8ccdbc9ca1c0661.so => not found
	librustc_cratesio_shim-95e8ffc201e8d42b.so => not found
	libstd-dd4752c70d4ce71d.so => not found
	libpthread.so.0 => /nix/store/xdsjx0gba4id3yyqxv66bxnm2sqixkjj-glibc-2.27/lib/libpthread.so.0 (0x00007fb61e10c000)
	libdl.so.2 => /nix/store/xdsjx0gba4id3yyqxv66bxnm2sqixkjj-glibc-2.27/lib/libdl.so.2 (0x00007fb61df08000)
	librt.so.1 => /nix/store/xdsjx0gba4id3yyqxv66bxnm2sqixkjj-glibc-2.27/lib/librt.so.1 (0x00007fb61dd00000)
	libgcc_s.so.1 => /nix/store/xdsjx0gba4id3yyqxv66bxnm2sqixkjj-glibc-2.27/lib/libgcc_s.so.1 (0x00007fb61daea000)
	libc.so.6 => /nix/store/xdsjx0gba4id3yyqxv66bxnm2sqixkjj-glibc-2.27/lib/libc.so.6 (0x00007fb61d736000)
	/nix/store/xdsjx0gba4id3yyqxv66bxnm2sqixkjj-glibc-2.27/lib/ld-linux-x86-64.so.2 => /nix/store/xdsjx0gba4id3yyqxv66bxnm2sqixkjj-glibc-2.27/lib64/ld-linux-x86-64.so.2 (0x00007fb62004b000)
	libm.so.6 => /nix/store/xdsjx0gba4id3yyqxv66bxnm2sqixkjj-glibc-2.27/lib/libm.so.6 (0x00007fb61d3a1000)

Looks like few libs are missing.

Somebody want to fix this? You would need to know how to override rls-preview in a custom overlay and wrap rls command with wrapProgram --prefix LD_LIBRARY_PATH : "${rustc}/lib:..."

garbas avatar Jan 18 '19 09:01 garbas

Actually, just using the rust package for the rustPlatform seemed to work. Can't check right now though.

boomshroom avatar Jan 18 '19 20:01 boomshroom