harfbuzz icon indicating copy to clipboard operation
harfbuzz copied to clipboard

8.1.1 fails to build on arm64 Mac OS

Open line72 opened this issue 2 years ago • 13 comments

I am trying to build version 8.1.1 on a Macbook M1 using the gtk-osx and jhbuild scripts.

I get the following error when trying to generate the gir file:

[98/102] Generating src/HarfBuzz-0.0.typelib with a custom command
FAILED: src/HarfBuzz-0.0.typelib
/Users/user/gtk/inst/bin/g-ir-compiler src/HarfBuzz-0.0.gir --output src/HarfBuzz-0.0.typelib --includedir=/Users/user/gtk/inst/share/gir-1.0
src/HarfBuzz-0.0.gir:38:38: error: Line 38, character 38: The attribute 'name' on the element 'type' must be specified
error parsing file src/HarfBuzz-0.0.gir: Line 38, character 38: The attribute 'name' on the element 'type' must be specified
[99/102] Compiling C++ object src/libharfbuzz-subset.0.dylib.p/hb-subset.cc.o
ninja: build stopped: subcommand failed.
*** Error during phase build of harfbuzz: ########## Error running ninja   *** [18/26]

line72 avatar Aug 16 '23 13:08 line72

That's really weird. What version of gobject-introspection do you have installed? Can you attach the HarfBuzz-0.0.gir file?

behdad avatar Aug 16 '23 15:08 behdad

I have gobject-introspection-1.76.1.

HarfBuzz-0.0.gir.zip

line72 avatar Aug 16 '23 15:08 line72

@khaledhosny do we ship the gir file in the tarball? All I can assume is that the gir was generated with a different version of gobject-introspection..

behdad avatar Aug 16 '23 15:08 behdad

I have gobject-introspection-1.76.1.

I just built on Mac brew with the same version and it built fine.

behdad avatar Aug 16 '23 15:08 behdad

Which build system are you using? meson, cmake, or autotools?

behdad avatar Aug 16 '23 15:08 behdad

I am using jhbuild to build everything. It is trying to use meson.

line72 avatar Aug 16 '23 18:08 line72

error parsing file src/HarfBuzz-0.0.gir: Line 38, character 38: The attribute 'name' on the element 'type' must be specified

@ebassi did something like this change in gobject-introspection?

behdad avatar Aug 16 '23 18:08 behdad

@khaledhosny do we ship the gir file in the tarball? All I can assume is that the gir was generated with a different version of gobject-introspection..

Does not look like we ship it.

khaledhosny avatar Aug 16 '23 23:08 khaledhosny

@behdad Nothing has changed in the attribute checks at least since 2010.

The warning seems to be coming from:

    <constant name="CODEPOINT_INVALID"
              value="-1"
              c:type="HB_CODEPOINT_INVALID">
      <source-position filename="../../Source/harfbuzz-8.1.1/src/hb-common.h"
                       line="115"/>
      <type c:type="hb_codepoint_t"/>
    </constant>

i.e.

/**
  * HB_CODEPOINT_INVALID:
  *
  * Unused #hb_codepoint_t value.
  *
  * Since: 8.0.0
  */
#define HB_CODEPOINT_INVALID ((hb_codepoint_t) -1)

Building with gobject-introspection 1.76.1 yields:

    <constant name="CODEPOINT_INVALID"
              value="4294967295"
              c:type="HB_CODEPOINT_INVALID"
              version="8.0.0">
      <doc xml:space="preserve"
           filename="src/hb-common.h"
           line="108">Unused #hb_codepoint_t value.</doc>
      <source-position filename="src/hb-common.h" line="115"/>
      <type name="codepoint_t" c:type="hb_codepoint_t"/>
    </constant>

ebassi avatar Aug 17 '23 11:08 ebassi

The fact that the XML is so different is puzzling; @line72 are you trying to regenerate the GIR from the typelib and then compiling it back?

ebassi avatar Aug 17 '23 11:08 ebassi

I am just using jhbuild, so I am running jhbuild build harfbuzz. Attached is the build log:

harfbuzz.log

line72 avatar Aug 17 '23 14:08 line72

This looks suspicious: [97/102] Generating src/HarfBuzz-0.0.gir with a custom command (wrapped by meson to set env)

line72 avatar Aug 17 '23 14:08 line72

This looks suspicious: [97/102] Generating src/HarfBuzz-0.0.gir with a custom command (wrapped by meson to set env)

That's a normal part of our build.

behdad avatar Aug 21 '23 19:08 behdad