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

Trouble making custom build: ccall not exporting #48

Closed
evanhackett opened this issue May 21, 2018 · 2 comments
Closed

Trouble making custom build: ccall not exporting #48

evanhackett opened this issue May 21, 2018 · 2 comments

Comments

@evanhackett
Copy link

I'm having trouble with the enableOnDemandTableLoading due to a complex webpack setup inside a react native app. Since I only need a few tables max, it will be fine to embed the tables I need in a custom build. The problem I'm having with making a custom build is I'm getting an error saying the "ccall" method is not exporting, despite me adding "ccall" to the EXTRA_EXPORTED_RUNTIME_METHODS.

To start the process I ran the following command:

emcc ./liblouis/.libs/liblouis.a -s RESERVED_FUNCTION_POINTERS=1 -s MODULARIZE=1\
         -s EXPORT_NAME="'liblouisBuild'" -s EXTRA_EXPORTED_RUNTIME_METHODS="['FS',\
        'Runtime', 'stringToUTF16', 'Pointer_Stringify', 'ccall']" --pre-js ./liblouis-js/inc/pre.js\
         --post-js ./liblouis-js/inc/post.js -o build-embed-tables.js --embed-file ueb_tables

Notice 'ccall' is included as instructed. I then ran:

cat ./liblouis-js/inc/append.js >> build-embed-tables.js

I then moved the built files to the js-build folder:

mv build-embed-tables.js js-build
mv build-embed-tables.wasm js-build

Then, in the liblouis-js package folder, I ran:

npm link ../js-build --production

At this point I wanted to test my build, so I ran:

npm run test-node -- build-embed-tables.js

And here is where I got the error message:

> [email protected] test-node /Users/evan/dev/7apps/liblouis/liblouis-js
> node ./testrunner/node.js "build-embed-tables.js"

[INFO] EXECUTING TESTS IN NODEJS
[INFO] loaded testrunner
'ccall' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)
'ccall' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)
================================================================================
EXITING EARLY ON EXCEPTION
================================================================================
abort("'ccall' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)") at Error
    at jsStackTrace (/Users/evan/dev/7apps/liblouis/js-build/build-no-tables-utf16.js:1054:13)
    at stackTrace (/Users/evan/dev/7apps/liblouis/js-build/build-no-tables-utf16.js:1071:12)
    at abort (/Users/evan/dev/7apps/liblouis/js-build/build-no-tables-utf16.js:6386:44)
    at Object.Module.ccall (/Users/evan/dev/7apps/liblouis/js-build/build-no-tables-utf16.js:6126:54)
    at LiblouisEasyApi.charSize (/Users/evan/dev/7apps/liblouis/liblouis-js/easy-api.js:168:42)
    at LiblouisEasyApi.charSize (/Users/evan/dev/7apps/liblouis/liblouis-js/easy-api.js:484:24)
    at new LiblouisEasyApi (/Users/evan/dev/7apps/liblouis/liblouis-js/easy-api.js:469:18)
    at Object.<anonymous> (/Users/evan/dev/7apps/liblouis/liblouis-js/liblouis.js:2:16)
    at Module._compile (module.js:635:30)
    at Object.Module._extensions..js (module.js:646:10)
================================================================================
SUCCESS: 0      FAILURE: 1      EXCEPTION: YES      DID EARLY EXIT: YES
================================================================================

As you can see, I put 'ccall' in the compile command, so I'm not sure what is going on. I also tried getting my build file to work in the browser, just in case the tests use ccall and my use in the browser doesn't. Not surprisingly, I got the error in my console window:

'ccall' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)

I'm not sure what else to try at this point. I'm not sure if this is an issue with liblouis, liblouis-js, emscripten, or my setup. I'm hoping I just did something wrong.

Any help would be much appreciated.

Thanks!

@reiner-dolp
Copy link
Collaborator

reiner-dolp commented May 22, 2018

ccall is a method of the emscripten runtime. See here. No need to export it.

You can look at the scripts we use to build liblouis/js-build automatically here. Our emscripten version is a year old, it might be that the emscripten CLI changed.

@reiner-dolp
Copy link
Collaborator

closing this since it's completely contained within #49. Also, no emcc version given to further investigate.

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