mozilla / nixpkgs-mozilla

Mozilla overlay for Nixpkgs.
MIT License
517 stars 128 forks source link

missing library when building only rls-preview #135

Open hyperfekt opened 5 years ago

hyperfekt commented 5 years ago

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.

Slabity commented 5 years ago

I also have this issue:

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

boomshroom commented 5 years ago

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.

garbas commented 5 years ago

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:..."

boomshroom commented 5 years ago

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