Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(maker-dmg): make macos-alias build on Node.js 22 #3810

Merged
merged 4 commits into from
Jan 21, 2025

Conversation

erickzhao
Copy link
Member

I was trying to install Forge dependencies on Node 22 and node-gyp rebuild was failing with the following error:

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/erick.zhao/Library/Caches/node-gyp/22.13.0/include/node/v8-template.h:1055:8: note: candidate function not viable: no known conversion from 'v8::AccessControl' to 'PropertyAttribute' for 5th argument
  void SetAccessor(
       ^
/Users/erick.zhao/Library/Caches/node-gyp/22.13.0/include/node/v8-template.h:1049: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:2594:8: error: no matching member function for call to 'SetAccessor'
  tpl->SetAccessor(
  ~~~~~^~~~~~~~~~~
/Users/erick.zhao/Library/Caches/node-gyp/22.13.0/include/node/v8-template.h:1055:8: note: candidate function not viable: no known conversion from 'v8::AccessControl' to 'PropertyAttribute' for 5th argument
  void SetAccessor(
       ^
/Users/erick.zhao/Library/Caches/node-gyp/22.13.0/include/node/v8-template.h:1049: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(
       ^
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.onExit (/Users/erick.zhao/Developer/electron/forge/node_modules/node-gyp/lib/build.js:203:23)
gyp ERR! stack     at ChildProcess.emit (node:events:524:28)
gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:293:12)
gyp ERR! System Darwin 24.2.0
gyp ERR! command "/Users/erick.zhao/.nvm/versions/node/v22.13.0/bin/node" "/Users/erick.zhao/Developer/electron/forge/node_modules/.bin/node-gyp" "rebuild"
gyp ERR! cwd /Users/erick.zhao/Developer/electron/forge/node_modules/macos-alias

I saw this was referring to nodejs/nan#936, so I upgraded the nan and macos-alias dependencies and the problem went away.

Note that we don't actually need macos-alias as a direct optionalDependency so I removed that from the package.json (it's included via electron-installer-dmg/appdmg/ds-store/macos-alias).

@erickzhao erickzhao marked this pull request as ready for review January 20, 2025 22:27
@erickzhao erickzhao requested a review from a team as a code owner January 20, 2025 22:27
@erickzhao erickzhao added this pull request to the merge queue Jan 21, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 21, 2025
@erickzhao erickzhao enabled auto-merge January 21, 2025 18:01
@erickzhao erickzhao added this pull request to the merge queue Jan 21, 2025
Merged via the queue into main with commit 2f36f14 Jan 21, 2025
12 checks passed
@erickzhao erickzhao deleted the build/properly-resolve-macos-alias branch January 21, 2025 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants