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_FETCH_PERSIST_FILE doesn't seem to persist to IndexedDB #16293

Open
tommitytom opened this issue Feb 15, 2022 · 2 comments
Open

EMSCRIPTEN_FETCH_PERSIST_FILE doesn't seem to persist to IndexedDB #16293

tommitytom opened this issue Feb 15, 2022 · 2 comments

Comments

@tommitytom
Copy link

I'm trying to persist downloaded files with fetch and IndexedDB. This was working fine for a while, but it appears to have stopped working at some point, I'm not sure when. This is the code I am using:

emscripten_fetch_attr_t attr;
emscripten_fetch_attr_init(&attr);
strcpy(attr.requestMethod, "GET");
attr.onsuccess = downloadSucceeded;
attr.onerror = downloadFailed;
attr.userData = req;
attr.attributes = EMSCRIPTEN_FETCH_LOAD_TO_MEMORY | EMSCRIPTEN_FETCH_PERSIST_FILE;

emscripten_fetch(&attr, req->ctx->uri.c_str());

emscripten_filesystem appears in the IndexedDB section of chrome, but no files appear in there. Any help would be appreciated!

Please include the following in your bug report:

Version of emscripten/emsdk:

emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.3 (c06156773675b2cb437e41459c12d44bd9a8f235)
clang version 14.0.0 (https://github.com/llvm/llvm-project d8f929a567083a6b90264193f1e4476f6b77c5fe)
Target: wasm32-unknown-emscripten
Thread model: posix
InstalledDir: /emsdk/upstream/bin

Full link command and output with -v appended:

 "/emsdk/node/14.18.2_64bit/bin/node" /emsdk/upstream/emscripten/src/compiler.js /tmp/tmpi6mhtfsl.json
 "/emsdk/upstream/bin/wasm-ld" -o development/index.wasm obj/development_x86/game_app/MainApp.o obj/development_x86/game_app/main.o -Lbin/development_x86 -L/usr/lib32 bin/development_x86/libgame.a bin/development_x86/libengine.a bin/development_x86/libbase.a bin/development_x86/libcommon.a bin/development_x86/libgameplay.a bin/development_x86/libdraco.a bin/development_x86/libdetour.a bin/development_x86/libspdlog.a bin/development_x86/libphysx.a bin/development_x86/libbx.a bin/development_x86/libbimg.a bin/development_x86/libbgfx.a bin/development_x86/libNoesis.a bin/development_x86/libcryptopp.a bin/development_x86/libmodl.a -L/emsdk/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten /emsdk/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten/crtbegin.o --whole-archive -lfetch-mt -lGL-mt-webgl2-full_es3 --no-whole-archive -lal -lhtml5 -lstubs -lnoexit -lc-mt -ldlmalloc-mt -lcompiler_rt-mt -lc++-mt -lc++abi-mt -lsockets-mt -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-cxx-exceptions -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr --allow-undefined-file=/tmp/tmptyhi3hq5.undefined --import-memory --shared-memory --export-if-defined=main --export-if-defined=resize_window --export-if-defined=set_max_download_count --export-if-defined=handle_connection --export-if-defined=_emscripten_thread_init --export-if-defined=_emscripten_thread_exit --export-if-defined=emscripten_tls_init --export-if-defined=emscripten_current_thread_process_queued_calls --export-if-defined=pthread_self --export-if-defined=__start_em_asm --export-if-defined=__stop_em_asm --export=stackSave --export=stackRestore --export=stackAlloc --export=__wasm_call_ctors --export=__errno_location --export=emscripten_dispatch_to_thread_ --export=_emscripten_main_thread_futex --export=_emscripten_thread_free_data --export=_emscripten_allow_main_runtime_queued_calls --export=emscripten_main_browser_thread_id --export=emscripten_main_thread_process_queued_calls --export=emscripten_run_in_main_runtime_thread_js --export=emscripten_stack_set_limits --export=emscripten_sync_run_in_main_thread_2 --export=emscripten_sync_run_in_main_thread_4 --export=memalign --export=malloc --export=free --export=__cxa_is_pointer_type --export=__cxa_can_catch --export=setThrew --export=__dl_seterr --export=ntohs --export=htons --export=strlen --export=saveSetjmp --export-table -z stack-size=5242880 --initial-memory=67108864 --entry=main --max-memory=2147483648 --global-base=1024
 "/emsdk/upstream/bin/wasm-emscripten-finalize" --minimize-wasm-changes -g --dyncalls-i64 --dwarf development/index.wasm -o development/index.wasm --detect-features
 "/emsdk/node/14.18.2_64bit/bin/node" /emsdk/upstream/emscripten/src/compiler.js /tmp/tmpyyt2k8sp.json
 "/emsdk/upstream/bin/wasm-opt" --post-emscripten -O2 --low-memory-unused --zero-filled-memory --strip-producers development/index.wasm -o development/index.wasm -g --mvp-features --enable-threads --enable-mutable-globals --enable-bulk-memory --enable-sign-ext
 "/emsdk/node/14.18.2_64bit/bin/node" /emsdk/upstream/emscripten/tools/acorn-optimizer.js /tmp/emscripten_temp_j6wwvmb6/index.js growableHeap
 "/emsdk/node/14.18.2_64bit/bin/node" /emsdk/upstream/emscripten/tools/preprocessor.js /tmp/emscripten_temp_j6wwvmb6/settings.js worker.js --expandMacros
 "/emsdk/node/14.18.2_64bit/bin/node" /emsdk/upstream/emscripten/tools/preprocessor.js /tmp/emscripten_temp_j6wwvmb6/settings.js index.html
@tommitytom
Copy link
Author

Does this require more info? Did I post it on the wrong repo?

@sbc100
Copy link
Collaborator

sbc100 commented Mar 1, 2022

No, this is the right repository. Sorry the lack to response, we have limited resources to address issues. If you can any time to look into it, one very useful thing you could do to help track down he issue would be to create a complete repro case (could you share that?) and then run a bisect to figure out exactly where/when this broke. See https://emscripten.org/docs/contributing/developers_guide.html#bisecting.

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