ExpoSEJS / ExpoSE

A Dynamic Symbolic Execution (DSE) engine for JavaScript. ExpoSE is highly scalable, compatible with recent JavaScript standards, and supports symbolic modelling of strings and regular expressions.
MIT License
183 stars 36 forks source link

Installation fails due to node-gyp requiring a more recent nodejs version for z3javascript #114

Open JJK96 opened 5 months ago

JJK96 commented 5 months ago

I first tried building on MacOS and ran into this issue. To make it easier for you to reproduce the issue, I upgraded the Dockerfile to match the latest install instruction. You can find the changes in my fork.

The build error is as follows:

Setting up for Node
v14.16.1
Installing top level
npm WARN expose@1.0.0 No repository field.
npm WARN expose@1.0.0 No license field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.3 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

added 443 packages from 304 contributors and audited 444 packages in 25.174s

36 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

Setting Up Packages
Cleaning lib/S$
Setting up lib/S$
Pulling Dependencies
npm WARN SDollar@0.0.1 No repository field.
npm WARN SDollar@0.0.1 license should be a valid SPDX license expression

up to date in 0.521s
found 0 vulnerabilities

Cleaning lib/Stats
Setting up lib/Stats
Pulling Dependencies
npm WARN Stats@0.0.5 No description
npm WARN Stats@0.0.5 No repository field.
npm WARN Stats@0.0.5 No license field.

up to date in 0.505s
found 0 vulnerabilities

Cleaning Analyser
Setting up Analyser
Pulling Dependencies
npm WARN deprecated mkdirp@0.5.0: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
npm WARN deprecated babel-preset-es2015@6.24.1: šŸ™Œ  Thanks for using Babel: we recommend using babel-preset-env now: please read https://babeljs.io/env to update!
npm WARN deprecated babel-preset-es2017@6.24.1: šŸ™Œ  Thanks for using Babel: we recommend using babel-preset-env now: please read https://babeljs.io/env to update!
npm WARN deprecated datatables@1.10.6: This NPM package for DataTables has now been deprecated and the 'datatables.net' set of packages should be used in preference to this one. Please see the NPM installation guide for DataTables for more details: https://datatables.net/download/npm.
npm WARN deprecated core-js@2.6.12: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
npm WARN deprecated natives@1.1.6: This module relies on Node.js's internals and will break at some point. Do not use it, and update to graceful-fs@4.x.

> core-js@2.6.12 postinstall /source/Analyser/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!

The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:
> https://opencollective.com/core-js
> https://www.patreon.com/zloirock

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)

> ExpoSE@0.0.2 postinstall /source/Analyser
> ./scripts/postinstall

npm WARN deprecated babel-preset-es2015@6.24.1: šŸ™Œ  Thanks for using Babel: we recommend using babel-preset-env now: please read https://babeljs.io/env to update!
npm WARN deprecated babel-preset-es2017@6.24.1: šŸ™Œ  Thanks for using Babel: we recommend using babel-preset-env now: please read https://babeljs.io/env to update!
npm WARN deprecated datatables@1.10.6: This NPM package for DataTables has now been deprecated and the 'datatables.net' set of packages should be used in preference to this one. Please see the NPM installation guide for DataTables for more details: https://datatables.net/download/npm.
npm WARN deprecated mkdirp@0.5.0: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
npm WARN deprecated core-js@2.6.12: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
npm WARN deprecated natives@1.1.6: This module relies on Node.js's internals and will break at some point. Do not use it, and update to graceful-fs@4.x.
npm WARN deprecated mkdirp@0.5.1: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
npm WARN deprecated jade@0.26.3: Jade has been renamed to pug, please install the latest version of pug instead of jade
npm WARN deprecated minimatch@0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated mkdirp@0.3.0: Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)
npm WARN deprecated to-iso-string@0.0.2: to-iso-string has been deprecated, use @segment/to-iso-string instead.

> core-js@2.6.12 postinstall /source/Analyser/node_modules/jalangi2/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"

npm notice created a lockfile as package-lock.json. You should commit this file.
added 146 packages from 825 contributors and audited 148 packages in 10.81s

4 packages are looking for funding
  run `npm fund` for details

found 29 vulnerabilities (18 moderate, 7 high, 4 critical)
  run `npm audit fix` to fix them, or `npm audit` for details
Cloning into 'node_modules/z3javascript'...

> ref-napi@3.0.3 install /source/Analyser/node_modules/z3javascript/node_modules/ref-napi
> node-gyp-build

> ffi-napi@4.0.3 install /source/Analyser/node_modules/z3javascript/node_modules/ffi-napi
> node-gyp-build

gyp ERR! configure error
gyp ERR! stack TypeError: Cannot read property 'pipeline' of undefined
gyp ERR! stack at Object.<anonymous> (/source/Analyser/node_modules/z3javascript/node_modules/node-gyp/lib/install.js:8:32)
gyp ERR! stack at Module._compile (internal/modules/cjs/loader.js:1063:30)
gyp ERR! stack at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
gyp ERR! stack at Module.load (internal/modules/cjs/loader.js:928:32)
gyp ERR! stack at Function.Module._load (internal/modules/cjs/loader.js:769:14)
gyp ERR! stack at Module.require (internal/modules/cjs/loader.js:952:19)
gyp ERR! stack at require (internal/modules/cjs/helpers.js:88:18)
gyp ERR! stack at Object.acc.<computed> [as install] (/source/Analyser/node_modules/z3javascript/node_modules/node-gyp/lib/node-gyp.js:80:32)
gyp ERR! stack at getNodeDir (/source/Analyser/node_modules/z3javascript/node_modules/node-gyp/lib/configure.js:53:26)
gyp ERR! stack at configure (/source/Analyser/node_modules/z3javascript/node_modules/node-gyp/lib/configure.js:24:10)
gyp ERR! System Linux 5.15.0-92-generic
gyp ERR! command "/home/expose/.local/share/fnm/node-versions/v14.16.1/installation/bin/node" "/source/Analyser/node_modules/z3javascript/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /source/Analyser/node_modules/z3javascript/node_modules/ffi-napi
gyp ERR! node -v v14.16.1
gyp ERR! node-gyp -v v10.0.1
gyp ERR! not ok
npm WARN notsup Unsupported engine for node-gyp@10.0.1: wanted: {"node":"^16.14.0 || >=18.0.0"} (current: {"node":"14.16.1","npm":"6.14.12"})
npm WARN notsup Not compatible with your version of node/npm: node-gyp@10.0.1
npm WARN notsup Unsupported engine for glob@10.3.10: wanted: {"node":">=16 || 14 >=14.17"} (current: {"node":"14.16.1","npm":"6.14.12"})
npm WARN notsup Not compatible with your version of node/npm: glob@10.3.10
npm WARN notsup Unsupported engine for make-fetch-happen@13.0.0: wanted: {"node":"^16.14.0 || >=18.0.0"} (current: {"node":"14.16.1","npm":"6.14.12"})
npm WARN notsup Not compatible with your version of node/npm: make-fetch-happen@13.0.0
npm WARN notsup Unsupported engine for proc-log@3.0.0: wanted: {"node":"^14.17.0 || ^16.13.0 || >=18.0.0"} (current: {"node":"14.16.1","npm":"6.14.12"})
npm WARN notsup Not compatible with your version of node/npm: proc-log@3.0.0
npm WARN notsup Unsupported engine for which@4.0.0: wanted: {"node":"^16.13.0 || >=18.0.0"} (current: {"node":"14.16.1","npm":"6.14.12"})
npm WARN notsup Not compatible with your version of node/npm: which@4.0.0
npm WARN notsup Unsupported engine for nopt@7.2.0: wanted: {"node":"^14.17.0 || ^16.13.0 || >=18.0.0"} (current: {"node":"14.16.1","npm":"6.14.12"})
npm WARN notsup Not compatible with your version of node/npm: nopt@7.2.0
npm WARN notsup Unsupported engine for minimatch@9.0.3: wanted: {"node":">=16 || 14 >=14.17"} (current: {"node":"14.16.1","npm":"6.14.12"})
npm WARN notsup Not compatible with your version of node/npm: minimatch@9.0.3
npm WARN notsup Unsupported engine for minipass@7.0.4: wanted: {"node":">=16 || 14 >=14.17"} (current: {"node":"14.16.1","npm":"6.14.12"})
npm WARN notsup Not compatible with your version of node/npm: minipass@7.0.4
npm WARN notsup Unsupported engine for path-scurry@1.10.1: wanted: {"node":">=16 || 14 >=14.17"} (current: {"node":"14.16.1","npm":"6.14.12"})
npm WARN notsup Not compatible with your version of node/npm: path-scurry@1.10.1
npm WARN notsup Unsupported engine for @npmcli/agent@2.2.1: wanted: {"node":"^16.14.0 || >=18.0.0"} (current: {"node":"14.16.1","npm":"6.14.12"})
npm WARN notsup Not compatible with your version of node/npm: @npmcli/agent@2.2.1
npm WARN notsup Unsupported engine for cacache@18.0.2: wanted: {"node":"^16.14.0 || >=18.0.0"} (current: {"node":"14.16.1","npm":"6.14.12"})
npm WARN notsup Not compatible with your version of node/npm: cacache@18.0.2
npm WARN notsup Unsupported engine for minipass-fetch@3.0.4: wanted: {"node":"^14.17.0 || ^16.13.0 || >=18.0.0"} (current: {"node":"14.16.1","npm":"6.14.12"})
npm WARN notsup Not compatible with your version of node/npm: minipass-fetch@3.0.4
npm WARN notsup Unsupported engine for ssri@10.0.5: wanted: {"node":"^14.17.0 || ^16.13.0 || >=18.0.0"} (current: {"node":"14.16.1","npm":"6.14.12"})
npm WARN notsup Not compatible with your version of node/npm: ssri@10.0.5
npm WARN notsup Unsupported engine for glob@10.3.10: wanted: {"node":">=16 || 14 >=14.17"} (current: {"node":"14.16.1","npm":"6.14.12"})
npm WARN notsup Not compatible with your version of node/npm: glob@10.3.10
npm WARN notsup Unsupported engine for minipass-collect@2.0.1: wanted: {"node":">=16 || 14 >=14.17"} (current: {"node":"14.16.1","npm":"6.14.12"})
npm WARN notsup Not compatible with your version of node/npm: minipass-collect@2.0.1
npm WARN notsup Unsupported engine for unique-filename@3.0.0: wanted: {"node":"^14.17.0 || ^16.13.0 || >=18.0.0"} (current: {"node":"14.16.1","npm":"6.14.12"})
npm WARN notsup Not compatible with your version of node/npm: unique-filename@3.0.0
npm WARN notsup Unsupported engine for @npmcli/fs@3.1.0: wanted: {"node":"^14.17.0 || ^16.13.0 || >=18.0.0"} (current: {"node":"14.16.1","npm":"6.14.12"})
npm WARN notsup Not compatible with your version of node/npm: @npmcli/fs@3.1.0
npm WARN notsup Unsupported engine for fs-minipass@3.0.3: wanted: {"node":"^14.17.0 || ^16.13.0 || >=18.0.0"} (current: {"node":"14.16.1","npm":"6.14.12"})
npm WARN notsup Not compatible with your version of node/npm: fs-minipass@3.0.3
npm WARN notsup Unsupported engine for minimatch@9.0.3: wanted: {"node":">=16 || 14 >=14.17"} (current: {"node":"14.16.1","npm":"6.14.12"})
npm WARN notsup Not compatible with your version of node/npm: minimatch@9.0.3
npm WARN notsup Unsupported engine for unique-slug@4.0.0: wanted: {"node":"^14.17.0 || ^16.13.0 || >=18.0.0"} (current: {"node":"14.16.1","npm":"6.14.12"})
npm WARN notsup Not compatible with your version of node/npm: unique-slug@4.0.0
npm WARN notsup Unsupported engine for abbrev@2.0.0: wanted: {"node":"^14.17.0 || ^16.13.0 || >=18.0.0"} (current: {"node":"14.16.1","npm":"6.14.12"})
npm WARN notsup Not compatible with your version of node/npm: abbrev@2.0.0
npm WARN notsup Unsupported engine for isexe@3.1.1: wanted: {"node":">=16"} (current: {"node":"14.16.1","npm":"6.14.12"})
npm WARN notsup Not compatible with your version of node/npm: isexe@3.1.1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.3.2 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN z3javascript@0.0.1 license should be a valid SPDX license expression

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ffi-napi@4.0.3 install: `node-gyp-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ffi-napi@4.0.3 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/expose/.npm/_logs/2024-02-16T13_19_25_449Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ExpoSE@0.0.2 postinstall: `./scripts/postinstall`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ExpoSE@0.0.2 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/expose/.npm/_logs/2024-02-16T13_19_25_553Z-debug.log
Cleaning Tester
Setting up Tester
Pulling Dependencies

> core-js@2.6.12 postinstall /source/Tester/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"

npm WARN Tester@0.0.1 No repository field.
npm WARN Tester@0.0.1 license should be a valid SPDX license expression
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

added 319 packages from 132 contributors and audited 323 packages in 13.096s

6 packages are looking for funding
  run `npm fund` for details

found 6 vulnerabilities (2 low, 4 high)
  run `npm audit fix` to fix them, or `npm audit` for details
Cleaning Distributor
Setting up Distributor
Pulling Dependencies
npm WARN Distributor@0.0.1 No repository field.
npm WARN Distributor@0.0.1 license should be a valid SPDX license expression

added 17 packages from 14 contributors and audited 17 packages in 1.376s

2 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

Cleaning Dashboard
./scripts/setup/cleanup: line 3: cd: Dashboard: No such file or directory
Setting up Dashboard
Pulling Dependencies
./scripts/setup/setup_pkg: line 7: cd: Dashboard: No such file or directory
npm WARN expose@1.0.0 No repository field.
npm WARN expose@1.0.0 No license field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.3 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

added 443 packages from 304 contributors and audited 444 packages in 19.767s

36 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

Cleaning Browser
Setting up Browser
Pulling Dependencies

> electron@2.0.18 postinstall /source/Browser/node_modules/electron
> node install.js

Downloading SHASUMS256.txt
[============================================>] 100.0% of 5.39 kB (5.39 kB/s)
npm WARN browser@1.0.0 No repository field.

added 115 packages from 115 contributors and audited 115 packages in 19.552s

4 packages are looking for funding
  run `npm fund` for details

found 16 vulnerabilities (3 low, 10 moderate, 3 high)
  run `npm audit fix` to fix them, or `npm audit` for details
Building Analyser

/source/.eslintrc.json
  0:0  warning  File ignored by default.  Use a negated ignore pattern (like "--ignore-pattern '!<relative/path/to/filename>'") to override

/source/Distributor/src/Spawn.js
  99:21  warning  Unnecessary escape character: \/  no-useless-escape

āœ– 2 problems (0 errors, 2 warnings)

Building Libs
Successfully compiled 1 file with Babel (1123ms).
Building Distributor
Successfully compiled 15 files with Babel (2052ms).
Building Analyser
Successfully compiled 24 files with Babel (2303ms).
Building into /source
Bundling Analyser/bin/Analyser.js into bin/bundle.js
Copying Analyser Dependencies to Browser
dan-mk commented 5 months ago

Thank you so much for the fork with the changes @JJK96, I could finally run the code and do some tests. I guess you were already able to find a workaround, but if anyone still needs it, here it is.

The problem is that the z3javascript package requires the most recent version of node-gyp (like this, with an asterisk "node-gyp": "*"). I just changed it to require the version 9.4.1, as it seems like it's the last one that is still working. Just change the Analyser's postinstall script to this:

(cd node_modules/jalangi2/ && npm install)
(
  git clone https://github.com/ExpoSEJS/z3javascript.git node_modules/z3javascript
  && cd node_modules/z3javascript
  && sed -i'' -e 's/"node-gyp": "\*"/"node-gyp": "9.4.1"/' package.json
  && npm install
)

i.e. just add the sed -i'' -e 's/"node-gyp": "\*"/"node-gyp": "9.4.1"/' package.json command