Giter Club home page Giter Club logo

Comments (4)

antelle avatar antelle commented on July 25, 2024

What’s your emsctipten and binaryen versions?
Could you please upload the build log somewhere?

from argon2-browser.

Fang- avatar Fang- commented on July 25, 2024

Emscripten 1.38.8. I think binaryen has the same version nr? Not sure how to find out. It's whatever came with the emscripten 1.38.8 install, which was latest as of yesterday.

Build log is just this.

from argon2-browser.

Fang- avatar Fang- commented on July 25, 2024

Building with -s ASSERTIONS=1 as suggested by the console output actually gave useful information!

uncaught exception: abort("'intArrayFromString' was not exported. add it to EXTRA_EXPORTED_RUNTIME_METHODS (see the FAQ)")

That was clearly actionable. Fixing that brought up a few similar errors. I ended up adding the following to the following into to the build scripts' linker flags:

-s 'EXTRA_EXPORTED_RUNTIME_METHODS=[\"intArrayFromString\",\"ALLOC_NORMAL\",\"allocate\"]'

At this point, testing using /docs/index.html, the WebAssembly version asked for Pointer_stringify to also be exported. Adding that into the above in build-wasm.sh resolved this, and makes it run fine! So that's one down at least.

The asm.js version, on the other hand, started complaining that Assertion failed: you need to wait for the runtime to be ready (e.g. wait for main() to be called). This is probably caused by the .wasm file request failing, as shown in the browser console:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at file:///Users/fang/softsrc/argon2-browser/docs/argon2-asm.min.wasm. (Reason: CORS request not http). 

But then I'm unsure what this is still doing different from the version supplied with the repo, which doesn't have any issue requesting the .wasm file. (Yes, I'm just loading the .html file into my browser directly rather than going through a localhost server, in all cases described here.)

I'm assuming this project still builds/runs fine as-is for you, with latest emscripten and emscripten cmake toolchain file?
Maybe there's a system discrepancy at play here. I'm on MacOS 10.12.6.

Would you consider accepting the above -s addition into the build scripts, assuming that doesn't magically break the build on your end?

Thanks again for your time, hopefully we can work together to make builds for this project more consistent across whatever variable it is we're hitting here. (:

from argon2-browser.

antelle avatar antelle commented on July 25, 2024

I'll close this, not sure what I can I do with it. Probably playing with different versions of compliers will eventually give a working result.

from argon2-browser.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.