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

"example_emscripten_opengl3" for Windows #4731

Closed
gvanem opened this issue Nov 17, 2021 · 6 comments
Closed

"example_emscripten_opengl3" for Windows #4731

gvanem opened this issue Nov 17, 2021 · 6 comments

Comments

@gvanem
Copy link

gvanem commented Nov 17, 2021

Version/Branch of Dear ImGui:

Version: v1.86 WIP, IMGUI_VERSION_NUM = 18510.
Branch: master from today.

Back-end/Renderer/Compiler/OS

Back-ends: imgui_impl_opengl3.cpp.
Compiler: Emscripten em++ ver 2.0.34.
Operating System: Win-10.

My Issue/Question:

Having just installed Emscripten ver. 2.0.34, I'd like to use examples/example_emscripten_opengl3/Makefile to
test it. But there is an issue with SDL2:

em++ -DIMGUI_DISABLE_FILE_FUNCTIONS -I../.. -I../../backends -Wall -Wformat -Os -s USE_SDL=2 
-s DISABLE_EXCEPTION_CATCHING=1  -c -o main.o main.cpp
ports:INFO: retrieving port: sdl2 from https://github.com/emscripten-ports/SDL2/archive/version_24.zip
em++: error: Unexpected hash: 03e154a70b262153fe5a8794d1803daddeffd7126c8b90ba1e7ba867c22c7ebc1a73b11e41f4b79d82c283ad8a5d518261b6939d19a33d3474096a39da5aecb2

If you are updating the port, please update the hash.
make: *** [makefile:70: main.o] Error 1

I did run emsdk.bat update. So what should I do about this? How/where do I update the hash.?

For reference, the em++ --version output:

emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 2.0.34 (0d24418f0eac4828f096ee070dae8472d427edaa)
...

And doing a set EMCC_DEBUG=1 first, I can see what em++ is trying to do, make:

...
emcc:DEBUG: compiling source file: imgui.cpp
ports:DEBUG: including port: sdl2
ports:DEBUG:     (at f:\util\emscripten\upstream\emscripten\cache\ports\sdl2)
cache:DEBUG: PID 10216 acquiring multiprocess file lock to Emscripten cache at f:\util\emscripten\upstream\emscripten\cache
tools.filelock:DEBUG: Attempting to acquire lock 53299184 on f:\util\emscripten\upstream\emscripten\cache\cache.lock
tools.filelock:DEBUG: Lock 53299184 acquired on f:\util\emscripten\upstream\emscripten\cache\cache.lock
cache:DEBUG: done
ports:INFO: retrieving port: sdl2 from https://github.com/emscripten-ports/SDL2/archive/version_24.zip
urllib3.connectionpool:DEBUG: Starting new HTTPS connection (1): github.com
urllib3.connectionpool:DEBUG: https://github.com:443 "GET /emscripten-ports/SDL2/archive/version_24.zip HTTP/1.1" 
401 None
em++: error: Unexpected hash: 3e154a70b262153fe5a8794d1803daddeffd7126c8b90ba1e7....
...

Trying a wget https://github.com/emscripten-ports/SDL2/archive/version_24.zip it download just fine.
But I've no idea how to unpack that into Emscripten's directory.

Looks very related to this Github token issue.

BTW. Trying the other emscripten example/example_emscripten_wgpu/Makefile, it does generates a
web/index.js and web/index.wasm.

@rokups
Copy link
Contributor

rokups commented Nov 17, 2021

Looks like emscripten issue to me. Try asking at https://github.com/emscripten-core/emsdk

@sbc100
Copy link

sbc100 commented Nov 18, 2021

I just confirmed that https://github.com/emscripten-ports/SDL2/archive/version_24.zip does seem to have the correct hash:

$ wget https://github.com/emscripten-ports/SDL2/archive/version_24.zip
$ sha512sum  version_24.zip 
5a8181acdcce29cdda7e7a4cc876602740f5b9deebd366ecec71ae15c4bbf1f352da4dd0e3c5e0ba8160709dda0270566d64a6cd3892da894463ecf8502836aa  version_24.zip
$ git grep 5a8181acdc
tools/ports/sdl2.py:HASH = '5a8181acdcce29cdda7e7a4cc876602740f5b9deebd366ecec71ae15c4bbf1f352da4dd0e3c5e0ba8160709dda0270566d64a6cd3892da894463ecf8502836aa'

Perhaps there was some intermittent network issue. Can you try again?

@gvanem
Copy link
Author

gvanem commented Nov 18, 2021

Can you try again?

Same error. What cache-item etc. do I have to delete to fix this?

@sbc100
Copy link

sbc100 commented Nov 19, 2021

The only thing that could cause this might be if github is actually serving different bytes to you when you request https://github.com/emscripten-ports/SDL2/archive/version_24.zip.

None of our CI system which all download this file, nor my local machine, see anything different. What do you see when you download that file locally and run sha512sum on it?

@gvanem
Copy link
Author

gvanem commented Nov 19, 2021

What do you see when you download that file locally and run sha512sum on it?

Same as you AFAICS:

wget https://github.com/emscripten-ports/SDL2/archive/version_24.zip

sha512sum version_24.zip
5a8181acdcce29cdda7e7a4cc876602740f5b9deebd366ecec71ae15c4bbf1f352da4dd0e3c5e0ba8160709dda0270566d64a6cd3892da894463ecf8
502836aa *version_24.zip

My sha512sum.exe is from Cygwin (32-bit).

@gvanem
Copy link
Author

gvanem commented Aug 12, 2022

I tried a emsdk.bat update just now and rebuilt this example. It worked. Hence closing.

@gvanem gvanem closed this as completed Aug 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants