Moddable-OpenSource / moddable

Tools for developers to create truly open IoT products using standard JavaScript on low cost microcontrollers.
http://www.moddable.com
1.32k stars 236 forks source link

Error: ‘fx_SuppressedError’ undeclared here (two locations, during build of SDK) #1407

Open JoshuaPK opened 4 days ago

JoshuaPK commented 4 days ago

Build environment: Linux, AlmaLinux 9.4, gcc 11.4.1, cmake 3.26.5, esp-idf 5.3 Moddable SDK version: 5.0.0 Target device: ESP32

Description I followed directions in the Getting Started documentation. I first installed esp-idf 5.3 using the method described in the Getting Started documentation (ESP32 Install), then installed the Moddable SDK. While attempting to do a 'make' on the SDK, I got the following compile errors:

/home/josh/dev/ide/moddable/build/tmp/lin/release/xsbug/mc.xs.c:19176:140: error: ‘fx_SuppressedError’ undeclared here (not in a function); did you mean ‘xsID_SuppressedError’?
19176 | 0x8b, .kind = XS_CALLBACK_X_KIND}, .value = { .callback = { fx_SuppressedError, NULL } }},
      |                                                             ^~~~~~~~~~~~~~~~~~
      |                                                             xsID_SuppressedError
make[1]: *** [/home/josh/dev/ide/moddable/build/tmp/lin/release/xsbug/makefile:362: /home/josh/dev/ide/moddable/build/tmp/lin/release/xsbug/mc.xs.c.o] Error 1

/home/josh/dev/ide/moddable/build/tmp/lin/release/xsbug/mc.xs.c:19176:140: error: ‘fx_SuppressedError’ undeclared here (not in a function); did you mean ‘xsID_SuppressedError’?
19176 | 0x8b, .kind = XS_CALLBACK_X_KIND}, .value = { .callback = { fx_SuppressedError, NULL } }},
      |                                                             ^~~~~~~~~~~~~~~~~~
      |                                                             xsID_SuppressedError
make[1]: *** [/home/josh/dev/ide/moddable/build/tmp/lin/release/xsbug/makefile:362: /home/josh/dev/ide/moddable/build/tmp/lin/release/xsbug/mc.xs.c.o] Error 1

I modified the affected files to change the reference of fs_SuppressedError to fx_Error and it built without problem after that.

Steps to Reproduce

  1. Install the esp-idf toolkit as described here
  2. Attempt to install the Moddable SDK
  3. Observe compiler error.

Expected behavior A successful SDK build.

phoddie commented 4 days ago

Thanks for the report. I'm not seeing that here on macOS, but will check on Linux.

FWIW – The error is happening when building xsbug. The SupressedError support is only built as part of the experimental Explicit Resource Management proposal support. That is disabled by default. The Moddable SDK only builds it for xst, the XS test tool used for conformance and fuzz testing, by setting mxExplicitResourceManagement=1 in the make file. Somehow your build of xsbug seems to have SupressedError partially enabled, which causing the link error.

mkellner commented 3 days ago

Hello @JoshuaPK, is it possible that there are changes made to files in your Moddable SDK?

I've checked my mc.xs.c file that was created when I built the tools, searching for Suppressed, but I did not find it.