fret icon indicating copy to clipboard operation
fret copied to clipboard

Docker build issue for v2.9.0 - import error

Open MuvvalaKaran opened this issue 2 years ago • 4 comments

Hello,

I am trying to install the latest FRET release (v2.9.0) on Ubuntu 20.04 following the Docker instructions

I get the following error

A JavaScript error occurred in the main process
127.7 Uncaught Exception:
127.7 /home/fret/fret/fret-electron/app/index.js:33
127.7 import React from 'react';

But, I was able to successfully install and run an older version of FRET (v 2.8.0). Note: I modified the base Docker image from ubuntu:latest to ubuntu:focal to resolve the glibc issue.

Here is the full output

=> ERROR [21/21] RUN /home/fret/fret/generate_executable_Linux.sh                                                                       132.2s
------
 > [21/21] RUN /home/fret/fret/generate_executable_Linux.sh:
12.28 
12.28 > [email protected] install
12.28 > make -C "./simulator" && make -C "./simulator" clean
12.28 
12.28 make: Entering directory '/home/fret/fret/fret-electron/app/tools/LTLSIM/ltlsim-core/simulator'
12.28 gcc -c -o ltlsim_commands.o ltlsim_commands.c -I. -g -Wall
12.33 gcc -c -o ltlsim_smvutils.o ltlsim_smvutils.c -I. -g -Wall
12.34 In file included from ltlsim_smvutils.c:2:
12.34 ltlsim_smvutils_private.h:85:13: warning: '_prepFormula' declared 'static' but never defined [-Wunused-function]
12.34    85 | static void _prepFormula(char *f_expr, const char *expr);
12.34       |             ^~~~~~~~~~~~
12.34 ltlsim_smvutils.c: In function 'ltlsim_analyse':
12.34 ltlsim_smvutils.c:10:9: warning: 'strncat' specified bound 4096 equals destination size [-Wstringop-overflow=]
12.34    10 |         strncat(fn, ".smv", SMV_BUFFER);
12.34       |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
12.36 gcc -c -o ltlsim_types.o ltlsim_types.c -I. -g -Wall
12.40 gcc ltlsim.c ltlsim_commands.o ltlsim_smvutils.o ltlsim_types.o -o ltlsim -I. -g -Wall
12.43 make: Leaving directory '/home/fret/fret/fret-electron/app/tools/LTLSIM/ltlsim-core/simulator'
12.43 make: Entering directory '/home/fret/fret/fret-electron/app/tools/LTLSIM/ltlsim-core/simulator'
12.43 rm -f *.o
12.43 make: Leaving directory '/home/fret/fret/fret-electron/app/tools/LTLSIM/ltlsim-core/simulator'
12.44 
12.44 added 8 packages, and audited 13 packages in 459ms
12.44 
12.44 found 0 vulnerabilities
12.44 /home/fret/fret/fret-electron
14.54 npm WARN EBADENGINE Unsupported engine {
14.54 npm WARN EBADENGINE   package: '@octokit/[email protected]',
14.54 npm WARN EBADENGINE   required: { node: '>= 18' },
14.54 npm WARN EBADENGINE   current: { node: 'v16.16.0', npm: '8.11.0' }
14.54 npm WARN EBADENGINE }
14.54 npm WARN EBADENGINE Unsupported engine {
14.54 npm WARN EBADENGINE   package: '@octokit/[email protected]',
14.54 npm WARN EBADENGINE   required: { node: '>= 18' },
14.54 npm WARN EBADENGINE   current: { node: 'v16.16.0', npm: '8.11.0' }
14.54 npm WARN EBADENGINE }
14.54 npm WARN EBADENGINE Unsupported engine {
14.54 npm WARN EBADENGINE   package: '@octokit/[email protected]',
14.54 npm WARN EBADENGINE   required: { node: '>= 18' },
14.54 npm WARN EBADENGINE   current: { node: 'v16.16.0', npm: '8.11.0' }
14.54 npm WARN EBADENGINE }
14.54 npm WARN EBADENGINE Unsupported engine {
14.54 npm WARN EBADENGINE   package: '@octokit/[email protected]',
14.54 npm WARN EBADENGINE   required: { node: '>= 18' },
14.54 npm WARN EBADENGINE   current: { node: 'v16.16.0', npm: '8.11.0' }
14.54 npm WARN EBADENGINE }
14.54 npm WARN EBADENGINE Unsupported engine {
14.54 npm WARN EBADENGINE   package: '@octokit/[email protected]',
14.54 npm WARN EBADENGINE   required: { node: '>= 18' },
14.54 npm WARN EBADENGINE   current: { node: 'v16.16.0', npm: '8.11.0' }
14.54 npm WARN EBADENGINE }
14.54 npm WARN EBADENGINE Unsupported engine {
14.54 npm WARN EBADENGINE   package: '@octokit/[email protected]',
14.54 npm WARN EBADENGINE   required: { node: '>= 18' },
14.54 npm WARN EBADENGINE   current: { node: 'v16.16.0', npm: '8.11.0' }
14.54 npm WARN EBADENGINE }
14.54 npm WARN EBADENGINE Unsupported engine {
14.54 npm WARN EBADENGINE   package: '@octokit/[email protected]',
14.54 npm WARN EBADENGINE   required: { node: '>= 18' },
14.54 npm WARN EBADENGINE   current: { node: 'v16.16.0', npm: '8.11.0' }
14.54 npm WARN EBADENGINE }
14.54 npm WARN EBADENGINE Unsupported engine {
14.54 npm WARN EBADENGINE   package: '@octokit/[email protected]',
14.54 npm WARN EBADENGINE   required: { node: '>= 18' },
14.54 npm WARN EBADENGINE   current: { node: 'v16.16.0', npm: '8.11.0' }
14.54 npm WARN EBADENGINE }
14.54 npm WARN EBADENGINE Unsupported engine {
14.54 npm WARN EBADENGINE   package: '@octokit/[email protected]',
14.54 npm WARN EBADENGINE   required: { node: '>= 18' },
14.54 npm WARN EBADENGINE   current: { node: 'v16.16.0', npm: '8.11.0' }
14.54 npm WARN EBADENGINE }
14.54 npm WARN EBADENGINE Unsupported engine {
14.54 npm WARN EBADENGINE   package: '@puppeteer/[email protected]',
14.54 npm WARN EBADENGINE   required: { node: '>=18' },
14.54 npm WARN EBADENGINE   current: { node: 'v16.16.0', npm: '8.11.0' }
14.54 npm WARN EBADENGINE }
14.54 npm WARN EBADENGINE Unsupported engine {
14.54 npm WARN EBADENGINE   package: '[email protected]',
14.54 npm WARN EBADENGINE   required: { node: '>=18' },
14.54 npm WARN EBADENGINE   current: { node: 'v16.16.0', npm: '8.11.0' }
14.54 npm WARN EBADENGINE }
14.55 npm WARN EBADENGINE Unsupported engine {
14.55 npm WARN EBADENGINE   package: '[email protected]',
14.55 npm WARN EBADENGINE   required: { node: '>= 18.0.0' },
14.55 npm WARN EBADENGINE   current: { node: 'v16.16.0', npm: '8.11.0' }
14.55 npm WARN EBADENGINE }
14.55 npm WARN EBADENGINE Unsupported engine {
14.55 npm WARN EBADENGINE   package: '[email protected]',
14.55 npm WARN EBADENGINE   required: { node: '>=18' },
14.55 npm WARN EBADENGINE   current: { node: 'v16.16.0', npm: '8.11.0' }
14.55 npm WARN EBADENGINE }
14.55 npm WARN EBADENGINE Unsupported engine {
14.55 npm WARN EBADENGINE   package: '[email protected]',
14.55 npm WARN EBADENGINE   required: { node: '>=18' },
14.55 npm WARN EBADENGINE   current: { node: 'v16.16.0', npm: '8.11.0' }
14.55 npm WARN EBADENGINE }
28.37 npm WARN deprecated [email protected]: Use your platform's native performance.now() and performance.timeOrigin.
28.90 npm WARN deprecated [email protected]: Use String.prototype.trim() instead
30.20 npm WARN deprecated [email protected]: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
30.27 npm WARN deprecated [email protected]: This package has been deprecated in favour of @sinonjs/samsam
31.45 npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
32.59 npm WARN deprecated [email protected]: Use uuid module instead
32.74 npm WARN deprecated [email protected]: use String.prototype.padStart()
33.59 npm WARN deprecated [email protected]: This SVGO version is no longer supported. Upgrade to v2.x.x.
34.39 npm WARN deprecated [email protected]: this library is no longer supported
34.85 npm WARN deprecated [email protected]: flatten is deprecated in favor of utility frameworks such as lodash.
35.79 npm WARN deprecated [email protected]: Use your platform's native DOMException instead
37.02 npm WARN deprecated [email protected]: CircularJSON is in maintenance only, flatted is its successor.
38.60 npm WARN deprecated [email protected]: Use your platform's native atob() and btoa() methods instead
38.63 npm WARN deprecated [email protected]: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.
39.13 npm WARN deprecated @types/[email protected]: This is a stub types definition. puppeteer provides its own type definitions, so you do not need this installed.
39.50 npm WARN deprecated [email protected]: Switch to the `bfj` package for fixes and new features!
39.69 npm WARN deprecated @npmcli/[email protected]: This functionality has been moved to @npmcli/fs
40.03 npm WARN deprecated [email protected]: Please use @electron/rebuild moving forward.  There is no API change, just a package name change
41.17 npm WARN deprecated @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-nullish-coalescing-operator instead.
41.17 npm WARN deprecated @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-optional-chaining instead.
41.21 npm WARN deprecated @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-json-strings instead.
41.26 npm WARN deprecated @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-logical-assignment-operators instead.
41.29 npm WARN deprecated @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-numeric-separator instead.
41.31 npm WARN deprecated @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-properties instead.
41.38 npm WARN deprecated @babel/[email protected]: 🚨 This package has been deprecated in favor of separate inclusion of a polyfill and regenerator-runtime (when needed). See the @babel/polyfill docs (https://babeljs.io/docs/en/babel-polyfill) for more information.
41.39 npm WARN deprecated @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-export-namespace-from instead.
41.55 npm WARN deprecated [email protected]: 16.1.1
43.08 npm WARN deprecated [email protected]: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
43.22 npm WARN deprecated [email protected]: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
44.48 npm WARN deprecated [email protected]: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
44.52 npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
45.20 npm WARN deprecated @npmcli/[email protected]: This functionality has been moved to @npmcli/fs
48.46 npm WARN deprecated [email protected]: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
49.01 npm WARN deprecated [email protected]: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
49.33 npm WARN deprecated [email protected]: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
50.09 npm WARN deprecated @material-ui/[email protected]: Material UI v4 doesn't receive active development since September 2021. See the guide https://mui.com/material-ui/migration/migration-v4/ to upgrade to v5.
50.92 npm WARN deprecated [email protected]: Support has ended for 9.x series. Upgrade to @latest
51.57 npm WARN deprecated @material-ui/[email protected]: Material UI v4 doesn't receive active development since September 2021. See the guide https://mui.com/material-ui/migration/migration-v4/ to upgrade to v5.
53.29 npm WARN deprecated [email protected]: 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.
54.53 npm WARN deprecated @material-ui/[email protected]: Material UI v4 doesn't receive active development since September 2021. See the guide https://mui.com/material-ui/migration/migration-v4/ to upgrade to v5.
54.92 npm WARN deprecated [email protected]: mdn-browser-compat-data is deprecated. Upgrade to @mdn/browser-compat-data. Learn more: https://github.com/mdn/browser-compat-data/blob/v1.1.2/UPGRADE-2.0.x.md
64.35 
64.35 > [email protected] postinstall
64.35 > node -r @babel/register internals/scripts/CheckNativeDep.js && npm run flow-typed && npm run build-dll && electron-builder install-app-deps && node node_modules/fbjs-scripts/node/check-dev-engines.js package.json
64.35 
67.37 
67.37 > [email protected] flow-typed
67.37 > rimraf flow-typed/npm && flow-typed install --overwrite || true
67.37 
67.90 [@octokit/rest] `const Octokit = require("@octokit/rest")` is deprecated. Use `const { Octokit } = require("@octokit/rest")` instead
68.06 • Found 140 dependencies in package.json to install libdefs for. Searching...
68.07 • flow-typed cache not found, fetching from GitHub...
89.01 UNCAUGHT ERROR: [
89.01   {},
89.01   {},
89.01   {},
89.01   {},
89.01   {},
89.01   {},
89.01   {},
89.01   {},
89.01   {},
89.01   {},
89.01   {},
89.01   {},
89.01   {},
89.01   {},
89.01   {},
89.01   {},
89.01   {},
89.01   {},
89.01   {}
89.01 ]
89.45 
89.45 > [email protected] build-dll
89.45 > cross-env NODE_ENV=development node --trace-warnings -r @babel/register ./node_modules/webpack/bin/webpack --config webpack.config.renderer.dev.dll.js
89.45 
100.3 asset renderer.dev.dll.js 24.8 MiB [emitted] (name: renderer)
100.3 8859 modules
100.3 
100.3 WARNING in ./node_modules/ejs-compiled-loader/node_modules/ejs/lib/ejs.js 366:4-22
100.3 require.extensions is not supported by webpack. Use a loader instead.
100.3  @ ./node_modules/ejs-compiled-loader/index.js 1:10-24
100.3  @ dll renderer renderer[15]
100.3 
100.3 WARNING in ./node_modules/ejs-compiled-loader/node_modules/ejs/lib/ejs.js 367:2-20
100.3 require.extensions is not supported by webpack. Use a loader instead.
100.3  @ ./node_modules/ejs-compiled-loader/index.js 1:10-24
100.3  @ dll renderer renderer[15]
100.3 
100.3 WARNING in ./node_modules/ejs-compiled-loader/node_modules/ejs/lib/ejs.js 374:11-18
100.3 Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
100.3  @ ./node_modules/ejs-compiled-loader/index.js 1:10-24
100.3  @ dll renderer renderer[15]
100.3 
100.3 WARNING in ./node_modules/ejs-compiled-loader/node_modules/ejs/lib/ejs.js 375:2-9
100.3 Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
100.3  @ ./node_modules/ejs-compiled-loader/index.js 1:10-24
100.3  @ dll renderer renderer[15]
100.3 
100.3 WARNING in ./node_modules/electron-debug/index.js 81:45-58
100.3 Critical dependency: the request of a dependency is an expression
100.3  @ dll renderer renderer[16]
100.3 
100.3 WARNING in ./node_modules/electron-debug/index.js 84:85-106
100.3 Critical dependency: the request of a dependency is an expression
100.3  @ dll renderer renderer[16]
100.3 
100.3 WARNING in ./node_modules/html-minifier/node_modules/uglify-js/tools/node.js 17:11-32
100.3 Critical dependency: the request of a dependency is an expression
100.3  @ ./node_modules/html-minifier/src/htmlminifier.js 8:15-35
100.3  @ ./node_modules/html-loader/index.js 5:19-43
100.3  @ dll renderer renderer[21]
100.3 
100.3 WARNING in ./node_modules/jest-junit/utils/getOptions.js 34:21-37
100.3 Critical dependency: the request of a dependency is an expression
100.3  @ ./node_modules/jest-junit/index.js 10:19-48
100.3  @ dll renderer renderer[24]
100.3 
100.3 6 warnings have detailed information that is not shown.
100.3 Use 'stats.errorDetails: true' resp. '--stats-error-details' to show it.
100.3 
100.3 webpack 5.91.0 compiled with 8 warnings in 9519 ms
101.0   • electron-builder  version=24.13.3
101.0   • loaded configuration  file=package.json ("build" field)
101.0   • installing production dependencies  platform=linux arch=x64 appDir=/home/fret/fret/fret-electron/app
127.0 
127.0 added 3179 packages, and audited 3184 packages in 2m
127.0 
127.0 260 packages are looking for funding
127.0   run `npm fund` for details
127.2 
127.2 141 vulnerabilities (6 low, 70 moderate, 36 high, 29 critical)
127.2 
127.2 To address issues that do not require attention, run:
127.2   npm audit fix
127.2 
127.2 To address all issues possible (including breaking changes), run:
127.2   npm audit fix --force
127.2 
127.2 Some issues need review, and may require choosing
127.2 a different dependency.
127.2 
127.2 Run `npm audit` for details.
127.4 
127.4 > [email protected] start
127.4 > cross-env NODE_ENV=production electron --no-sandbox ./app/
127.4 
127.6 [1434:0614/172446.449013:ERROR:bus.cc(407)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
127.7 App threw an error during load
127.7 /home/fret/fret/fret-electron/app/index.js:33
127.7 import React from 'react';
127.7 ^^^^^^
127.7 
127.7 SyntaxError: Cannot use import statement outside a module
127.7     at internalCompileFunction (node:internal/vm:73:18)
127.7     at wrapSafe (node:internal/modules/cjs/loader:1185:20)
127.7     at Module._compile (node:internal/modules/cjs/loader:1227:27)
127.7     at Object..js (node:internal/modules/cjs/loader:1326:10)
127.7     at Module.load (node:internal/modules/cjs/loader:1126:32)
127.7     at node:internal/modules/cjs/loader:967:12
127.7     at Function._load (node:electron/js2c/node_init:2:13357)
127.7     at loadApplicationPackage (/home/fret/fret/fret-electron/node_modules/electron/dist/resources/default_app.asar/main.js:121:16)
127.7     at Object.<anonymous> (/home/fret/fret/fret-electron/node_modules/electron/dist/resources/default_app.asar/main.js:233:9)
127.7     at Module._compile (node:internal/modules/cjs/loader:1271:14)
127.7 (node:1434) [DEP0128] DeprecationWarning: Invalid 'main' field in '/home/fret/fret/fret-electron/app/package.json' of './main.prod.js'. Please either fix that or report it to the module author
127.7 (Use `electron --trace-deprecation ...` to show where the warning was created)
127.7 A JavaScript error occurred in the main process
127.7 Uncaught Exception:
127.7 /home/fret/fret/fret-electron/app/index.js:33
127.7 import React from 'react';
127.7 ^^^^^^
127.7 
127.7 SyntaxError: Cannot use import statement outside a module
127.7     at internalCompileFunction (node:internal/vm:73:18)
127.7     at wrapSafe (node:internal/modules/cjs/loader:1185:20)
127.7     at Module._compile (node:internal/modules/cjs/loader:1227:27)
127.7     at Object..js (node:internal/modules/cjs/loader:1326:10)
127.7     at Module.load (node:internal/modules/cjs/loader:1126:32)
127.7     at node:internal/modules/cjs/loader:967:12
127.7     at Function._load (node:electron/js2c/node_init:2:13357)
127.7     at loadApplicationPackage (/home/fret/fret/fret-electron/node_modules/electron/dist/resources/default_app.asar/main.js:121:16)
127.7     at Object.<anonymous> (/home/fret/fret/fret-electron/node_modules/electron/dist/resources/default_app.asar/main.js:233:9)
127.7     at Module._compile (node:internal/modules/cjs/loader:1271:14)
127.7 [1434:0614/172446.612066:ERROR:ozone_platform_x11.cc(240)] Missing X server or $DISPLAY
127.7 [1434:0614/172446.612075:ERROR:env.cc(255)] The platform failed to initialize.  Exiting.
127.9 /home/fret/fret/fret-electron/node_modules/electron/dist/electron exited with signal SIGSEGV
129.0 Packaging app for platform linux x64 using electron v27.3.7
131.9 The main entry point to your app was not found. Make sure "main.prod.js" exists and does not get ignored by your ignore option
131.9 tar: FRET-linux-x64: Cannot stat: No such file or directory
131.9 tar: Exiting with failure status due to previous errors
------
Dockerfile:53
--------------------
  51 |     WORKDIR /home/fret/fret/fret-electron
  52 |     RUN mkdir /home/fret/Desktop
  53 | >>> RUN /home/fret/fret/generate_executable_Linux.sh
  54 |     
  55 |     CMD /bin/bash
--------------------
ERROR: failed to solve: process "/bin/sh -c /home/fret/fret/generate_executable_Linux.sh" did not complete successfully: exit code: 2

Hope to hear from you soon. Thanks!

MuvvalaKaran avatar Jun 15 '24 00:06 MuvvalaKaran

Hi @MuvvalaKaran ,

Thank you for using FRET and reporting this issue. There is a command missing from the script that causes this. After line 73:

https://github.com/NASA-SW-VnV/fret/blob/2c5faa5f9bd52eec1cd14837737a4ce7fab8ca44/tools/Scripts/docker/generate_executable_Linux.sh#L73

Add the following:

npm run build

Then follow the instructions again and let me know if it worked.

Thanks,

Andreas

andreaskatis avatar Jun 15 '24 01:06 andreaskatis

Thank you, @andreaskatis, for the quick response. The above solution works, and I am able to build and run the latest FRET.

I do have another question regarding support for LTL patterns in the FRET language. In your recent paper

Vázquez, G., Mavridou, A., Farrell, M., Pressburger, T., Calinescu, R. (2024). Robotics: A New Mission for FRET Requirements. In: Benz, N., Gopinath, D., Shi, N. (eds) NASA Formal Methods. NFM 2024. Lecture Notes in Computer Science, vol 14627.

You can write formulas in FRET like robot shall eventually satisfy l0 + robot shall eventually satisfy l1 from Table 3 of the paper.

Looks like the most recent release does not support multiple requirements (using the + operation). Is that correct? Is there a development branch/version that I need to checkout?

MuvvalaKaran avatar Jun 15 '24 01:06 MuvvalaKaran

FRET doesn't have a way to string requirements together. The + in the paper just means that multiple separate requirements need to be written to capture the meaning of one pattern. Sorry for the ambiguity in the paper.

tpressburger avatar Jun 18 '24 19:06 tpressburger

Thank you for the clarification. You can close this issue.

MuvvalaKaran avatar Jun 18 '24 20:06 MuvvalaKaran