buggins / dlangui

Cross Platform GUI for D programming language
Boost Software License 1.0
805 stars 120 forks source link

Please support the GDC compiler #643

Closed Behkar closed 1 year ago

Behkar commented 1 year ago
± |master ✓| → dub run --build=release --compiler=gdc
Performing "release" build using gdc for x86_64.
bindbc-loader 1.0.1: target for configuration "noBC" is up to date.
bindbc-freetype 1.0.5: target for configuration "dynamic" is up to date.
bindbc-opengl 1.0.3: target for configuration "dynamic" is up to date.
bindbc-sdl 1.0.1: target for configuration "dynamic" is up to date.
inilike 1.2.2: target for configuration "library" is up to date.
isfreedesktop 0.1.1: target for configuration "library" is up to date.
xdgpaths 0.2.5: target for configuration "library" is up to date.
icontheme 1.2.3: target for configuration "library" is up to date.
undead 1.1.8: building configuration "library"...
/home/mahdis/.dub/packages/undead-1.1.8/undead/src/undead/doformat.d:419:15: error: none of the overloads of template ‘core.stdc.stdarg.va_arg’ are callable using argument types ‘!()(__va_list_tag[1], TypeInfo, void*)’
  419 |         va_arg(ap, ti, argBuffer + pos);
      |               ^
/usr/lib/gcc/x86_64-redhat-linux/12/include/d/core/stdc/stdarg.d:172:7: note: Candidates are: ‘va_arg(T)(ref va_list ap)’
  172 |     T va_arg(T)(ref va_list ap); // intrinsic
      |       ^
/usr/lib/gcc/x86_64-redhat-linux/12/include/d/core/stdc/stdarg.d:271:10: note:                 ‘va_arg(T)(ref va_list ap, ref T parmn)’
  271 |     void va_arg(T)(ref va_list ap, ref T parmn); // intrinsic
      |          ^
/home/mahdis/.dub/packages/undead-1.1.8/undead/src/undead/stream.d:1209:13: error: template instance ‘undead.doformat.doFormat!()’ error instantiating
 1209 |     doFormat(&doFormatCallback,arguments,argptr);
      |             ^
gdc failed with exit code 1.

It seems, all the packages compile successfully with GDC, it just remains undead.

My compiler version : gdc (GCC) 12.2.1 20221121 (Red Hat 12.2.1-4)

PetarKirov commented 1 year ago

It looks like the root cause is that the undead library does not support GDC. While, in theory undead could be updated to support it, the main reason for the creation of undead is to have a place throw old code from Phobos, that doesn't meet the quality requirements for the standard library. @GrimMaple I suggest you look into what's needed to remove undead as a dependency altogether.

GrimMaple commented 1 year ago

The problem is, indeed, the undeaD package that fails to compile with GDC. dlangui uses std.xml, which would be not an easy task to replace. Very sad times

GrimMaple commented 1 year ago

A quick look through possible replacements for XML left me in a state of despair. There doesn't seem to be any suitable XML replacemnt on dub at all. There isn't a single library that is maintained. The closest to a maintained XML I could get is arsd.dom, which isn't really an XML parser, but rather a HTML parser. At least I can easily reach to Adam in case it breaks,,, I don't know what to do with this. I'll talk about it with Adam when he wakes up, but this is gonna have to be on hold for some time

GrimMaple commented 1 year ago

OK, I replaced undeaD with arsd.dom. Gonna add GDC target to the pipelines. Gonna close this manually once I'm sure everything compiles on all 3 mainline compilers :)

GrimMaple commented 1 year ago

Unfortunately, even having replaced undeaD with Adam's arsd.dom, it's still impossible to build with GDC. Though this time I'm putting the blame at GDC, because it straight up doesn't support -mv compiler switch. I'll look into reporting this to GDC team

GrimMaple commented 1 year ago

UP: I managed to build with GDC locally, but it involved some hacking of arsd library. Once that is updated on dub, I will bump the dependency version and resolve this issue.

GrimMaple commented 1 year ago

@Behkar I think this should be resolved as of now. I pushed version 0.10.2, but it will take a while for dub to pick this up. I can't speed up the process as I don't have access to dlangui page on dub. Once it updates though, please, feel free to test this out. If you experience any more issues, just reopen this or create a new issue :)

GrimMaple commented 1 year ago

@Behkar dub finally updated the dlangui version, so it should be OK to use now. The version is 0.10.2