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

Emscripten 2.0 broke CI #3412

Closed
wants to merge 1 commit into from
Closed

Conversation

RoryO
Copy link

@RoryO RoryO commented Aug 17, 2020

They changed the compiler backend to llvm and broke default builds, example. emscripten-core/emscripten#11319. Yay webdev! Hard coding to 1.40.1 works for now and fixes CI. I don't know really anything about emscripten, perhaps someone who does can bring it up to 2.0.

@RoryO RoryO changed the title Emscripten 2.0 broke build Emscripten 2.0 broke CI Aug 17, 2020
@ocornut
Copy link
Owner

ocornut commented Aug 17, 2020

Cc #3402 @rokups I guess we should investigate what breaks it for 2.0 and if the fastcomp thing is involved.

@RoryO
Copy link
Author

RoryO commented Aug 17, 2020

Please close if there's a fix for 2.0/master. Looking out for people getting a series of red builds that isn't their fault.

@ocornut
Copy link
Owner

ocornut commented Aug 18, 2020

Pardon the ping, perhaps @floooh would be the kind of person who would know what broken in Emscripten seeing they frequently to use it :)

@floooh
Copy link
Contributor

floooh commented Aug 18, 2020

I'll have a look. There was a regression in emscripten SDK 1.40 (emscripten-core/emscripten#11771), but that was fixed fairly quickly.

My own github actions are green (https://github.com/floooh/sokol/runs/997560167?check_suite_focus=true), so I guess it's something about how the emscripten SDK is setup, I'll have a look at your github action files...

@ocornut
Copy link
Owner

ocornut commented Aug 18, 2020

Thanks! FYI to clarify we are building with Emscripten 2.0
https://github.com/ocornut/imgui/runs/997577916?check_suite_focus=true

I thought @RoryO original post suggested the build didn't run..
Installing 2.0 on Windows to test now.

@ocornut
Copy link
Owner

ocornut commented Aug 18, 2020

Well I think this is a mistake, it's just that your X11 samples branch is missing the fix we did on August 12.

@floooh
Copy link
Contributor

floooh commented Aug 18, 2020

Ah ok, found it. The problem isn't in the ImGui repository, but in the forked repository:

https://github.com/RoryO/imgui/blob/9b832038f5ce8a5f16e45f7c15e99dad0ed56968/.github/workflows/build.yml#L392

        emsdk-master/emsdk install latest-fastcomp
        emsdk-master/emsdk activate latest-fastcomp

Should be changed to:

        emsdk-master/emsdk install latest
        emsdk-master/emsdk activate latest

The ImGui repository itself looks fine.

Cheers!

@ocornut
Copy link
Owner

ocornut commented Aug 18, 2020

I can't get it to run but then again with the CORS thing I don't remember if I could get 1.4 to run...
I installed a CORS plugin but I don't know if it works with localhost?

Chrome:

example_emscripten.html:44 both async and sync fetching of the wasm failed
printErr @ example_emscripten.html:44
abort @ example_emscripten.js:1651
getBinary @ example_emscripten.js:1760
(anonymous) @ example_emscripten.js:1782
getBinaryPromise @ example_emscripten.js:1781
instantiateArrayBuffer @ example_emscripten.js:1825
instantiateAsync @ example_emscripten.js:1854
createWasm @ example_emscripten.js:1870
(anonymous) @ example_emscripten.js:6584
example_emscripten.html:44 failed to asynchronously prepare wasm: RuntimeError: abort(both async and sync fetching of the wasm failed) at Error
    at jsStackTrace (file:///C:/Omar/Work/imgui/examples/example_emscripten/example_emscripten.js:1958:17)
    at stackTrace (file:///C:/Omar/Work/imgui/examples/example_emscripten/example_emscripten.js:1975:16)
    at abort (file:///C:/Omar/Work/imgui/examples/example_emscripten/example_emscripten.js:1656:44)
    at getBinary (file:///C:/Omar/Work/imgui/examples/example_emscripten/example_emscripten.js:1760:5)
    at file:///C:/Omar/Work/imgui/examples/example_emscripten/example_emscripten.js:1782:13
    at new Promise (<anonymous>)
    at getBinaryPromise (file:///C:/Omar/Work/imgui/examples/example_emscripten/example_emscripten.js:1781:10)
    at instantiateArrayBuffer (file:///C:/Omar/Work/imgui/examples/example_emscripten/example_emscripten.js:1825:12)
    at instantiateAsync (file:///C:/Omar/Work/imgui/examples/example_emscripten/example_emscripten.js:1854:14)
    at createWasm (file:///C:/Omar/Work/imgui/examples/example_emscripten/example_emscripten.js:1870:3)
printErr @ example_emscripten.html:44
(anonymous) @ example_emscripten.js:1828
Promise.then (async)
instantiateArrayBuffer @ example_emscripten.js:1827
instantiateAsync @ example_emscripten.js:1854
createWasm @ example_emscripten.js:1870
(anonymous) @ example_emscripten.js:6584
example_emscripten.html:44 RuntimeError: abort(both async and sync fetching of the wasm failed) at Error
    at jsStackTrace (file:///C:/Omar/Work/imgui/examples/example_emscripten/example_emscripten.js:1958:17)
    at stackTrace (file:///C:/Omar/Work/imgui/examples/example_emscripten/example_emscripten.js:1975:16)
    at abort (file:///C:/Omar/Work/imgui/examples/example_emscripten/example_emscripten.js:1656:44)
    at getBinary (file:///C:/Omar/Work/imgui/examples/example_emscripten/example_emscripten.js:1760:5)
    at file:///C:/Omar/Work/imgui/examples/example_emscripten/example_emscripten.js:1782:13
    at new Promise (<anonymous>)
    at getBinaryPromise (file:///C:/Omar/Work/imgui/examples/example_emscripten/example_emscripten.js:1781:10)
    at instantiateArrayBuffer (file:///C:/Omar/Work/imgui/examples/example_emscripten/example_emscripten.js:1825:12)
    at instantiateAsync (file:///C:/Omar/Work/imgui/examples/example_emscripten/example_emscripten.js:1854:14)
    at createWasm (file:///C:/Omar/Work/imgui/examples/example_emscripten/example_emscripten.js:1870:3)
printErr @ example_emscripten.html:44
abort @ example_emscripten.js:1651
(anonymous) @ example_emscripten.js:1831
Promise.then (async)
instantiateArrayBuffer @ example_emscripten.js:1827
instantiateAsync @ example_emscripten.js:1854
createWasm @ example_emscripten.js:1870
(anonymous) @ example_emscripten.js:6584
example_emscripten.js:1662 Uncaught (in promise) RuntimeError: abort(RuntimeError: abort(both async and sync fetching of the wasm failed) at Error
    at jsStackTrace (file:///C:/Omar/Work/imgui/examples/example_emscripten/example_emscripten.js:1958:17)
    at stackTrace (file:///C:/Omar/Work/imgui/examples/example_emscripten/example_emscripten.js:1975:16)
    at abort (file:///C:/Omar/Work/imgui/examples/example_emscripten/example_emscripten.js:1656:44)
    at getBinary (file:///C:/Omar/Work/imgui/examples/example_emscripten/example_emscripten.js:1760:5)
    at file:///C:/Omar/Work/imgui/examples/example_emscripten/example_emscripten.js:1782:13
    at new Promise (<anonymous>)
    at getBinaryPromise (file:///C:/Omar/Work/imgui/examples/example_emscripten/example_emscripten.js:1781:10)
    at instantiateArrayBuffer (file:///C:/Omar/Work/imgui/examples/example_emscripten/example_emscripten.js:1825:12)
    at instantiateAsync (file:///C:/Omar/Work/imgui/examples/example_emscripten/example_emscripten.js:1854:14)
    at createWasm (file:///C:/Omar/Work/imgui/examples/example_emscripten/example_emscripten.js:1870:3)) at Error
    at jsStackTrace (file:///C:/Omar/Work/imgui/examples/example_emscripten/example_emscripten.js:1958:17)
    at stackTrace (file:///C:/Omar/Work/imgui/examples/example_emscripten/example_emscripten.js:1975:16)
    at abort (file:///C:/Omar/Work/imgui/examples/example_emscripten/example_emscripten.js:1656:44)
    at file:///C:/Omar/Work/imgui/examples/example_emscripten/example_emscripten.js:1831:7
    at abort (file:///C:/Omar/Work/imgui/examples/example_emscripten/example_emscripten.js:1662:11)
    at file:///C:/Omar/Work/imgui/examples/example_emscripten/example_emscripten.js:1831:7
abort @ example_emscripten.js:1662
(anonymous) @ example_emscripten.js:1831
Promise.then (async)
instantiateArrayBuffer @ example_emscripten.js:1827
instantiateAsync @ example_emscripten.js:1854
createWasm @ example_emscripten.js:1870
(anonymous) @ example_emscripten.js:6584

@ocornut
Copy link
Owner

ocornut commented Aug 18, 2020

OK i found my issue:

"Unfortunately several browsers (including Chrome, Safari, and Internet Explorer) do not support file:// XHR requests, and can’t load extra files needed by the HTML (like a .wasm file, or packaged file data as mentioned lower down). For these browsers you’ll need to serve the files using a local webserver and then open http://localhost:8000/hello.html)."

Using python -m http.server to use a folder on http://localhost:8000 worked and I can confirm the Emscripten 2.0 builds works!
Will add some extra instructions in the readme files.

@floooh
Copy link
Contributor

floooh commented Aug 18, 2020

Using python -m http.server...

Note that the emscripten SDK also has a handy "emrun" command:

> emrun hello.html

Starts an adhoc web server (don't know if via python or node.js) and the browser with the right URL:

https://emscripten.org/docs/compiling/Running-html-files-with-emrun.html

PS: the "--emrun" linker flag mentioned in the documentation isn't really necessary, that's only needed to redirect stdout etc to the terminal.

@ocornut
Copy link
Owner

ocornut commented Aug 18, 2020

Thank you!
Here's the updated documentation https://github.com/ocornut/imgui/blob/master/examples/example_emscripten/README.md
Closing this now,

@ocornut ocornut closed this Aug 18, 2020
@RoryO
Copy link
Author

RoryO commented Aug 18, 2020

Interesting. I switched my branch and merged in the head of docking branch on the 15th I think. Well, I’m glad my error helped on some other way!

@ocornut ocornut added the web label Jul 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants