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

Compile time error, unknown type name ‘hb_font_t’ #2226

Closed
fiechr opened this issue Aug 7, 2019 · 13 comments

Comments

@fiechr
Copy link

commented Aug 7, 2019

I'm building locally from source (using custom makepkg configuration on Arch/Manjaro). Today I got this error while compiling the current master.
Last (successful) build was from about two weeks ago.

I also cleaned up everything first, but that didn't change anything.

./configure --launch-jobs=$(nproc) --launch --build="build" --prefix=/usr --enable-fdk-aac --enable-numa --enable-x265

[...]
In file included from /usr/include/pango-1.0/pango/pango-attributes.h:25,
from /usr/include/pango-1.0/pango/pango.h:25,
from /usr/include/gtk-3.0/gdk/gdktypes.h:35,
from /usr/include/gtk-3.0/gdk/gdkapplaunchcontext.h:30,
from /usr/include/gtk-3.0/gdk/gdk.h:32,
from /usr/include/gtk-3.0/gtk/gtk.h:30,
from /home/cf/abs/local/handbrake-git-cf/src/handbrake/build/../gtk/src/ghbcompat.h:27,
from /home/cf/abs/local/handbrake-git-cf/src/handbrake/build/../gtk/src/settings.c:30:
/usr/include/pango-1.0/pango/pango-font.h:493:53: error: unknown type name ‘hb_feature_t’; did you mean ‘hb_value_t’?
493 |                                                     hb_feature_t     *features,
|                                                     ^~~~~~~~~~~~
|                                                     hb_value_t
/usr/include/pango-1.0/pango/pango-font.h:497:1: error: unknown type name ‘hb_font_t’
497 | hb_font_t *           pango_font_get_hb_font       (PangoFont        *font);
| ^~~~~~~~~
make[2]: *** [Makefile:670: callbacks.o] Error 1
make[2]: *** [Makefile:670: settings.o] Error 1
make[2]: Leaving directory '/home/cf/abs/local/handbrake-git-cf/src/handbrake/build/gtk/src'
make[1]: *** [Makefile:449: install-recursive] Error 1
make[1]: Leaving directory '/home/cf/abs/local/handbrake-git-cf/src/handbrake/build/gtk'
make: *** [../gtk/module.rules:37: gtk.install] Error 2
==> ERROR: A failure occurred in package().
Aborting...

Any ideas? Happy to provide more information.

@fiechr

This comment has been minimized.

Copy link
Author

commented Aug 7, 2019

Here is a more detailed output of the process: https://pastebin.com/2kpiqRFB

@sr55

This comment has been minimized.

Copy link
Contributor

commented Aug 12, 2019

Welcome to the world of dependency hell. Looks like your version of harfbuzz is too new.

The next time we update the libraries in bulk, we'll look at updating this (assuming the key operating systems we support have moved forward too)

If not, I'd suggest switching to our flatpak builds (which we have in nightly form too).

@cmatomic

This comment has been minimized.

Copy link

commented Aug 18, 2019

what version of harfbuzz is used in flatpak ?

@fiechr

This comment has been minimized.

Copy link
Author

commented Aug 30, 2019

I assume the flatpak version does not support FDK AAC?

Is there an easy way to locally update the harfbuzz (or whatever necessary) libs? I tried to replace the download URI of the harfbuzz package in the contrib folder, but still got the error. Or is it possible to completely disable this part? As far as I understand, harfbuzz is for creating non-latin symbols, which I don't use anyway.

@bradleysepos bradleysepos reopened this Sep 3, 2019

@bradleysepos

This comment has been minimized.

Copy link
Contributor

commented Sep 8, 2019

I've been working on this. The problem seems to be with Pango 1.44.x, specifically where they've changed their include directives from harfbuzz/hb.h to hb.h, essentially reverting a years-old bugfix to work around a conflict with HandBrake's hb.h.

Unfortunately, the only permanent fix is going to be isolating our include and lib namespace (hb -> handbrake). Until then, HandBrake will not build on affected systems without downgrading to Pango 1.43.x or earlier.

If you're looking for newer HarfBuzz, I have a PR open for testing: #2287

@sr55

This comment has been minimized.

Copy link
Contributor

commented Sep 8, 2019

Did they list a reason for reverting?

@bradleysepos

This comment has been minimized.

Copy link
Contributor

commented Sep 8, 2019

The change is here: https://gitlab.gnome.org/GNOME/pango/commit/a7b17aa2bad77c485943c860a20aedc2b2b115ff

Pango is separate from HarfBuzz, but the HarfBuzz lead developer does work on both. As far as I can tell, Pango just decided to do things differently on a whim and broke a bunch of stuff. And they've decided other projects are simply doing things wrong, which might be true: https://gitlab.gnome.org/GNOME/pango/issues/387#note_568800

Unfortunately, it seems they didn't consider the case of conflicting header files.

I reached out to the person who maintains the Pango package for Arch and he basically pointed me at the above response by the Pango developer. So it seems nobody is interested in fixing our issue. It seems we should move to handbrake.h and libhandbrake as soon as possible.

@jstebbins

This comment has been minimized.

Copy link
Contributor

commented Sep 8, 2019

We converted to libhandbrake quite some time ago due to the conflict with harfbuzz. It's weird that they would undo a working header file arrangement and exchange it for an obviously broken one. But whatever 🤷‍♂ renaming handbrake.h is pretty straight forward.

@fiechr

This comment has been minimized.

Copy link
Author

commented Sep 12, 2019

Thank you very much for looking into it!

I've tried to build the current master again and the error from before is gone. Unfortunately now there is a long list of other errors. :-)

Maybe that's to be expected at this point, I just wanted to let you know.

[...]
In file included from /home/cf/abs/local/handbrake-git-cf/src/handbrake/build/../gtk/src/settings.h:28,
                 from /home/cf/abs/local/handbrake-git-cf/src/handbrake/build/../gtk/src/audiohandler.c:28:
/home/cf/abs/local/handbrake-git-cf/src/handbrake/build/../gtk/src/values.h:87:11: note: expected ‘const gchar *’ {aka ‘const char *’} but argument is of type ‘int’
   87 | GhbValue* ghb_string_value(const gchar *str);
      |           ^~~~~~~~~~~~~~~~
/home/cf/abs/local/handbrake-git-cf/src/handbrake/build/../gtk/src/audiohandler.c: In function ‘audio_quality_radio_changed_cb’:
/home/cf/abs/local/handbrake-git-cf/src/handbrake/build/../gtk/src/audiohandler.c:1101:28: error: ‘HB_INVALID_AUDIO_QUALITY’ undeclared (first use in this function)
 1101 |             if (quality == HB_INVALID_AUDIO_QUALITY)
      |                            ^~~~~~~~~~~~~~~~~~~~~~~~
/home/cf/abs/local/handbrake-git-cf/src/handbrake/build/../gtk/src/audiohandler.c: In function ‘ghb_create_audio_settings_row’:
/home/cf/abs/local/handbrake-git-cf/src/handbrake/build/../gtk/src/audiohandler.c:1765:35: warning: initialization of ‘const hb_encoder_t *’ {aka ‘const struct hb_encoder_s *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
 1765 |     const hb_encoder_t *aud_enc = hb_audio_encoder_get_next(NULL);
      |                                   ^~~~~~~~~~~~~~~~~~~~~~~~~
/home/cf/abs/local/handbrake-git-cf/src/handbrake/build/../gtk/src/audiohandler.c:1851:56: error: ‘HB_AMIXDOWN_5POINT1’ undeclared (first use in this function)
 1851 |     ghb_update_widget(GTK_WIDGET(combo), ghb_int_value(HB_AMIXDOWN_5POINT1));
      |                                                        ^~~~~~~~~~~~~~~~~~~
/home/cf/abs/local/handbrake-git-cf/src/handbrake/build/../gtk/src/audiohandler.c: In function ‘audio_def_set_limits’:
/home/cf/abs/local/handbrake-git-cf/src/handbrake/build/../gtk/src/audiohandler.c:2205:48: error: ‘HB_INVALID_AUDIO_QUALITY’ undeclared (first use in this function)
 2205 |         hb_audio_quality_get_default(codec) != HB_INVALID_AUDIO_QUALITY ||
      |                                                ^~~~~~~~~~~~~~~~~~~~~~~~
/home/cf/abs/local/handbrake-git-cf/src/handbrake/build/../gtk/src/audiohandler.c:2206:19: error: ‘HB_ACODEC_AUTO_PASS’ undeclared (first use in this function)
 2206 |         (codec == HB_ACODEC_AUTO_PASS &&
      |                   ^~~~~~~~~~~~~~~~~~~
/home/cf/abs/local/handbrake-git-cf/src/handbrake/build/../gtk/src/audiohandler.c:2224:15: error: ‘HB_ACODEC_PASS_FLAG’ undeclared (first use in this function)
 2224 |     if (enc & HB_ACODEC_PASS_FLAG)
      |               ^~~~~~~~~~~~~~~~~~~
/home/cf/abs/local/handbrake-git-cf/src/handbrake/build/../gtk/src/audiohandler.c: In function ‘ghb_audio_quality_enabled’:
/home/cf/abs/local/handbrake-git-cf/src/handbrake/build/../gtk/src/audiohandler.c:57:1: warning: control reaches end of non-void function [-Wreturn-type]
   57 | }
      | ^
/home/cf/abs/local/handbrake-git-cf/src/handbrake/build/../gtk/src/audiohandler.c: In function ‘ghb_select_fallback’:
/home/cf/abs/local/handbrake-git-cf/src/handbrake/build/../gtk/src/audiohandler.c:362:1: warning: control reaches end of non-void function [-Wreturn-type]
  362 | }
      | ^
make[3]: *** [Makefile:670: audiohandler.o] Error 1
make[3]: Leaving directory '/home/cf/abs/local/handbrake-git-cf/src/handbrake/build/gtk/src'
make[2]: *** [Makefile:449: all-recursive] Error 1
make[2]: Leaving directory '/home/cf/abs/local/handbrake-git-cf/src/handbrake/build/gtk'
make[1]: *** [Makefile:381: all] Error 2
make[1]: Leaving directory '/home/cf/abs/local/handbrake-git-cf/src/handbrake/build/gtk'
make: *** [../gtk/module.rules:31: gtk.build] Error 2
make: *** Waiting for unfinished jobs....
time end: Thu Sep 12 18:23:54 2019
duration: 7 minutes, 46 seconds (466.01s)
result: FAILURE (code 2)
@jstebbins

This comment has been minimized.

Copy link
Contributor

commented Sep 12, 2019

You've got some completely unrelated problem going on there. None of those warnings and errors make any sense at all. But perhaps there were more errors before what you've pasted that caused a cascade into nonsense?

Anyway, we are continuing to work on the harfbuzz issues #2310
I think we are close to a solution

@khaledhosny

This comment has been minimized.

Copy link

commented Sep 15, 2019

The right way to include HarfBuzz hb.h is #include <hb.h> since the include path returned by pkg-config points to the harfbuzz directory not its parent directory.

Using #include <harfbuzz/hb.h> works accidentally when the parent directory (e.g. /user/include) in in the include path, but if HarfBuzz is installed in a non-standard directory it will fail.

@jstebbins

This comment has been minimized.

Copy link
Contributor

commented Sep 15, 2019

It's probably too late for them to change it since apps already expect the current behavior, but IMO this is an error in harfbuz pkg-config that results in pollution of the namespace.

Regardless, we've done what is necessary to allow harfbuzz hog the namespace.

@sr55 sr55 closed this Sep 19, 2019

@sr55

This comment has been minimized.

Copy link
Contributor

commented Sep 19, 2019

I don't actually have an appropriate label for this one so just closing it.

@sr55 sr55 added this to the 1.3.0 milestone Sep 19, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
6 participants
You can’t perform that action at this time.