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

Error when building on electron #83

Open
getchardy opened this issue Jul 27, 2022 · 2 comments
Open

Error when building on electron #83

getchardy opened this issue Jul 27, 2022 · 2 comments

Comments

@getchardy
Copy link

getchardy commented Jul 27, 2022

With certain versions of NodeJS, we are encountering errors when rebuilding this dependency using electron-builder:

It works in Node 16.3

Does not work in Node 16.16:

• electron-builder  version=22.11.7 os=21.5.0
  • loaded configuration  file=/var/folders/63/sz2y_mcj6jl0kcxtd8szkckc0000gp/T/tmp-28175-BXEvpGscumnI
  • author is missed in the package.json  appPackageFile=/Users/chardy/code/project/src/package.json
  • writing effective config  file=release/development/builder-effective-config.yaml
  • rebuilding native dependencies  dependencies=segfault-handler@1.3.0 platform=darwin arch=arm64
  • rebuilding native dependency  name=segfault-handler version=1.3.0
  ⨯ cannot execute  cause=exit status 1
                    out=$ node-gyp rebuild
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

                    errorOut=gyp info it worked if it ends with ok
    gyp info using node-gyp@9.0.0
    gyp info using node@16.16.0 | darwin | arm64
    gyp info find Python using Python version 3.8.9 found at "/Applications/Xcode.app/Contents/Developer/usr/bin/python3"
    gyp info spawn /Applications/Xcode.app/Contents/Developer/usr/bin/python3
    gyp info spawn args [
    gyp info spawn args   '/Users/chardy/.nvm/versions/node/v16.16.0/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/chardy/code/project/src/node_modules/segfault-handler/build/config.gypi',
    gyp info spawn args   '-I',
    gyp info spawn args   '/Users/chardy/.nvm/versions/node/v16.16.0/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
    gyp info spawn args   '-I',
    gyp info spawn args   '/Users/chardy/.electron-gyp/11.5.0/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/chardy/.electron-gyp/11.5.0',
    gyp info spawn args   '-Dnode_gyp_dir=/Users/chardy/.nvm/versions/node/v16.16.0/lib/node_modules/npm/node_modules/node-gyp',
    gyp info spawn args   '-Dnode_lib_file=/Users/chardy/.electron-gyp/11.5.0/<(target_arch)/node.lib',
    gyp info spawn args   '-Dmodule_root_dir=/Users/chardy/code/project/src/node_modules/segfault-handler',
    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: name 'openssl_fips' is not defined while evaluating condition 'openssl_fips != ""' in binding.gyp while trying to load binding.gyp
    gyp ERR! configure error 
    gyp ERR! stack Error: `gyp` failed with exit code: 1
    gyp ERR! stack     at ChildProcess.onCpExit (/Users/chardy/.nvm/versions/node/v16.16.0/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:261:16)
    gyp ERR! stack     at ChildProcess.emit (node:events:527:28)
    gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
    gyp ERR! System Darwin 21.5.0
    gyp ERR! command "/Users/chardy/.nvm/versions/node/v16.16.0/bin/node" "/Users/chardy/.nvm/versions/node/v16.16.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
    gyp ERR! cwd /Users/chardy/code/project/src/node_modules/segfault-handler
    gyp ERR! node -v v16.16.0
    gyp ERR! node-gyp -v v9.0.0
    gyp ERR! not ok 
    error Command failed with exit code 1.
@getchardy
Copy link
Author

I saw a similar issue reported in nodejs/node-gyp#2673.
If I add the following into bindings.gyp then it works:

'variables' : {
    'openssl_fips': '',
}

@squid-f
Copy link

squid-f commented Sep 4, 2022

Hi. I have a similar issue using Node 18.7.0.

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

No branches or pull requests

2 participants