Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while loading libsyntax #1687

Closed
0x7CFE opened this issue Jun 15, 2017 · 5 comments
Closed

Error while loading libsyntax #1687

0x7CFE opened this issue Jun 15, 2017 · 5 comments

Comments

@0x7CFE
Copy link

0x7CFE commented Jun 15, 2017

I've just installed rustfmt-nigtly and got the following error:

$ rustfmt --help
rustfmt: error while loading shared libraries: libsyntax-93b867817c21b413.so: cannot open shared object file: No such file or directory
cargo 0.20.0-nightly (0d0f3baad 2017-06-13)
$ rustc --version --verbose
rustc 1.19.0-nightly (03abb1bd7 2017-06-13)
binary: rustc
commit-hash: 03abb1bd70ac56e4aba0684bab819892a0157843
commit-date: 2017-06-13
host: x86_64-unknown-linux-gnu
release: 1.19.0-nightly
LLVM version: 4.0
@topecongiro
Copy link
Contributor

To use libsyntax.so, LD_LIBRARY_PATH must include the directory which contains libsyntax.so.
In Linux, export LD_LIBRARY_PATH=$(rustc --print sysroot)/lib:$LD_LIBRARY_PATH should work.

@0x7CFE
Copy link
Author

0x7CFE commented Jun 15, 2017

That worked, thank you!

@nrc nrc closed this as completed Jun 15, 2017
@willbush
Copy link

Just a note for anyone coming across this issue and the above solution does not work as it did not work for me. I found that libsyntax-93b867817c21b413.so was not even in the path (rustc --print sysroot)/lib and the issue was due to my nightly version of rust being stuck on 1.19.0-nightly.

I had to reinstall nightly rust as described here and now I'm on rustc 1.21.0-nightly. I then did rustup run nightly cargo install rustfmt-nightly --force and that solved the issue for me.

@marcusklaas
Copy link
Contributor

marcusklaas commented Aug 17, 2017

Hmmm.. this doesn't seem to work for me.

marcus@localhost ~/lisp-parser> echo $LD_LIBRARY_PATH
/home/marcus/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib

marcus@localhost ~/lisp-parser> ls -l /home/marcus/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib
[...]
-rw-r--r--. 1 marcus marcus  6587560 Aug 17 14:19 libsyntax-e261a49b7068161c.so

marcus@localhost ~/lisp-parser> rustfmt
rustfmt: error while loading shared libraries: libsyntax-e261a49b7068161c.so: cannot open shared object file: No such file or directory

I'm at a loss on why it cannot be found :/

edit: it seems to be a thing related to vs code - it works in a regular terminal emulator.

@nrc
Copy link
Member

nrc commented Aug 17, 2017

If you run VSCode from the command line, it should pick up the right environment, however, I think something different happens when you start it from an icon?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants