romgrk / node-gtk

GTK+ bindings for NodeJS (via GObject introspection)
MIT License
494 stars 42 forks source link

Build issues on macOS #217

Closed romgrk closed 4 years ago

romgrk commented 4 years ago
In file included from ../src/modules/cairo/cairo.cc:13:
In file included from ../src/modules/cairo/font-face.h:15:
In file included from /usr/local/Cellar/cairo/1.16.0_3/include/cairo/cairo-quartz.h:43:
In file included from /System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.h:23:
In file included from /System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h:19:
In file included from /System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:43:
In file included from /System/Library/Frameworks/CoreFoundation.framework/Headers/CFBase.h:77:
/usr/include/MacTypes.h:309:41: error: typedef redefinition with different types ('unsigned char' vs 'v8::Boolean')
typedef unsigned char                   Boolean;

https://travis-ci.org/github/romgrk/node-gtk/jobs/736552109#L6350-L6358 https://gitlab.freedesktop.org/cairo/cairo/-/issues/429

romgrk commented 4 years ago

Observations:

Update: the recent build of v0.4.0 seems to compile but fail some tests -_-

test details
  39 passing (57s)
  1 pending
  2 failing
  1) conversion__array.js:
     Failed: undefined
[WARN] gi.cc: GetConstantValue: 137: Couldn't load HarfBuzz.LANGUAGE_INVALID: invalid constant size: 0
Result: aGVsbG8=
Result: 5d41402abc4b2a76b9719d911017c592
Result: [
  true,
  [
     47,  42,  10,  32,  42,  32,  99, 111, 110, 118, 101, 114,
    115, 105, 111, 110,  95,  95,  97, 114, 114,  97, 121,  46,
    106, 115,  10,  32,  42,  47,  10,  10,  10,  99, 111, 110,
    115, 116,  32, 102, 115,  32,  61,  32, 114, 101, 113, 117,
    105, 114, 101,  40,  39, 102, 115,  39,  41,  10,  99, 111,
    110, 115, 116,  32, 112,  97, 116, 104,  32,  61,  32, 114,
    101, 113, 117, 105, 114, 101,  40,  39, 112,  97, 116, 104,
     39,  41,  10,  99, 111, 110, 115, 116,  32, 103, 105,  32,
     61,  32, 114, 101,
    ... 1333 more items
  ]
]
Result: [ 'argument1', '--gtk-debug', 'misc', 'argument2' ]
    at Object. (/Users/travis/build/romgrk/node-gtk/tests/conversion__array.js:55:10)

  2) function_call__inout.js:
     [ 'argument1', '--gtk-debug', 'misc', 'argument2' ] expected length === 2
[WARN] gi.cc: GetConstantValue: 137: Couldn't load HarfBuzz.LANGUAGE_INVALID: invalid constant size: 0

npm ERR! Test failed.  See above for more details.
WebReflection commented 4 years ago

I've tried to change, remove, the typedef unsigned char Boolean in macOS header without success, but if cairo version was the same before I don't understand why it fails now ... I've tried both node 14 and 15, maybe I should try node 12 instead?

wotzlaff commented 4 years ago

The name Boolean is used in the present version of the macOS system and framework headers. (To be honest I am not sure whether this statement is fully correct because I am no macOS user.) This causes a conflict if we use using v8::Boolean;. I gave a quick fix in #230, but maybe we should be more careful with the other using statements, too.

WebReflection commented 4 years ago

I can confirm your branch works on macOS Catalina 10.15.7 too