gvsbuild icon indicating copy to clipboard operation
gvsbuild copied to clipboard

Harfbuzz Build Fails When Using VS2017 with GIR Attribute Error

Open doadin opened this issue 4 years ago • 6 comments

On windows 10 20H2 using MSVC 2017 python 3.7.9 `Project(s) built: ninja (1.656 s) nuget (1.721 s) python (0.000 s) meson (-10781.082 s) pkg-config (42.776 s) cmake (31.515 s) win-iconv (84.063 s) gettext (223.562 s) libffi (9.281 s) zlib (4.422 s) glib (119.830 s) enchant (10.579 s) cargo (24.515 s) libpng (10.437 s) freetype (10.813 s) libxml2 (17.984 s) fontconfig (29.953 s) pixman (9.984 s) cairo (43.250 s) msys2 (0.000 s) gobject-introspection (36.656 s) fribidi (6.845 s) nasm (1.656 s) libjpeg-turbo (40.407 s) libtiff-4 (43.859 s) gdk-pixbuf (46.891 s) atk (44.469 s) json-glib (43.766 s) libepoxy (24.797 s) hicolor-icon-theme (1.609 s) wing (7.343 s) pycairo (13.578 s) pygobject (13.078 s) lz4 (46.453 s)

Project(s) not built: pango

Missing dependecies: librsvg cogl gtk3 gtk3-full adwaita-icon-theme`

FAILED: subprojects/harfbuzz/src/HarfBuzz-0.0.typelib
"C:\Python37\python.exe" "C:\gtk-build\tools\meson-0.57.1\meson.py" "--internal" "exe" "--unpickle" "C:\gtk-build\build\x64\release\pango\_gvsbuild-meson\meson-private\meson_exe_g-ir-compiler.exe_c698b8d87ab5af16d3c9df00bc88a32057b8a4a2.dat"
while executing ['C:/gtk-build/gtk/x64/release/bin/../bin/g-ir-compiler.exe', 'subprojects/harfbuzz/src/HarfBuzz-0.0.gir', '--output', 'subprojects/harfbuzz/src/HarfBuzz-0.0.typelib', '--includedir=C:/gtk-build/gtk/x64/release/bin/../share/gir-1.0']
--- stdout ---
--- stderr ---
subprojects/harfbuzz/src/HarfBuzz-0.0.gir:117:37: error: Line 117, character 37: The attribute 'name' on the element 'type' must be specified
error parsing file subprojects/harfbuzz/src/HarfBuzz-0.0.gir: Line 117, character 37: The attribute 'name' on the element 'type' must be specified
[260/358] Linking target subprojects/harfbuzz/test/api/test-subset-hmtx.exe
[261/358] Compiling C object utils/pango-view.exe.p/viewer-cairo.c.obj
[262/358] Compiling C object utils/pango-segmentation.exe.p/pango-segmentation.c.obj
[263/358] Compiling C object utils/pango-list.exe.p/pango-list.c.obj
[264/358] Generating Pango-1.0.gir with a custom command (wrapped by meson to set PATH)
ninja: build stopped: subcommand failed.
* Removing pango dependents ...
* > Removing librsvg for pango ...
* > Removing cogl for pango ...
* > Removing gtk3 for pango ...
* > Removing gtk3-full for pango ...
* Removing librsvg dependents ...
* > Removing adwaita-icon-theme for librsvg ...
* Removing cogl dependents ...
* Removing gtk3 dependents ...
* Removing gtk3-full dependents ...
* Removing adwaita-icon-theme dependents ...

doadin avatar Dec 31 '21 11:12 doadin

Hi @doadin, what command are you using to build with?

danyeaw avatar Dec 31 '21 16:12 danyeaw

@danyeaw python build.py -d build --clean --gtk3-ver=3.24 --vs-ver=15 --platform=x64 --same-python -k --enable-gi --py-wheel enchant gtk3-full pycairo pygobject lz4 --skip gtksourceview,emeus,clutter --capture-out --print-out

doadin avatar Dec 31 '21 17:12 doadin

I'm just realizing that that top output is from a different build log however same error still occurs.

` Project(s) built: ninja (1.593 s) nuget (1.562 s) python (0.000 s) meson (3.485 s) pkg-config (6.391 s) cmake (4.125 s) win-iconv (8.547 s) gettext (47.235 s) libffi (6.625 s) zlib (5.047 s) glib (105.391 s) enchant (11.593 s) cargo (30.936 s) libpng (12.861 s) freetype (22.625 s) libxml2 (24.891 s) fontconfig (38.515 s) pixman (9.781 s) cairo (55.625 s) msys2 (0.000 s) gobject-introspection (39.422 s) fribidi (11.469 s) nasm (1.578 s) libjpeg-turbo (35.703 s) libtiff-4 (41.437 s) gdk-pixbuf (42.485 s) atk (14.141 s) json-glib (18.969 s) libepoxy (18.172 s) hicolor-icon-theme (1.578 s) wing (6.219 s) pycairo (14.891 s) pygobject (15.890 s) lz4 (52.094 s)

Project(s) not built: harfbuzz

Missing dependecies: pango librsvg cogl gtk3 gtk3-full adwaita-icon-theme `

` src/HarfBuzz-0.0.gir:117:37: error: Line 117, character 37: The attribute 'name' on the element 'type' must be specified error parsing file src/HarfBuzz-0.0.gir: Line 117, character 37: The attribute 'name' on the element 'type' must be specified ninja: build stopped: subcommand failed.

  • Removing harfbuzz dependents ...
  • Removing pango for harfbuzz ...

  • Removing librsvg for harfbuzz ...

  • Removing cogl for harfbuzz ...

  • Removing gtk3 for harfbuzz ...

  • Removing gtk3-full for harfbuzz ...

  • Removing pango dependents ...
  • Removing adwaita-icon-theme for pango ...

  • Removing librsvg dependents ...
  • Removing cogl dependents ...
  • Removing gtk3 dependents ...
  • Removing gtk3-full dependents ...
  • Removing adwaita-icon-theme dependents ...

`

doadin avatar Dec 31 '21 17:12 doadin

@doadin This is hard to debug when you are using the --keep / -k continue build on failure flag. I can reproduce that gobject-introspection fails to build when using --same-python if I run python build.py build --clean --gtk3-ver=3.24 --vs-ver=16 --platform=x64 --msys-dir=C:\tools\msys64 --same-python --enable-gi --py-wheel gobject-introspection

Running custom install script 'C:\\gtk-build\\github\\gvsbuild\\.venv\\Scripts\\python.exe C:\\gtk-build\\tools\\meson-0.57.1\\meson.py --internal gettext install --subdir=po --localedir=share/locale --pkgname=glib20'
(tar) Exporting gobject-introspection
Building project gobject-introspection (1.70.0)
The Meson build system
Version: 0.57.1
Source dir: C:\gtk-build\build\x64\release\gobject-introspection
Build dir: C:\gtk-build\build\x64\release\gobject-introspection\_gvsbuild-meson
Build type: native build
Project name: gobject-introspection
Project version: 1.70.0
C compiler for the host machine: cl (msvc 19.29.30138 "Microsoft (R) C/C++ Optimizing Compiler Version 19.29.30138 for x64")
C linker for the host machine: link link 14.29.30138.0
Host machine cpu family: x86_64
Host machine cpu: x86_64
Program python3 found: YES (C:\gtk-build\github\gvsbuild\.venv\Scripts\python.exe)
Compiler for C supports arguments -FImsvc_recommended_pragmas.h: NO
Compiler for C supports arguments -utf-8: YES
Checking for size of "char" : 1
Checking for size of "short" : 2
Checking for size of "int" : 4
Checking for size of "long" : 4
Configuring config.h using configuration
Found pkg-config: C:\gtk-build\gtk\x64\release\bin\pkg-config.EXE (1.8.0)
Run-time dependency glib-2.0 found: YES 2.70.1
Run-time dependency gobject-2.0 found: YES 2.70.1
Run-time dependency gio-2.0 found: YES 2.70.1
Run-time dependency gmodule-2.0 found: YES 2.70.1
Run-time dependency gio-windows-2.0 found: YES 2.70.1
Run-time dependency libffi found: YES 3.2.1
Could not find Python3 library 'C:\\gtk-build\\github\\gvsbuild\\.venv\\libs\\python310.lib'
Dependency python found: NO

It builds just fine without --same-python. Are there other build failures?

danyeaw avatar Jan 02 '22 18:01 danyeaw

My apologies, I am getting this and the other issue I opened mixed as far as command line used. I was getting another issue #472 so I stopped using --same-python, and without that the only issue I get is: src/HarfBuzz-0.0.gir:117:37: error: Line 117, character 37: The attribute 'name' on the element 'type' must be specified error parsing file src/HarfBuzz-0.0.gir: Line 117, character 37: The attribute 'name' on the element 'type' must be specified ninja: build stopped: subcommand failed.

I will also note I switched to vs2019 and it runs fine. Is there a simple way to just compile HarfBuzz so I can get a more detailed log for you?

doadin avatar Jan 03 '22 02:01 doadin

I briefly looked into this some time ago when catching said error myself, and the gir file referenced indeed lists none or void as name when grepping for line 117(not actual line 117, but string text). For me works fine also in vc2019, just not vc2017, just like doadin. I tested with just harfbuzz lastly but log is same. Googling this at the time, I suspect it's related to this link and it's other link, albeit other context, but same error and described worked with 2019 not 2017, mentioning different preprocessors and more finicky in 2017. In short dangling headers and added wrong include dirs, but over my head to try fix as noob regarding windows building.

https://github.com/ebassi/graphene/issues/205

Fanc999:

It seems like pkg-config will try to set -I$(PREFIX)\include as one of the include paths it found if that directory exists, even if none of the dependent .pc files have includedir=${prefix}/include. So, you might want to check whether there are any dangling include paths in your compiler cflags for the various object files, and throw things in the dangling include paths away or move them somewhere else, and things should work. It seems that g-ir-scanner is quite sensitive to what include paths are given and/or set in the environment, and it would be beyond me to fix that in g-ir-scanner

Sorry if way off here.

mhertz avatar Jan 03 '22 15:01 mhertz