-
Notifications
You must be signed in to change notification settings - Fork 32
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
Using on OS X: 'Symbol not found: __cg_jpeg_resync_to_restart' #1
Comments
Also doing this weird stuff from here seems to fix the problem if that helps:
Edit: Not recommended as breaks things! |
I've run into the same problem and traced it back to here as well... Running:
Seems to make it compile. In my case, some packages I installed using homebrew have made these symlinks in It seems since it includes |
The other strange thing, if I compile with rust beta (1.11.0-beta.1), I get the linking error. If I compile with rust stable (1.10.0), it builds correctly. |
So after going down the rabbit hole, here's what's going on:
So now.. how do we fix this? As @whodidthis mentioned, you could change the symlinks in You could install The other option that could work would be just to add some conditional compilation here. If windows is the only platform with How about this for #[cfg(windows)]
fn main() {
use std::process::Command;
for output in Command::new("pg_config").arg("--libdir").output() {
if output.status.success() {
for path in String::from_utf8(output.stdout) {
println!("cargo:rustc-link-search=native={}", &path);
}
}
}
}
#[cfg(not(windows))]
fn main() {} |
Ping @sgrif |
Hrm. I've always assumed this was a Rust bug. |
Ah, I hadn't tried that. However, it doesn't seem to help. I needed to do a |
What the hell is even requiring libjpeg in the first place? I'd be fine with changing the build script to make sure that we only specifically change the linking for libpq, but I'd prefer not to make the change you've proposed as it will break anyone who has libpq installed in a nonstandard location. I'm also wondering if this is actually something that needs to get looked at upstream? Surely anybody who ends up doing |
To be honest, I'm not exactly sure how libjpeg, etc. is coming into the picture. Homebrew isn't listing it as a dependency:
I still get the error if I reduce
To your second point, I'm a bit torn on it. On one hand, it's obviously useful to specify it for non-standard locations, but now when we go to run, we're saying we're going to specifically override the loader's search path to have a priority for I was originally thinking it could be possible to only specify that |
Is there a way for us to tell the linker to additionally look in a path but On Mon, Jul 18, 2016, 11:18 AM compressed notifications@github.com wrote:
|
I'm not sure there is a way to do that. We would probably need to add the system paths first. I remembered today that Interestingly, What do you think of this approach? |
I submitted a PR for the above idea. I think this seems to be the safest way to move forward. I didn't bother with pulling in |
I'm still wondering what on earth was wanting to link against libjpeg |
So to follow up, I still never figured out exactly why libpq depends on libjpeg, but it's some very deep transitive dependency of a platform framework it uses on Mac. I've spent a good bit of time researching the issue, and now that I have a better understanding of the problem I decided this is common enough to try to handle. So basically on Mac, if |
Thanks for the update. I agree it is some deep transitive dependency as well. Good idea for following the symlink! I've tried the new version and it works for me, without having to set the env var. Thanks! |
Possibly related to the conversation in sgrif/pq-sys#1. Attempts to fix a `dyld: Symbol not found: __cg_jpeg_resync_to_restart` in travis.
Possibly related to the conversation in sgrif/pq-sys#1. Attempts to fix a `dyld: Symbol not found: __cg_jpeg_resync_to_restart` in travis.
@whodidthis Cannot thank you enough. Been trying to debug this for over 3 hours, your solution finally worked. Thanks a bunch :) |
Thank you. I met the some issue and solved it by typing these command! |
I tried using diesel but something gives the following error on a mac from just adding the
pq-sys
dependency:The text was updated successfully, but these errors were encountered: