-
-
Notifications
You must be signed in to change notification settings - Fork 311
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
Programs using syn end up dynamically linking libproc_macro and libstd and not being able to run standalone when built with Rust nightly-2018-04-07 #400
Comments
We can also observe the issue directly in the binaries produced for the syn examples by the way.
|
There is a |
Can you explain why that is enabled by default? Not sure that makes sense to me. |
I looked into this a bit. I'm currently using the |
It looks like you had a lot of proc macro code compiled into the askama crate. I opened djc/askama#77 to move all the proc macro code into your proc macro crate. |
A library that I am trying to use is in turn using syn.
When I build my binary with Rust nightly-2018-04-07, the binary ends up being dynamically linked against libstd and libproc_macro, neither of which can be found.
Therefore it is only possible to execute with
cargo run
, and it is not possible to run the binary directly because attempting to do so results inerror while loading shared libraries: libproc_macro-d3bd4d284648dcab.so: cannot open shared object file: No such file or directory
.I bisected the commits of the library I am using here: djc/askama#73
The dynamic linking of libstd and libproc_macro started happening after the version of syn used was changed from 0.11 to 0.12. Comparing the
Cargo.toml
of syn 0.11.11 to that of 0.12.0, it turns out that a dependency onproc-macro2
was introduced between these versions, and since https://github.com/alexcrichton/proc-macro2 is described as "a small shim over the proc_macro crate in the compiler intended to multiplex the current stable interface (as of 2017-07-05) and the upcoming richer interface", I guess this must be where the dynamic linking of libproc_macro comes from.In your README there is a note about proc-macro2:
However, since the library that I am using on its own does not need nightly features, that library should do this of course.
And I think it would get messy if users of that library have to take into consideration something about a dependency of a dependency of a dependency.
Is there something that can be done in syn so that this problem can be resolved?
cc @djc (author of Askama, the library that I am using that has a dependency on syn.)
The text was updated successfully, but these errors were encountered: