vercel / hyper

A terminal built on web technologies
https://hyper.is
MIT License
43.27k stars 3.52k forks source link

Can't build hyper from sources in Ubuntu linux `gyp: name 'openssl_fips' is not defined` #6385

Open mwoz123 opened 2 years ago

mwoz123 commented 2 years ago

Issue

Can't build from sources in Ubuntu. Log:


marcin@pc:~/workspace/hyper$ yarn
yarn install v1.22.17
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
[1/4] 🔍  Resolving packages...
success Already up-to-date.
$ webpack --config-name hyper-app && electron-builder install-app-deps && yarn run rebuild-node-pty && cpy --cwd=target --parents "node_modules/**/*" "../app/" && husky install
hyper-app:
  assets by path keymaps/*.json 4.49 KiB
    asset keymaps/darwin.json 1.57 KiB [compared for emit] [from: app/keymaps/darwin.json] [copied]
    asset keymaps/linux.json 1.52 KiB [compared for emit] [from: app/keymaps/linux.json] [copied]
    asset keymaps/win32.json 1.4 KiB [compared for emit] [from: app/keymaps/win32.json] [copied]
  assets by path static/*.png 10.5 KiB
    asset static/icon96x96.png 5.72 KiB [compared for emit] [from: app/static/icon96x96.png] [copied]
    asset static/icon.png 4.78 KiB [compared for emit] [from: app/static/icon.png] [copied]
  assets by path *.json 1.21 KiB
    asset package.json 1020 bytes [compared for emit] [from: app/package.json] [copied]
    asset tsconfig.json 224 bytes [compared for emit] [from: app/tsconfig.json] [copied]
  asset yarn.lock 37 KiB [compared for emit] [from: app/yarn.lock] [copied]
  asset index.html 836 bytes [compared for emit] [from: app/index.html] [copied]
  asset ignore_this.js 84 bytes [compared for emit] (name: main)
  ./app/index.ts 1 bytes [built] [code generated]
  hyper-app (webpack 5.70.0) compiled successfully in 212 ms
  • electron-builder  version=22.14.13
  • loaded configuration  file=/home/marcin/workspace/hyper/electron-builder.json
  • installing production dependencies  platform=linux arch=x64 appDir=/home/marcin/workspace/hyper/target
  ⨯ /snap/node/6001/bin/node exited with code ERR_ELECTRON_BUILDER_CANNOT_EXECUTE
Output:
yarn install v1.22.17
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

Error output:
warning " > @electron/remote@2.0.5" has unmet peer dependency "electron@>= 13.0.0".
error /home/marcin/workspace/hyper/target/node_modules/native-process-working-directory: Command failed.
Exit code: 1
Command: node-gyp rebuild
Arguments: 
Directory: /home/marcin/workspace/hyper/target/node_modules/native-process-working-directory
Output:
gyp info it worked if it ends with ok
gyp info using node-gyp@8.4.1
gyp info using node@17.7.1 | linux | x64
gyp info find Python using Python version 3.8.10 found at "/usr/bin/python3"
gyp info spawn /usr/bin/python3
gyp info spawn args [
gyp info spawn args   '/snap/node/6001/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   '/home/marcin/workspace/hyper/target/node_modules/native-process-working-directory/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/snap/node/6001/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/home/marcin/.electron-gyp/17.1.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=/home/marcin/.electron-gyp/17.1.2',
gyp info spawn args   '-Dnode_gyp_dir=/snap/node/6001/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/home/marcin/.electron-gyp/17.1.2/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/home/marcin/workspace/hyper/target/node_modules/native-process-working-directory',
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 (/snap/node/6001/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:259: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 Linux 5.13.0-35-generic
gyp ERR! command "/snap/node/6001/bin/node" "/snap/node/6001/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/marcin/workspace/hyper/target/node_modules/native-process-working-directory
gyp ERR! node -v v17.7.1
gyp ERR! node-gyp -v v8.4.1
gyp ERR! not ok
  failedTask=installAppDeps stackTrace=Error: /snap/node/6001/bin/node exited with code ERR_ELECTRON_BUILDER_CANNOT_EXECUTE
Output:
yarn install v1.22.17
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           Error output:
warning " > @electron/remote@2.0.5" has unmet peer dependency "electron@>= 13.0.0".
error /home/marcin/workspace/hyper/target/node_modules/native-process-working-directory: Command failed.
Exit code: 1
Command: node-gyp rebuild
Arguments: 
Directory: /home/marcin/workspace/hyper/target/node_modules/native-process-working-directory
Output:
gyp info it worked if it ends with ok
gyp info using node-gyp@8.4.1
gyp info using node@17.7.1 | linux | x64
gyp info find Python using Python version 3.8.10 found at "/usr/bin/python3"
gyp info spawn /usr/bin/python3
gyp info spawn args [
gyp info spawn args   '/snap/node/6001/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   '/home/marcin/workspace/hyper/target/node_modules/native-process-working-directory/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/snap/node/6001/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/home/marcin/.electron-gyp/17.1.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=/home/marcin/.electron-gyp/17.1.2',
gyp info spawn args   '-Dnode_gyp_dir=/snap/node/6001/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/home/marcin/.electron-gyp/17.1.2/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/home/marcin/workspace/hyper/target/node_modules/native-process-working-directory',
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 (/snap/node/6001/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:259: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 Linux 5.13.0-35-generic
gyp ERR! command "/snap/node/6001/bin/node" "/snap/node/6001/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/marcin/workspace/hyper/target/node_modules/native-process-working-directory
gyp ERR! node -v v17.7.1
gyp ERR! node-gyp -v v8.4.1
gyp ERR! not ok
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               at ChildProcess.<anonymous> (/home/marcin/workspace/hyper/node_modules/builder-util/src/util.ts:250:14)
    at Object.onceWrapper (node:events:642:26)
    at ChildProcess.emit (node:events:527:28)
    at maybeClose (node:internal/child_process:1090:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
marcin@pc:~/workspace/hyper$ 
nardoor commented 2 years ago

Hello @mwoz123

I faced the same issue and wokred around it by changing the node version I use.

For instance I used node v16.x (to match the version used in the CI workflow) but I assume any version other than 17.x should work around this.

# if you use nvm
nvm install 16

This github issue seems to be closely related with https://github.com/nodejs/node-gyp/issues/2534.

mwoz123 commented 2 years ago

Thanks @nardoor - node 16 works :)