electron / forge

:electron: A complete tool for building and publishing Electron applications
https://electronforge.io
MIT License
6.49k stars 517 forks source link

Building @electron-forge/maker-dmg@7.3.0 fails with both node 18 and 20 #3541

Open hbel opened 7 months ago

hbel commented 7 months ago

Pre-flight checklist

Electron Forge version

6.4.2

Electron version

28.2.2

Operating system

macOS 14.4 (Silicon)

Last known working Electron Forge version

None

Expected behavior

I would expect to be able to install the @electron-forge/maker-dmg package

Actual behavior

Installting with yarn add @electron-forge/maker-dmg fails with the following error (fyi, the error is identical for node 20)

    gyp info it worked if it ends with ok
    gyp info using node-gyp@10.0.1
    gyp info using node@18.19.1 | darwin | arm64
    gyp info find Python using Python version 3.11.6 found at "/Users/hendrikbelitz/miniforge3/bin/python3"
    gyp info spawn /Users/hendrikbelitz/miniforge3/bin/python3
    gyp info spawn args [
    gyp info spawn args '/Users/hendrikbelitz/.nvm/versions/node/v18.19.1/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
    gyp info spawn args 'binding.gyp',
    gyp info spawn args '-f',
    gyp info spawn args 'make',
    gyp info spawn args '-I',
    gyp info spawn args '/Users/hendrikbelitz/git/mieterbund/word4mia/node_modules/macos-alias/build/config.gypi',
    gyp info spawn args '-I',
    gyp info spawn args '/Users/hendrikbelitz/.nvm/versions/node/v18.19.1/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
    gyp info spawn args '-I',
    gyp info spawn args '/Users/hendrikbelitz/.electron-gyp/28.2.2/include/node/common.gypi',
    gyp info spawn args '-Dlibrary=shared_library',
    gyp info spawn args '-Dvisibility=default',
    gyp info spawn args '-Dnode_root_dir=/Users/hendrikbelitz/.electron-gyp/28.2.2',
    gyp info spawn args '-Dnode_gyp_dir=/Users/hendrikbelitz/.nvm/versions/node/v18.19.1/lib/node_modules/npm/node_modules/node-gyp',
    gyp info spawn args '-Dnode_lib_file=/Users/hendrikbelitz/.electron-gyp/28.2.2/<(target_arch)/node.lib',
    gyp info spawn args '-Dmodule_root_dir=/Users/hendrikbelitz/git/mieterbund/word4mia/node_modules/macos-alias',
    gyp info spawn args '-Dnode_engine=v8',
    gyp info spawn args '--depth=.',
    gyp info spawn args '--no-parallel',
    gyp info spawn args '--generator-output',
    gyp info spawn args 'build',
    gyp info spawn args '-Goutput_dir=.'
    gyp info spawn args ]
    gyp info spawn make
    gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
    In file included from ../src/volume.cc:2:
    ../../nan/nan.h:688:39: warning: 'IdleNotificationDeadline' is deprecated: Use MemoryPressureNotification() to influence the GC schedule. [-Wdeprecated-declarations]
        return v8::Isolate::GetCurrent()->IdleNotificationDeadline(
                                          ^
    /Users/hendrikbelitz/.electron-gyp/28.2.2/include/node/v8-isolate.h:1343:3: note: 'IdleNotificationDeadline' has been explicitly marked deprecated here
      V8_DEPRECATE_SOON(
      ^
    /Users/hendrikbelitz/.electron-gyp/28.2.2/include/node/v8config.h:561:41: note: expanded from macro 'V8_DEPRECATE_SOON'
    #   define V8_DEPRECATE_SOON(message) [[deprecated(message)]]
                                            ^
    In file included from ../src/volume.cc:2:
    ../../nan/nan.h:2548:8: error: no matching member function for call to 'SetAccessor'
      tpl->SetAccessor(
      ~~~~~^~~~~~~~~~~
    /Users/hendrikbelitz/.electron-gyp/28.2.2/include/node/v8-template.h:816:8: note: candidate function not viable: no known conversion from 'v8::PropertyAttribute' to 'AccessControl' for 5th argument
      void SetAccessor(
           ^
    /Users/hendrikbelitz/.electron-gyp/28.2.2/include/node/v8-template.h:809:8: note: candidate function not viable: no known conversion from 'imp::NativeGetter' (aka 'void (*)(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value> &)') to 'AccessorGetterCallback' (aka 'void (*)(Local<String>, const PropertyCallbackInfo<Value> &)') for 2nd argument
      void SetAccessor(
           ^
    In file included from ../src/volume.cc:2:
    ../../nan/nan.h:2596:8: error: no matching member function for call to 'SetAccessor'
      tpl->SetAccessor(
      ~~~~~^~~~~~~~~~~
    /Users/hendrikbelitz/.electron-gyp/28.2.2/include/node/v8-template.h:816:8: note: candidate function not viable: no known conversion from 'v8::PropertyAttribute' to 'AccessControl' for 5th argument
      void SetAccessor(
           ^
    /Users/hendrikbelitz/.electron-gyp/28.2.2/include/node/v8-template.h:809:8: note: candidate function not viable: no known conversion from 'imp::NativeGetter' (aka 'void (*)(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value> &)') to 'AccessorGetterCallback' (aka 'void (*)(Local<String>, const PropertyCallbackInfo<Value> &)') for 2nd argument
      void SetAccessor(
           ^
    1 warning and 2 errors generated.
    make: *** [Release/obj.target/volume/src/volume.o] Error 1
    gyp ERR! build error 
    gyp ERR! stack Error: `make` failed with exit code: 2
    gyp ERR! stack at ChildProcess.<anonymous> (/Users/hendrikbelitz/.nvm/versions/node/v18.19.1/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:209:23)
    gyp ERR! System Darwin 23.4.0
    gyp ERR! command "/Users/hendrikbelitz/.nvm/versions/node/v18.19.1/bin/node" "/Users/hendrikbelitz/.nvm/versions/node/v18.19.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
    gyp ERR! cwd /Users/hendrikbelitz/git/mieterbund/word4mia/node_modules/macos-alias
    gyp ERR! node -v v18.19.1
    gyp ERR! node-gyp -v v10.0.1
    gyp ERR! not ok 

Steps to reproduce

Create a new Electron project, including electron forge. Try to install the dmg maker.

Additional information

No response

alexandrbig commented 7 months ago

Hi, I have the same issue, but not with forge. I am trying to package the application on M1 chip with exactly the same error. I know, that it is not informative at all, but just telling, that it might be not the forge.

In my case it stops with

  • rebuilding native dependency  name=cpu-features version=0.0.9
  • cannot build optional native dependency  name=cpu-features
                                             version=0.0.9
                                             cause=exit status 1
gyp info using node-gyp@10.1.0
gyp info using node@20.9.0 | darwin | arm64
hbel commented 7 months ago

@alexandrbig I moved some steps forward by upgrading electron to 29.x.

I ran into other problems than (mostly node packages compiled with the wrong node version), but most of that was solvable by running npm rebuild on the corresponding packages.

I was able to build a Universal Binary DMG package with that yesterday, although fixing all that stuff step by step and waiting several minutes each time for the next error message was quite tedious.