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 shared libraries #1248

Closed
stuartnelson3 opened this issue Feb 8, 2018 · 12 comments
Closed

Error while loading shared libraries #1248

stuartnelson3 opened this issue Feb 8, 2018 · 12 comments

Comments

@stuartnelson3
Copy link

With bindgen installed via cargo install bindgen and rustup installed via the standard curl | bash method:

# rustup --version
rustup 1.10.0 (c6a8f7c60 2018-01-25)

# cargo --version
cargo 0.24.0 (45043115c 2017-12-05)

# bindgen
bindgen: error while loading shared libraries: libproc_macro-6572f0cb64bf7b5a.so: cannot open shared object file: No such file or directory

# env LD_LIBRARY_PATH=/home/stuartnelson/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/ bindgen
error: The following required arguments were not provided:
    <header>
USAGE:
    bindgen [FLAGS] [OPTIONS] <header> -- <clang-args>...
For more information try --help

It seems like the .so is in a standard location, so I think it's incorrect that I have to manually specify it?

@TheKnarf
Copy link

TheKnarf commented Feb 9, 2018

I'm having similare problems on Mac OS:

➜  examples git:(master) ✗ rustup --version
rustup 1.9.0 (57fc3c087 2018-01-04)
➜  examples git:(master) ✗ cargo --version
cargo 0.24.0 (45043115c 2017-12-05)
➜  examples git:(master) ✗ bindgen
dyld: Library not loaded: @rpath/libproc_macro-135818a8fe3a20d3.dylib
  Referenced from: /Users/fl-macbook-retina/.cargo/bin/bindgen
  Reason: image not found
[1]    46570 abort      bindgen

@emilio
Copy link
Contributor

emilio commented Feb 10, 2018

cargo run +stable bindgen should help I think... I suspect this is due to the recent syn update, cc @Eijebong.

@TheKnarf
Copy link

TheKnarf commented Feb 13, 2018

I'm not sure what you're suggesting @emilio as bindgen was installed and ran using cargo install bindgen as a global tool. Is this not supposed to work? Is there a stable option for cargo install that I'm not aware of?

@Dushistov
Copy link
Contributor

@TheKnarf

I suppose the right command would be rustup run stable bindgen if you install via cargo install bindgen with default stable compiler.

@stuartnelson3
Copy link
Author

Ah, that is unexpected

@retep998
Copy link
Member

bindgen as a binary depends on internal rustc crates. Therefore you cannot run it directly, but instead must run it using rustup run and you must specify the same toolchain that you used to install it originally. If you ever update that toolchain then you must reinstall bindgen.

@TheKnarf
Copy link

This isn't described at all in the documentation. It should be updated with what @retep998 and @Dushistov said.

@fitzgen
Copy link
Member

fitzgen commented Feb 14, 2018

Bisected to

6899c275ee0ab0687ec66c490ddd1a76f8223513 is the first bad commit
commit 6899c275ee0ab0687ec66c490ddd1a76f8223513
Author: Bastien Orivel <[email protected]>
Date:   Tue Jan 23 00:12:58 2018 +0100

    Bump quote to 0.4

I think we should revert this commit.

@fitzgen
Copy link
Member

fitzgen commented Feb 14, 2018

@alexcrichton confirmed that proc_macro2 depends on rustc internal libraries. He says that we could potentially put that behind a default-on feature, and that bindgen could disable it. Once that happens, we can try using the new quote and proc_macro2 again.

fitzgen added a commit to fitzgen/rust-bindgen that referenced this issue Feb 14, 2018
@staktrace
Copy link

We had a similar problem with cbindgen with the update to the latest syn. I filed rust-lang/rust#47931 for it, in case anybody is interested in following along with the upstream issue.

@emilio emilio closed this as completed in eb415c7 Feb 14, 2018
pmarks added a commit to rust-bio/rust-htslib that referenced this issue Mar 25, 2018
johanneskoester pushed a commit to rust-bio/rust-htslib that referenced this issue Mar 26, 2018
@hcpl
Copy link

hcpl commented Apr 1, 2018

I guess this topic can be revisited, now that syn 0.5 released with default-on proc-macro feature: https://github.com/dtolnay/quote/blob/45d3801fde811d432955100220ead1ff2ba27edd/Cargo.toml#L20

@Eijebong
Copy link
Contributor

Eijebong commented Apr 1, 2018

Yep, but this is the same as for cssparser, we need to try and coordinate everything.
Unless you want to do it, it's going to have to wait until at least Tuesday as I don't really have the time for that right now.

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

9 participants