gtkd-developers / gir-to-d

Create D bindings from GObject introspection files
GNU Lesser General Public License v3.0
23 stars 13 forks source link

Cannot build on Fedora Rawhide #20

Closed russel closed 5 years ago

russel commented 6 years ago

I just tried building on Fedora Rawhide (fully up to date as at 2018-10-17T07:10+01:00)

|> meson --prefix=$HOME/Built /home/users/russel/Repositories/Git/Forks/Gir_to_D
The Meson build system
Version: 0.48.0
Source dir: /home/users/russel/Repositories/Git/Forks/Gir_to_D
Build dir: /home/russel/BuildArea/Gir_to_D
Build type: native build
Project name: GIR-to-D
Project version: 0.16.0
Native D compiler: ldc2 (llvm 1.12.0 "LDC - the LLVM D compiler (1.12.0):")
Build machine cpu family: x86_64
Build machine cpu: x86_64
Build targets in project: 2
Found ninja-1.8.2 at /home/russel/Built/bin/ninja

So far so good. However:

|> ninja
[2/20] Compiling D object 'girtod@exe/source_gtd_GlibTypes.d.o'.
FAILED: girtod@exe/source_gtd_GlibTypes.d.o 
ldc2 -I=girtod@exe -I=. -I=../../../users/russel/Repositories/Git/Forks/Gir_to_D -I=../../../users/russel/Repositories/Git/Forks/Gir_to_D/source/ -I= -enable-color -wi -g -J/home/russel/BuildArea/Gir_to_D   -of='girtod@exe/source_gtd_GlibTypes.d.o' -c ../../../users/russel/Repositories/Git/Forks/Gir_to_D/source/gtd/GlibTypes.d
Error: Expected argument to '-I'
[3/20] Compiling D object 'girtod@exe/source_gtd_DefReader.d.o'.
FAILED: girtod@exe/source_gtd_DefReader.d.o 
ldc2 -I=girtod@exe -I=. -I=../../../users/russel/Repositories/Git/Forks/Gir_to_D -I=../../../users/russel/Repositories/Git/Forks/Gir_to_D/source/ -I= -enable-color -wi -g -J/home/russel/BuildArea/Gir_to_D   -of='girtod@exe/source_gtd_DefReader.d.o' -c ../../../users/russel/Repositories/Git/Forks/Gir_to_D/source/gtd/DefReader.d
Error: Expected argument to '-I'
[4/20] Compiling D object 'girtod@exe/source_girtod.d.o'.
FAILED: girtod@exe/source_girtod.d.o 
ldc2 -I=girtod@exe -I=. -I=../../../users/russel/Repositories/Git/Forks/Gir_to_D -I=../../../users/russel/Repositories/Git/Forks/Gir_to_D/source/ -I= -enable-color -wi -g -J/home/russel/BuildArea/Gir_to_D   -of='girtod@exe/source_girtod.d.o' -c ../../../users/russel/Repositories/Git/Forks/Gir_to_D/source/girtod.d
Error: Expected argument to '-I'
[5/20] Compiling D object 'girtod@exe/source_gtd_GirConstant.d.o'.
FAILED: girtod@exe/source_gtd_GirConstant.d.o 
ldc2 -I=girtod@exe -I=. -I=../../../users/russel/Repositories/Git/Forks/Gir_to_D -I=../../../users/russel/Repositories/Git/Forks/Gir_to_D/source/ -I= -enable-color -wi -g -J/home/russel/BuildArea/Gir_to_D   -of='girtod@exe/source_gtd_GirConstant.d.o' -c ../../../users/russel/Repositories/Git/Forks/Gir_to_D/source/gtd/GirConstant.d
Error: Expected argument to '-I'
[6/20] Compiling D object 'girtod@exe/source_gtd_GirField.d.o'.
FAILED: girtod@exe/source_gtd_GirField.d.o 
ldc2 -I=girtod@exe -I=. -I=../../../users/russel/Repositories/Git/Forks/Gir_to_D -I=../../../users/russel/Repositories/Git/Forks/Gir_to_D/source/ -I= -enable-color -wi -g -J/home/russel/BuildArea/Gir_to_D   -of='girtod@exe/source_gtd_GirField.d.o' -c ../../../users/russel/Repositories/Git/Forks/Gir_to_D/source/gtd/GirField.d
Error: Expected argument to '-I'
[7/20] Compiling D object 'girtod@exe/source_gtd_GirEnum.d.o'.
FAILED: girtod@exe/source_gtd_GirEnum.d.o 
ldc2 -I=girtod@exe -I=. -I=../../../users/russel/Repositories/Git/Forks/Gir_to_D -I=../../../users/russel/Repositories/Git/Forks/Gir_to_D/source/ -I= -enable-color -wi -g -J/home/russel/BuildArea/Gir_to_D   -of='girtod@exe/source_gtd_GirEnum.d.o' -c ../../../users/russel/Repositories/Git/Forks/Gir_to_D/source/gtd/GirEnum.d
Error: Expected argument to '-I'
[8/20] Compiling D object 'girtod@exe/source_gtd_GirAlias.d.o'.
FAILED: girtod@exe/source_gtd_GirAlias.d.o 
ldc2 -I=girtod@exe -I=. -I=../../../users/russel/Repositories/Git/Forks/Gir_to_D -I=../../../users/russel/Repositories/Git/Forks/Gir_to_D/source/ -I= -enable-color -wi -g -J/home/russel/BuildArea/Gir_to_D   -of='girtod@exe/source_gtd_GirAlias.d.o' -c ../../../users/russel/Repositories/Git/Forks/Gir_to_D/source/gtd/GirAlias.d
Error: Expected argument to '-I'
[9/20] Compiling D object 'girtod@exe/source_gtd_GirStruct.d.o'.
FAILED: girtod@exe/source_gtd_GirStruct.d.o 
ldc2 -I=girtod@exe -I=. -I=../../../users/russel/Repositories/Git/Forks/Gir_to_D -I=../../../users/russel/Repositories/Git/Forks/Gir_to_D/source/ -I= -enable-color -wi -g -J/home/russel/BuildArea/Gir_to_D   -of='girtod@exe/source_gtd_GirStruct.d.o' -c ../../../users/russel/Repositories/Git/Forks/Gir_to_D/source/gtd/GirStruct.d
Error: Expected argument to '-I'
[10/20] Compiling D object 'girtod@exe/source_gtd_GirFunction.d.o'.
FAILED: girtod@exe/source_gtd_GirFunction.d.o 
ldc2 -I=girtod@exe -I=. -I=../../../users/russel/Repositories/Git/Forks/Gir_to_D -I=../../../users/russel/Repositories/Git/Forks/Gir_to_D/source/ -I= -enable-color -wi -g -J/home/russel/BuildArea/Gir_to_D   -of='girtod@exe/source_gtd_GirFunction.d.o' -c ../../../users/russel/Repositories/Git/Forks/Gir_to_D/source/gtd/GirFunction.d
Error: Expected argument to '-I'
[11/20] Compiling D object 'girtod@exe/source_gtd_GirPackage.d.o'.
FAILED: girtod@exe/source_gtd_GirPackage.d.o 
ldc2 -I=girtod@exe -I=. -I=../../../users/russel/Repositories/Git/Forks/Gir_to_D -I=../../../users/russel/Repositories/Git/Forks/Gir_to_D/source/ -I= -enable-color -wi -g -J/home/russel/BuildArea/Gir_to_D   -of='girtod@exe/source_gtd_GirPackage.d.o' -c ../../../users/russel/Repositories/Git/Forks/Gir_to_D/source/gtd/GirPackage.d
Error: Expected argument to '-I'
ninja: build stopped: subcommand failed.
ximion commented 6 years ago

@russel This is a regression in Meson 0.48.0 (one of quite a few, unfortunately...). Try downgrading or upgrading Meson to fix this issue. See https://github.com/mesonbuild/meson/pull/4342 for the patch that fixes the problem in the next release, and a few more details on the bug.

russel commented 6 years ago

@ximion I have a clone of Meson so can use master/HEAD instead of the Debian or Fedora release packages to avoid being blocked on this problem.

Conan-Kudo commented 5 years ago

I don't observe this issue anymore with gir-to-d, but I do observe a new problem when trying to build GlibD on Rawhide with gir-to-d 0.17.0.

Dependency glib-2.0 found: YES 2.59.0
Dependency gobject-2.0 found: YES 2.59.0
Dependency gio-2.0 found: YES 2.59.0
Dependency gobject-introspection-1.0 found: YES 1.59.3
...
Program girtod found: YES (/usr/bin/girtod)
Message: Generating D interfaces from GIR...
Running command: /usr/bin/girtod -i /builddir/build/BUILD/GlibD-2.0.2/src -o /builddir/build/BUILD/GlibD-2.0.2/x86_64-redhat-linux-gnu/generated --print-files relative,/builddir/build/BUILD/GlibD-2.0.2
--- stdout ---
x86_64-redhat-linux-gnu/generated/gtkd/Implement.d
x86_64-redhat-linux-gnu/generated/gtkd/paths.d
x86_64-redhat-linux-gnu/generated/gtkd/Loader.d

--- stderr ---
Error /usr/share/gir-1.0/GLib-2.0.gir(21): Unexpected tag: source-position in GirAlias: DateDay

meson.build:36:4: ERROR:  Problem encountered: Unable to build D intefaces from GIR:
Error /usr/share/gir-1.0/GLib-2.0.gir(21): Unexpected tag: source-position in GirAlias: DateDay
MikeWey commented 5 years ago

I can't reproduce this locally, could you post the first 40 lines of the GLib-2.0.gir file?

Conan-Kudo commented 5 years ago
<?xml version="1.0"?>
<!-- This file was automatically generated from C sources - DO NOT EDIT!
To affect the contents of this file, edit the original C definitions,
and/or use gtk-doc annotations.  -->
<repository version="1.2"
            xmlns="http://www.gtk.org/introspection/core/1.0"
            xmlns:c="http://www.gtk.org/introspection/c/1.0"
            xmlns:glib="http://www.gtk.org/introspection/glib/1.0">
  <package name="glib-2.0"/>
  <c:include name="glib.h"/>
  <namespace name="GLib"
             version="2.0"
             shared-library="libgobject-2.0.so.0,libglib-2.0.so.0"
             c:identifier-prefixes="G"
             c:symbol-prefixes="g,glib">
    <alias name="DateDay" c:type="GDateDay">
      <doc xml:space="preserve"
           filename="glib-2.0.c"
           line="289">Integer representing a day of the month; between 1 and 31.
#G_DATE_BAD_DAY represents an invalid day of the month.</doc>
      <source-position filename="gdate.h" line="50"/>
      <type name="guint8" c:type="guint8"/>
    </alias>
    <alias name="DateYear" c:type="GDateYear">
      <doc xml:space="preserve"
           filename="glib-2.0.c"
           line="334">Integer representing a year; #G_DATE_BAD_YEAR is the invalid
value. The year must be 1 or higher; negative (BC) years are not
allowed. The year is represented with four digits.</doc>
      <source-position filename="gdate.h" line="49"/>
      <type name="guint16" c:type="guint16"/>
    </alias>
    <alias name="MutexLocker" c:type="GMutexLocker">
      <doc xml:space="preserve"
           filename="gthread.h"
           line="270">Opaque type. See g_mutex_locker_new() for details.</doc>
      <source-position filename="gthread.h" line="276"/>
      <type name="none" c:type="void"/>
    </alias>
    <alias name="Pid" c:type="GPid">
MikeWey commented 5 years ago

Looks like they added the source location of the symbol to the gir files.

I think https://github.com/gtkd-developers/gir-to-d/commit/44ad4768734fdfe0b37b7097a71c85287c8a297a updates gir-to-d for the possible locations this could be used.

Conan-Kudo commented 5 years ago

@MikeWey That helped, and now I got further along in the GlibD build, but I see this error now, and I'm not sure whether it means it's a gir-to-d issue or a GlibD issue:

FAILED: glibd-2.0@sha/x86_64-redhat-linux-gnu_generated_glib_c_types.d.o 
ldc2 -I=glibd-2.0@sha -I=. -I=.. -I=generated -I=../generated -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/uuid -enable-color -release -w -g -O1 -relocation-model=pic   -of='glibd-2.0@sha/x86_64-redhat-linux-gnu_generated_glib_c_types.d.o' -c ../x86_64-redhat-linux-gnu/generated/glib/c/types.d
../x86_64-redhat-linux-gnu/generated/glib/c/types.d(4539): Error: use `real` instead of `long double`

That's repeating for each of the four compilation units it gets to before it dies...

MikeWey commented 5 years ago

It's an issue with gir-to-d, should be fixed now.

russel commented 5 years ago

I'm afraid I have now ditched Fedora, and am solely on Debian Sid, so having started this issue, I can't contribute now. Sorry.

Conan-Kudo commented 5 years ago

@MikeWey This is definitely fixed now.

gir-to-d: https://koji.fedoraproject.org/koji/buildinfo?buildID=1191994 glibd: https://koji.fedoraproject.org/koji/buildinfo?buildID=1199351