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

Missing symbol #79

Closed
paulrouget opened this issue Sep 6, 2017 · 4 comments
Closed

Missing symbol #79

paulrouget opened this issue Sep 6, 2017 · 4 comments

Comments

@paulrouget
Copy link
Contributor

paulrouget commented Sep 6, 2017

When using: harfbuzz + tinyfiledialog, we end up with this error on Linux:

zenity: symbol lookup error: libpangoft2-1.0.so.0: undefined symbol: hb_ft_face_create_cached

Only when the program is started with cargo run. Cargo adds its own LD_LIBRARY_PATH. So the binary zenity doesn't look at the system harfbuzz library, but the one in target/debug/build.

STR:

  • Create a new bin rust project
[package]
name = "test"
version = "0.0.1"

[dependencies]
harfbuzz-sys = "0.1.13"
tinyfiledialogs = "2.5.9"
extern crate tinyfiledialogs;

fn main() {
    let _ = tinyfiledialogs::input_box("", "", "");
}
  • cargo run
  • exception occurs

I think we just need to expose the missing symbol, but I'm having issue doing so.

extern "C" {
    pub fn hb_ft_face_create_cached(face: freetype::freetype::FT_Face) -> *mut hb_face_t;
}

Symbol doesn't look exposed (checking with nm -g).

This is blocking servoshell: paulrouget/servoshell#14

@mbrubeck
Copy link
Contributor

mbrubeck commented Sep 6, 2017

The symbol is missing because, when building Harfbuzz from source, this package builds without Freetype support:

--without-freetype \

We should add an option to enable Freetype support for packages that need it.

In this case a better solution might be to link against the system harfbuzz rather than building harfbuzz from source. Installing the libharfbuzz-dev or harfbuzz-devel package on Linux should make this happen automatically. (Note to self: Add this info to the documentation.) We could also add an environment variable to explicitly disable building from source...

@paulrouget
Copy link
Contributor Author

Servo uses harfbuzz on Linux. Using cargo run will set the LD_LIBRARY_PATH to the library build, which include libharfbuzz.so.

Are you suggesting that we build rust-harfbuzz against the local library if it's present?

@mbrubeck
Copy link
Contributor

mbrubeck commented Sep 6, 2017

Yes, people building Servo on Linux should install the Harfbuzz development packages, so that the harfbuzz-sys crate will link against the system library and will not build its own copy from source. (Among other things, this will reduce build time.) Building from source is a fallback option that is meant for systems like Android where we don't have a system library to link to.

(But regardless, we can also provide an option to make it possible to build from source with freetype support.)

@paulrouget
Copy link
Contributor Author

You're right. It works.

But regardless, we can also provide an option to make it possible to build from source with freetype support.

Wouldn't it be better to just disable shared libraries? Then the LD_LIBRARY_PATH set by cargo run won't point to libharfbuzz.so and misguide zenity?

bors-servo pushed a commit that referenced this issue Sep 7, 2017
disable .so files

Fix #79

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/rust-harfbuzz/80)
<!-- Reviewable:end -->
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

2 participants