-
Notifications
You must be signed in to change notification settings - Fork 192
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
diesel
link order issues sometimes break build
#69
Comments
Thank you! I've confirmed this bug still exists after all known workarounds are applied. I'll take a shot at it tomorrow. |
OK, I've spent the last several hours updating everything to the latest dependencies, and I can still reproduce this bug. Here's a few things I've observed so far: 1. All the link errors involve
|
OK, so I have verified that:
So this sounds like a case of |
It doesn't do anything in particular to ensure that OpenSSL, etc., get linked in. And none of the bugs in the bug tracker look relevant. So now I want to look at the other, similar Rust images that statically link |
As mentioned in #64, it may be possible to force correct linking using:
|
Other cross builders:
So there's no obvious, existing solution in any other Rust static builders. Next steps:
|
Issue filed upstream: sgrif/pq-sys#25 |
Would you mind notifying watchers of this issue when the problem is solved? I am really concerned. |
@vityafx Please try the workaround mentioned above: // Order matters!
extern crate openssl;
#[macro_use]
extern crate diesel; This should work for most current versions of Rust. |
It worked for me but I think importing openssl crate when I don't need it is a bit weird, especially breaking the order of the imports. |
The deliberately ordered Not sure who needs to hear this, but just in case anyone else gets stuck... give |
We're going to need somebody to submit a PR for sgrif/pq-sys#25. I'm extremely busy on another project right now and won't be able to tackle this for a couple of weeks. Please feel free to ping me at the end of July or early August. |
Can I use this hack still on the rust 2018 edition? |
I have asked the question about rust 2018 because it does not work in it. The hack with UPD: It worked again suddenly. I don't know why. |
This thing does not let me sleep normally. |
I haven't seen any new reports of this error in a while, so maybe the upstream fixes all went through. If you're still seeing problems on the most recent versions of everything, please feel free to reopen this issue. Thank you to everybody who has found workarounds or fixes for this issue! |
Just a note that if you have multiple binaries in your project you need to put the |
I'm still having this issue and no combination of any of the suggestions I've found work. Are there any new suggestions? Edit: actually nevermind - I forgot I had a |
This bug could be related to rust-lang/rust#61328 (which has bitten me multiple times). It seems to be something to do with the order in which linker inputs are declared - the above workaround presumably changes the declaration order of linker libs which somehow fixes it. |
diesel
link order issues sometimes break build
Trying to build with the
using-diesel
example fails. Here is snippet of error:The text was updated successfully, but these errors were encountered: